Skip to content

Commit d03554f

Browse files
committed
눈내리는 효과, highlight 쪽 폰트 수정
1 parent cb099a3 commit d03554f

File tree

3 files changed

+70
-9
lines changed

3 files changed

+70
-9
lines changed

_layouts/default.html

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,61 @@
88
</div>
99
</body>
1010

11-
</html>
11+
</html>
12+
<script>
13+
var date = new Date();
14+
var month = date.getMonth() + 1;
15+
if ('12|1|2|'.indexOf(month) > -1) {
16+
console.log('겨울이네요 눈이 내립니다! 헷');
17+
console.log('현재 url', window.location.href);
18+
doYouWannaBuildaSnowMan();
19+
}
20+
// 눈내리는 효과를 주기위해...
21+
function doYouWannaBuildaSnowMan() {
22+
const body = document.querySelector('body');
23+
const MIN_DURATION = 10;
24+
var count = 0;
25+
26+
function makeSnowFlake() {
27+
const snowflake = document.createElement("div");
28+
const delay = Math.random() * 10;
29+
const initialOpacity = Math.random();
30+
const duration = Math.random() * 20 + MIN_DURATION;
31+
snowflake.classList.add('snowflake');
32+
snowflake.style.left = `${Math.random() * window.screen.width}px`
33+
snowflake.style.animationDelay = `${delay}s`;
34+
snowflake.style.opacity = initialOpacity;
35+
snowflake.style.animation = `fall ${duration}s linear`;
36+
body.appendChild(snowflake);
37+
setTimeout(() => {
38+
body.removeChild(snowflake);
39+
if (count <= 100) makeSnowFlake();
40+
count++;
41+
}, (duration + delay) * 1000);
42+
}
43+
for (let index = 0; index < 50; index++) {
44+
setTimeout(makeSnowFlake(), 500 * index);
45+
}
46+
}
47+
</script>
48+
49+
50+
<style>
51+
.snowflake {
52+
width: 8px;
53+
height: 8px;
54+
background-color: #3482F6;
55+
border-radius: 50%;
56+
position: absolute;
57+
top: -8px;
58+
}
59+
60+
@keyframes fall {
61+
from {}
62+
63+
to {
64+
transform: translateY(100vh);
65+
opacity: 0;
66+
}
67+
}
68+
</style>

_sass/base/_global.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
color: white;
1010
}
1111
}
12+
.highlight * {
13+
font-family: 'Fira Code';
14+
}
1215
html, body{height:100%;}
1316
body{-webkit-user-select:text;-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}
1417

_sass/base/_highlight.scss

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
* Variables
1818
*/
1919

20-
$dt-gray-dark: #282a36; // Background
21-
$dt-gray: #44475a; // Current Line & Selection
20+
$dt-gray-dark: #282a36; // Background
21+
$dt-gray: #44475a; // Current Line & Selection
2222
$dt-gray-light: #f8f8f2; // Foreground
23-
$dt-blue: #6272a4; // Comment
23+
$dt-blue: #6272a4; // Comment
2424
$dt-cyan: #8be9fd;
2525
$dt-green: #50fa7b;
2626
$dt-orange: #ffb86c;
@@ -36,12 +36,13 @@
3636
.highlight {
3737
background: $dt-gray-dark;
3838
color: $dt-gray-light;
39-
padding: 10px;
39+
padding: 10px;
4040
overflow: auto;
41-
margin : 10px 0;
41+
margin: 10px 0;
4242
font-family: 'Fira Code', "D2 Coding", monospace;
43-
letter-spacing: 1.2px;
44-
* {font-size:0.9rem;
43+
// letter-spacing: 1.2px;
44+
* {
45+
font-size: 0.9rem;
4546
}
4647

4748
.hll,
@@ -104,7 +105,7 @@
104105
}
105106

106107
.bp {
107-
font-style: italic;
108+
// font-style: italic;
108109
}
109110

110111
.c,

0 commit comments

Comments
 (0)