seawolf2357 commited on
Commit
bcd71ae
ยท
verified ยท
1 Parent(s): c14b8a9

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +119 -585
index.html CHANGED
@@ -1,598 +1,132 @@
1
- <!DOCTYPE html>
2
- <html lang="ko">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>EV Cook Site - ๋ฐฉ๋ฌธ์ž ์ถ”์  ํ™œ์„ฑํ™”</title>
7
- <style>
8
- * {
9
- margin: 0;
10
- padding: 0;
11
- box-sizing: border-box;
12
- }
13
-
14
- body {
15
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
16
- background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
17
- min-height: 100vh;
18
- color: #333;
19
- }
20
-
21
- .header {
22
- background: rgba(255, 255, 255, 0.95);
23
- padding: 20px 0;
24
- box-shadow: 0 2px 10px rgba(0,0,0,0.1);
25
- }
26
-
27
- .header-content {
28
- max-width: 1200px;
29
- margin: 0 auto;
30
- padding: 0 20px;
31
- display: flex;
32
- justify-content: space-between;
33
- align-items: center;
34
- }
35
-
36
- .logo {
37
- font-size: 28px;
38
- font-weight: bold;
39
- color: #1e3c72;
40
- }
41
-
42
- .nav {
43
- display: flex;
44
- gap: 30px;
45
- }
46
-
47
- .nav a {
48
- color: #333;
49
- text-decoration: none;
50
- font-weight: 500;
51
- transition: color 0.3s;
52
- }
53
-
54
- .nav a:hover {
55
- color: #1e3c72;
56
- }
57
-
58
- .main-container {
59
- max-width: 1200px;
60
- margin: 50px auto;
61
- padding: 0 20px;
62
- }
63
-
64
- .hero-section {
65
- background: white;
66
- border-radius: 20px;
67
- padding: 60px;
68
- text-align: center;
69
- box-shadow: 0 20px 60px rgba(0,0,0,0.1);
70
- margin-bottom: 40px;
71
- }
72
-
73
- .hero-section h1 {
74
- font-size: 48px;
75
- color: #1e3c72;
76
- margin-bottom: 20px;
77
- }
78
-
79
- .hero-section p {
80
- font-size: 20px;
81
- color: #666;
82
- margin-bottom: 30px;
83
- }
84
-
85
- .tracking-status {
86
- background: #e8f5e9;
87
- border: 2px solid #4caf50;
88
- border-radius: 10px;
89
- padding: 20px;
90
- margin: 20px 0;
91
- }
92
-
93
- .tracking-status h3 {
94
- color: #2e7d32;
95
- margin-bottom: 10px;
96
- }
97
-
98
- .info-grid {
99
- display: grid;
100
- grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
101
- gap: 20px;
102
- margin-top: 40px;
103
- }
104
-
105
- .info-card {
106
- background: white;
107
- padding: 30px;
108
- border-radius: 15px;
109
- box-shadow: 0 10px 30px rgba(0,0,0,0.1);
110
- transition: transform 0.3s;
111
- }
112
-
113
- .info-card:hover {
114
- transform: translateY(-5px);
115
- }
116
-
117
- .info-card h3 {
118
- color: #1e3c72;
119
- margin-bottom: 15px;
120
- font-size: 24px;
121
- }
122
-
123
- .info-card p {
124
- color: #666;
125
- line-height: 1.6;
126
- }
127
-
128
- .status-indicator {
129
- display: inline-flex;
130
- align-items: center;
131
- gap: 8px;
132
- background: #f5f5f5;
133
- padding: 8px 16px;
134
- border-radius: 20px;
135
- font-size: 14px;
136
- }
137
-
138
- .status-indicator.active {
139
- background: #e8f5e9;
140
- color: #2e7d32;
141
- }
142
-
143
- .status-dot {
144
- width: 8px;
145
- height: 8px;
146
- border-radius: 50%;
147
- background: #4caf50;
148
- animation: pulse 2s infinite;
149
- }
150
-
151
- @keyframes pulse {
152
- 0% {
153
- box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
154
- }
155
- 70% {
156
- box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
157
- }
158
- 100% {
159
- box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
160
- }
161
- }
162
-
163
- .tracking-details {
164
- background: #f8f9fa;
165
- padding: 20px;
166
- border-radius: 10px;
167
- margin-top: 20px;
168
- font-family: monospace;
169
- font-size: 14px;
170
- }
171
-
172
- .tracking-details .row {
173
- display: flex;
174
- justify-content: space-between;
175
- padding: 8px 0;
176
- border-bottom: 1px solid #e0e0e0;
177
- }
178
-
179
- .tracking-details .row:last-child {
180
- border-bottom: none;
181
- }
182
-
183
- .tracking-details .label {
184
- font-weight: bold;
185
- color: #555;
186
- }
187
-
188
- .tracking-details .value {
189
- color: #1e3c72;
190
- }
191
-
192
- .buttons {
193
- display: flex;
194
- gap: 15px;
195
- margin-top: 30px;
196
- justify-content: center;
197
- flex-wrap: wrap;
198
- }
199
-
200
- button {
201
- padding: 12px 30px;
202
- background: #1e3c72;
203
- color: white;
204
- border: none;
205
- border-radius: 8px;
206
- font-size: 16px;
207
- font-weight: 500;
208
- cursor: pointer;
209
- transition: all 0.3s;
210
- }
211
-
212
- button:hover {
213
- background: #2a5298;
214
- transform: translateY(-2px);
215
- box-shadow: 0 5px 15px rgba(0,0,0,0.2);
216
- }
217
-
218
- button.secondary {
219
- background: #757575;
220
- }
221
-
222
- button.secondary:hover {
223
- background: #616161;
224
- }
225
-
226
- .footer {
227
- text-align: center;
228
- padding: 40px 20px;
229
- color: white;
230
- margin-top: 60px;
231
- }
232
 
