Skip to content

Commit a08fb19

Browse files
author
Troy Giunipero
committed
more sassification to stylesheet
1 parent 9396a93 commit a08fb19

File tree

1 file changed

+63
-56
lines changed

1 file changed

+63
-56
lines changed

css/style.scss

Lines changed: 63 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,61 @@
1+
// color vars
2+
$charcoal: #6c6c6c;
3+
$olive: #b8b690;
4+
$orange: #d97036;
5+
$beige: #e2ddb7;
6+
$creme: #fcfbf7;
7+
$near-black: #191919;
8+
9+
$bkgd-img: '../resources/img/grit.png';
10+
11+
// mixins
12+
@mixin font-face($font-name) {
13+
@font-face {
14+
font-family: $font-name;
15+
src: local($font-name), url('../resources/font/' + $font-name + '.ttf');
16+
}
17+
}
18+
19+
@mixin bkgd-transition($duration: 0.5s, $easing: ease) {
20+
-moz-transition: background $duration $easing;
21+
-webkit-transition: background $duration $easing;
22+
}
23+
24+
// Styles for canvas
125
html {
226
height: 100%;
3-
background: #f1eedc url('../resources/img/grit.png') repeat;
4-
-moz-transition: background 0.5s ease;
5-
-webkit-transition: background 0.5s ease;
27+
background: #f1eedc url($bkgd-img) repeat;
28+
@include bkgd-transition;
629

730
&#day {
8-
body { background-color: #fcfbf7; }
9-
#optionTab { background: #f1eedc url('../resources/img/grit.png') repeat right; }
31+
body { background-color: $creme; }
32+
#optionTab { background: #f1eedc url($bkgd-img) repeat right; }
1033
hr { background-color: #cfccab; }
11-
div#controls span, div#optionTabText { color: #6c6c6c; }
34+
div#controls span, div#optionTabText { color: $charcoal; }
1235
}
1336

1437
&#night {
15-
background: #434237 url('../resources/img/grit.png') repeat;
16-
body { background-color: #191919; }
17-
#optionTab { background: #434237 url('../resources/img/grit.png') repeat right; }
38+
background: #434237 url($bkgd-img) repeat;
39+
body { background-color: $near-black; }
40+
#optionTab { background: #434237 url($bkgd-img) repeat right; }
1841
hr { background-color: #7c7961; }
1942
div#controls span, div#optionTabText { color: #aaa; }
2043
}
2144
}
2245

2346
body {
24-
font-family: 'Raleway';
47+
font-family: 'Raleway-Light';
2548
border-radius: 10px;
26-
background: #fcfbf7;
49+
background: $creme;
2750
position: fixed;
2851
top: 10px;
2952
left: 10px;
3053
right: 10px;
3154
bottom: 10px;
32-
color: #6c6c6c;
55+
color: $charcoal;
3356
-moz-user-select: none;
3457
-webkit-user-select: none;
35-
-moz-transition: background 0.5s ease;
36-
-webkit-transition: background 0.5s ease;
58+
@include bkgd-transition;
3759
}
3860

3961
h1 {
@@ -42,11 +64,11 @@ h1 {
4264
text-shadow: 2px 2px 5px #555555;
4365
font-size: 75px;
4466
font-weight: normal;
45-
font-family: 'Dancing Script';
67+
font-family: 'Dancing-Script';
4668
}
4769

4870

49-
/** Styles for blocks and time digits **/
71+
// Styles for blocks and time digits
5072
div#clockWidget, div#timeDisplay {
5173
top: 50%;
5274
left: 50%;
@@ -63,7 +85,7 @@ div#clockWidget {
6385
div#timeDisplay {
6486
display: none;
6587
letter-spacing: 2px;
66-
font-family: 'Raleway Thin';
88+
font-family: 'Raleway-Thin';
6789

6890
&.horizontal {
6991
width: 150px;
@@ -109,40 +131,39 @@ div.block {
109131
display: inline-block;
110132
line-height: 27px;
111133
font-size: 18px;
112-
-moz-transition:background 0.2s ease-in;
113-
-webkit-transition:background 0.2s ease-in;
134+
@include bkgd-transition(0.2s, ease-in);
114135

115136
&.row2 {
116137
border: 3px solid #a0a078;
117-
background: #b8b690 url('../resources/img/grit.png') repeat;
138+
background: $olive url($bkgd-img) repeat;
118139

119-
&.dark { background: #b8b690 url('../resources/img/grit.png') repeat; }
120-
&.light { background: rgba(244, 243, 235, 0.1) url('../resources/img/grit.png') repeat; }
140+
&.dark { background: $olive url($bkgd-img) repeat; }
141+
&.light { background: rgba(244, 243, 235, 0.1) url($bkgd-img) repeat; }
121142
}
122143

123144
&.row1 {
124145
border: 3px solid #c85b2c;
125-
background: #d97036 url('../resources/img/grit.png') repeat;
146+
background: $orange url($bkgd-img) repeat;
126147

127-
&.dark { background: #d97036 url('../resources/img/grit.png') repeat; }
128-
&.light { background: rgba(248, 236, 226, 0.1) url('../resources/img/grit.png') repeat; }
148+
&.dark { background: $orange url($bkgd-img) repeat; }
149+
&.light { background: rgba(248, 236, 226, 0.1) url($bkgd-img) repeat; }
129150
}
130151

131152
&.row0 {
132153
border: 3px solid #c3c19b;
133-
background: #e2ddb7 url('../resources/img/grit.png') repeat;
154+
background: $beige url($bkgd-img) repeat;
134155

135-
&.dark { background: #e2ddb7 url('../resources/img/grit.png') repeat; }
136-
&.light { background: rgba(248, 247, 239, 0.1) url('../resources/img/grit.png') repeat; }
156+
&.dark { background: $beige url($bkgd-img) repeat; }
157+
&.light { background: rgba(248, 247, 239, 0.1) url($bkgd-img) repeat; }
137158
}
138159

139160
> span { color: #444; }
140161
}
141162

142163

143-
/** Styles for options **/
164+
// Styles for options
144165
div#optionTab {
145-
background: #f1eedc url('../resources/img/grit.png') repeat right;
166+
background: #f1eedc url($bkgd-img) repeat right;
146167
letter-spacing: 2px;
147168
top: 50%;
148169
left: 100%;
@@ -154,10 +175,9 @@ div#optionTab {
154175
height: 94px;
155176
width: 44px;
156177
cursor: default;
157-
-moz-transition: background 0.5s ease;
158-
-webkit-transition: background 0.5s ease;
159-
-webkit-backface-visibility: hidden; /* eliminates trailing border lines during animation */
160-
} /* http://stackoverflow.com/questions/12273528/trailing-border-lines-in-chrome */
178+
@include bkgd-transition;
179+
-webkit-backface-visibility: hidden; // eliminates trailing border lines during animation
180+
} // http://stackoverflow.com/questions/12273528/trailing-border-lines-in-chrome
161181

162182
div#optionTabText {
163183
margin-top: 46px;
@@ -230,16 +250,15 @@ div#layout {
230250
}
231251

232252

233-
/** Styles for option panel buttons **/
253+
// Styles for option panel buttons
234254
button {
235-
color: #6c6c6c;
255+
color: $charcoal;
236256
font-size: .9em;
237-
font-family: 'Raleway';
257+
font-family: 'Raleway-Light';
238258
letter-spacing: 1px;
239259
margin: 4px 0;
240260
cursor: pointer;
241-
-moz-transition: background 0.4s ease;
242-
-webkit-transition: background 0.4s ease;
261+
@include bkgd-transition(0.4s);
243262
border: 1px solid #cfccab;
244263
background-color: #f3f1e4;
245264
border-radius: 6px;
@@ -258,7 +277,7 @@ button {
258277
opacity: 0.6;
259278

260279
&:hover, &:focus, &:active {
261-
color: #6C6C6C;
280+
color: $charcoal;
262281
background-color: #f3f1e4;
263282
}
264283
}
@@ -272,19 +291,7 @@ button {
272291
&#sun, &#horizontal { display: none; }
273292
}
274293

275-
276-
/** Import fonts **/
277-
@font-face {
278-
font-family: 'Raleway Thin';
279-
src: local('Raleway-Thin'), url('../resources/font/Raleway-Thin.ttf');
280-
}
281-
282-
@font-face {
283-
font-family: 'Raleway';
284-
src: local('Raleway-Light'), url('../resources/font/Raleway-Light.ttf');
285-
}
286-
287-
@font-face {
288-
font-family: 'Dancing Script';
289-
src: local('Dancing-Script'), url('../resources/font/Dancing-Script.ttf');
290-
}
294+
// Import fonts
295+
@include font-face('Raleway-Thin');
296+
@include font-face('Raleway-Light');
297+
@include font-face('Dancing-Script');

0 commit comments

Comments
 (0)