/
githubmirror
/
tldraw
Обзор
Документация
Войти
/
githubmirror
/
tldraw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
apps/analytics/index.html
40 строк
1015 B
Steve Ruiz
Refactor analytics app to vanilla JS and modular architecture (#6964)
21 окт 2025, 14:57
Не верифицирован
21 окт 2025, 14:57
e993810
Код
Авторство
О чём код?
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Analytics Banner Preview</title> <style> body { width: 100%; height: 100%; background-color: white; color: black; } body.dark { background-color: black; color: white; } </style> </head> <body> <button id="toggle-theme">toggle theme</button> <button id="cookie-dialog">show cookie preferences</button> </body> <script> const button = document.getElementById('toggle-theme') button.addEventListener('click', () => { document.body.classList.toggle('dark') document.body.setAttribute( 'data-theme', document.body.classList.contains('dark') ? 'dark' : 'light' ) }) const cookieButton = document.getElementById('cookie-dialog') cookieButton.addEventListener('click', () => { window.tlanalytics.openPrivacySettings() }) </script> <script src="./public/tl-analytics.js"></script> </html>