224 lines
5.3 KiB
HTML
224 lines
5.3 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>Streamer Widgets</title>
|
|
<style>
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
background: #f8fafc;
|
|
color: #334155;
|
|
margin: 0;
|
|
padding: 0;
|
|
display: flex;
|
|
justify-content: center;
|
|
min-height: 100vh;
|
|
}
|
|
.container {
|
|
width: 100%;
|
|
max-width: 640px;
|
|
margin: 40px 20px;
|
|
background: #ffffff;
|
|
border-radius: 12px;
|
|
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
overflow: hidden;
|
|
}
|
|
header {
|
|
background: #0f172a;
|
|
color: white;
|
|
padding: 24px 32px;
|
|
}
|
|
h1 {
|
|
margin: 0;
|
|
font-size: 24px;
|
|
font-weight: 600;
|
|
}
|
|
.subtitle {
|
|
margin-top: 8px;
|
|
font-size: 14px;
|
|
color: #94a3b8;
|
|
}
|
|
.content {
|
|
padding: 32px;
|
|
}
|
|
h2 {
|
|
font-size: 18px;
|
|
margin: 0 0 16px;
|
|
color: #1e293b;
|
|
}
|
|
.widget-list {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 16px;
|
|
}
|
|
.widget-item {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
padding: 16px;
|
|
background: #f1f5f9;
|
|
border-radius: 8px;
|
|
border: 1px solid #e2e8f0;
|
|
}
|
|
.widget-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
}
|
|
.widget-name {
|
|
font-weight: 600;
|
|
color: #0f172a;
|
|
text-decoration: none;
|
|
}
|
|
.widget-name:hover {
|
|
text-decoration: underline;
|
|
}
|
|
.widget-url-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
background: #ffffff;
|
|
border: 1px solid #cbd5e1;
|
|
border-radius: 6px;
|
|
padding: 8px 12px;
|
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
font-size: 13px;
|
|
color: #475569;
|
|
}
|
|
.widget-url-row input {
|
|
flex: 1;
|
|
border: none;
|
|
background: transparent;
|
|
font-family: inherit;
|
|
font-size: inherit;
|
|
color: inherit;
|
|
outline: none;
|
|
min-width: 0;
|
|
}
|
|
.copy-btn {
|
|
background: #0f172a;
|
|
color: white;
|
|
border: none;
|
|
padding: 4px 10px;
|
|
border-radius: 4px;
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
flex-shrink: 0;
|
|
}
|
|
.copy-btn:hover {
|
|
background: #1e293b;
|
|
}
|
|
.widget-options {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 16px;
|
|
margin-top: 8px;
|
|
padding-top: 12px;
|
|
border-top: 1px solid #e2e8f0;
|
|
}
|
|
.option-group {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 6px;
|
|
}
|
|
.option-group label {
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
color: #64748b;
|
|
text-transform: uppercase;
|
|
}
|
|
.option-group select {
|
|
padding: 6px 10px;
|
|
border: 1px solid #cbd5e1;
|
|
border-radius: 4px;
|
|
font-size: 13px;
|
|
background: white;
|
|
cursor: pointer;
|
|
}
|
|
.footer {
|
|
border-top: 1px solid #e2e8f0;
|
|
padding: 16px 32px;
|
|
background: #f8fafc;
|
|
font-size: 13px;
|
|
color: #64748b;
|
|
text-align: center;
|
|
}
|
|
.footer a {
|
|
color: #0f172a;
|
|
text-decoration: none;
|
|
}
|
|
.footer a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
code {
|
|
font-family: inherit;
|
|
background: rgba(0,0,0,0.05);
|
|
padding: 2px 4px;
|
|
border-radius: 4px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<header>
|
|
<h1>Streamer Widgets</h1>
|
|
<div class="subtitle">Local OBS overlay server</div>
|
|
</header>
|
|
<div class="content">
|
|
<h2>Available Widgets</h2>
|
|
<ul class="widget-list">
|
|
{{WIDGET_LIST}}
|
|
</ul>
|
|
</div>
|
|
<div class="footer">
|
|
Server running at <code>{{HOSTPORT}}</code> · <a href="/config">Configure Chat</a>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
// Live Chat URL generator
|
|
function updateLiveChatUrl() {
|
|
const baseUrl = document.getElementById('livechat-base-url');
|
|
if (!baseUrl) return;
|
|
|
|
const theme = document.getElementById('livechat-theme').value;
|
|
const direction = document.getElementById('livechat-direction').value;
|
|
const urlInput = document.getElementById('livechat-url');
|
|
const openLink = document.getElementById('livechat-open');
|
|
|
|
let url = baseUrl.value;
|
|
const params = [];
|
|
|
|
if (theme !== 'dark') params.push(`theme=${theme}`);
|
|
if (direction !== 'down') params.push(`direction=${direction}`);
|
|
|
|
if (params.length > 0) {
|
|
url += '?' + params.join('&');
|
|
}
|
|
|
|
urlInput.value = url;
|
|
openLink.href = url;
|
|
}
|
|
|
|
function copyUrl(inputId) {
|
|
const input = document.getElementById(inputId);
|
|
input.select();
|
|
navigator.clipboard.writeText(input.value).then(() => {
|
|
const btn = input.parentElement.querySelector('.copy-btn');
|
|
const originalText = btn.textContent;
|
|
btn.textContent = 'Copied!';
|
|
setTimeout(() => btn.textContent = originalText, 1500);
|
|
});
|
|
}
|
|
|
|
// Initialize on page load
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
updateLiveChatUrl();
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|