js+css实现srt字幕文件转快闪文字动画视频下载本地代码
代码语言:html
所属分类:动画
代码描述:js+css实现srt字幕文件转快闪文字动画视频下载本地代码
代码标签: js css srt 字幕 文件 转 快闪 文字 动画 视频 下载 本地 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FLASH SUB · 逐字快闪字幕生成器</title>
<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=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;700;900&display=swap" rel="stylesheet">
<style>
:root {
--bg: #06060c; --bg-2: #0c0c16; --card: #11111d; --card-2: #181826;
--border: #25253a; --border-2: #353550;
--fg: #f0f0f8; --fg-2: #c0c0d0; --muted: #7a7a90; --muted-2: #5a5a70;
--accent: #ff2e6c; --accent-2: #00f0ff; --accent-3: #ffcc00;
--success: #00ff88; --danger: #ff3030;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif; background: var(--bg); color: var(--fg); }
body::before {
content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
background:
radial-gradient(circle at 12% 18%, rgba(255, 46, 108, 0.10), transparent 45%),
radial-gradient(circle at 88% 82%, rgba(0, 240, 255, 0.10), transparent 45%);
}
.app { position: relative; height: 100vh; display: grid; grid-template-rows: 56px 1fr; z-index: 1; }
.header { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; background: rgba(8, 8, 14, 0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); z-index: 10; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; color: white; position: relative; overflow: hidden; }
.logo-mark::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.4) 50%, transparent 60%); animation: shine 3s linear infinite; }
@keyframes shine { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text .title { font-size: 15px; font-weight: 700; letter-spacing: 0.5px; }
.logo-text .sub { font-size: 10px; color: var(--muted); font-family: 'JetBrains Mono', monospace; margin-top: 1px; letter-spacing: 0.5px; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); background: var(--card); color: var(--fg); font-family: inherit; font-size: 12px; font-weight: 500; border-radius: 6px; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.btn:hover { background: var(--card-2); border-color: var(--border-2); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #ff5a8a); border-color: transparent; color: white; font-weight: 600; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(255, 46, 108, 0.35); }
.btn-accent { background: linear-gradient(135deg, var(--accent-2), #5ad8ff); border-color: transparent; color: #001020; font-weight: 700; }
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 240, 255, 0.35); }
.btn-accent:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: transparent; }
.btn-icon { padding: 6px 8px; min-width: 28px; }
.main { display: grid; grid-template-columns: 280px 1fr 300px; overflow: hidden; }
.sidebar { background: rgba(12, 12, 22, 0.6); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.sidebar-right { border-right: none; border-left: 1px solid var(--border); }
.sidebar-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.sidebar-title { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; }
.sidebar-body { flex: 1; overflow-y: auto; padding: 12px; }
.sub-list { display: flex; flex-direction: column; gap: 6px; }
.sub-item { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px; cursor: pointer; transition: all 0.15s; position: relative; }
.sub-item:hover { background: var(--card-2); border-color: var(--border-2); }
.sub-item.active { border-color: var(--accent-2); background: rgba(0, 240, 255, 0.05); }
.sub-item.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent-2); border-radius: 8px 0 0 8px; }
.sub-time { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); margin-bottom: 4px; display: flex; justify-content: space-between; }
.sub-text { font-size: 13px; color: var(--fg); line-height: 1.4; word-break: break-all; }
.sub-actions { display: flex; gap: 4px; margin-top: 6px; opacity: 0; transition: opacity 0.15s; }
.sub-item:hover .sub-actions { opacity: 1; }
.sub-action-btn { padding: 2px 8px; font-size: 10px; background: var(--card-2); border: 1px solid var(--border); border-radius: 4px; color: var(--muted); cursor: pointer; font-family: inherit; }
.sub-action-btn:hover { color: var(--fg); background: var(--border); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.drop-zone { border: 1.5px dashed var(--border-2); border-radius: 8px; padding: 20px; text-align: center; margin-bottom: 12px; transition: all 0.2s; cursor: pointer; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent-2); background: rgba(0, 240, 255, 0.04); }
.drop-zone .icon { font-size: 22px; margin-bottom: 6px; color: var(--accent-2); }
.drop-zone .text { font-size: 12px; color: var(--fg-2); }
.drop-zone .hint { font-size: 10px; color: var(--muted-2); margin-top: 4px; font-family: 'JetBrains Mono', monospace; }
.stage { display: flex; flex-direction: column; overflow: hidden; padding: 16px; gap: 12px; }
.canvas-wrap { flex: 1; display: flex; align-items: center; justify-content: center; background:
linear-gradient(45deg, #0a0a14 25%, transparent 25%),
linear-gradient(-45deg, #0a0a14 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, #0a0a14 75%),
linear-gradient(-45deg, transparent 75%, #0a0a14 75%);
background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0px; background-color: #06060c; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; position: relative; }
#previewCanva.........完整代码请登录后点击上方下载按钮下载查看















网友评论0