233
- .console-hint {
234
- background: #fff3cd;
235
- border: 1px solid #ffeaa7;
236
- padding: 15px;
237
- border-radius: 8px;
238
- margin: 20px 0;
239
- text-align: center;
240
- }
241
 
242
- .console-hint code {
243
- background: #f8f9fa;
244
- padding: 2px 6px;
245
- border-radius: 3px;
246
- font-family: monospace;
247
- }
248
- </style>
249
- </head>
250
- <body>
251
- <header class="header">
252
- <div class="header-content">
253
- <div class="logo">โšก EV Cook</div>
254
- <nav class="nav">
255
- <a href="#home">ํ™ˆ</a>
256
- <a href="#about">์†Œ๊ฐœ</a>
257
- <a href="#tracking">์ถ”์ ์ •๋ณด</a>
258
- <a href="#contact">๋ฌธ์˜</a>
259
- </nav>
260
- </div>
261
- </header>
262
-
263
- <div class="main-container">
264
- <section class="hero-section">
265
- <h1>EV Cook ์ถ”์  ๋ฐ๋ชจ ์‚ฌ์ดํŠธ</h1>
266
- <p>์ด ์‚ฌ์ดํŠธ๋Š” ๋ฐฉ๋ฌธ์ž ์ถ”์  ์‹œ์Šคํ…œ์ด ํ™œ์„ฑํ™”๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค</p>
267
-
268
- <div class="tracking-status">
269
- <h3>๐Ÿ” ์ถ”์  ์ƒํƒœ</h3>
270
- <div class="status-indicator active">
271
- <span class="status-dot"></span>
272
- <span>์ถ”์  ํ™œ์„ฑํ™”๋จ</span>
273
- </div>
274
-
275
- <div class="tracking-details">
276
- <div class="row">
277
- <span class="label">Device ID:</span>
278
- <span class="value" id="deviceId">๋กœ๋”ฉ ์ค‘...</span>
279
- </div>
280
- <div class="row">
281
- <span class="label">์ถ”์  ์„œ๋ฒ„:</span>
282
- <span class="value">seawolf2357-evcook.hf.space</span>
283
- </div>
284
- <div class="row">
285
- <span class="label">์‚ฌ์ดํŠธ ID:</span>
286
- <span class="value">38e0a883</span>
287
- </div>
288
- <div class="row">
289
- <span class="label">์ถ”์  ์‹œ์ž‘:</span>
290
- <span class="value" id="trackingStart">-</span>
291
- </div>
292
- </div>
293
- </div>
294
 
