Skip to content

Commit 0f3e6d6

Browse files
committed
neon: make it glow!
1 parent 382843d commit 0f3e6d6

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

src/_layouts/base.njk

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,25 @@
5353

5454
{% include "gtag.njk" %}
5555
{% include "nutshell.njk" %}
56-
</script>
56+
57+
<script>
58+
// Array of colors
59+
const colors = [
60+
"#e0e0e0", // $transwhite
61+
"#70d6ff", // $pale-azure
62+
"#ff70a6", // $cyclamen
63+
"#ff9770", // $atomic-tangerine
64+
"#ffd670", // $naples-yellow
65+
"#e9ff70", // $mindaro
66+
"#70ff99", // $lime-green
67+
"#9770ff" // $violet
68+
];
69+
// Select a random color
70+
const randomColor = colors[Math.floor(Math.random() * colors.length)];
71+
72+
// Apply the random color to a CSS variable
73+
document.documentElement.style.setProperty('--flicker-color', randomColor);
74+
</script>
5775
</body>
5876
{% include "footer.njk" %}
5977
</html>

src/styles/css.scss

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,30 @@ html {
5959
}
6060
}
6161

62+
.neonText {
63+
animation: flicker 5s infinite alternate;
64+
}
65+
66+
@keyframes flicker {
67+
0%, 18%, 22%, 25%, 53%, 57%, 100% {
68+
69+
text-shadow:
70+
0 0 2px #fff,
71+
0 0 20px var(--flicker-color),
72+
73+
}
74+
75+
20%, 24%, 55% {
76+
text-shadow: none;
77+
}
78+
}
79+
6280
body {
6381
overflow-x: hidden;
6482
}
6583

84+
85+
6686
strong {
6787
@include theme(dark) {
6888
color: $naples-yellow;
@@ -146,6 +166,7 @@ mjx-container {
146166
background: #c8fffd;
147167
color: black;
148168
}
169+
149170
pre,
150171
code {
151172
background: rgb(48, 48, 48);
@@ -180,6 +201,10 @@ h6 {
180201
margin: 1em 0 0.2em;
181202
}
182203

204+
h1, h2, h3 {
205+
@extend .neonText;
206+
}
207+
183208
p,
184209
ul,
185210
ol {

0 commit comments

Comments
 (0)