Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
199 lines (167 loc) · 8.23 KB
/
Copy pathindex.html
File metadata and controls
199 lines (167 loc) · 8.23 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<meta name="description" content="DualMind - AI Battle Arena for comparing language models">
<meta name="theme-color" content="#000000">
<title>DualMind - Battle Arena</title>
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://arena.dualmindlab.tech/">
<meta property="og:title" content="DualMind - AI Battle Arena">
<meta property="og:description" content="An anonymous side-by-side comparison arena for LLMs. Vote on responses to build the open LLM leaderboard.">
<meta property="og:image" content="https://arena.dualmindlab.tech/assets/og-image.png">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://arena.dualmindlab.tech/">
<meta property="twitter:title" content="DualMind - AI Battle Arena">
<meta property="twitter:description" content="An anonymous side-by-side comparison arena for LLMs. Vote on responses to build the open LLM leaderboard.">
<meta property="twitter:image" content="https://arena.dualmindlab.tech/assets/og-image.png">
<!-- Fonts: Outfit (UI) + JetBrains Mono (code). Only these two are loaded. -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
rel="stylesheet">
<!-- Syntax Highlighting CSS (non-blocking, loaded async) -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/vs2015.min.css" media="print" onload="this.media='all'">
<!-- Markdown & Syntax Highlighting JS — deferred: only needed after first AI response -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/dompurify@3.1.6/dist/purify.min.js" defer></script>
<!-- Styles: tokens.css must be first (defines all CSS custom properties) -->
<link rel="stylesheet" href="./css/tokens.css">
<link rel="stylesheet" href="./css/styles.css">
<link rel="stylesheet" href="./css/auth-styles.css">
<link rel="stylesheet" href="./css/model-selector.css">
<link rel="stylesheet" href="./css/sidebar-actions.css">
<link rel="stylesheet" href="css/leaderboard-page.css">
<link rel="stylesheet" href="css/ui-improvements.css">
<link rel="stylesheet" href="css/voting-ui.css">
<link rel="stylesheet" href="css/ai-input.css">
<link rel="stylesheet" href="css/share-modal.css">
<link rel="stylesheet" href="css/custom-modal.css">
<link rel="stylesheet" href="css/user-profile.css">
<!-- Favicon -->
<link rel="icon" type="image/svg+xml"
href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 21 21'><rect width='9' height='9' rx='1' fill='%23577B87'/><rect x='12' width='9' height='9' rx='1' fill='%234AABC2'/><rect x='12' y='12' width='9' height='9' rx='1' fill='%23CB9275'/><rect y='12' width='9' height='9' rx='1' fill='%23FDF4CD'/></svg>">
<!-- Config (must run synchronously before app) -->
<script src="./config.js"></script>
<!-- Global Error Handler - Prevents blank screen on JS failures -->
<script>
(function () {
var errorShown = false;
function showErrorBanner(message) {
if (errorShown) return;
errorShown = true;
var banner = document.createElement('div');
banner.id = 'app-error-banner';
banner.style.cssText = 'position:fixed;top:0;left:0;right:0;background:#1a1a2e;border-bottom:2px solid #ef4444;padding:16px 24px;z-index:99999;display:flex;align-items:center;justify-content:space-between;gap:16px;font-family:Outfit,sans-serif;';
banner.innerHTML =
'<div style="color:#fff;font-size:14px;">' +
'<strong style="color:#ef4444;">⚠️ App Error:</strong> ' +
'<span style="opacity:0.9;">' + message + '</span>' +
'</div>' +
'<button onclick="location.reload()" style="background:#4AABC2;color:#fff;border:none;padding:8px 16px;border-radius:8px;cursor:pointer;font-weight:600;">Retry</button>';
document.body.insertBefore(banner, document.body.firstChild);
var loading = document.getElementById('auth-loading-overlay');
if (loading) loading.style.display = 'none';
}
window.onerror = function (message, source, lineno, colno, error) {
console.error('Global error:', message, source, lineno);
showErrorBanner('Failed to load the application. Click Retry to reload.');
return false;
};
window.onunhandledrejection = function (event) {
console.error('Unhandled rejection:', event.reason);
if (event.reason && event.reason.message &&
(event.reason.message.includes('Failed to fetch') ||
event.reason.message.includes('NetworkError') ||
event.reason.message.includes('import') ||
event.reason.message.includes('module'))) {
showErrorBanner('Network error occurred. Check your connection and click Retry.');
}
};
window._DUALMIND_APP_READY = false;
setTimeout(function () {
if (!window._DUALMIND_APP_READY) {
var loading = document.getElementById('auth-loading-overlay');
if (loading && loading.style.display !== 'none') {
showErrorBanner('App initialization timed out. Click Retry to reload.');
}
}
}, 10000);
})();
</script>
<!-- Supabase Auth Initialization (Auto-initializes if configured) -->
<script src="./js/auth/supabase-init.js" defer></script>
</head>
<body>
<a class="skip-link" href="#chat-input">Skip to chat input</a>
<div class="bg-glow"></div>
<!-- Background Image (decorative) -->
<img src="./assets/background.png" class="app-background" alt="" aria-hidden="true">
<!-- Main App Container -->
<div id="app" style="display:none;">
<!-- Sidebar -->
<div id="sidebar-container" role="navigation" aria-label="Sidebar"></div>
<!-- Header + Main Content Area -->
<div class="main-wrapper">
<!-- Header -->
<div id="header-container" role="banner"></div>
<!-- Content Area -->
<main id="main-content" class="main-content scrollable" role="main" tabindex="-1"></main>
<!-- Chat Input at Bottom -->
<div id="chat-input-container" role="region" aria-label="Chat input"></div>
</div>
<!-- Floating Voting UI (appears above input after both responses) -->
<div id="floating-voting" hidden></div>
</div>
<!-- Auth Loading Overlay - Shows until auth resolves -->
<div id="auth-loading-overlay" style="
position: fixed;
inset: 0;
background: #000;
display: flex;
align-items: center;
justify-content: center;
z-index: 9999;
font-family: Outfit, sans-serif;
">
<div style="text-align: center; color: #fff;">
<div class="spinner" style="
width: 40px;
height: 40px;
border: 4px solid rgba(255,255,255,0.1);
border-top-color: #4AABC2;
border-radius: 50%;
animation: spin 0.8s linear infinite;
margin: 0 auto 16px;
"></div>
<p style="margin-top: 16px; opacity: 0.8; font-size: 14px; font-family: Outfit, sans-serif;">Loading...</p>
</div>
</div>
<style>
@keyframes spin {
to {
transform: rotate(360deg);
}
}
</style>
<!-- Scripts -->
<script type="module" src="./js/ui/app.js"></script>
<script src="./js/feature-flags.js?v=20260328-5" defer></script>
<!-- Fallback for browsers without module support -->
<script nomodule>
document.body.innerHTML = `
<div style="display:flex;align-items:center;justify-content:center;height:100vh;background:#000;color:#fff;font-family:Outfit,sans-serif;text-align:center;padding:20px;">
<div>
<h1>Browser Not Supported</h1>
<p>Please use a modern browser like Chrome, Firefox, Safari, or Edge.</p>
</div>
</div>
`;
</script>
</body>
</html>