Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
Learning JavaScript
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MohammadAli Keshavarz
Learning JavaScript
Commits
2cd8e2d4
Commit
2cd8e2d4
authored
Oct 25, 2019
by
MohammadAli Keshavarz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change code format of style.css and change current score of player by random number
parent
2f4f095d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
128 additions
and
100 deletions
+128
-100
app.js
section3/app.js
+10
-1
style.css
section3/style.css
+118
-99
No files found.
section3/app.js
View file @
2cd8e2d4
...
...
@@ -6,3 +6,12 @@ GAME RULES:
- The player can choose to 'Hold', which means that his ROUND score gets added to his GLBAL score. After that, it's the next player's turn
- The first player to reach 100 points on GLOBAL score wins the game
*/
var
scores
,
dice
,
roundScore
,
activePlayer
;
scores
=
[
0
,
0
];
roundScore
=
0
;
activePlayer
=
0
;
dice
=
Math
.
floor
(
Math
.
random
()
*
6
)
+
1
;
document
.
querySelector
(
'#current-'
+
activePlayer
).
textContent
=
dice
;
section3/style.css
View file @
2cd8e2d4
...
...
@@ -6,7 +6,6 @@
margin
:
0
;
padding
:
0
;
box-sizing
:
border-box
;
}
.clearfix
::after
{
...
...
@@ -16,7 +15,11 @@
}
body
{
background-image
:
linear-gradient
(
rgba
(
62
,
20
,
20
,
0.4
),
rgba
(
62
,
20
,
20
,
0.4
)),
url(back.jpg)
;
background-image
:
linear-gradient
(
rgba
(
62
,
20
,
20
,
0.4
),
rgba
(
62
,
20
,
20
,
0.4
)
),
url(back.jpg)
;
background-size
:
cover
;
background-position
:
center
;
font-family
:
Lato
;
...
...
@@ -45,8 +48,6 @@ body {
padding
:
100px
;
}
/**********************************************
*** PLAYERS
**********************************************/
...
...
@@ -66,25 +67,28 @@ body {
text-align
:
center
;
font-size
:
80px
;
font-weight
:
100
;
color
:
#EB4D4D
;
color
:
#eb4d4d
;
margin-bottom
:
130px
;
}
.active
{
background-color
:
#f7f7f7
;
}
.active
.player-name
{
font-weight
:
300
;
}
.active
{
background-color
:
#f7f7f7
;
}
.active
.player-name
{
font-weight
:
300
;
}
.active
.player-name
::after
{
content
:
"\2022"
;
font-size
:
47px
;
position
:
absolute
;
color
:
#EB4D4D
;
color
:
#eb4d4d
;
top
:
-7px
;
right
:
10px
;
}
.player-current-box
{
background-color
:
#EB4D4D
;
background-color
:
#eb4d4d
;
color
:
#fff
;
width
:
40%
;
margin
:
0
auto
;
...
...
@@ -119,15 +123,19 @@ button {
transition
:
background-color
0.3s
,
color
0.3s
;
}
button
:hover
{
font-weight
:
600
;
}
button
:hover
i
{
margin-right
:
20px
;
}
button
:hover
{
font-weight
:
600
;
}
button
:hover
i
{
margin-right
:
20px
;
}
button
:focus
{
outline
:
none
;
}
i
{
color
:
#EB4D4D
;
color
:
#eb4d4d
;
display
:
inline-block
;
margin-right
:
15px
;
font-size
:
32px
;
...
...
@@ -137,9 +145,15 @@ i {
transition
:
margin
0.3s
;
}
.btn-new
{
top
:
45px
;}
.btn-roll
{
top
:
403px
;}
.btn-hold
{
top
:
467px
;}
.btn-new
{
top
:
45px
;
}
.btn-roll
{
top
:
403px
;
}
.btn-hold
{
top
:
467px
;
}
.dice
{
position
:
absolute
;
...
...
@@ -147,8 +161,13 @@ i {
top
:
178px
;
transform
:
translateX
(
-50%
);
height
:
100px
;
box-shadow
:
0px
10px
60px
rgba
(
0
,
0
,
0
,
0.10
);
box-shadow
:
0px
10px
60px
rgba
(
0
,
0
,
0
,
0.1
);
}
.winner
{
background-color
:
#f7f7f7
;
}
.winner
.player-name
{
font-weight
:
300
;
color
:
#EB4D4D
;
}
\ No newline at end of file
.winner
{
background-color
:
#f7f7f7
;
}
.winner
.player-name
{
font-weight
:
300
;
color
:
#eb4d4d
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment