seawolf2357 commited on
Commit
e9fa16f
ยท
verified ยท
1 Parent(s): 32b2b9a

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +92 -357
index.html CHANGED
@@ -324,11 +324,11 @@
324
  </div>
325
  <div class="row">
326
  <span class="label">์ถ”์  ์„œ๋ฒ„:</span>
327
- <span class="value">seawolf2357-evcook.hf.space</span>
328
  </div>
329
  <div class="row">
330
  <span class="label">์‚ฌ์ดํŠธ ID:</span>
331
- <span class="value">38e0a883</span>
332
  </div>
333
  <div class="row">
334
  <span class="label">์ถ”์  ์‹œ์ž‘:</span>
@@ -354,8 +354,7 @@
354
  <div class="debug-log" id="debugLog"></div>
355
  <div class="buttons" style="margin-top: 10px;">
356
  <button onclick="clearDebugLog()" class="secondary">๋กœ๊ทธ ์ง€์šฐ๊ธฐ</button>
357
- <button onclick="window._tracker.debug.checkConfig()" class="secondary">์„œ๋ฒ„ ๊ตฌ์กฐ ํ™•์ธ</button>
358
- <button onclick="window._tracker.debug.testAllMethods()" class="secondary">๋ชจ๋“  ๋ฐฉ๋ฒ• ํ…Œ์ŠคํŠธ</button>
359
  </div>
360
  </div>
361
 
@@ -388,92 +387,27 @@
388
 
389
  <footer class="footer">
390
  <p>&copy; 2025 EV Cook. ๋ชจ๋“  ๊ถŒ๋ฆฌ ๋ณด์œ .</p>
391
- <p>์ถ”์  ์„œ๋ฒ„: <a href="https://seawolf2357-evcook.hf.space" target="_blank" style="color: white;">seawolf2357-evcook.hf.space</a></p>
392
  </footer>
393
 
394
- <!-- ์™„๋ฒฝํ•œ ๋ฐฉ๋ฌธ์ž ์ถ”์  ์Šคํฌ๋ฆฝํŠธ -->
395
  <script>
