Dodanie menu dolnego, dodanie sposobu kończenia tury, sass.

This commit is contained in:
kplaczek
2017-10-01 19:49:55 +02:00
parent 87b8fe37a3
commit 198f0c1f49
12 changed files with 957 additions and 16 deletions

53
sass/_coins.scss Normal file
View File

@@ -0,0 +1,53 @@
.group {
clear: both;
&.inactive {
opacity: 0.4;
}
.coin {
border-radius: 90px;
display: inline-block;
height: 9vh;
width: 9vh;
text-align: center;
border: 1px solid transparent;
margin: 5px 0vh 5px -4vh;
font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
background-position: center 72%;
background-repeat: no-repeat;
color: $coin-text-color;
cursor: pointer;
text-shadow: 0 0 2px #fff;
font-size: 3vh;
&:first-child {
margin: 5px 0vh 5px 0vh;
}
&.selected {
float: right;
}
&.blank {
opacity: 0.7;
&.selected {
opacity: 1;
&:first-child {
margin: 5px 0vh 5px -4vh;
}
}
}
@each $icon, $border_color, $background_color, $background_size in (leather, saddlebrown, burlywood, 45%),
(fabric, purple, #f5d6f5, 71%),
(spice, forestgreen, #dff9b6, 60%),
(silver, silver, #879fc6, 44%),
(gold, goldenrod, #fcf4ca, 40%),
(diamond, darkred, #f66282, 48%), {
&.#{$icon} {
border-color: #{$border_color};
background-image: url(../#{$icon}.svg);
background-size: #{$background_size};
background-color: #{$background_color};
}
}
}
}

0
sass/_dark.scss Normal file
View File

32
sass/_grid.scss Normal file
View File

@@ -0,0 +1,32 @@
.container {
display: grid;
grid-template-areas:
"player1container acceptcontainer player2container"
"leather leather leather"
"fabric fabric fabric"
"spice spice spice"
"silver silver silver"
"gold gold gold"
"diamond diamond diamond"
"menu menu menu";
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(8, 1fr);
}
@media screen and (orientation: landscape){
/*.container {display: none; }*/
}
.group {
&.leather { grid-area: leather; }
&.fabric { grid-area: fabric; }
&.spice { grid-area: spice; }
&.silver { grid-area: silver; }
&.gold { grid-area: gold; }
&.diamond { grid-area: diamond; }
}
.player1container {grid-area: player1container; }
.player2container {grid-area: player2container;}
#menu { grid-area: menu; }

236
sass/_light.scss Normal file
View File

@@ -0,0 +1,236 @@
body {
height: 100vh;
font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
}
#menu {
display: flex;
flex-direction: row;
justify-content: space-around;
height: 100%;
align-items: center;
a {
max-width: 100%;
text-align: center;
line-height: 6vh;
color: $menu-color;
text-decoration: none;
padding: 1vw;
display: inline-block;
&:hover {
background-color: $menu-background-color-hover;
color: $menu-color-hover;
}
}
}
/* PLAYERS START */
.container {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
height: 100vh;
}
.acceptcontainer {
.accept {
grid-area: acceptcontainer;
visibility: hidden;
border: 2px solid $accept-border;
margin: 1.5vh auto;
max-width: 100%;
height: 5vh;
padding: 0.5vh 0vw;
font-weight: bold;
background-color: $accept-background-color;
cursor: pointer;
line-height: 5vh;
text-align: center;
display: flex;
justify-items: center;
flex-direction: row;
justify-content: space-around;
&.on {
visibility: visible;
}
}
.bonus {
height: 5vh;
width: 5vh;
display: inline-block;
margin: 0;
border-radius: 50%;
border: 1px solid $bonus-coin-border-color;
background: no-repeat $accept-bonus-coin-background-color center center / 60% 60%;
display: none;
@for $i from 3 through 5 {
&.bonus#{$i} {
background-image: url(../bonus#{$i}.svg);
}
}
}
}
.player {
border: 2px solid $player-border-color;
padding: 0.5vh 4vh;
margin: 1.5vh auto;
width: 10vw;
color: #444;
cursor: pointer;
border-radius: 2px;
font-weight: bold;
font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
height: 5vh;
width: 10vw;
line-height: 5vh;
text-align: center;
&.selected {
background: $player-selected-background-color;
color: $player-selected-color;
}
.score {
height: 50px;
width: 23px;
display: inline-block;
background-image: none;
background-size: auto auto;
margin: 0 5px;
background-image: url(../maharaja.svg);
background-size: 100%;
background-repeat: no-repeat;
&:first-child {
margin-left: 15px;
}
}
}
/* PLAYERS END */
* {
font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
}
/* SCORE TABLE START */
.scoreTable {
width: 90vw;
background: $score-table-background;
content: "";
height: 70vh;
position: absolute;
top: 15vh;
left: 5vw;
box-shadow: 0 0 207px #000000;
border: 3px solid $score-table-border-color;
display: none;
h1 {
text-align: center;
font-size: 10vh;
}
&.visible {
display: block;
}
.score_section {
display: none;
font-size: 35px;
justify-content: space-around;
&.show {
display: flex;
}
}
.bonus_section {
display: none;
justify-content: center;
&.show {
display: flex;
}
}
.players_section, .camel_section {
display: flex;
justify-content: space-around;
font-size: 45px;
}
.camel_section .player1_camel, .camel_section .player2_camel {
background: url('../camel.svg') no-repeat 0 0 / 10vh 10vh;
height: 10vh;
width: 10vh;
cursor: pointer;
opacity: 0.1;
}
.camel_section .nobody {
opacity: 0.1;
}
.camel_section .player1_camel.selected, .camel_section .player2_camel.selected, .camel_section .nobody.selected {
opacity: 1;
}
.player1_bonus {
text-align: right;
margin-right: 3.5vh;
}
.player1_bonus .bonus3, .player1_bonus .bonus4, .player1_bonus .bonus5 {
display: flex;
flex-direction: row-reverse;
}
.bonus_section {
span:first-child {
margin-left: 0;
}
span {
height: 6vh;
width: 6vh;
display: inline-block;
margin-left: -30px;
border-radius: 50%;
border: 1px solid $bonus-coin-border-color;
background: no-repeat #fff center center / 60% 60%;
/*display: none;*/
}
.player1_bonus {
span:first-child {
margin-left: -30px;
}
}
.player2_bonus, .player1_bonus {
width: 50%;
}
.player2_bonus {
margin-left: 3.5vh;
}
@for $i from 3 through 5 {
.bonus#{$i} span {
background-image: url(../bonus#{$i}.svg);
}
}
}
}

48
sass/_reset.scss Normal file
View File

@@ -0,0 +1,48 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}

18
sass/_variables.scss Normal file
View File

@@ -0,0 +1,18 @@
$coin-text-color: #000;
$accept-border: dodgerblue;
$accept-background-color: #bedfff;
$bonus-coin-border-color: dodgerblue;
$accept-bonus-coin-background-color: #fff;
$player-border-color: dodgerblue;
$player-selected-background-color: #6f9cc9;
$player-selected-color: #f2eeee;
$score-table-background: #fff;
$score-table-border-color: #ccc;
$menu-color: #666;
$menu-color-hover: #333;
$menu-background-color-hover: #eee;

6
sass/index.scss Normal file
View File

@@ -0,0 +1,6 @@
@import 'reset';
@import 'variables';
@import 'grid';
@import 'light';
@import 'coins';
@import 'dark';