295
- <div class="buttons">
296
- <button onclick="testTracking()">๐Ÿ“Š ์ถ”์  ํ…Œ์ŠคํŠธ</button>
297
- <button onclick="sendCustomEvent()">๐ŸŽฏ ์ปค์Šคํ…€ ์ด๋ฒคํŠธ</button>
298
- <button onclick="viewDetails()" class="secondary">๐Ÿ“‹ ์ƒ์„ธ ์ •๋ณด</button>
299
- </div>
300
- </section>
301
-
302
- <div class="info-grid">
303
- <div class="info-card">
304
- <h3>๐Ÿš€ ์‹ค์‹œ๊ฐ„ ์ถ”์ </h3>
305
- <p>ํŽ˜์ด์ง€ ๋ฐฉ๋ฌธ, ํด๋ฆญ, ์Šคํฌ๋กค ๋“ฑ ๋ชจ๋“  ์‚ฌ์šฉ์ž ํ™œ๋™์ด ์‹ค์‹œ๊ฐ„์œผ๋กœ ์ถ”์ ๋ฉ๋‹ˆ๋‹ค. ๊ฐœ๋ฐœ์ž ๋„๊ตฌ ์ฝ˜์†”์—์„œ ์ถ”์  ๋กœ๊ทธ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.</p>
306
- </div>
307
- <div class="info-card">
308
- <h3>๐Ÿ”’ ๊ฐœ์ธ์ •๋ณด ๋ณดํ˜ธ</h3>
309
- <p>๋””๋ฐ”์ด์Šค ID๋Š” ๋ธŒ๋ผ์šฐ์ € ์ •๋ณด๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ์ƒ์„ฑ๋˜๋ฉฐ, ๊ฐœ์ธ์„ ์‹๋ณ„ํ•  ์ˆ˜ ์žˆ๋Š” ์ •๋ณด๋Š” ์ˆ˜์ง‘ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.</p>
310
- </div>
311
- <div class="info-card">
312
- <h3>๐Ÿ“ˆ ๋ถ„์„ ๋Œ€์‹œ๋ณด๋“œ</h3>
313
- <p>์ˆ˜์ง‘๋œ ๋ฐ์ดํ„ฐ๋Š” ์ถ”์  ์„œ๋ฒ„์˜ ๋Œ€์‹œ๋ณด๋“œ์—์„œ ์‹ค์‹œ๊ฐ„์œผ๋กœ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.</p>
314
- </div>
315
- </div>
316
-
317
- <div class="console-hint">
318
- ๐Ÿ’ก <strong>๊ฐœ๋ฐœ์ž ๋„๊ตฌ ํ™œ์šฉ:</strong> <code>F12</code>๋ฅผ ๋ˆŒ๋Ÿฌ Console ํƒญ์—์„œ ์ถ”์  ์ด๋ฒคํŠธ๋ฅผ ์‹ค์‹œ๊ฐ„์œผ๋กœ ํ™•์ธํ•˜์„ธ์š”!
319
- </div>
320
-
321
- <div id="detailsSection" style="display: none;">
322
- <section class="hero-section" style="margin-top: 40px;">
323
- <h2>๐Ÿ“Š ๋ธŒ๋ผ์šฐ์ € ์ƒ์„ธ ์ •๋ณด</h2>
324
- <pre id="browserDetails" style="text-align: left; background: #f5f5f5; padding: 20px; border-radius: 8px; overflow-x: auto;"></pre>
325
- </section>
326
- </div>
327
- </div>
328
-
329
- <footer class="footer">
330
- <p>&copy; 2025 EV Cook. ๋ชจ๋“  ๊ถŒ๋ฆฌ ๋ณด์œ .</p>
331
- <p>์ถ”์  ์„œ๋ฒ„: <a href="https://seawolf2357-evcook.hf.space" target="_blank" style="color: white;">seawolf2357-evcook.hf.space</a></p>
332
- </footer>
333
-
334
- <!-- Visitor Tracking Script -->
335
- <script>
336
- (function() {
337
- // ์ถ”์  ์„œ๋ฒ„ URL (์˜ฌ๋ฐ”๋ฅธ URL๋กœ ์ˆ˜์ •!)
338
- const TRACKING_SERVER = 'https://seawolf2357-evcook.hf.space';
339
- const SITE_ID = '38e0a883';
340
-
341
- // ๋””๋ฐ”์ด์Šค ID ์ƒ์„ฑ/์กฐํšŒ
342
- function getDeviceId() {
343
- let deviceId = localStorage.getItem('_tracker_device_id');
344
- if (!deviceId) {
345
- // ํ•˜๋“œ์›จ์–ด ๊ธฐ๋ฐ˜ ID ์ƒ์„ฑ
346
- const components = [
347
- screen.width + 'x' + screen.height,
348
- navigator.hardwareConcurrency || 0,
349
- navigator.deviceMemory || 0,
350
- navigator.platform,
351
- navigator.language,
352
- new Date().getTimezoneOffset()
353
- ];
354
-
355
- // ๊ฐ„๋‹จํ•œ ํ•ด์‹œ ํ•จ์ˆ˜
356
- let hash = 0;
357
- const str = components.join('|');
358
- for (let i = 0; i < str.length; i++) {
359
- const char = str.charCodeAt(i);
360
- hash = ((hash << 5) - hash) + char;
361
- hash = hash & hash;
362
- }
363
-
364
- deviceId = 'DEV_' + Math.abs(hash).toString(36);
365
- localStorage.setItem('_tracker_device_id', deviceId);
366
- }
367
- return deviceId;
368
- }
369
-
370
- // WebGL ์ •๋ณด ์ˆ˜์ง‘
371
- function getWebGLInfo() {
372
- try {
373
- const canvas = document.createElement('canvas');
374
- const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
375
- if (!gl) return 'Not supported';
376
-
377
- const debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
378
- if (debugInfo) {
379
- return gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
380
- }
381
- return 'Unknown';
382
- } catch(e) {
383
- return 'Error';
384
  }
 
 
385
  }
386
 
387
- // Gradio ์—”๋“œํฌ์ธํŠธ๋กœ ๋ฐ์ดํ„ฐ ์ „์†ก (๋‘ ๊ฐ€์ง€ ๋ฐฉ๋ฒ• ๋ชจ๋‘ ์‹œ๋„)
388
- async function collectAndSend(eventType = 'pageview', eventData = {}) {
389
- const data = {
390
- siteId: SITE_ID,
391
- deviceId: getDeviceId(),
392
- eventType: eventType,
393
- eventData: eventData,
394
- pageUrl: window.location.href,
395
- pageTitle: document.title,
396
- referrer: document.referrer,
397
- userAgent: navigator.userAgent,
398
- screenResolution: screen.width + 'x' + screen.height,
399
- platform: navigator.platform,
400
- language: navigator.language,
401
- timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
402
- cpuCores: navigator.hardwareConcurrency || 0,
403
- deviceMemory: navigator.deviceMemory || 0,
404
- gpuInfo: getWebGLInfo(),
405
- timestamp: new Date().toISOString()
406
- };
407
 
408
- try {
409
- // ๋ฐฉ๋ฒ• 1: ์ƒˆ๋กœ์šด API ์—”๋“œํฌ์ธํŠธ ์‚ฌ์šฉ
410
- const response1 = await fetch(TRACKING_SERVER + '/api/process_tracking', {
411
- method: 'POST',
412
- headers: {
413
- 'Content-Type': 'application/json',
414
- },
415
- body: JSON.stringify({
416
- data_json: JSON.stringify(data)
417
- })
418
- });
419
-
420
- if (response1.ok) {
421
- console.log('[Tracker] โœ… Event tracked via API:', eventType, data);
422
- return;
423
- }
424
- } catch(e) {
425
- console.log('[Tracker] API method failed, trying legacy method...');
426
- }
427
 
428
- try {
429
- // ๋ฐฉ๋ฒ• 2: ๊ธฐ์กด Gradio ์—”๋“œํฌ์ธํŠธ ์‚ฌ์šฉ (ํด๋ฐฑ)
430
- const response2 = await fetch(TRACKING_SERVER + '/run/predict', {
431
- method: 'POST',
432
- headers: {
433
- 'Content-Type': 'application/json',
434
- },
435
- body: JSON.stringify({
436
- data: [JSON.stringify(data)],
437
- fn_index: 0 // process_tracking API ํ•จ์ˆ˜์˜ ์ธ๋ฑ์Šค
438
- })
439
- });
440
-
441
- if (response2.ok) {
442
- console.log('[Tracker] โœ… Event tracked via legacy:', eventType, data);
443
- } else {
444
- console.error('[Tracker] โŒ Server error:', response2.status);
445
- }
446
- } catch(e) {
447
- console.error('[Tracker] โŒ Network error:', e);
448
  }
 
 
449
  }
450
 
451
- // ์ „์—ญ ์ถ”์  ํ•จ์ˆ˜
452
- window._tracker = {
453
- trackEvent: function(eventName, eventData) {
454
- collectAndSend('custom', { name: eventName, data: eventData });
455
- }
456
- };
457
-
458
- // ํŽ˜์ด์ง€ ๋กœ๋“œ์‹œ ์ถ”์ 
459
- if (document.readyState === 'loading') {
460
- document.addEventListener('DOMContentLoaded', () => collectAndSend());
461
- } else {
462
- collectAndSend();
463
- }
464
-
465
- // SPA ์ง€์› - URL ๋ณ€๊ฒฝ ๊ฐ์ง€
466
- let lastUrl = location.href;
467
- new MutationObserver(() => {
468
- const url = location.href;
469
- if (url !== lastUrl) {
470
- lastUrl = url;
471
- collectAndSend('navigation', { from: lastUrl, to: url });
472
- }
473
- }).observe(document, {subtree: true, childList: true});
474
-
475
- // ์Šคํฌ๋กค ์ถ”์ 
476
- let scrollTracked = false;
477
- window.addEventListener('scroll', () => {
478
- if (!scrollTracked && window.scrollY > 100) {
479
- scrollTracked = true;
480
- window._tracker.trackEvent('scroll', { depth: window.scrollY });
481
- }
482
- });
483
-
484
- // ๋””๋ฒ„๊น… ์ •๋ณด ์ถœ๋ ฅ
485
- console.log('%c๐Ÿ” EV Cook ์ถ”์  ์‹œ์Šคํ…œ ์ดˆ๊ธฐํ™”', 'color: #4CAF50; font-size: 16px; font-weight: bold;');
486
- console.log('์ถ”์  ์„œ๋ฒ„:', TRACKING_SERVER);
487
- console.log('์‚ฌ์ดํŠธ ID:', SITE_ID);
488
- console.log('๋””๋ฐ”์ด์Šค ID:', getDeviceId());
489
- })();
490
- </script>
491
- <!-- End Visitor Tracking Script -->
492
-
493
- <!-- ํŽ˜์ด์ง€ ๊ธฐ๋Šฅ ์Šคํฌ๋ฆฝํŠธ -->
494
- <script>
495
- // ํŽ˜์ด์ง€ ๋กœ๋“œ์‹œ ์‹คํ–‰
496
- window.addEventListener('DOMContentLoaded', () => {
497
- // Device ID ํ‘œ์‹œ
498
- setTimeout(() => {
499
- const deviceId = localStorage.getItem('_tracker_device_id');
500
- if (deviceId) {
501
- document.getElementById('deviceId').textContent = deviceId;
502
- }
503
- document.getElementById('trackingStart').textContent = new Date().toLocaleString('ko-KR');
504
- }, 500);
505
- });
506
-
507
- // ์ถ”์  ํ…Œ์ŠคํŠธ
508
- function testTracking() {
509
- if (window._tracker) {
510
- window._tracker.trackEvent('test_button_click', {
511
- button: 'tracking_test',
512
- timestamp: Date.now(),
513
- location: 'hero_section'
514
- });
515
-
516
- alert('โœ… ์ถ”์  ์ด๋ฒคํŠธ๊ฐ€ ์ „์†ก๋˜์—ˆ์Šต๋‹ˆ๋‹ค!\n\n๊ฐœ๋ฐœ์ž ๋„๊ตฌ(F12) Console ํƒญ์—์„œ ํ™•์ธํ•˜์„ธ์š”.');
517
- } else {
518
- alert('โŒ ์ถ”์  ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ๋กœ๋“œ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.');
519
- }
520
- }
521
-
522
- // ์ปค์Šคํ…€ ์ด๋ฒคํŠธ ์ „์†ก
523
- function sendCustomEvent() {
524
- const eventName = prompt('์ด๋ฒคํŠธ ์ด๋ฆ„์„ ์ž…๋ ฅํ•˜์„ธ์š”:', 'custom_action');
525
- if (eventName && window._tracker) {
526
- const eventData = {
527
- custom_name: eventName,
528
- user_input: true,
529
- timestamp: Date.now()
530
- };
531
-
532
- window._tracker.trackEvent(eventName, eventData);
533
-
534
- alert(`โœ… '${eventName}' ์ด๋ฒคํŠธ๊ฐ€ ์ „์†ก๋˜์—ˆ์Šต๋‹ˆ๋‹ค!`);
535
- console.log('[Custom Event]', eventName, eventData);
536
- }
537
- }
538
-
539
- // ์ƒ์„ธ ์ •๋ณด ๋ณด๊ธฐ
540
- function viewDetails() {
541
- const details = {
542
- tracking: {
543
- deviceId: localStorage.getItem('_tracker_device_id'),
544
- siteId: '38e0a883',
545
- serverUrl: 'https://seawolf2357-evcook.hf.space'
546
- },
547
- browser: {
548
- userAgent: navigator.userAgent,
549
- platform: navigator.platform,
550
- vendor: navigator.vendor,
551
- language: navigator.language,
552
- languages: navigator.languages,
553
- cookieEnabled: navigator.cookieEnabled,
554
- doNotTrack: navigator.doNotTrack,
555
- onLine: navigator.onLine
556
- },
557
- screen: {
558
- resolution: screen.width + 'x' + screen.height,
559
- colorDepth: screen.colorDepth,
560
- pixelRatio: window.devicePixelRatio
561
- },
562
- viewport: {
563
- width: window.innerWidth,
564
- height: window.innerHeight
565
- },
566
- hardware: {
567
- cpuCores: navigator.hardwareConcurrency || 'Unknown',
568
- deviceMemory: navigator.deviceMemory ? navigator.deviceMemory + 'GB' : 'Unknown'
569
  },
570
- location: {
571
- href: window.location.href,
572
- hostname: window.location.hostname,
573
- protocol: window.location.protocol,
574
- pathname: window.location.pathname
575
- },
576
- time: {
577
- timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
578
- offset: new Date().getTimezoneOffset(),
579
- locale: new Date().toLocaleString()
580
- }
581
- };
582
-
583
- document.getElementById('browserDetails').textContent = JSON.stringify(details, null, 2);
584
- document.getElementById('detailsSection').style.display = 'block';
585
 
586
- // ์ƒ์„ธ ์ •๋ณด ๋ณด๊ธฐ๋„ ์ถ”์ 
587
- window._tracker.trackEvent('view_details', { action: 'show_browser_info' });
588
- }
589
-
590
- // ์ฝ˜์†”์— ์ถ”์  ์ •๋ณด ์ถœ๋ ฅ
591
- console.log('%c๐Ÿ” EV Cook ์ถ”์  ์‹œ์Šคํ…œ ํ™œ์„ฑํ™”๋จ', 'color: #4CAF50; font-size: 16px; font-weight: bold;');
592
- console.log('%c์ถ”์  ์„œ๋ฒ„:', 'font-weight: bold;', 'https://seawolf2357-evcook.hf.space');
593
- console.log('%c์‚ฌ์ดํŠธ ID:', 'font-weight: bold;', '38e0a883');
594
- console.log('%cDevice ID:', 'font-weight: bold;', localStorage.getItem('_tracker_device_id') || '์ƒ์„ฑ ์ค‘...');
595
- console.log('\n%c๐Ÿ’ก Tip: window._tracker.trackEvent(name, data)๋กœ ์ปค์Šคํ…€ ์ด๋ฒคํŠธ๋ฅผ ์ „์†กํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.', 'color: #666;');
596
- </script>
597
- </body>
598
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- Simplified API Tracking Script -->
2
+ <script>
3
+ (function() {
4
+ // ์ถ”์  ์„œ๋ฒ„ ์„ค์ •
5
+ const TRACKING_SERVER = 'https://seawolf2357-evcook.hf.space';
6
+ const SITE_ID = '38e0a883';
7
+
8
+ // ๋””๋ฐ”์ด์Šค ID ์ƒ์„ฑ
9
+ function getDeviceId() {
10
+ let deviceId = localStorage.getItem('_tracker_device_id');
11
+ if (!deviceId) {
12
+ deviceId = 'DEV_' + Date.now() + '_' + Math.random().toString(36).substring(2, 9);
13
+ localStorage.setItem('_tracker_device_id', deviceId);
14
+ }
15
+ return deviceId;
16
+ }
17
+
18
+ // ์ถ”์  ๋ฐ์ดํ„ฐ ์ „์†ก (๋‹จ์ˆœํ™”)
19
+ async function sendTracking(eventType = 'pageview', eventData = {}) {
20
+ const data = {
21
+ siteId: SITE_ID,
22
+ deviceId: getDeviceId(),
23
+ eventType: eventType,
24
+ eventData: eventData,
25
+ pageUrl: window.location.href,
26
+ pageTitle: document.title,
27
+ referrer: document.referrer,
28
+ userAgent: navigator.userAgent,
29
+ screenResolution: screen.width + 'x' + screen.height,
30
+ platform: navigator.platform,
31
+ language: navigator.language,
32
+ timestamp: new Date().toISOString()
33
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
+ console.log('[Tracker] Sending:', eventType);
 
 
 
 
 
 
 
36
 
37
+ // ๋ฐฉ๋ฒ• 1: Direct API with data_json parameter
38
+ try {
39
+ const response = await fetch(TRACKING_SERVER + '/api/predict/', {
40
+ method: 'POST',
41
+ headers: {
42
+ 'Content-Type': 'application/json',
43
+ },
44
+ body: JSON.stringify({
45
+ data: [JSON.stringify(data)], // data_json expects a string
46
+ fn_index: 0
47
+ })
48
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
+ if (response.ok) {
51
+ console.log('[Tracker] โœ… Success (Method 1)');
52
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  }
54
+ } catch (e) {
55
+ console.log('[Tracker] Method 1 error:', e);
56
  }
57
 
58
+ // ๋ฐฉ๋ฒ• 2: Using form data (alternative approach)
59
+ try {
60
+ const formData = new FormData();
61
+ formData.append('data_json', JSON.stringify(data));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
+ const response = await fetch(TRACKING_SERVER + '/api/process_tracking', {
64
+ method: 'POST',
65
+ body: formData
66
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
+ if (response.ok) {
69
+ console.log('[Tracker] โœ… Success (Method 2)');
70
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  }
72
+ } catch (e) {
73
+ console.log('[Tracker] Method 2 error:', e);
74
  }
75
 
76
+ // ๋ฐฉ๋ฒ• 3: Legacy endpoint
77
+ try {
78
+ const response = await fetch(TRACKING_SERVER + '/run/predict', {
79
+ method: 'POST',
80
+ headers: {
81
+ 'Content-Type': 'application/json',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  },
83
+ body: JSON.stringify({
84
+ data: [JSON.stringify(data)],
85
+ fn_index: 0
86
+ })
87
+ });
 
 
 
 
 
 
 
 
 
 
88
 
89
+ if (response.ok) {
90
+ console.log('[Tracker] โœ… Success (Method 3)');
91
+ return;
92
+ }
93
+ } catch (e) {
94
+ console.log('[Tracker] Method 3 error:', e);
95
+ }
96
+
97
+ console.error('[Tracker] โŒ All methods failed');
98
+ }
99
+
100
+ // ์ „์—ญ ์ถ”์  ๊ฐ์ฒด
101
+ window._tracker = {
102
+ trackEvent: function(name, data) {
103
+ sendTracking('custom', { name: name, data: data });
104
+ },
105
+
106
+ // ๊ฐ„๋‹จํ•œ ํ…Œ์ŠคํŠธ ํ•จ์ˆ˜
107
+ test: function() {
108
+ console.log('[Tracker] Sending test event...');
109
+ sendTracking('test', {
110
+ message: 'This is a test event',
111
+ timestamp: new Date().toISOString()
112
+ });
113
+ }
114
+ };
115
+
116
+ // ํŽ˜์ด์ง€ ๋กœ๋“œ ์ถ”์ 
117
+ sendTracking('pageview');
118
+
119
+ // ์Šคํฌ๋กค ์ถ”์ 
120
+ let scrolled = false;
121
+ window.addEventListener('scroll', function() {
122
+ if (!scrolled && window.scrollY > 100) {
123
+ scrolled = true;
124
+ sendTracking('scroll', { depth: window.scrollY });
125
+ }
126
+ });
127
+
128
+ console.log('๐Ÿ” EV Cook Tracker Ready');
129
+ console.log('Device ID:', getDeviceId());
130
+ console.log('Test with: window._tracker.test()');
131
+ })();
132
+ </script>