396
  (function() {
397
- // ์ถ”์  ์„œ๋ฒ„ ์„ค์ •
398
- const TRACKING_SERVER = 'https://seawolf2357-evcook.hf.space';
399
- const SITE_ID = '38e0a883';
400
- const PROCESS_TRACKING_FN_INDEX = 10; // ์„œ๋ฒ„ ๋ถ„์„ ๊ฒฐ๊ณผ process_tracking์˜ fn_index
401
-
402
- // ๋””๋ฒ„๊ทธ ๋กœ๊น…
403
- const debugLog = [];
404
- function addDebugLog(type, message) {
405
- const timestamp = new Date().toLocaleTimeString();
406
- const logEntry = { type, message, timestamp };
407
- debugLog.push(logEntry);
408
-
409
- // ์ฝ˜์†”์—๋„ ์ถœ๋ ฅ
410
- const consoleMethod = type === 'error' ? 'error' : type === 'success' ? 'log' : 'info';
411
- console[consoleMethod](`[Tracker ${timestamp}] ${message}`);
412
-
413
- // UI ์—…๋ฐ์ดํŠธ
414
- updateDebugPanel();
415
- }
416
-
417
- function updateDebugPanel() {
418
- const debugLogEl = document.getElementById('debugLog');
419
- if (debugLogEl) {
420
- debugLogEl.innerHTML = debugLog.slice(-50).reverse().map(entry =>
421
- `<div class="log-entry ${entry.type}">[${entry.timestamp}] ${entry.message}</div>`
422
- ).join('');
423
- }
424
- }
425
 
426
  // ๋””๋ฐ”์ด์Šค ID ์ƒ์„ฑ/์กฐํšŒ
427
  function getDeviceId() {
428
  let deviceId = localStorage.getItem('_tracker_device_id');
429
  if (!deviceId) {
430
- // ํ•˜๋“œ์›จ์–ด ๊ธฐ๋ฐ˜ ID ์ƒ์„ฑ
431
- const components = [
432
- screen.width + 'x' + screen.height,
433
- navigator.hardwareConcurrency || 0,
434
- navigator.deviceMemory || 0,
435
- navigator.platform,
436
- navigator.language,
437
- new Date().getTimezoneOffset(),
438
- navigator.vendor,
439
- screen.colorDepth,
440
- window.devicePixelRatio || 1
441
- ];
442
-
443
- // ๋” ๊ฐ•๋ ฅํ•œ ํ•ด์‹œ ํ•จ์ˆ˜
444
- let hash = 0;
445
- const str = components.join('|');
446
- for (let i = 0; i < str.length; i++) {
447
- const char = str.charCodeAt(i);
448
- hash = ((hash << 5) - hash) + char;
449
- hash = hash & hash;
450
- }
451
-
452
- deviceId = 'DEV_' + Math.abs(hash).toString(36).toUpperCase();
453
  localStorage.setItem('_tracker_device_id', deviceId);
454
- addDebugLog('info', `์ƒˆ Device ID ์ƒ์„ฑ: ${deviceId}`);
455
  }
456
  return deviceId;
457
  }
458
 
459
- // WebGL ์ •๋ณด ์ˆ˜์ง‘
460
- function getWebGLInfo() {
461
- try {
462
- const canvas = document.createElement('canvas');
463
- const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
464
- if (!gl) return 'Not supported';
465
-
466
- const debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
467
- if (debugInfo) {
468
- return gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
469
- }
470
- return 'Unknown';
471
- } catch(e) {
472
- return 'Error: ' + e.message;
473
- }
474
- }
475
-
476
- // ์ถ”์  ๋ฐ์ดํ„ฐ ์ „์†ก (๋ชจ๋“  ๋ฐฉ๋ฒ• ์‹œ๋„)
477
  async function collectAndSend(eventType = 'pageview', eventData = {}) {
478
  const data = {
479
  siteId: SITE_ID,
@@ -487,292 +421,84 @@
487
  screenResolution: screen.width + 'x' + screen.height,
488
  platform: navigator.platform,
489
  language: navigator.language,
490
- timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
491
- cpuCores: navigator.hardwareConcurrency || 0,
492
- deviceMemory: navigator.deviceMemory || 0,
493
- gpuInfo: getWebGLInfo(),
494
  timestamp: new Date().toISOString()
495
  };
496
 
497
- addDebugLog('info', `์ด๋ฒคํŠธ ์ „์†ก ์‹œ์ž‘: ${eventType}`);
498
- updateTrackingStatus('์ „์†ก ์ค‘...');
499
-
500
- let success = false;
501
-
502
- // ๋ฐฉ๋ฒ• 1: Gradio Client API (/call/process_tracking)
503
- if (!success) {
504
- try {
505
- addDebugLog('info', '๋ฐฉ๋ฒ• 1: Gradio Client API ์‹œ๋„');
506
- const response = await fetch(TRACKING_SERVER + '/call/process_tracking', {
507
- method: 'POST',
508
- headers: {
509
- 'Content-Type': 'application/json',
510
- },
511
- body: JSON.stringify({
512
- data: [JSON.stringify(data)]
513
- })
514
- });
515
-
516
- if (response.ok) {
517
- const result = await response.json();
518
-
519
- // event_id๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๊ฒฐ๊ณผ ๊ฐ€์ ธ์˜ค๊ธฐ
520
- if (result.event_id) {
521
- const resultResponse = await fetch(TRACKING_SERVER + '/call/process_tracking/' + result.event_id);
522
- if (resultResponse.ok) {
523
- addDebugLog('success', 'โœ… ๋ฐฉ๋ฒ• 1 ์„ฑ๊ณต: Gradio Client API');
524
- success = true;
525
- updateTrackingStatus('์ „์†ก ์™„๋ฃŒ (Client API)');
526
- }
527
- }
528
- }
529
- } catch (e) {
530
- addDebugLog('error', `๋ฐฉ๋ฒ• 1 ์‹คํŒจ: ${e.message}`);
531
- }
532
- }
533
-
534
- // ๋ฐฉ๋ฒ• 2: Direct API with fn_index=10
535
- if (!success) {
536
- try {
537
- addDebugLog('info', `๋ฐฉ๋ฒ• 2: Direct API (fn_index=${PROCESS_TRACKING_FN_INDEX}) ์‹œ๋„`);
538
- const response = await fetch(TRACKING_SERVER + '/api/predict', {
539
- method: 'POST',
540
- headers: {
541
- 'Content-Type': 'application/json',
542
- },
543
- body: JSON.stringify({
544
- data: [JSON.stringify(data)],
545
- fn_index: PROCESS_TRACKING_FN_INDEX
546
- })
547
- });
548
-
549
- if (response.ok) {
550
- const result = await response.json();
551
- addDebugLog('success', 'โœ… ๋ฐฉ๋ฒ• 2 ์„ฑ๊ณต: Direct API');
552
- success = true;
553
- updateTrackingStatus('์ „์†ก ์™„๋ฃŒ (Direct API)');
554
- } else {
555
- addDebugLog('error', `๋ฐฉ๋ฒ• 2 ์‹คํŒจ: HTTP ${response.status}`);
556
- }
557
- } catch (e) {
558
- addDebugLog('error', `๋ฐฉ๋ฒ• 2 ์‹คํŒจ: ${e.message}`);
559
- }
560
- }
561
-
562
- // ๋ฐฉ๋ฒ• 3: Queue API
563
- if (!success) {
564
- try {
565
- addDebugLog('info', '๋ฐฉ๋ฒ• 3: Queue API ์‹œ๋„');
566
- const session_hash = Math.random().toString(36).substring(2, 15);
567
-
568
- const joinResponse = await fetch(TRACKING_SERVER + '/queue/join', {
569
- method: 'POST',
570
- headers: {
571
- 'Content-Type': 'application/json',
572
- },
573
- body: JSON.stringify({
574
- data: [JSON.stringify(data)],
575
- fn_index: PROCESS_TRACKING_FN_INDEX,
576
- session_hash: session_hash
577
- })
578
- });
579
-
580
- if (joinResponse.ok) {
581
- // SSE๋กœ ๊ฒฐ๊ณผ ๋ฐ›๊ธฐ
582
- const reader = joinResponse.body.getReader();
583
- const decoder = new TextDecoder();
584
-
585
- while (true) {
586
- const { done, value } = await reader.read();
587
- if (done) break;
588
-
589
- const text = decoder.decode(value);
590
- if (text.includes('process_completed')) {
591
- addDebugLog('success', 'โœ… ๋ฐฉ๋ฒ• 3 ์„ฑ๊ณต: Queue API');
592
- success = true;
593
- updateTrackingStatus('์ „์†ก ์™„๋ฃŒ (Queue API)');
594
- break;
595
- }
596
- }
597
- }
598
- } catch (e) {
599
- addDebugLog('error', `๋ฐฉ๋ฒ• 3 ์‹คํŒจ: ${e.message}`);
600
- }
601
- }
602
-
603
- // ๋ฐฉ๋ฒ• 4: Run endpoint
604
- if (!success) {
605
- try {
606
- addDebugLog('info', '๋ฐฉ๋ฒ• 4: Run endpoint ์‹œ๋„');
607
- const response = await fetch(TRACKING_SERVER + '/run/process_tracking', {
608
- method: 'POST',
609
- headers: {
610
- 'Content-Type': 'application/json',
611
- },
612
- body: JSON.stringify({
613
- data: [JSON.stringify(data)]
614
- })
615
- });
616
-
617
- if (response.ok) {
618
- addDebugLog('success', 'โœ… ๋ฐฉ๋ฒ• 4 ์„ฑ๊ณต: Run endpoint');
619
- success = true;
620
- updateTrackingStatus('์ „์†ก ์™„๋ฃŒ (Run API)');
621
  }
622
- } catch (e) {
623
- addDebugLog('error', `๋ฐฉ๋ฒ• 4 ์‹คํŒจ: ${e.message}`);
 
 
624
  }
625
- }
626
-
627
- if (!success) {
628
- addDebugLog('error', 'โŒ ๋ชจ๋“  ์ „์†ก ๋ฐฉ๋ฒ• ์‹คํŒจ');
629
- updateTrackingStatus('์ „์†ก ์‹คํŒจ');
630
- }
631
-
632
- return success;
633
- }
634
-
635
- // ์ถ”์  ์ƒํƒœ ์—…๋ฐ์ดํŠธ
636
- function updateTrackingStatus(status) {
637
- const statusEl = document.getElementById('trackingStatus');
638
- if (statusEl) {
639
- statusEl.textContent = status;
640
  }
641
  }
642
 
643
- // ์ „์—ญ ์ถ”์  ๊ฐ์ฒด
644
  window._tracker = {
645
  trackEvent: function(eventName, eventData) {
646
- return collectAndSend('custom', { name: eventName, data: eventData });
647
- },
648
-
649
- // ๋””๋ฒ„๊น… ๋„๊ตฌ
650
- debug: {
651
- getDeviceId: getDeviceId,
652
- getWebGLInfo: getWebGLInfo,
653
-
654
- // ์„œ๋ฒ„ ๊ตฌ์กฐ ํ™•์ธ
655
- checkConfig: async function() {
656
- addDebugLog('info', '์„œ๋ฒ„ ๊ตฌ์กฐ ํ™•์ธ ์ค‘...');
657
- try {
658
- const response = await fetch(TRACKING_SERVER + '/config');
659
- const config = await response.json();
660
-
661
- addDebugLog('info', `Gradio ๋ฒ„์ „: ${config.version}`);
662
-
663
- if (config.dependencies) {
664
- addDebugLog('info', `API ํ•จ์ˆ˜ ๊ฐœ์ˆ˜: ${config.dependencies.length}`);
665
- config.dependencies.forEach((dep, i) => {
666
- if (dep.api_name) {
667
- addDebugLog('info', `[${i}] ${dep.api_name}`);
668
- }
669
- });
670
- }
671
- } catch (e) {
672
- addDebugLog('error', `์„œ๏ฟฝ๏ฟฝ๏ฟฝ ๊ตฌ์กฐ ํ™•์ธ ์‹คํŒจ: ${e.message}`);
673
- }
674
- },
675
-
676
- // ๋ชจ๋“  ๋ฐฉ๋ฒ• ํ…Œ์ŠคํŠธ
677
- testAllMethods: async function() {
678
- addDebugLog('info', '=== ๋ชจ๋“  ์ „์†ก ๋ฐฉ๋ฒ• ํ…Œ์ŠคํŠธ ์‹œ์ž‘ ===');
679
- const testData = {
680
- test: true,
681
- method: 'all',
682
- timestamp: new Date().toISOString()
683
- };
684
- await collectAndSend('test_all_methods', testData);
685
- },
686
-
687
- // ๊ฐ„๋‹จํ•œ ํ…Œ์ŠคํŠธ
688
- test: function() {
689
- return collectAndSend('debug_test', {
690
- test: true,
691
- timestamp: new Date().toISOString(),
692
- random: Math.random()
693
- });
694
- },
695
-
696
- // ๋กœ๊ทธ ํ™•์ธ
697
- getLogs: function() {
698
- return debugLog;
699
- }
700
  }
701
  };
702
 
703
  // ํŽ˜์ด์ง€ ๋กœ๋“œ์‹œ ์ถ”์ 
704
  if (document.readyState === 'loading') {
705
- document.addEventListener('DOMContentLoaded', () => {
706
- addDebugLog('info', 'DOM ๋กœ๋“œ ์™„๋ฃŒ, pageview ์ „์†ก');
707
- collectAndSend();
708
- });
709
  } else {
710
- addDebugLog('info', 'ํŽ˜์ด์ง€ ์ด๋ฏธ ๋กœ๋“œ๋จ, pageview ์ „์†ก');
711
  collectAndSend();
712
  }
713
 
714
- // SPA ์ง€์› - URL ๋ณ€๊ฒฝ ๊ฐ์ง€
715
- let lastUrl = location.href;
716
- new MutationObserver(() => {
717
- const url = location.href;
718
- if (url !== lastUrl) {
719
- lastUrl = url;
720
- addDebugLog('info', `URL ๋ณ€๊ฒฝ ๊ฐ์ง€: ${url}`);
721
- collectAndSend('navigation', { from: lastUrl, to: url });
722
- }
723
- }).observe(document, {subtree: true, childList: true});
724
-
725
- // ์Šคํฌ๋กค ์ถ”์ 
726
- let scrollTracked = false;
727
- window.addEventListener('scroll', () => {
728
- if (!scrollTracked && window.scrollY > 100) {
729
- scrollTracked = true;
730
- addDebugLog('info', `์Šคํฌ๋กค ์ด๋ฒคํŠธ: ${window.scrollY}px`);
731
- window._tracker.trackEvent('scroll', { depth: window.scrollY });
732
  }
733
- });
734
 
735
- // ํด๋ฆญ ์ถ”์  (์„ ํƒ์‚ฌํ•ญ)
736
- document.addEventListener('click', (e) => {
737
- const target = e.target;
738
- if (target.tagName === 'A' || target.tagName === 'BUTTON') {
739
- const trackData = {
740
- element: target.tagName,
741
- text: target.textContent.substring(0, 50),
742
- href: target.href || '',
743
- id: target.id || '',
744
- class: target.className || ''
745
- };
746
- window._tracker.trackEvent('click', trackData);
747
  }
748
- });
749
 
750
- // ํŽ˜์ด์ง€ ์ดํƒˆ ์ถ”์  (์„ ํƒ์‚ฌํ•ญ)
751
- window.addEventListener('beforeunload', () => {
752
- const timeOnPage = Math.floor((Date.now() - window._trackerStartTime) / 1000);
753
- window._tracker.trackEvent('page_exit', {
754
- timeOnPage: timeOnPage,
755
- scrollDepth: window.scrollY
756
- });
757
- });
758
 
759
- // ์‹œ์ž‘ ์‹œ๊ฐ„ ๊ธฐ๋ก
760
- window._trackerStartTime = Date.now();
761
-
762
- // ์ดˆ๊ธฐํ™” ๋ฉ”์‹œ์ง€
763
- console.log('%c๐Ÿ” EV Cook Tracker v6.0 (์™„๋ฒฝํ•œ ๋ฒ„์ „)', 'color: #4CAF50; font-size: 16px; font-weight: bold;');
764
- console.log('%c์„œ๋ฒ„: ' + TRACKING_SERVER, 'color: #2196F3');
765
- console.log('%c์‚ฌ์ดํŠธ ID: ' + SITE_ID, 'color: #2196F3');
766
- console.log('%cDevice ID: ' + getDeviceId(), 'color: #2196F3');
767
- console.log('%cprocess_tracking fn_index: ' + PROCESS_TRACKING_FN_INDEX, 'color: #2196F3');
768
- console.log('\n%c๐Ÿ“š ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋ช…๋ น์–ด:', 'font-weight: bold');
769
- console.log('โ€ข window._tracker.trackEvent(name, data) - ์ปค์Šคํ…€ ์ด๋ฒคํŠธ ์ „์†ก');
770
- console.log('โ€ข window._tracker.debug.checkConfig() - ์„œ๋ฒ„ ๊ตฌ์กฐ ํ™•์ธ');
771
- console.log('โ€ข window._tracker.debug.test() - ํ…Œ์ŠคํŠธ ์ด๋ฒคํŠธ ์ „์†ก');
772
- console.log('โ€ข window._tracker.debug.testAllMethods() - ๋ชจ๋“  ๋ฐฉ๋ฒ• ํ…Œ์ŠคํŠธ');
773
- console.log('โ€ข window._tracker.debug.getLogs() - ๋””๋ฒ„๊ทธ ๋กœ๊ทธ ํ™•์ธ');
774
-
775
- addDebugLog('success', 'EV Cook Tracker ์ดˆ๊ธฐํ™” ์™„๋ฃŒ');
776
  })();
