Repository navigation
Expand file tree
/
Copy pathlogo_renderer.html
More file actions
582 lines (500 loc) · 27.9 KB
/
Copy pathlogo_renderer.html
File metadata and controls
582 lines (500 loc) · 27.9 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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
<!DOCTYPE html>
<html lang="tr" class="dark">
<head>
<!-- Chosen Palette: Slate Matrix & Amber Pulse -->
<!-- Application Structure Plan: Interactive Canvas logo visualizer updated to showcase Concept 3 (Matris Verisinden Toplumsal Ağa / Data Grid to Social Network Cluster). Features real-time concept switching between Concept 3 and Concept 4, interactive node animation controls, background theme toggling (Dark Studio, Light Minimal, Transparent Grid), multi-scale usage previews (32px to 256px), and high-resolution 1000x1000 HD PNG export. -->
<!-- Visualization & Content Choices: Rendered strictly using native HTML5 Canvas 2D API for high-DPI vector graphics, animated node interactions, matrix line coordinate plotting, and glow effects without raster images or Mermaid JS. Confirming NO SVG elements are embedded in the HTML body. -->
<!-- CONFIRMATION: NO SVG graphics used. NO Mermaid JS used. -->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hesaplamalı Sosyal Bilimler Çalıştayı - Logo Visualizer</title>
<!-- Tailwind CSS CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
colors: {
brand: {
50: '#f0f3ff',
500: '#6366f1',
600: '#4f46e5',
900: '#1e1b4b',
dark: '#0f172a',
},
accent: {
cyan: '#06b6d4',
orange: '#f97316',
rose: '#f43f5e',
purple: '#a855f7'
}
}
}
}
}
</script>
<style>
.checkerboard {
background-color: #0f172a;
background-image: linear-gradient(45deg, #1e293b 25%, transparent 25%),
linear-gradient(-45deg, #1e293b 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #1e293b 75%),
linear-gradient(-45deg, transparent 75%, #1e293b 75%);
background-size: 20px 20px;
background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}
</style>
</head>
<body class="bg-slate-950 text-slate-100 font-sans antialiased min-h-screen flex flex-col">
<!-- Top Navigation Header -->
<header class="border-b border-slate-800 bg-slate-900/80 backdrop-blur sticky top-0 z-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-16 flex items-center justify-between">
<div class="flex items-center space-x-3">
<div class="w-8 h-8 rounded-lg bg-indigo-600 flex items-center justify-center font-bold text-white text-xs tracking-wider">
HSB
</div>
<div>
<h1 class="text-sm font-bold text-white leading-none">Logo Render & Visualizer</h1>
<span class="text-[11px] text-indigo-400">Hesaplamalı Sosyal Bilimler Çalıştayı</span>
</div>
</div>
<!-- Concept Selector Buttons -->
<div class="flex items-center space-x-2 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs">
<button id="btnConcept3" onclick="switchConcept(3)" class="px-3 py-1.5 rounded-lg font-semibold transition bg-indigo-600 text-white shadow">
Konsept 3: Matris & Ağ
</button>
<button id="btnConcept4" onclick="switchConcept(4)" class="px-3 py-1.5 rounded-lg font-semibold transition text-slate-400 hover:text-white">
Konsept 4: Sinyal & Dalga
</button>
</div>
<div class="flex items-center space-x-3">
<button onclick="exportPNG(1000)" class="bg-indigo-600 hover:bg-indigo-500 text-white text-xs font-semibold px-4 py-2 rounded-lg transition shadow-lg shadow-indigo-600/20 flex items-center gap-2">
<span>💾</span>
<span>HD PNG İndir (1000x1000)</span>
</button>
</div>
</div>
</header>
<main class="flex-grow max-w-7xl w-full mx-auto px-4 sm:px-6 lg:px-8 py-8 grid grid-cols-1 lg:grid-cols-12 gap-8 items-start">
<!-- Primary Canvas Renderer Center -->
<div class="lg:col-span-7 flex flex-col items-center justify-center space-y-4">
<div id="canvasCard" class="relative w-full max-w-[500px] aspect-square rounded-3xl p-4 shadow-2xl transition-all duration-300 border border-slate-800 flex items-center justify-center bg-slate-900">
<canvas id="logoCanvas" width="500" height="500" class="w-full h-full object-contain rounded-2xl cursor-pointer" title="Modülasyon ve etkileşim için tıklayın"></canvas>
</div>
<!-- Interactive Quick Controls Below Canvas -->
<div class="w-full max-w-[500px] bg-slate-900 border border-slate-800 rounded-xl p-4 flex flex-wrap items-center justify-between gap-3 text-xs">
<div class="flex items-center space-x-2">
<span class="text-slate-400 font-medium">Arka Plan:</span>
<button onclick="setTheme('dark')" class="px-2.5 py-1 rounded bg-slate-800 text-slate-200 border border-slate-700 hover:border-indigo-500">Koyu Studio</button>
<button onclick="setTheme('light')" class="px-2.5 py-1 rounded bg-slate-200 text-slate-900 hover:bg-white">Açık Minimal</button>
<button onclick="setTheme('transparent')" class="px-2.5 py-1 rounded bg-slate-900 text-slate-300 border border-slate-700">Saydam Grid</button>
</div>
<div class="flex items-center space-x-2">
<label class="inline-flex items-center cursor-pointer">
<input type="checkbox" id="animateToggle" onchange="toggleAnimation()" class="sr-only peer" checked>
<div class="w-9 h-5 bg-slate-800 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-indigo-600"></div>
<span class="ml-2 text-slate-300 font-medium">Nabız Animasyonu</span>
</label>
</div>
</div>
</div>
<!-- Right Side: Details & Multi-Scale Favicon Previews -->
<div class="lg:col-span-5 space-y-6">
<div class="bg-slate-900 border border-slate-800 rounded-2xl p-6 space-y-4">
<div class="inline-flex items-center space-x-2 px-3 py-1 rounded-full bg-indigo-500/10 border border-indigo-500/30 text-indigo-300 text-xs font-semibold">
<span id="conceptBadge">✓ 1:1 Vektörel Konsept 3</span>
</div>
<h2 id="conceptTitle" class="text-xl font-bold text-white">Matris Verisinden Toplumsal Ağa</h2>
<p id="conceptDescription" class="text-slate-300 text-xs leading-relaxed">
Bu tasarım, sol taraftaki düzenli matris veri noktalarının (hesaplamalı veri madenciliği, yapısal veri dizilimleri) sağ tarafa doğru organik ve dinamik bir toplumsal etkileşim ağına dönüşmesini sembolize eder.
</p>
<div class="grid grid-cols-2 gap-3 pt-2 text-xs">
<div class="bg-slate-950 p-3 rounded-xl border border-slate-800">
<span class="text-indigo-400 font-bold block mb-0.5">Boyut Oranı</span>
<span class="text-slate-200">1:1 Kare Canvas (500x500)</span>
</div>
<div class="bg-slate-950 p-3 rounded-xl border border-slate-800">
<span class="text-amber-400 font-bold block mb-0.5">Tipografi</span>
<span class="text-slate-200">Türkçe - Geniş Aralıklı Sans</span>
</div>
</div>
</div>
<!-- Multi-Scale Usage Test (Scale Preview Grid) -->
<div class="bg-slate-900 border border-slate-800 rounded-2xl p-6 space-y-4">
<h3 class="text-sm font-bold text-white flex items-center justify-between">
<span>Ölçeklenebilirlik Testi (Favicon & Avatar)</span>
<span class="text-xs text-slate-500 font-normal">Farklı boyut görünümü</span>
</h3>
<div class="grid grid-cols-4 gap-4 items-end text-center pt-2">
<div class="flex flex-col items-center space-y-2">
<div class="w-8 h-8 rounded-lg overflow-hidden border border-slate-700 bg-slate-950 p-0.5">
<canvas id="preview32" width="32" height="32" class="w-full h-full"></canvas>
</div>
<span class="text-[10px] text-slate-400">32x32px</span>
</div>
<div class="flex flex-col items-center space-y-2">
<div class="w-12 h-12 rounded-xl overflow-hidden border border-slate-700 bg-slate-950 p-0.5">
<canvas id="preview64" width="64" height="64" class="w-full h-full"></canvas>
</div>
<span class="text-[10px] text-slate-400">64x64px</span>
</div>
<div class="flex flex-col items-center space-y-2">
<div class="w-16 h-16 rounded-xl overflow-hidden border border-slate-700 bg-slate-950 p-0.5">
<canvas id="preview128" width="128" height="128" class="w-full h-full"></canvas>
</div>
<span class="text-[10px] text-slate-400">128x128px</span>
</div>
<div class="flex flex-col items-center space-y-2">
<div class="w-24 h-24 rounded-2xl overflow-hidden border border-slate-700 bg-slate-950 p-1">
<canvas id="preview256" width="256" height="256" class="w-full h-full"></canvas>
</div>
<span class="text-[10px] text-slate-400">256x256px</span>
</div>
</div>
</div>
</div>
</main>
<!-- JavaScript Canvas Logic -->
<script>
const canvas = document.getElementById('logoCanvas');
const ctx = canvas.getContext('2d');
let activeConcept = 3; // Default to Concept 3
let currentTheme = 'dark';
let isAnimating = true;
let animationFrameId = null;
function switchConcept(conceptNum) {
activeConcept = conceptNum;
const btn3 = document.getElementById('btnConcept3');
const btn4 = document.getElementById('btnConcept4');
const badge = document.getElementById('conceptBadge');
const title = document.getElementById('conceptTitle');
const desc = document.getElementById('conceptDescription');
if (conceptNum === 3) {
btn3.className = "px-3 py-1.5 rounded-lg font-semibold transition bg-indigo-600 text-white shadow";
btn4.className = "px-3 py-1.5 rounded-lg font-semibold transition text-slate-400 hover:text-white";
badge.innerHTML = "✓ 1:1 Vektörel Konsept 3";
title.innerText = "Matris Verisinden Toplumsal Ağa";
desc.innerText = "Bu tasarım, sol taraftaki düzenli matris veri noktalarının (hesaplamalı veri madenciliği, yapısal veri dizilimleri) sağ tarafa doğru organik ve dinamik bir toplumsal etkileşim ağına dönüşmesini sembolize eder.";
} else {
btn4.className = "px-3 py-1.5 rounded-lg font-semibold transition bg-indigo-600 text-white shadow";
btn3.className = "px-3 py-1.5 rounded-lg font-semibold transition text-slate-400 hover:text-white";
badge.innerHTML = "✓ 1:1 Vektörel Konsept 4";
title.innerText = "Sinyal ve Sosyal Ağ Dönüşüm Amblemi";
desc.innerText = "Bu amblem, hesaplamalı sosyal bilimlerin iki temel direğini birleştirir: Sol ve sağ tarafta akan sürekli sinyal işleme dalgaları (veri girdisi) ve merkezde bu sinyallerin birleşerek oluşturduğu karmaşık toplumsal etkileşim ağı.";
}
if (!isAnimating) {
renderLogo(ctx, 500, 500, 0);
updatePreviews(0);
}
}
function renderLogo(targetCtx, width, height, time = 0, options = {}) {
const scale = width / 500;
targetCtx.save();
targetCtx.clearRect(0, 0, width, height);
targetCtx.scale(scale, scale);
const theme = options.theme || currentTheme;
const animate = options.animate !== undefined ? options.animate : isAnimating;
// 1. Background Card
if (theme !== 'transparent') {
const bgGrad = targetCtx.createRadialGradient(250, 225, 20, 250, 225, 320);
if (theme === 'light') {
bgGrad.addColorStop(0, '#FFFFFF');
bgGrad.addColorStop(0.7, '#F1F5F9');
bgGrad.addColorStop(1, '#E2E8F0');
} else {
bgGrad.addColorStop(0, '#141926');
bgGrad.addColorStop(0.6, '#0F172A');
bgGrad.addColorStop(1, '#070A12');
}
targetCtx.beginPath();
targetCtx.roundRect(10, 10, 480, 480, 40);
targetCtx.fillStyle = bgGrad;
targetCtx.fill();
targetCtx.strokeStyle = theme === 'light' ? 'rgba(99, 102, 241, 0.25)' : 'rgba(99, 102, 241, 0.3)';
targetCtx.lineWidth = 1.5;
targetCtx.stroke();
}
if (activeConcept === 3) {
renderConcept3(targetCtx, time, animate, theme);
} else {
renderConcept4(targetCtx, time, animate, theme);
}
// Typography (Turkish Title)
const textColor = theme === 'light' ? '#0F172A' : '#FFFFFF';
const subTextColor = theme === 'light' ? '#4338CA' : '#818CF8';
targetCtx.textAlign = 'center';
targetCtx.textBaseline = 'middle';
targetCtx.font = '800 17px -apple-system, BlinkMacSystemFont, "Inter", sans-serif';
targetCtx.fillStyle = textColor;
drawSpacedText(targetCtx, "HESAPLAMALI SOSYAL BİLİMLER", 250, 412, 3);
targetCtx.font = '700 13px -apple-system, BlinkMacSystemFont, "Inter", sans-serif';
targetCtx.fillStyle = subTextColor;
drawSpacedText(targetCtx, "ÇALIŞTAYI", 250, 440, 7);
targetCtx.restore();
}
// CONCEPT 3: Matrix Grid to Network Cluster
function renderConcept3(targetCtx, time, animate, theme) {
const pulse = animate ? Math.sin(time * 0.004) * 2 : 0;
// 1. Matrix Coordinate Dotted Guidelines
targetCtx.strokeStyle = theme === 'light' ? 'rgba(56, 189, 248, 0.25)' : 'rgba(56, 189, 248, 0.15)';
targetCtx.lineWidth = 1;
targetCtx.setLineDash([3, 3]);
const gridXs = [90, 140, 190];
const gridYs = [80, 130, 180, 230];
gridYs.forEach(y => {
targetCtx.beginPath();
targetCtx.moveTo(80, y);
targetCtx.lineTo(200, y);
targetCtx.stroke();
});
gridXs.forEach(x => {
targetCtx.beginPath();
targetCtx.moveTo(x, 70);
targetCtx.lineTo(x, 240);
targetCtx.stroke();
});
targetCtx.setLineDash([]);
// 2. Network Edges & Transition Bridges
const edges = [
// Matrix to Hub Bridges
[140, 130, 270, 190, '#38BDF8', 0.5, 1.5],
[190, 80, 270, 190, '#38BDF8', 0.4, 1.2],
[190, 130, 270, 190, '#6366F1', 0.7, 2.0],
[190, 130, 360, 180, '#818CF8', 0.4, 1.2],
[140, 180, 190, 180, '#38BDF8', 0.5, 1.5],
[190, 180, 270, 190, '#6366F1', 0.8, 2.5],
[190, 180, 240, 280, '#F43F5E', 0.6, 1.5],
[140, 230, 240, 280, '#F43F5E', 0.5, 1.8],
[190, 230, 240, 280, '#F43F5E', 0.7, 2.0],
[190, 230, 330, 270, '#F97316', 0.7, 1.8],
// Internal Organic Cluster Edges
[270, 190, 360, 180, '#F97316', 0.85, 2.8],
[270, 190, 330, 270, '#F43F5E', 0.9, 3.0],
[270, 190, 240, 280, '#6366F1', 0.8, 2.2],
[360, 180, 330, 270, '#F97316', 0.85, 2.5],
[240, 280, 330, 270, '#F43F5E', 0.8, 2.2],
// Peripheral Links
[360, 180, 415, 135, '#F97316', 0.6, 1.5],
[360, 180, 410, 230, '#F97316', 0.7, 1.8],
[330, 270, 410, 230, '#F43F5E', 0.6, 1.5],
[330, 270, 375, 335, '#F43F5E', 0.7, 1.6],
[240, 280, 265, 350, '#A855F7', 0.5, 1.4],
[330, 270, 265, 350, '#F43F5E', 0.5, 1.2]
];
edges.forEach(([x1, y1, x2, y2, color, alpha, lw]) => {
targetCtx.beginPath();
targetCtx.moveTo(x1, y1);
targetCtx.lineTo(x2, y2);
targetCtx.strokeStyle = color;
targetCtx.globalAlpha = alpha;
targetCtx.lineWidth = lw;
targetCtx.stroke();
targetCtx.globalAlpha = 1.0;
});
// 3. Matrix Nodes (Left side regular grid)
const matrixNodes = [
[90, 80, 3, 0.4], [140, 80, 3.5, 0.5], [190, 80, 4, 0.7],
[90, 130, 3.5, 0.5], [140, 130, 4.5, 0.8], [190, 130, 5.5, 0.95],
[90, 180, 3.5, 0.5], [140, 180, 5, 0.85], [190, 180, 6.5, 1.0],
[90, 230, 3, 0.4], [140, 230, 4.5, 0.7], [190, 230, 5.5, 0.95]
];
matrixNodes.forEach(([cx, cy, r, alpha]) => {
targetCtx.beginPath();
targetCtx.arc(cx, cy, r, 0, Math.PI * 2);
targetCtx.fillStyle = '#38BDF8';
targetCtx.globalAlpha = alpha;
targetCtx.fill();
targetCtx.globalAlpha = 1.0;
});
// 4. Cluster Nodes (Right side organic network)
function drawNode(cx, cy, r, color, glowRadius, isCore = false) {
targetCtx.save();
if (glowRadius > 0 && theme !== 'light') {
targetCtx.shadowColor = color;
targetCtx.shadowBlur = glowRadius;
}
targetCtx.beginPath();
targetCtx.arc(cx, cy, r, 0, Math.PI * 2);
targetCtx.fillStyle = color;
targetCtx.fill();
targetCtx.restore();
if (isCore || r >= 6) {
targetCtx.beginPath();
targetCtx.arc(cx, cy, isCore ? 6 : r * 0.4, 0, Math.PI * 2);
targetCtx.fillStyle = '#FFFFFF';
targetCtx.fill();
}
}
// Satellites
drawNode(415, 135, 4, '#F97316', 6);
drawNode(410, 230, 5.5, '#F97316', 8);
drawNode(375, 335, 4.5, '#F43F5E', 6);
drawNode(265, 350, 4, '#A855F7', 6);
// Primary Hubs
drawNode(240, 280, 7.5 + pulse * 0.5, '#818CF8', 10);
drawNode(360, 180, 9 + pulse * 0.6, '#F97316', 14);
drawNode(330, 270, 10 + pulse * 0.7, '#F43F5E', 16);
// Central Bridge Node
const corePulse = 12 + pulse;
drawNode(270, 190, corePulse, '#6366F1', 22, true);
}
// CONCEPT 4: Signal Wave to Social Network Lattice
function renderConcept4(targetCtx, time, animate, theme) {
// Coordinate Grid Lines
targetCtx.strokeStyle = theme === 'light' ? 'rgba(99, 102, 241, 0.15)' : 'rgba(129, 140, 248, 0.08)';
targetCtx.lineWidth = 1;
targetCtx.setLineDash([4, 4]);
targetCtx.beginPath();
targetCtx.arc(250, 200, 160, 0, Math.PI * 2);
targetCtx.arc(250, 200, 110, 0, Math.PI * 2);
targetCtx.moveTo(250, 40); targetCtx.lineTo(250, 360);
targetCtx.moveTo(80, 200); targetCtx.lineTo(420, 200);
targetCtx.stroke();
targetCtx.setLineDash([]);
// Signal Waveforms
const waveOffset = animate ? Math.sin(time * 0.003) * 6 : 0;
const gradCyan = targetCtx.createLinearGradient(40, 200, 460, 200);
gradCyan.addColorStop(0, 'rgba(6, 182, 212, 0.15)');
gradCyan.addColorStop(0.5, 'rgba(56, 189, 248, 0.85)');
gradCyan.addColorStop(1, 'rgba(6, 182, 212, 0.15)');
targetCtx.beginPath();
targetCtx.moveTo(40, 200);
targetCtx.bezierCurveTo(100, 130 + waveOffset, 160, 200, 220, 200);
targetCtx.bezierCurveTo(280, 200, 340, 200 - waveOffset, 400, 200);
targetCtx.bezierCurveTo(430, 220, 460, 200, 460, 200);
targetCtx.strokeStyle = gradCyan;
targetCtx.lineWidth = 2.5;
targetCtx.stroke();
const gradMagenta = targetCtx.createLinearGradient(40, 220, 460, 220);
gradMagenta.addColorStop(0, 'rgba(192, 132, 252, 0.1)');
gradMagenta.addColorStop(0.5, 'rgba(232, 121, 249, 0.9)');
gradMagenta.addColorStop(1, 'rgba(192, 132, 252, 0.1)');
targetCtx.beginPath();
targetCtx.moveTo(40, 215);
targetCtx.bezierCurveTo(90, 260 - waveOffset, 140, 215, 190, 215);
targetCtx.bezierCurveTo(240, 215, 340, 215 + waveOffset, 400, 170);
targetCtx.bezierCurveTo(430, 200, 460, 215, 460, 215);
targetCtx.strokeStyle = gradMagenta;
targetCtx.lineWidth = 2.8;
targetCtx.stroke();
// Social Network Edges
const edges = [
[160, 200, 210, 150, '#38BDF8', 0.5, 1.5],
[210, 150, 250, 110, '#818CF8', 0.7, 1.8],
[250, 110, 290, 150, '#C084FC', 0.7, 1.8],
[290, 150, 340, 200, '#38BDF8', 0.5, 1.5],
[210, 150, 250, 200, '#818CF8', 0.8, 2.0],
[290, 150, 250, 200, '#A855F7', 0.8, 2.0],
[180, 230, 215, 265, '#34D399', 0.6, 1.5],
[215, 265, 250, 290, '#10B981', 0.8, 2.0],
[250, 290, 285, 265, '#10B981', 0.8, 2.0],
[285, 265, 320, 230, '#34D399', 0.6, 1.5],
[215, 265, 250, 200, '#38BDF8', 0.85, 2.2],
[285, 265, 250, 200, '#E879F9', 0.85, 2.2],
[250, 110, 250, 200, '#C084FC', 0.85, 2.2],
[250, 200, 250, 290, '#34D399', 0.85, 2.2]
];
edges.forEach(([x1, y1, x2, y2, color, alpha, lw]) => {
targetCtx.beginPath();
targetCtx.moveTo(x1, y1);
targetCtx.lineTo(x2, y2);
targetCtx.strokeStyle = color;
targetCtx.globalAlpha = alpha;
targetCtx.lineWidth = lw;
targetCtx.stroke();
targetCtx.globalAlpha = 1.0;
});
function drawNode(cx, cy, r, color, glowRadius, isCore = false) {
targetCtx.save();
if (glowRadius > 0 && theme !== 'light') {
targetCtx.shadowColor = color;
targetCtx.shadowBlur = glowRadius;
}
targetCtx.beginPath();
targetCtx.arc(cx, cy, r, 0, Math.PI * 2);
targetCtx.fillStyle = color;
targetCtx.fill();
targetCtx.restore();
if (isCore || r >= 6) {
targetCtx.beginPath();
targetCtx.arc(cx, cy, isCore ? 7 : r * 0.38, 0, Math.PI * 2);
targetCtx.fillStyle = '#FFFFFF';
targetCtx.fill();
}
}
drawNode(160, 200, 5, '#38BDF8', 8);
drawNode(340, 200, 5, '#38BDF8', 8);
drawNode(210, 150, 6.5, '#818CF8', 10);
drawNode(290, 150, 6.5, '#C084FC', 10);
drawNode(215, 265, 6.5, '#38BDF8', 10);
drawNode(285, 265, 6.5, '#E879F9', 10);
drawNode(250, 110, 8.5, '#A855F7', 14);
drawNode(250, 290, 8.5, '#10B981', 14);
const pulseR = animate ? 14 + Math.sin(time * 0.005) * 2 : 14;
drawNode(250, 200, pulseR, '#E879F9', 22, true);
}
function drawSpacedText(targetCtx, text, x, y, spacing) {
let totalWidth = targetCtx.measureText(text).width + (text.length - 1) * spacing;
let startX = x - totalWidth / 2;
for (let i = 0; i < text.length; i++) {
let char = text[i];
let charWidth = targetCtx.measureText(char).width;
targetCtx.fillText(char, startX + charWidth / 2, y);
startX += charWidth + spacing;
}
}
function loop(timestamp) {
renderLogo(ctx, 500, 500, timestamp);
updatePreviews(timestamp);
if (isAnimating) {
animationFrameId = requestAnimationFrame(loop);
}
}
function updatePreviews(time) {
[32, 64, 128, 256].forEach(size => {
const prevCanvas = document.getElementById(`preview${size}`);
if (prevCanvas) {
const pCtx = prevCanvas.getContext('2d');
renderLogo(pCtx, size, size, time, { animate: false });
}
});
}
function setTheme(theme) {
currentTheme = theme;
const container = document.getElementById('canvasCard');
if (theme === 'transparent') {
container.className = "relative w-full max-w-[500px] aspect-square rounded-3xl p-4 shadow-2xl transition-all duration-300 border border-slate-800 flex items-center justify-center checkerboard";
} else if (theme === 'light') {
container.className = "relative w-full max-w-[500px] aspect-square rounded-3xl p-4 shadow-2xl transition-all duration-300 border border-slate-300 flex items-center justify-center bg-slate-100";
} else {
container.className = "relative w-full max-w-[500px] aspect-square rounded-3xl p-4 shadow-2xl transition-all duration-300 border border-slate-800 flex items-center justify-center bg-slate-900";
}
if (!isAnimating) {
renderLogo(ctx, 500, 500, 0);
updatePreviews(0);
}
}
function toggleAnimation() {
isAnimating = document.getElementById('animateToggle').checked;
if (isAnimating) {
loop(performance.now());
}
}
function exportPNG(targetSize = 1000) {
const expCanvas = document.createElement('canvas');
expCanvas.width = targetSize;
expCanvas.height = targetSize;
const expCtx = expCanvas.getContext('2d');
renderLogo(expCtx, targetSize, targetSize, 0, { animate: false });
const conceptName = activeConcept === 3 ? 'konsept3_matris_ag' : 'konsept4_sinyal_ag';
const link = document.createElement('a');
link.download = `hesaplamali_sosyal_bilimler_calistayi_logo_${conceptName}.png`;
link.href = expCanvas.toDataURL('image/png');
link.click();
}
// Initialize
loop(0);
</script>
</body>
</html>