-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblog.html
More file actions
177 lines (162 loc) · 5.61 KB
/
Copy pathblog.html
File metadata and controls
177 lines (162 loc) · 5.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>blog - juliet shen</title>
<link href="index.css" rel="stylesheet">
<link rel="icon" type="image/png" href="favicon.png">
</head>
<body>
<canvas id="stars-canvas"></canvas>
<div class="theme-toggle">
<button onclick="setTheme('unmasked')" id="btn-unmasked" class="active">unmasked</button>
<button onclick="setTheme('masking')" id="btn-masking">masking</button>
</div>
<div class="site-header">
<h1>Juliet Shen</h1>
<p class="subtitle">my corner of the internet</p>
</div>
<div class="site-topnav">
<a href="index.html">home</a> <span class="sep">-</span>
<a href="blog.html" class="active">blog</a> <span class="sep">-</span>
<a href="bio.html">bio</a> <span class="sep">-</span>
<a href="resume.html">resume</a>
</div>
<div class="site-marquee-bar">
<div class="site-marquee">
<span>~*~ thanks for visiting my site!! be nice to others!! subscribe 4 subscribe!! ~*~ ~*~ thanks for visiting my site!! sign my guestbook!! subscribe 4 subscribe!! ~*~</span>
</div>
</div>
<div class="site-page">
<div class="site-module">
<div class="site-module-header">weblog</div>
<div class="site-module-body" id="blog-posts">
<!-- Posts are loaded from posts/index.json -->
<p style="color: var(--site-text-light);">loading posts...</p>
</div>
</div>
</div>
<div class="site-footer">
© 2026 julietshen | powered by nostalgia | Brooklyn, NYC
</div>
<script>
(function() {
const canvas = document.getElementById('stars-canvas');
const ctx = canvas.getContext('2d');
let stars = [];
const STAR_COUNT = 200;
function resize() {
canvas.width = window.innerWidth;
canvas.height = document.documentElement.scrollHeight;
}
function createStars() {
stars = [];
for (let i = 0; i < STAR_COUNT; i++) {
stars.push({
x: Math.random() * canvas.width,
y: Math.random() * canvas.height,
r: Math.random() * 1.5 + 0.3,
alpha: Math.random(),
delta: (Math.random() * 0.02 + 0.005) * (Math.random() < 0.5 ? 1 : -1),
});
}
}
function draw() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
for (const s of stars) {
s.alpha += s.delta;
if (s.alpha <= 0.1 || s.alpha >= 1) s.delta *= -1;
ctx.beginPath();
ctx.arc(s.x, s.y, s.r, 0, Math.PI * 2);
ctx.fillStyle = `rgba(200, 210, 255, ${s.alpha})`;
ctx.fill();
}
requestAnimationFrame(draw);
}
window.addEventListener('resize', () => { resize(); createStars(); });
resize(); createStars(); draw();
window.addEventListener('load', () => { resize(); });
})();
// Blog loader
(function() {
fetch('posts/index.json')
.then(r => r.json())
.then(posts => {
const container = document.getElementById('blog-posts');
if (!posts.length) {
container.innerHTML = '<p>no posts yet... check back soon!</p>';
return;
}
container.innerHTML = posts.map(post => `
<div class="blog-post-preview">
<div class="preview-date">${post.date}</div>
<div class="preview-title"><a href="posts/${post.file}">${post.title}</a></div>
<div class="preview-snippet">${post.snippet}</div>
</div>
`).join('');
})
.catch(() => {
document.getElementById('blog-posts').innerHTML =
'<p>no posts yet... check back soon!</p>';
});
})();
// Cursor star trail
(function() {
var chars = ['✦', '✧', '⋆', '˚', '✩', '★', '☆'];
var colors = ['#ffd700', '#ffec8b', '#fff4c1', '#f0c420', '#ffe066', '#daa520', '#fff8dc'];
var throttle = 0;
document.addEventListener('mousemove', function(e) {
if (++throttle % 3 !== 0) return;
if (document.body.classList.contains('theme-masking')) return;
var el = document.createElement('span');
el.textContent = chars[Math.floor(Math.random() * chars.length)];
el.style.cssText = 'position:fixed;pointer-events:none;z-index:9999;font-size:' +
(Math.random() * 12 + 8) + 'px;left:' + (e.clientX + (Math.random() - 0.5) * 40) +
'px;top:' + (e.clientY + (Math.random() - 0.5) * 40) +
'px;color:' + colors[Math.floor(Math.random() * colors.length)] +
';opacity:1;text-shadow:0 0 4px rgba(255,215,0,0.6);';
document.body.appendChild(el);
(function(el) {
var vy = Math.random() * 0.8 + 0.3;
var vx = (Math.random() - 0.5) * 0.6;
var opacity = 1;
var x = parseFloat(el.style.left);
var y = parseFloat(el.style.top);
function fall() {
opacity -= 0.008;
y += vy;
x += vx;
vy += 0.02;
el.style.left = x + 'px';
el.style.top = y + 'px';
el.style.opacity = opacity;
if (opacity > 0) {
requestAnimationFrame(fall);
} else {
el.remove();
}
}
requestAnimationFrame(fall);
})(el);
});
})();
function setTheme(theme) {
if (theme === 'masking') {
document.body.classList.add('theme-masking');
} else {
document.body.classList.remove('theme-masking');
}
document.getElementById('btn-unmasked').classList.toggle('active', theme === 'unmasked');
document.getElementById('btn-masking').classList.toggle('active', theme === 'masking');
localStorage.setItem('site-theme', theme);
}
(function() {
var saved = localStorage.getItem('site-theme');
if (saved) setTheme(saved);
})();
</script>
<script data-goatcounter="https://shensational.goatcounter.com/count"
async src="//gc.zgo.at/count.js"></script>
</body>
</html>