777
  </script>
778
  <!-- End Visitor Tracking Script -->
@@ -799,13 +525,8 @@
799
  timestamp: Date.now(),
800
  location: 'hero_section',
801
  userAction: true
802
- }).then(success => {
803
- if (success) {
804
- alert('โœ… ์ถ”์  ์ด๋ฒคํŠธ๊ฐ€ ์„ฑ๊ณต์ ์œผ๋กœ ์ „์†ก๋˜์—ˆ์Šต๋‹ˆ๋‹ค!\n\n๋””๋ฒ„๊ทธ ํŒจ๋„์—์„œ ์ƒ์„ธ ์ •๋ณด๋ฅผ ํ™•์ธํ•˜์„ธ์š”.');
805
- } else {
806
- alert('โŒ ์ถ”์  ์ด๋ฒคํŠธ ์ „์†ก์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.\n\n๋””๋ฒ„๊ทธ ํŒจ๋„์—์„œ ์˜ค๋ฅ˜๋ฅผ ํ™•์ธํ•˜์„ธ์š”.');
807
- }
808
  });
 
809
  } else {
810
  alert('โŒ ์ถ”์  ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ๋กœ๋“œ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.');
811
  }
@@ -843,9 +564,9 @@
843
  const details = {
844
  tracking: {
845
  deviceId: localStorage.getItem('_tracker_device_id'),
846
- siteId: '38e0a883',
847
- serverUrl: 'https://seawolf2357-evcook.hf.space',
848
- startTime: window._trackerStartTime ? new Date(window._trackerStartTime).toLocaleString() : 'Unknown'
849
  },
850
  browser: {
851
  userAgent: navigator.userAgent,
@@ -874,8 +595,7 @@
874
  hardware: {
875
  cpuCores: navigator.hardwareConcurrency || 'Unknown',
876
  deviceMemory: navigator.deviceMemory ? navigator.deviceMemory + 'GB' : 'Unknown',
877
- maxTouchPoints: navigator.maxTouchPoints || 0,
878
- webGL: window._tracker.debug.getWebGLInfo()
879
  },
880
  location: {
881
  href: window.location.href,
@@ -888,8 +608,7 @@
888
  time: {
889
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
890
  offset: new Date().getTimezoneOffset(),
891
- locale: new Date().toLocaleString(),
892
- timeOnPage: window._trackerStartTime ? Math.floor((Date.now() - window._trackerStartTime) / 1000) + '์ดˆ' : 'Unknown'
893
  },
894
  storage: {
895
  localStorage: typeof(Storage) !== "undefined",
@@ -922,17 +641,33 @@
922
 
923
  // ๋””๋ฒ„๊ทธ ๋กœ๊ทธ ์ง€์šฐ๊ธฐ
924
  function clearDebugLog() {
925
- window._tracker.debug.getLogs().length = 0;
926
- const debugLogEl = document.getElementById('debugLog');
927
- if (debugLogEl) {
928
- debugLogEl.innerHTML = '<div class="log-entry info">๋กœ๊ทธ๊ฐ€ ์ง€์›Œ์กŒ์Šต๋‹ˆ๋‹ค.</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
929
  }
930
  }
931
 
932
  // ์ฝ˜์†”์— ์ถ”์  ์ •๋ณด ์ถœ๋ ฅ
933
  console.log('%c๐Ÿ” EV Cook ์ถ”์  ์‹œ์Šคํ…œ ํ™œ์„ฑํ™”๋จ', 'color: #4CAF50; font-size: 16px; font-weight: bold;');
934
- console.log('%c์ถ”์  ์„œ๋ฒ„:', 'font-weight: bold;', 'https://seawolf2357-evcook.hf.space');
935
- console.log('%c์‚ฌ์ดํŠธ ID:', 'font-weight: bold;', '38e0a883');
936
  console.log('%cDevice ID:', 'font-weight: bold;', localStorage.getItem('_tracker_device_id') || '์ƒ์„ฑ ์ค‘...');
937
  console.log('\n%c๐Ÿ’ก Tip: ๋””๋ฒ„๊ทธ ํŒจ๋„ ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ ์‹ค์‹œ๊ฐ„ ์ถ”์  ๋กœ๊ทธ๋ฅผ ํ™•์ธํ•˜์„ธ์š”!', 'color: #666;');
938
  </script>
 
324
  </div>
325
  <div class="row">
326
  <span class="label">์ถ”์  ์„œ๋ฒ„:</span>
327
+ <span class="value">seawolf2357-ev-cook-siteurl.static.hf.space</span>
328
  </div>
329
  <div class="row">
330
  <span class="label">์‚ฌ์ดํŠธ ID:</span>
331
+ <span class="value">c4562ca1</span>
332
  </div>
333
  <div class="row">
334
  <span class="label">์ถ”์  ์‹œ์ž‘:</span>
 
354
  <div class="debug-log" id="debugLog"></div>
355
  <div class="buttons" style="margin-top: 10px;">
356
  <button onclick="clearDebugLog()" class="secondary">๋กœ๊ทธ ์ง€์šฐ๊ธฐ</button>
357
+ <button onclick="checkServerStatus()" class="secondary">์„œ๋ฒ„ ์ƒํƒœ ํ™•์ธ</button>
 
358
  </div>
359
  </div>
360
 
 
387
 
388
  <footer class="footer">
389
  <p>&copy; 2025 EV Cook. ๋ชจ๋“  ๊ถŒ๋ฆฌ ๋ณด์œ .</p>
390
+ <p>์ถ”์  ์„œ๋ฒ„: <a href="https://seawolf2357-ev-cook-siteurl.static.hf.space" target="_blank" style="color: white;">seawolf2357-ev-cook-siteurl.static.hf.space</a></p>
391
  </footer>
392
 
393
+ <!-- Visitor Tracking Script -->
394
  <script>
395
  (function() {
396
+ // ์ถ”์  ์„œ๋ฒ„ URL
397
+ const TRACKING_SERVER = 'https://seawolf2357-ev-cook-siteurl.static.hf.space/';
398
+ const SITE_ID = 'c4562ca1';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
399
 
400
  // ๋””๋ฐ”์ด์Šค ID ์ƒ์„ฑ/์กฐํšŒ
401
  function getDeviceId() {
402
  let deviceId = localStorage.getItem('_tracker_device_id');
403
  if (!deviceId) {
404
+ deviceId = 'DEV_' + Date.now() + '_' + Math.random().toString(36).substring(2, 9);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
405
  localStorage.setItem('_tracker_device_id', deviceId);
 
406
  }
407
  return deviceId;
408
  }
409
 
410
+ // ์ถ”์  ๋ฐ์ดํ„ฐ ์ „์†ก
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
411
  async function collectAndSend(eventType = 'pageview', eventData = {}) {
412
  const data = {
413
  siteId: SITE_ID,
 
421
  screenResolution: screen.width + 'x' + screen.height,
422
  platform: navigator.platform,
423
  language: navigator.language,
 
 
 
 
424
  timestamp: new Date().toISOString()
425
  };
426
 
427
+ try {
428
+ const response = await fetch(TRACKING_SERVER + '/call/process_tracking', {
429
+ method: 'POST',
430
+ headers: { 'Content-Type': 'application/json' },
431
+ body: JSON.stringify({ data: [JSON.stringify(data)] })
432
+ });
433
+
434
+ if (response.ok) {
435
+ const result = await response.json();
436
+ if (result.event_id) {
437
+ console.log('[Tracker] โœ… Event tracked');
438
+ updateTrackingStatus('์ „์†ก ์™„๋ฃŒ');
439
+ addDebugLog('success', `์ด๋ฒคํŠธ ์ „์†ก ์„ฑ๊ณต: ${eventType}`);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  }
441
+ } else {
442
+ console.error('[Tracker] Server error:', response.status);
443
+ updateTrackingStatus('์ „์†ก ์‹คํŒจ');
444
+ addDebugLog('error', `์„œ๋ฒ„ ์˜ค๋ฅ˜: ${response.status}`);
445
  }
446
+ } catch(e) {
447
+ console.error('[Tracker] Error:', e);
448
+ updateTrackingStatus('๋„คํŠธ์›Œํฌ ์˜ค๋ฅ˜');
449
+ addDebugLog('error', `๋„คํŠธ์›Œํฌ ์˜ค๋ฅ˜: ${e.message}`);
 
 
 
 
 
 
 
 
 
 
 
450
  }
451
  }
452
 
453
+ // ์ „์—ญ ์ถ”์  ํ•จ์ˆ˜
454
  window._tracker = {
455
  trackEvent: function(eventName, eventData) {
456
+ collectAndSend('custom', { name: eventName, data: eventData });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
457
  }
458
  };
459
 
460
  // ํŽ˜์ด์ง€ ๋กœ๋“œ์‹œ ์ถ”์ 
461
  if (document.readyState === 'loading') {
462
+ document.addEventListener('DOMContentLoaded', () => collectAndSend());
 
 
 
463
  } else {
 
464
  collectAndSend();
465
  }
466
 
467
+ // ๋””๋ฒ„๊ทธ ๋กœ๊ทธ (UI ์—ฐ๋™์šฉ)
468
+ const debugLog = [];
469
+ function addDebugLog(type, message) {
470
+ const timestamp = new Date().toLocaleTimeString();
471
+ debugLog.push({ type, message, timestamp });
472
+ updateDebugPanel();
473
+ }
474
+
475
+ function updateDebugPanel() {
476
+ const debugLogEl = document.getElementById('debugLog');
477
+ if (debugLogEl) {
478
+ debugLogEl.innerHTML = debugLog.slice(-50).reverse().map(entry =>
479
+ `<div class="log-entry ${entry.type}">[${entry.timestamp}] ${entry.message}</div>`
480
+ ).join('');
 
 
 
 
481
  }
482
+ }
483
 
484
+ function updateTrackingStatus(status) {
485
+ const statusEl = document.getElementById('trackingStatus');
486
+ if (statusEl) {
487
+ statusEl.textContent = status;
 
 
 
 
 
 
 
 
488
  }
489
+ }
490
 
491
+ // ์ „์—ญ ํ•จ์ˆ˜ ํ™•์žฅ
492
+ window._tracker.getDebugLog = function() {
493
+ return debugLog;
494
+ };
 
 
 
 
495
 
496
+ // ์ดˆ๊ธฐํ™” ๋กœ๊ทธ
497
+ console.log('๐Ÿ” EV Cook Tracker ์ดˆ๊ธฐํ™”๋จ');
498
+ console.log('์„œ๋ฒ„:', TRACKING_SERVER);
499
+ console.log('์‚ฌ์ดํŠธ ID:', SITE_ID);
500
+ console.log('๋””๋ฐ”์ด์Šค ID:', getDeviceId());
501
+ addDebugLog('info', 'EV Cook Tracker ์ดˆ๊ธฐํ™” ์™„๋ฃŒ');
 
 
 
 
 
 
 
 
 
 
 
502
  })();
503
  </script>
504
  <!-- End Visitor Tracking Script -->
 
525
  timestamp: Date.now(),
526
  location: 'hero_section',
527
  userAction: true
 
 
 
 
 
 
528
  });
529
+ alert('โœ… ์ถ”์  ์ด๋ฒคํŠธ๊ฐ€ ์ „์†ก๋˜์—ˆ์Šต๋‹ˆ๋‹ค!\n\n์ฝ˜์†”๊ณผ ๋””๋ฒ„๊ทธ ํŒจ๋„์—์„œ ํ™•์ธํ•˜์„ธ์š”.');
530
  } else {
531
  alert('โŒ ์ถ”์  ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ๋กœ๋“œ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.');
532
  }
 
564
  const details = {
565
  tracking: {
566
  deviceId: localStorage.getItem('_tracker_device_id'),
567
+ siteId: 'c4562ca1',
568
+ serverUrl: 'https://seawolf2357-ev-cook-siteurl.static.hf.space',
569
+ startTime: new Date().toLocaleString()
570
  },
571
  browser: {
572
  userAgent: navigator.userAgent,
 
595
  hardware: {
596
  cpuCores: navigator.hardwareConcurrency || 'Unknown',
597
  deviceMemory: navigator.deviceMemory ? navigator.deviceMemory + 'GB' : 'Unknown',
598
+ maxTouchPoints: navigator.maxTouchPoints || 0
 
599
  },
600
  location: {
601
  href: window.location.href,
 
608
  time: {
609
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
610
  offset: new Date().getTimezoneOffset(),
611
+ locale: new Date().toLocaleString()
 
612
  },
613
  storage: {
614
  localStorage: typeof(Storage) !== "undefined",
 
641
 
642
  // ๋””๋ฒ„๊ทธ ๋กœ๊ทธ ์ง€์šฐ๊ธฐ
643
  function clearDebugLog() {
644
+ if (window._tracker && window._tracker.getDebugLog) {
645
+ window._tracker.getDebugLog().length = 0;
646
+ const debugLogEl = document.getElementById('debugLog');
647
+ if (debugLogEl) {
648
+ debugLogEl.innerHTML = '<div class="log-entry info">๋กœ๊ทธ๊ฐ€ ์ง€์›Œ์กŒ์Šต๋‹ˆ๋‹ค.</div>';
649
+ }
650
+ }
651
+ }
652
+
653
+ // ์„œ๋ฒ„ ์ƒํƒœ ํ™•์ธ
654
+ async function checkServerStatus() {
655
+ try {
656
+ const response = await fetch('https://seawolf2357-ev-cook-siteurl.static.hf.space/');
657
+ if (response.ok) {
658
+ alert('โœ… ์„œ๋ฒ„๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์ž‘๋™ ์ค‘์ž…๋‹ˆ๋‹ค.');
659
+ } else {
660
+ alert('โš ๏ธ ์„œ๋ฒ„ ์‘๋‹ต ์ƒํƒœ: ' + response.status);
661
+ }
662
+ } catch (e) {
663
+ alert('โŒ ์„œ๋ฒ„์— ์—ฐ๊ฒฐํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค: ' + e.message);
664
  }
665
  }
666
 
667
  // ์ฝ˜์†”์— ์ถ”์  ์ •๋ณด ์ถœ๋ ฅ
668
  console.log('%c๐Ÿ” EV Cook ์ถ”์  ์‹œ์Šคํ…œ ํ™œ์„ฑํ™”๋จ', 'color: #4CAF50; font-size: 16px; font-weight: bold;');
669
+ console.log('%c์ถ”์  ์„œ๋ฒ„:', 'font-weight: bold;', 'https://seawolf2357-ev-cook-siteurl.static.hf.space');
670
+ console.log('%c์‚ฌ์ดํŠธ ID:', 'font-weight: bold;', 'c4562ca1');
671
  console.log('%cDevice ID:', 'font-weight: bold;', localStorage.getItem('_tracker_device_id') || '์ƒ์„ฑ ์ค‘...');
672
  console.log('\n%c๐Ÿ’ก Tip: ๋””๋ฒ„๊ทธ ํŒจ๋„ ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ ์‹ค์‹œ๊ฐ„ ์ถ”์  ๋กœ๊ทธ๋ฅผ ํ™•์ธํ•˜์„ธ์š”!', 'color: #666;');
673
  </script>