449 lines
12 KiB
HTML
449 lines
12 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>YouTube Summaries</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
margin: 20px;
|
|
background-color: #ffe4e6;
|
|
color: #9f1239;
|
|
}
|
|
header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
header input[type="text"] {
|
|
flex: 1;
|
|
padding: 8px;
|
|
font-size: 16px;
|
|
border-radius: 4px;
|
|
border: 1px solid #ccc;
|
|
}
|
|
header input[type="checkbox"] {
|
|
accent-color: #9f1239;
|
|
}
|
|
header button {
|
|
padding: 8px 16px;
|
|
font-size: 16px;
|
|
border: none;
|
|
border-radius: 4px;
|
|
background-color: #9f1239;
|
|
color: white;
|
|
cursor: pointer;
|
|
}
|
|
header button:hover {
|
|
background-color: #7c0e2e;
|
|
}
|
|
header label {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 5px;
|
|
font-size: 14px;
|
|
color: #9f1239;
|
|
}
|
|
.loading {
|
|
margin-top: 5px;
|
|
font-style: italic;
|
|
color: #9f1239;
|
|
}
|
|
#summaries-container {
|
|
margin-top: 20px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 15px;
|
|
}
|
|
.entry {
|
|
display: flex;
|
|
gap: 10px;
|
|
padding: 10px;
|
|
border: 1px solid #fff;
|
|
border-radius: 5px;
|
|
background-color: #fff1f2;
|
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
|
}
|
|
.entry .left {
|
|
width: 150px;
|
|
flex-shrink: 0;
|
|
}
|
|
.entry .thumbnail {
|
|
max-width: 100%;
|
|
border-radius: 3px;
|
|
}
|
|
.entry .middle {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
.entry .right {
|
|
width: 140px;
|
|
flex-shrink: 0;
|
|
}
|
|
.entry ul {
|
|
list-style-type: none;
|
|
padding-left: 0;
|
|
margin: 0;
|
|
}
|
|
.entry li {
|
|
margin-bottom: 5px;
|
|
}
|
|
.entry a {
|
|
color: #9f1239;
|
|
text-decoration: none;
|
|
}
|
|
.entry a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
.entry .summary {
|
|
transition: max-height 0.2s;
|
|
line-height: 1.45;
|
|
}
|
|
.entry .summary p {
|
|
margin: 0 0 0.65em;
|
|
}
|
|
.entry .summary p:last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
.entry .summary ul,
|
|
.entry .summary ol {
|
|
margin: 0.45em 0 0.65em;
|
|
padding-left: 1.4em;
|
|
}
|
|
.entry .summary ul {
|
|
list-style-type: disc;
|
|
}
|
|
.entry .summary ol {
|
|
list-style-type: decimal;
|
|
}
|
|
.entry .summary li {
|
|
margin-bottom: 0.25em;
|
|
}
|
|
.entry .summary blockquote {
|
|
margin: 0.65em 0;
|
|
padding-left: 0.85em;
|
|
border-left: 3px solid #fda4af;
|
|
color: #7c0e2e;
|
|
}
|
|
.entry .summary pre {
|
|
margin: 0.65em 0;
|
|
padding: 0.7em;
|
|
overflow: auto;
|
|
border: 1px solid #fecdd3;
|
|
border-radius: 4px;
|
|
background: #fff;
|
|
color: #5f0f23;
|
|
}
|
|
.entry .summary code {
|
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
font-size: 0.92em;
|
|
}
|
|
.entry .summary :not(pre) > code {
|
|
padding: 0.08em 0.25em;
|
|
border-radius: 3px;
|
|
background: #fff;
|
|
color: #5f0f23;
|
|
}
|
|
.entry .summary table {
|
|
width: 100%;
|
|
margin: 0.75em 0;
|
|
border-collapse: collapse;
|
|
background: #fff;
|
|
}
|
|
.entry .summary th,
|
|
.entry .summary td {
|
|
padding: 0.45em 0.55em;
|
|
border: 1px solid #fecdd3;
|
|
vertical-align: top;
|
|
text-align: left;
|
|
}
|
|
.entry .summary th {
|
|
background: #ffe4e6;
|
|
}
|
|
.entry-actions {
|
|
display: flex;
|
|
align-items: center;
|
|
flex-shrink: 0;
|
|
gap: 4px;
|
|
}
|
|
.entry-icon-button {
|
|
width: 24px;
|
|
height: 24px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 0;
|
|
border: none;
|
|
border-radius: 4px;
|
|
background: transparent;
|
|
color: #9f1239;
|
|
line-height: 1;
|
|
cursor: pointer;
|
|
}
|
|
.entry-icon-button:hover {
|
|
background: #ffe4e6;
|
|
}
|
|
.entry-icon-button svg {
|
|
width: 15px;
|
|
height: 15px;
|
|
stroke: currentColor;
|
|
}
|
|
.delete-entry-button {
|
|
color: #9f1239;
|
|
font-size: 22px;
|
|
font-weight: normal;
|
|
}
|
|
.entry .summary hr {
|
|
border: 0;
|
|
border-top: 1px solid currentColor;
|
|
color: inherit;
|
|
margin: 0.7em 0;
|
|
}
|
|
.entry.collapsed .summary {
|
|
display: -webkit-box !important;
|
|
-webkit-line-clamp: 2;
|
|
-webkit-box-orient: vertical;
|
|
overflow: hidden;
|
|
max-height: 2.8em;
|
|
}
|
|
.pagination {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 5px;
|
|
justify-content: center;
|
|
margin: 10px 0;
|
|
}
|
|
.pagination button {
|
|
padding: 4px 8px;
|
|
font-size: 14px;
|
|
border: 1px solid #9f1239;
|
|
background-color: #fff1f2;
|
|
color: #9f1239;
|
|
border-radius: 3px;
|
|
cursor: pointer;
|
|
}
|
|
.pagination button:hover {
|
|
background-color: #9f1239;
|
|
color: white;
|
|
}
|
|
.pagination button.active {
|
|
background-color: #9f1239;
|
|
color: white;
|
|
font-weight: bold;
|
|
}
|
|
header button:disabled {
|
|
background-color: #ffe4e6;
|
|
color: #9f1239;
|
|
opacity: 0.7;
|
|
cursor: default;
|
|
border: 1px solid #fbb6ce;
|
|
}
|
|
.settings-dialog[hidden] {
|
|
display: none;
|
|
}
|
|
.settings-dialog {
|
|
position: fixed;
|
|
inset: 0;
|
|
z-index: 1000;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 24px;
|
|
background: rgba(69, 10, 10, 0.28);
|
|
}
|
|
.settings-panel {
|
|
width: min(720px, 100%);
|
|
max-height: min(760px, calc(100vh - 48px));
|
|
overflow: auto;
|
|
padding: 18px;
|
|
border: 1px solid #fecdd3;
|
|
border-radius: 6px;
|
|
background: #fff1f2;
|
|
box-shadow: 0 16px 40px rgba(159, 18, 57, 0.18);
|
|
}
|
|
.settings-panel-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 16px;
|
|
margin-bottom: 14px;
|
|
}
|
|
.settings-panel-header h2 {
|
|
margin: 0;
|
|
font-size: 20px;
|
|
}
|
|
.settings-close-button {
|
|
width: 30px;
|
|
height: 30px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 0;
|
|
border: none;
|
|
border-radius: 4px;
|
|
background: transparent;
|
|
color: #9f1239;
|
|
font-size: 24px;
|
|
line-height: 1;
|
|
cursor: pointer;
|
|
}
|
|
.settings-close-button:hover {
|
|
background: #ffe4e6;
|
|
}
|
|
.settings-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
margin: 10px 0;
|
|
font-size: 15px;
|
|
}
|
|
.settings-row input[type="checkbox"] {
|
|
accent-color: #9f1239;
|
|
}
|
|
.settings-input {
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
padding: 9px 10px;
|
|
border: 1px solid #fda4af;
|
|
border-radius: 4px;
|
|
background: #fff;
|
|
color: #7f1d1d;
|
|
font-size: 14px;
|
|
}
|
|
.settings-field-label {
|
|
display: block;
|
|
margin: 16px 0 6px;
|
|
font-size: 14px;
|
|
font-weight: bold;
|
|
}
|
|
.settings-field-group[hidden] {
|
|
display: none;
|
|
}
|
|
.settings-help {
|
|
margin: 6px 0 0;
|
|
font-size: 13px;
|
|
line-height: 1.35;
|
|
color: #be123c;
|
|
}
|
|
.settings-inline-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
|
gap: 10px;
|
|
}
|
|
.settings-prompt-textarea {
|
|
width: 100%;
|
|
min-height: 260px;
|
|
box-sizing: border-box;
|
|
padding: 10px;
|
|
border: 1px solid #fda4af;
|
|
border-radius: 4px;
|
|
background: #fff;
|
|
color: #7f1d1d;
|
|
font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
|
resize: vertical;
|
|
}
|
|
.settings-prompt-textarea.compact {
|
|
min-height: 150px;
|
|
}
|
|
.settings-actions {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
gap: 10px;
|
|
margin-top: 12px;
|
|
}
|
|
.settings-actions button {
|
|
padding: 8px 12px;
|
|
border: 1px solid #9f1239;
|
|
border-radius: 4px;
|
|
background: #fff1f2;
|
|
color: #9f1239;
|
|
cursor: pointer;
|
|
}
|
|
.settings-actions button:hover {
|
|
background: #9f1239;
|
|
color: #fff;
|
|
}
|
|
.cookie-panel {
|
|
width: min(560px, 100%);
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<header style="display:flex; flex-direction:column; gap:5px;">
|
|
<form id="summarize-form" style="display:flex; width:100%; gap:10px; align-items:center; flex-wrap: wrap;">
|
|
<input type="text" id="url-input" placeholder="Enter YouTube URL" />
|
|
<button type="submit">Summarize!</button>
|
|
<select id="model-select" style="padding:6px; font-size:14px;">
|
|
<option disabled selected>Loading models…</option>
|
|
</select>
|
|
</form>
|
|
<div id="loading" class="loading" style="display:none;">Loading…</div>
|
|
</header>
|
|
<div id="settings-dialog" class="settings-dialog" hidden role="dialog" aria-modal="true" aria-labelledby="settings-title">
|
|
<section class="settings-panel">
|
|
<div class="settings-panel-header">
|
|
<h2 id="settings-title">Settings</h2>
|
|
<button type="button" id="settings-close-button" class="settings-close-button" aria-label="Close settings">×</button>
|
|
</div>
|
|
<label class="settings-row">
|
|
<input type="checkbox" id="whisper-checkbox" checked />
|
|
<span>Use Whisper</span>
|
|
</label>
|
|
<label class="settings-row">
|
|
<input type="checkbox" id="autotranslate-checkbox" checked />
|
|
<span>Auto Translate</span>
|
|
</label>
|
|
<label for="discord-webhook-url-input" class="settings-field-label">Discord Webhook URL</label>
|
|
<input
|
|
type="password"
|
|
id="discord-webhook-url-input"
|
|
class="settings-input"
|
|
placeholder="https://discord.com/api/webhooks/..."
|
|
autocomplete="off"
|
|
spellcheck="false"
|
|
/>
|
|
<label for="youtube-cookie-source-select" class="settings-field-label">YouTube Cookies</label>
|
|
<select id="youtube-cookie-source-select" class="settings-input"></select>
|
|
<div class="settings-actions">
|
|
<button type="button" id="clear-youtube-cookie-source-button">Clear YouTube cookies source</button>
|
|
</div>
|
|
<label for="master-prompt-textarea" class="settings-field-label">Master Prompt</label>
|
|
<textarea id="master-prompt-textarea" class="settings-prompt-textarea" spellcheck="false"></textarea>
|
|
<div class="settings-actions">
|
|
<button type="button" id="reset-master-prompt-button">Reset to default</button>
|
|
</div>
|
|
<label for="translation-prompt-de-textarea" class="settings-field-label">German Translation Prompt</label>
|
|
<textarea id="translation-prompt-de-textarea" class="settings-prompt-textarea compact" spellcheck="false"></textarea>
|
|
<div class="settings-actions">
|
|
<button type="button" id="reset-translation-prompt-de-button">Reset to default</button>
|
|
</div>
|
|
<label for="translation-prompt-jp-textarea" class="settings-field-label">Japanese Translation Prompt</label>
|
|
<textarea id="translation-prompt-jp-textarea" class="settings-prompt-textarea compact" spellcheck="false"></textarea>
|
|
<div class="settings-actions">
|
|
<button type="button" id="reset-translation-prompt-jp-button">Reset to default</button>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
<div id="cookie-dialog" class="settings-dialog cookie-dialog" hidden role="dialog" aria-modal="true" aria-labelledby="cookie-title">
|
|
<section class="settings-panel cookie-panel">
|
|
<div class="settings-panel-header">
|
|
<h2 id="cookie-title">YouTube Sign-In Required</h2>
|
|
</div>
|
|
<p id="cookie-message" class="settings-help"></p>
|
|
<label for="cookie-source-select" class="settings-field-label">Browser</label>
|
|
<select id="cookie-source-select" class="settings-input"></select>
|
|
<div class="settings-actions">
|
|
<button type="button" id="cookie-cancel-button">Cancel</button>
|
|
<button type="button" id="cookie-use-button">Use Source</button>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
<div id="pagination-top" class="pagination" style="display:none;"></div>
|
|
<div id="summaries-container"></div>
|
|
<div id="pagination-bottom" class="pagination" style="display:none;"></div>
|
|
<script src="vendor/markdown-it.min.js"></script>
|
|
<script src="renderer.js"></script>
|
|
</body>
|
|
</html>
|