Files
sdb2-extension-chrome/popup.html
JSC cb607760ce Add SDB Audio Extractor extension with options and popup UI
- Implemented manifest.json for extension configuration
- Created options.html and options.js for user settings management
- Developed popup.html and popup.js for audio extraction functionality
- Added icons for the extension (icon16.png, icon48.png)
- Integrated API token and base URL configuration with validation
- Implemented audio extraction from YouTube videos with error handling
2025-09-20 20:54:12 +02:00

168 lines
3.2 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
width: 350px;
padding: 20px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
margin: 0;
}
.header {
text-align: center;
margin-bottom: 20px;
}
.logo {
font-size: 24px;
font-weight: bold;
color: #333;
margin-bottom: 5px;
}
.subtitle {
color: #666;
font-size: 14px;
}
.video-info {
background: #f5f5f5;
padding: 15px;
border-radius: 8px;
margin-bottom: 20px;
}
.video-title {
font-weight: 500;
margin-bottom: 8px;
line-height: 1.4;
}
.video-url {
font-size: 12px;
color: #666;
word-break: break-all;
}
.extract-btn {
width: 100%;
background: #ff0000;
color: white;
border: none;
padding: 12px;
border-radius: 6px;
font-size: 16px;
font-weight: 500;
cursor: pointer;
margin-bottom: 15px;
}
.extract-btn:hover {
background: #cc0000;
}
.extract-btn:disabled {
background: #ccc;
cursor: not-allowed;
}
.status {
text-align: center;
margin: 15px 0;
padding: 10px;
border-radius: 6px;
font-size: 14px;
}
.status.success {
background: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}
.status.error {
background: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}
.status.loading {
background: #d1ecf1;
color: #0c5460;
border: 1px solid #bee5eb;
}
.config-section {
border-top: 1px solid #eee;
padding-top: 15px;
margin-top: 15px;
}
.config-btn {
width: 100%;
background: #007bff;
color: white;
border: none;
padding: 10px;
border-radius: 6px;
cursor: pointer;
font-size: 14px;
}
.config-btn:hover {
background: #0056b3;
}
.warning {
background: #fff3cd;
color: #856404;
border: 1px solid #ffeaa7;
padding: 10px;
border-radius: 6px;
font-size: 14px;
margin-bottom: 15px;
}
.hidden {
display: none;
}
</style>
</head>
<body>
<div class="header">
<div class="logo">🎵 SDB Extractor</div>
<div class="subtitle">Extract audio from YouTube videos</div>
</div>
<div id="warning" class="warning hidden">
Please configure your API token in the extension options before extracting audio.
</div>
<div id="not-youtube" class="warning hidden">
This extension only works on YouTube video pages.
</div>
<div id="video-section" class="hidden">
<div class="video-info">
<div class="video-title" id="video-title">Loading...</div>
<div class="video-url" id="video-url"></div>
</div>
<button id="extract-btn" class="extract-btn">
Extract Audio
</button>
</div>
<div id="status" class="status hidden"></div>
<div class="config-section">
<button id="config-btn" class="config-btn">
Configure API Token
</button>
</div>
<script src="popup.js"></script>
</body>
</html>