code-katas/snake/snake.scss

238 lines
5.6 KiB
SCSS
Raw Normal View History

2014-12-11 22:52:55 -06:00
/* Pallete: http://www.colourlovers.com/palette/1832769/100_Following_Me
* A70407 - Red
* F4A612 - Orange
* FFFB51 - Soft Yellow
* 1E4119 - Green
* 0B0C38 - Blue */
//$fg: #333;
$fg: #FFF;
$out: #A70407;
$in: #0B0C38;
$accent1: #F4A612;
$accent2: #FFFB51;
$accent3: #1E4119;
@import "../resources/css/forSize.mixin.scss";
* { margin: 0;
padding: 0;
box-sizing: border-box; }
html {
background-color: $out;
font-family: "Press Start 2P";
}
2014-12-12 05:01:43 -06:00
ol > li { margin-left: 4em; }
#levelSelect > h5 { margin-left: 0.5rem; }
ul { list-style: none; }
2014-12-11 22:52:55 -06:00
.corner {
border-style: solid;
position: absolute;
height: 1rem;
width: 1rem;
2014-12-11 22:52:55 -06:00
&:nth-child(1) {
top: -0.5rem; left: -0.5rem;
border-width: 0.5rem 0 0 0.5rem; }
&:nth-child(2) {
top: -0.5rem; right: -0.5rem;
border-width: 0.5rem 0.5rem 0 0; }
&:nth-child(3) {
bottom: -0.5rem; right: -0.5rem;
border-width: 0 0.5rem 0.5rem 0; }
&:nth-child(4) {
bottom: -0.5rem; left: -0.5rem;
border-width: 0 0 0.5rem 0.5rem; } }
body {
border: solid 0.5rem $accent1;
background-color: $accent2;
padding: 0.5rem;
position: relative;
2014-12-11 22:52:55 -06:00
& > .corner {
width: 1.5rem;
height: 1.5rem;
background-color: $accent1;
border-color: $out; }
#container {
border: solid 0.5rem $accent3;
background-color: $in;
color: $fg;
position: relative;
2014-12-11 22:52:55 -06:00
& > .corner {
background-color: $accent3;
border-color: $accent2; }
2014-12-11 22:52:55 -06:00
header {
text-align: center;
2014-12-12 05:01:43 -06:00
& > h1 { padding-top: 0.5rem; } }
2014-12-12 05:01:43 -06:00
section { transition: 1s; }
section p, section ol, section ul { margin-left: 0.5rem; }
section#editorControls { display: none; } }
section#levelSelect {
overflow: auto;
ol {
font-size: 80%;
li {
cursor: pointer;
&.selected { color: $accent2; } } } }
section#controls {
li { margin-top: 0.5rem; }
.arrow {
width: 1rem; height: 1rem;
&.right { transform: rotate(90deg); }
&.down { transform: rotate(180deg); }
&.left { transform: rotate(270deg); } } } }
h2, h3, h4 {
color: $accent1;
text-decoration: underline; }
h5 { color: $accent1; }
2014-12-11 22:52:55 -06:00
button {
background-color: $out;
border-color: $accent2 $accent1 $accent1 $accent2;
border-style: solid;
border-width: 0.25rem;
color: $fg;
display: block;
font-family: inherit;
padding: 0.1rem;
position: relative;
.corner {
border: none;
background-color: $in;
2014-12-11 22:52:55 -06:00
height: 0.25rem;
width: 0.25rem;
&:nth-child(1) {
top: -0.25rem; left: -0.25rem;
border-width: 0.25rem 0 0 0.25rem; }
&:nth-child(2) {
top: -0.25rem; right: -0.25rem;
border-width: 0.25rem 0.25rem 0 0; }
&:nth-child(3) {
bottom: -0.25rem; right: -0.25rem;
border-width: 0 0.25rem 0.25rem 0; }
&:nth-child(4) {
bottom: -0.25rem; left: -0.25rem;
border-width: 0 0 0.25rem 0.25rem; } } }
@include forAspect(wide) {
body {
margin-top: 2rem;
2014-12-12 05:01:43 -06:00
2014-12-11 22:52:55 -06:00
height: 37rem;
2014-12-12 05:01:43 -06:00
width: 73rem;
#container {
2014-12-11 22:52:55 -06:00
height: 35rem;
width: 71rem;
2014-12-12 05:01:43 -06:00
section {
display: inline-block;
vertical-align: top; }
2014-12-12 05:01:43 -06:00
section#gameContainer {
width: 30rem;
margin-left: 20rem;
margin-right: 20rem; }
#snakeCanvas {
width: 30rem;
height: 30rem; }
section#description, section#levelSelect, section#controls,
section#options, section#score {
2014-12-12 05:01:43 -06:00
position: absolute;
width: 19rem; }
2014-12-12 05:01:43 -06:00
section#description { left: 0.5rem; }
section#controls { left: 0.5rem; top: 13.5rem; }
section#options { left: 0.5rem; top: 20rem; }
section#levelSelect { right: 0.5rem; top: 8rem; }
section#score { right: 0.5rem; }
section#levelSelect { height: 25rem; }
2014-12-12 05:01:43 -06:00
section#levelSelect h5 { margin-top: 1rem; } } }
2014-12-11 22:52:55 -06:00
}
@include forAspect(landscape) {
body {
width: 73rem;
height: 37rem;
margin-top: 2rem;
#container {
2014-12-11 22:52:55 -06:00
height: 35rem;
width: 71rem; } }
}
@include forSize(ultraLarge) {
html { font-size: 125%; } }
@include forSize(medium) {
html { font-size: 55%; } }
@include forSize(notSmall) {
body {
margin-left: auto;
margin-right: auto; }
}
2014-12-12 05:01:43 -06:00
.debug-size, .debug-aspect {
font-family: "PT Mono" !important;
2014-12-12 05:01:43 -06:00
position: fixed;
background: black;
color: white; }
2014-12-12 05:01:43 -06:00
.debug-aspect {
left: 0;
bottom: 0; }
.debug-size {
right: 0;
bottom: 0; }
.small-only, .medium-only, .large-only, .ultralarge-only, .wide-only,
.landscape-only, .even-only, .portrait-only, .tall-only {
display: none; }
@include forSize(small) { .small-only { display: inline; } }
@include forSize(medium) { .medium-only { display: inline; } }
@include forSize(large) { .large-only { display: inline; } }
@include forAspect(ultraLarge) { .ultralarge-only { display: inline; } }
@include forAspect(wide) { .wide-only { display: inline; } }
@include forAspect(landscape) { .landscape-only { display: inline; } }
@include forAspect(even) { .even-only { display: inline; } }
@include forAspect(portrait) { .portrait-only { display: inline; } }
@include forAspect(tall) { .tall-only { display: inline; } }