-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
379 lines (340 loc) · 22.4 KB
/
index.html
File metadata and controls
379 lines (340 loc) · 22.4 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Catalina Rojas Ugarte</title>
<link href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&family=Geist:wght@200;300;400&family=Inter:wght@300;400&display=swap" rel="stylesheet">
<style>
* { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; }
body { font-family:'Geist',sans-serif; font-weight:300; min-height:100vh; overflow-x:hidden; }
.sea { position:fixed; inset:0; z-index:0; overflow:hidden; }
.sea-sky { position:absolute; inset:0; background:#050608; transition:background 1.2s ease; }
.sea-water { position:absolute; bottom:0; left:0; right:0; height:50%; transition:background 1.2s ease; }
.sea-horizon { position:absolute; bottom:48%; left:0; right:0; height:1px; background:rgba(255,255,255,.05); }
.wave { position:absolute; left:-100%; width:300%; border-radius:40%; opacity:.1; }
.w1{height:180px;bottom:35%} .w2{height:150px;bottom:28%;opacity:.07}
.w3{height:120px;bottom:18%;opacity:.08} .w4{height:200px;bottom:8%;opacity:.12}
.stars-layer { position:absolute; inset:0; height:52%; transition:opacity 1.2s; }
#starCanvas { position:absolute; inset:0; width:100%; height:100%; }
.moon {
position:absolute; border-radius:50%; z-index:2;
background:radial-gradient(circle at 38% 38%,#fffce8,#f0e060);
box-shadow:0 0 28px 8px rgba(240,210,80,.18),0 0 60px 20px rgba(240,210,80,.07);
transition:left 1.4s ease, top 1.4s ease, opacity 1.2s ease, width .6s, height .6s;
transform:translate(-50%,-50%);
}
.sun {
position:absolute; border-radius:50%; z-index:2;
transition:left 1.4s ease, top 1.4s ease, opacity 1.2s ease, background 1.2s, box-shadow 1.2s, width .6s, height .6s;
transform:translate(-50%,-50%);
}
.planet { position:absolute; border-radius:50%; transition:opacity 1.2s; transform:translate(-50%,-50%); }
.reflect {
position:absolute; bottom:18%; left:50%; transform:translateX(-50%);
width:3px; height:28%;
background:linear-gradient(to bottom,rgba(255,220,120,.3),transparent);
filter:blur(7px); animation:flicker 3s ease-in-out infinite alternate;
}
/* text readability overlay */
.text-overlay {
position:fixed; inset:0; z-index:0; pointer-events:none;
background:linear-gradient(to top,
rgba(0,0,0,.78) 0%,
rgba(0,0,0,.48) 30%,
rgba(0,0,0,.18) 60%,
rgba(0,0,0,0) 100%
);
}
@keyframes flicker { from{opacity:.4} to{opacity:.9} }
.dial-wrap {
position:fixed; bottom:1.8rem; right:1.8rem; z-index:20;
display:flex; flex-direction:column; align-items:center; gap:.45rem;
user-select:none;
}
.dial-label { font-size:8.5px; letter-spacing:.15em; text-transform:uppercase; color:rgba(200,210,230,.45); pointer-events:none; }
#dialSvg { cursor:grab; touch-action:none; }
#dialSvg:active { cursor:grabbing; }
.page { position:relative; z-index:1; min-height:100vh; display:flex; flex-direction:column; justify-content:space-between; padding:clamp(2rem,4vw,3rem) clamp(2rem,5vw,4rem); }
.top { display:flex; justify-content:space-between; align-items:center; animation:up .7s ease both; }
.nav { display:flex; gap:1.6rem; }
.nav a { font-size:10px; letter-spacing:.2em; text-transform:uppercase; color:rgba(220,225,235,.7); text-decoration:none; transition:color .2s; }
.nav a:hover { color:#fff; }
.loc { font-size:10px; letter-spacing:.08em; color:rgba(200,210,225,.5); }
.lang { display:flex; gap:.5rem; align-items:center; }
.lang button { background:none; border:none; font-family:'Geist',sans-serif; font-size:10px; letter-spacing:.2em; text-transform:uppercase; color:rgba(200,210,225,.45); cursor:pointer; padding:0; transition:color .2s; }
.lang button:hover { color:#fff; }
.lang button.on { color:rgba(240,235,225,.95); }
.lang .sep { color:rgba(180,190,210,.25); font-size:10px; }
body.es .en,body.es .de{display:none}
body.en .es,body.en .de{display:none}
body.de .es,body.de .en{display:none}
.middle { animation:up .7s .08s ease both; }
h1 { font-family:'Cormorant Garamond',serif; font-weight:300; font-size:clamp(1.8rem,3.8vw,2.8rem); letter-spacing:.07em; line-height:1.1; color:rgba(255,252,245,.98); margin-bottom:.5rem; }
.title { font-size:10px; letter-spacing:.2em; text-transform:uppercase; color:rgba(210,215,230,.65); margin-bottom:1.8rem; }
.div-line { width:28px; height:1px; background:rgba(200,210,225,.25); margin-bottom:1.8rem; }
.bio { font-family:'Inter',sans-serif; font-weight:300; font-size:.88rem; line-height:1.85; color:rgba(220,225,238,.85); max-width:400px; letter-spacing:.01em; }
.bottom { display:grid; grid-template-columns:1fr 1fr; gap:1.5rem 4rem; animation:up .7s .16s ease both; }
.col-label { font-size:9px; letter-spacing:.28em; text-transform:uppercase; color:rgba(190,200,220,.5); margin-bottom:.9rem; }
.entries { display:flex; flex-direction:column; }
.entry { padding:.85rem 0; border-bottom:1px solid rgba(255,255,255,.08); display:flex; flex-direction:column; gap:.28rem; }
.entry:first-of-type { border-top:1px solid rgba(255,255,255,.08); }
.entry-name { font-size:15px; font-weight:300; color:rgba(245,242,235,.95); text-decoration:none; letter-spacing:.02em; transition:color .2s; display:inline-block; line-height:1.3; }
a.entry-name:hover { color:#fff; }
.entry-sub { font-size:11.5px; font-weight:300; letter-spacing:.04em; color:rgba(195,205,222,.65); line-height:1.45; }
.donate { margin-top:1.1rem; font-size:10px; letter-spacing:.18em; text-transform:uppercase; color:rgba(190,200,220,.45); text-decoration:none; transition:color .25s; display:inline-block; }
.donate:hover { color:rgba(240,242,248,.85); }
@keyframes up { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
@media(max-width:560px){
.page{ display:block; padding:0; min-height:auto; }
.middle{
min-height:100svh; display:flex; flex-direction:column;
justify-content:center; padding:2rem 1.8rem;
}
.top{
position:absolute; top:1.2rem; left:1.5rem; right:1.5rem;
display:flex; justify-content:space-between; align-items:flex-start;
z-index:10; flex-direction:column; gap:.5rem;
}
.top > div{display:flex;align-items:center;gap:.8rem;}
.loc{font-size:9px;}
.bottom{
grid-template-columns:1fr; padding:2.5rem 1.8rem 5rem;
background:rgba(0,0,0,.75);
}
.dial-wrap{ bottom:1rem; right:1rem; z-index:9999; }
h1{font-size:clamp(2rem,10vw,2.6rem)}
.bio{max-width:100%}
}
</style>
</head>
<body class="es">
<div class="sea">
<div class="sea-sky" id="sky"></div>
<div class="stars-layer" id="starsLayer"><canvas id="starCanvas"></canvas></div>
<div class="moon" id="moon" style="width:30px;height:30px;left:75%;top:20%;"></div>
<div class="sun" id="sun" style="width:38px;height:38px;opacity:0;left:75%;top:20%;"></div>
<div class="sea-water" id="seaWater"></div>
<div class="sea-horizon"></div>
<div class="wave w1" id="wv1"></div>
<div class="wave w2" id="wv2"></div>
<div class="wave w3" id="wv3"></div>
<div class="wave w4" id="wv4"></div>
<div class="reflect" id="reflect"></div>
</div>
<div class="text-overlay"></div>
<div class="dial-wrap">
<svg id="dialSvg" width="72" height="72" viewBox="0 0 72 72"></svg>
<span class="dial-label" id="dialLabel">—</span>
</div>
<div class="page">
<div class="top">
<nav class="nav">
<a href="/cv" target="_blank">CV</a>
<a href="https://github.com/crojasu" target="_blank">GitHub</a>
<a href="/cdn-cgi/l/email-protection#31435e5b50421f525045505d585f5071565c50585d1f525e5c">Email</a>
</nav>
<div style="display:flex;align-items:center;gap:1.5rem;">
<span class="loc">Santiago de Chile · Berlin · Grecia</span>
<div class="lang">
<button onclick="setLang('es',this)">ES</button>
<span class="sep">/</span>
<button onclick="setLang('en',this)">EN</button>
<span class="sep">/</span>
<button onclick="setLang('de',this)">DE</button>
</div>
</div>
</div>
<div class="middle">
<h1>Catalina Rojas Ugarte</h1>
<p class="title">Feminist Anthropologist · Senior Software Engineer</p>
<div class="div-line"></div>
<p class="bio">
<span class="es">Trabajo en la intersección de datos, feminismo, derechos humanos y activismo digital.</span>
<span class="en">I work at the intersection of data, feminism, human rights and digital activism.</span>
<span class="de">Ich arbeite an der Schnittstelle von Daten, Feminismus, Menschenrechten und digitalem Aktivismus.</span>
</p>
</div>
<div class="bottom">
<div>
<p class="col-label"><span class="es">Trabajo & proyectos</span><span class="en">Work & projects</span><span class="de">Arbeit & Projekte</span></p>
<div class="entries">
<div class="entry">
<a class="entry-name" href="https://welevelup.org" target="_blank">Level Up UK</a>
<span class="entry-sub">Tech Lead · UK</span>
</div>
<div class="entry">
<a class="entry-name" href="https://femicide-watch.up.railway.app/" target="_blank">Femicide Media Watch</a>
<span class="entry-sub"><span class="es">Founder & Lead Engineer · monitoreo de femicidio en cinco países</span><span class="en">Founder & Lead Engineer · femicide monitoring across five countries</span><span class="de">Founder & Lead Engineer · Femizid-Monitoring in fünf Ländern</span></span>
</div>
<div class="entry">
<a class="entry-name" href="https://cineymujeres-production.up.railway.app/" target="_blank">Cine y Mujeres</a>
<span class="entry-sub"><span class="es">Founder & Lead Engineer · índice de género en el cine chileno</span><span class="en">Founder & Lead Engineer · gender index in Chilean cinema</span><span class="de">Founder & Lead Engineer · Geschlechterindex im chilenischen Kino</span></span>
</div>
</div>
<a class="donate" href="https://ko-fi.com/crojasu" target="_blank"><span class="es">☕ Apoyar los proyectos</span><span class="en">☕ Support the projects</span><span class="de">☕ Projekte unterstützen</span></a>
</div>
<div>
<p class="col-label"><span class="es">Arte</span><span class="en">Art</span><span class="de">Kunst</span></p>
<div class="entries">
<div class="entry">
<a class="entry-name" href="/santiagoencorto/" target="_blank">Quiebre Espontáneo en la Simetría</a>
<span class="entry-sub"><span class="es">Cortometraje · la experiencia de migrar vista a través del arte y la ciencia</span><span class="en">Short film · the experience of migration through the lens of art and science</span><span class="de">Kurzfilm · die Erfahrung der Migration durch die Perspektive von Kunst und Wissenschaft</span></span>
</div>
<div class="entry">
<a class="entry-name" href="https://www.instagram.com/wolf_a_fox/" target="_blank">@wolf_a_fox</a>
<span class="entry-sub"><span class="es">A veces pinto</span><span class="en">I paint sometimes</span><span class="de">Manchmal male ich</span></span>
</div>
</div>
</div>
</div>
</div>
<script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><script>
function setLang(l,btn){document.body.className=l;document.querySelectorAll('.lang button').forEach(b=>b.classList.remove('on'));if(btn)btn.classList.add('on');}
(function(){var l=(navigator.language||'es').toLowerCase();l=l.startsWith('es')?'es':l.startsWith('de')?'de':'en';setLang(l,document.querySelector('.lang button:nth-child('+({es:1,en:3,de:5}[l])+')') );})();
var SKY=[
[[4,4,8],[8,12,18],[12,20,30],[6,9,15]],[[4,4,8],[7,11,17],[11,18,28],[5,8,14]],
[[3,3,7],[6,10,16],[10,16,26],[4,7,12]],[[3,3,7],[6,10,16],[10,16,26],[4,7,12]],
[[4,4,10],[8,12,20],[16,22,35],[7,11,18]],
[[10,8,20],[28,24,55],[90,55,65],[180,100,65]],[[14,11,26],[45,33,65],[130,75,72],[205,128,72]],
[[20,17,38],[65,50,85],[155,95,82],[212,142,82]],
[[26,58,102],[42,102,172],[88,158,218],[56,118,176]],[[28,62,106],[46,107,177],[92,162,220],[58,122,178]],
[[30,65,110],[50,112,182],[96,166,222],[60,126,180]],[[32,68,115],[52,116,186],[100,168,224],[62,128,182]],
[[26,72,138],[42,122,205],[106,170,232],[74,154,216]],[[26,72,138],[42,122,205],[106,170,232],[74,154,216]],
[[26,72,138],[42,122,205],[106,170,232],[74,154,216]],[[26,72,138],[42,122,205],[106,170,232],[74,154,216]],
[[26,72,138],[42,122,205],[106,170,232],[74,154,216]],
// 17 golden hour
[[22,10,50],[75,22,82],[210,88,38],[248,162,58]],
// 18 deep sunset
[[16,8,42],[58,16,70],[185,62,28],[232,128,45]],
// 19 dusk
[[12,7,32],[40,12,52],[140,42,20],[185,92,35]],
// 20 civil twilight
[[8,6,22],[24,10,36],[90,30,14],[130,65,26]],
// 21 night falls
[[6,5,14],[10,8,24],[16,12,28],[8,7,16]],
[[4,4,8],[8,12,18],[12,20,30],[6,9,15]],[[4,4,8],[8,12,18],[12,20,30],[6,9,15]]
];
var WATER=[[10,20,40],[10,20,40],[10,20,40],[10,20,40],[10,20,40],[85,44,32],[102,58,36],[112,68,42],[52,102,162],[52,102,162],[52,102,162],[52,102,162],[62,118,188],[62,118,188],[62,118,188],[62,118,188],[62,118,188],[192,90,42],[174,78,36],[134,58,28],[102,42,22],[10,20,40],[10,20,40],[10,20,40]];
var WC=['#1a3a6a','#1a3a6a','#1a3a6a','#1a3a6a','#1a3a6a','#7a3530','#8a4030','#9a4f40','#3a78b8','#3a78b8','#3a78b8','#3a78b8','#4a88d0','#4a88d0','#4a88d0','#4a88d0','#4a88d0','#b05828','#9a4228','#7a2c1c','#601a12','#1a3a6a','#1a3a6a','#1a3a6a'];
function lerp(a,b,t){return a+(b-a)*t}
function lA(a,b,t){return a.map((v,i)=>lerp(v,b[i],t))}
function rgb(c){return`rgb(${Math.round(c[0])},${Math.round(c[1])},${Math.round(c[2])})`}
function rgba(c,a){return`rgba(${Math.round(c[0])},${Math.round(c[1])},${Math.round(c[2])},${a.toFixed(2)})`}
function skyAt(h){var h0=Math.floor(h)%24,t=h-Math.floor(h),h1=(h0+1)%24;return[0,1,2,3].map(i=>lA(SKY[h0][i],SKY[h1][i],t))}
function waterAt(h){var h0=Math.floor(h)%24,t=h-Math.floor(h),h1=(h0+1)%24;return lA(WATER[h0],WATER[h1],t)}
function sunAt(h){
if(h<5.5||h>20.5)return{op:0};
var t=(h-5.5)/15;
var op=Math.min(1,h<6.5?(h-5.5):h>19.5?(20.5-h):1);
var sz=h<7||h>19?26:h>10&&h<16?42:34;
var warm=Math.max(0,1-Math.abs(h-13)/7);
var g=Math.round(lerp(155,240,warm)),b=Math.round(lerp(10,200,warm));
// arc stays in top-right: x from 58% to 92%, y from 28% down to 8% and back
var x=lerp(58,92,t);
var y=28-18*Math.sin(t*Math.PI);
return{op,x,y,sz,
bg:`radial-gradient(circle at 40% 40%,#fffce0,rgb(255,${g},${b}) 45%,rgb(245,${Math.max(0,g-65)},${Math.max(0,b-80)}))`,
sh:`0 0 ${sz*1.3}px ${sz*.5}px rgba(255,${g},${b},.5),0 0 ${sz*2.5}px ${sz}px rgba(255,${Math.max(0,g-30)},0,.2)`
};
}
function moonAt(h){
var hn=h>=19?h-19:h+5;
if(hn<0||hn>12)return{op:0};
var t=hn/12;
// moon arcs top-right too, right-to-left within same zone
var x=lerp(92,58,t);
var y=28-18*Math.sin(t*Math.PI);
return{op:Math.min(1,Math.max(0,hn<1?hn:hn>11?(12-hn):1)),x,y};
}
var LABELS={
es:['Noche','Madrugada','Amanecer','Mañana','Mediodía','Tarde','Atardecer','Noche'],
en:['Night','Early morning','Dawn','Morning','Midday','Afternoon','Sunset','Night'],
de:['Nacht','Früh','Morgendämmerung','Morgen','Mittag','Nachmittag','Sonnenuntergang','Nacht']
};
function applyHour(h){
var c=skyAt(h);
document.getElementById('sky').style.background=`linear-gradient(180deg,${rgb(c[0])} 0%,${rgb(c[1])} 30%,${rgb(c[2])} 55%,${rgb(c[3])} 100%)`;
var wt=waterAt(h);
document.getElementById('seaWater').style.background=`linear-gradient(180deg,${rgba(wt,0)} 0%,${rgba(wt,.55)} 40%,rgba(5,10,20,.92) 100%)`;
var hi=Math.round(h)%24;
['wv1','wv2','wv3','wv4'].forEach(id=>document.getElementById(id).style.background=WC[hi]);
var stOp=h>=8&&h<=18?0:h>18&&h<20?(20-h)/2:h>5&&h<8?(8-h)/3:1;
document.getElementById('starsLayer').style.opacity=stOp;
// sun — arcs in top-right zone
var s=sunAt(h),sEl=document.getElementById('sun');
sEl.style.opacity=s.op;
if(s.op>0){
sEl.style.width=sEl.style.height=s.sz+'px';
sEl.style.left=s.x+'%';
sEl.style.top=s.y+'%';
sEl.style.background=s.bg;
sEl.style.boxShadow=s.sh;
}
// moon — arcs in top-right zone
var m=moonAt(h),mEl=document.getElementById('moon');
mEl.style.opacity=m.op;
if(m.op>0){mEl.style.left=m.x+'%';mEl.style.top=m.y+'%';}
document.getElementById('reflect').style.opacity=h<6||h>20?.8:h>10&&h<16?.4:.3;
var hd=Math.floor(h%24),md=Math.round((h-Math.floor(h))*60);
var seg=hd<3?0:hd<5?1:hd<7?2:hd<12?3:hd<13?4:hd<17?5:hd<20?6:7;
var lang=document.body.className.replace(/\s.*/,'');
document.getElementById('dialLabel').textContent=String(hd).padStart(2,'0')+':'+String(md).padStart(2,'0')+' '+(LABELS[lang]||LABELS.en)[seg];
}
// Stars
(function(){
var c=document.getElementById('starCanvas');
function draw(){
var W=window.innerWidth,H=Math.round(window.innerHeight*.52);
c.width=W;c.height=H;var ctx=c.getContext('2d');
for(var i=0;i<220;i++){var x=Math.random()*W,y=Math.random()*H,r=Math.random()*.85+.2,a=Math.random()*.6+.25;ctx.beginPath();ctx.arc(x,y,r,0,Math.PI*2);ctx.fillStyle=`rgba(255,255,255,${a})`;ctx.fill();}
for(var i=0;i<14;i++){var x=Math.random()*W,y=Math.random()*H*.75,r=Math.random()*.6+1.3;ctx.beginPath();ctx.arc(x,y,r*5,0,Math.PI*2);ctx.fillStyle='rgba(255,252,230,.04)';ctx.fill();ctx.beginPath();ctx.arc(x,y,r,0,Math.PI*2);ctx.fillStyle='rgba(255,252,228,.88)';ctx.fill();}
var pl=[{x:.18*W,y:.22*H,r:4.5,col:'#fffce0',glow:'rgba(240,220,100,.38)',n:'Venus'},{x:.68*W,y:.15*H,r:7,col:'#f0dfc8',glow:'rgba(200,162,120,.35)',n:'Júpiter'},{x:.84*W,y:.31*H,r:3.5,col:'#ff8850',glow:'rgba(195,55,25,.42)',n:'Marte'}];
pl.forEach(p=>{ctx.beginPath();ctx.arc(p.x,p.y,p.r*3.5,0,Math.PI*2);ctx.fillStyle=p.glow.replace(/,[^,]+\)$/,',.07)');ctx.fill();ctx.beginPath();ctx.arc(p.x,p.y,p.r*2,0,Math.PI*2);ctx.fillStyle=p.glow.replace(/,[^,]+\)$/,',.2)');ctx.fill();ctx.beginPath();ctx.arc(p.x,p.y,p.r,0,Math.PI*2);ctx.fillStyle=p.col;ctx.fill();ctx.font='8px sans-serif';ctx.fillStyle='rgba(255,255,255,.22)';ctx.fillText(p.n,p.x+p.r+5,p.y+3);});
}
draw();window.addEventListener('resize',draw);
})();
// Dial
(function(){
var svg=document.getElementById('dialSvg'),NS='http://www.w3.org/2000/svg';
var CX=36,CY=36,R=28,r2=20;
var now=new Date(),curH=now.getHours()+now.getMinutes()/60;
var drag=false,lastA=0;
var defs=document.createElementNS(NS,'defs');
defs.innerHTML='<filter id="glow" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="1.8" result="b"/><feMerge><feMergeNode in="b"/><feMergeNode in="SourceGraphic"/></feMerge></filter>';
svg.appendChild(defs);
var bg=document.createElementNS(NS,'circle');bg.setAttribute('cx',CX);bg.setAttribute('cy',CY);bg.setAttribute('r','35');bg.setAttribute('fill','rgba(0,0,0,.5)');svg.appendChild(bg);
for(var i=0;i<48;i++){
var h=(i+.5)/48*24,a0=i/48*Math.PI*2-Math.PI/2,a1=(i+1)/48*Math.PI*2-Math.PI/2;
var sc=skyAt(h)[2];
var x1=CX+R*Math.cos(a0),y1=CY+R*Math.sin(a0),x2=CX+R*Math.cos(a1),y2=CY+R*Math.sin(a1);
var x3=CX+r2*Math.cos(a1),y3=CY+r2*Math.sin(a1),x4=CX+r2*Math.cos(a0),y4=CY+r2*Math.sin(a0);
var p=document.createElementNS(NS,'path');
p.setAttribute('d',`M${x1} ${y1} A${R} ${R} 0 0 1 ${x2} ${y2} L${x3} ${y3} A${r2} ${r2} 0 0 0 ${x4} ${y4} Z`);
p.setAttribute('fill',`rgba(${Math.round(sc[0])},${Math.round(sc[1])},${Math.round(sc[2])},.82)`);
p.setAttribute('stroke','none');svg.appendChild(p);
}
var inner=document.createElementNS(NS,'circle');inner.setAttribute('cx',CX);inner.setAttribute('cy',CY);inner.setAttribute('r',r2-1);inner.setAttribute('fill','rgba(0,0,0,.65)');svg.appendChild(inner);
for(var i=0;i<24;i++){var a=i/24*Math.PI*2-Math.PI/2,maj=i%6===0;var ln=document.createElementNS(NS,'line');ln.setAttribute('x1',CX+(maj?r2-1:r2+1)*Math.cos(a));ln.setAttribute('y1',CY+(maj?r2-1:r2+1)*Math.sin(a));ln.setAttribute('x2',CX+(maj?r2+4.5:r2+2.5)*Math.cos(a));ln.setAttribute('y2',CY+(maj?r2+4.5:r2+2.5)*Math.sin(a));ln.setAttribute('stroke',maj?'rgba(255,255,255,.4)':'rgba(255,255,255,.14)');ln.setAttribute('stroke-width',maj?'1.5':'0.8');svg.appendChild(ln);}
var hH=document.createElementNS(NS,'line');hH.setAttribute('x1',CX);hH.setAttribute('y1',CY);hH.setAttribute('stroke','rgba(240,230,215,.8)');hH.setAttribute('stroke-width','1.8');hH.setAttribute('stroke-linecap','round');svg.appendChild(hH);
var hM=document.createElementNS(NS,'line');hM.setAttribute('x1',CX);hM.setAttribute('y1',CY);hM.setAttribute('stroke','rgba(240,230,215,.5)');hM.setAttribute('stroke-width','1');hM.setAttribute('stroke-linecap','round');svg.appendChild(hM);
var cd=document.createElementNS(NS,'circle');cd.setAttribute('cx',CX);cd.setAttribute('cy',CY);cd.setAttribute('r','2.2');cd.setAttribute('fill','rgba(240,230,215,.7)');svg.appendChild(cd);
var dot=document.createElementNS(NS,'circle');dot.setAttribute('r','4.5');dot.setAttribute('fill','rgba(255,255,255,.95)');dot.setAttribute('filter','url(#glow)');svg.appendChild(dot);
function updDot(h){var a=h/24*Math.PI*2-Math.PI/2,rm=(R+r2)/2;dot.setAttribute('cx',CX+rm*Math.cos(a));dot.setAttribute('cy',CY+rm*Math.sin(a));}
function updHands(h){var hh=h%12,mf=(h%1)*60,ha=(hh/12+mf/720)*Math.PI*2-Math.PI/2,ma=mf/60*Math.PI*2-Math.PI/2;hH.setAttribute('x2',CX+11*Math.cos(ha));hH.setAttribute('y2',CY+11*Math.sin(ha));hM.setAttribute('x2',CX+16*Math.cos(ma));hM.setAttribute('y2',CY+16*Math.sin(ma));}
function setH(h){curH=((h%24)+24)%24;updDot(curH);updHands(curH);applyHour(curH);}
function angFrom(e){var r=svg.getBoundingClientRect(),px=e.touches?e.touches[0].clientX:e.clientX,py=e.touches?e.touches[0].clientY:e.clientY;return Math.atan2(py-(r.top+r.height/2),px-(r.left+r.width/2));}
svg.addEventListener('mousedown',e=>{drag=true;lastA=angFrom(e);e.preventDefault();});
svg.addEventListener('touchstart',e=>{drag=true;lastA=angFrom(e);e.preventDefault();},{passive:false});
window.addEventListener('mousemove',e=>{if(!drag)return;var a=angFrom(e),d=a-lastA;if(d>Math.PI)d-=Math.PI*2;if(d<-Math.PI)d+=Math.PI*2;lastA=a;setH(curH+d*12/Math.PI);});
window.addEventListener('touchmove',e=>{if(!drag)return;var a=angFrom(e),d=a-lastA;if(d>Math.PI)d-=Math.PI*2;if(d<-Math.PI)d+=Math.PI*2;lastA=a;setH(curH+d*12/Math.PI);},{passive:false});
window.addEventListener('mouseup',()=>drag=false);window.addEventListener('touchend',()=>drag=false);
svg.addEventListener('wheel',e=>{e.preventDefault();setH(curH+e.deltaY*.025);},{passive:false});
svg.addEventListener('click',e=>{if(Math.abs(e.movementX||0)+Math.abs(e.movementY||0)>4)return;var a=angFrom(e)+Math.PI/2;setH(((a/(Math.PI*2))*24+24)%24);});
setH(curH);
setInterval(()=>{if(!drag){var n=new Date();updHands(n.getHours()+n.getMinutes()/60);}},30000);
})();
</script>
</body>
</html>