ux: 批量下载按钮换多层图标,合并视频开始/停止按钮,延长滚动阈值调至0.7
This commit is contained in:
1 parent
cbaa4197b9
commit
a204d0c04a
3 files changed
+33
-27
No files matched your search
@@ -3211,12 +3211,12 @@
|
||||
// ── 按钮代理:点击 sticky bar 按钮 = 点击原始按钮 ──
|
||||
if (mobileStart) {
|
||||
mobileStart.addEventListener('click', () => {
|
||||
if (startBtn && !startBtn.disabled) startBtn.click();
|
||||
});
|
||||
}
|
||||
if (mobileStop) {
|
||||
mobileStop.addEventListener('click', () => {
|
||||
if (stopBtn && !stopBtn.disabled) stopBtn.click();
|
||||
const running = stopBtn && !stopBtn.classList.contains('hidden');
|
||||
if (running) {
|
||||
if (stopBtn && !stopBtn.disabled) stopBtn.click();
|
||||
} else {
|
||||
if (startBtn && !startBtn.disabled) startBtn.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
if (mobileSplice) {
|
||||
@@ -3225,14 +3225,22 @@
|
||||
});
|
||||
}
|
||||
|
||||
// ── 同步生成按钮状态(running / idle)到 sticky bar ──
|
||||
// ── 同步生成按钮状态(running / idle)到一体切换按钮 ──
|
||||
function syncGenerateSlotState() {
|
||||
if (!slotGenerate || !mobileStart || !mobileStop) return;
|
||||
if (!mobileStart) return;
|
||||
const running = stopBtn && !stopBtn.classList.contains('hidden');
|
||||
mobileStop.classList.toggle('hidden', !running);
|
||||
mobileStart.classList.toggle('hidden', running);
|
||||
slotGenerate.classList.toggle('is-running', running);
|
||||
if (mobileStart) mobileStart.disabled = Boolean(startBtn && startBtn.disabled);
|
||||
// 切换图标
|
||||
const playIcon = mobileStart.querySelector('.mobile-gen-play');
|
||||
const stopIcon = mobileStart.querySelector('.mobile-gen-stop');
|
||||
const label = mobileStart.querySelector('.mobile-gen-label');
|
||||
if (playIcon) playIcon.style.display = running ? 'none' : '';
|
||||
if (stopIcon) stopIcon.style.display = running ? '' : 'none';
|
||||
if (label) label.textContent = running ? '停止' : '开始生成';
|
||||
// 切换样式:running 时改为 outline 风格
|
||||
mobileStart.className = running
|
||||
? 'geist-button-outline mobile-action-btn gap-2'
|
||||
: 'geist-button mobile-action-btn gap-2';
|
||||
mobileStart.disabled = !running && Boolean(startBtn && startBtn.disabled);
|
||||
}
|
||||
|
||||
if (startBtn || stopBtn) {
|
||||
@@ -3253,7 +3261,7 @@
|
||||
if (slotGenerate) slotGenerate.classList.toggle('mobile-action-slot--active', !spliceVisible);
|
||||
if (slotSplice) slotSplice.classList.toggle('mobile-action-slot--active', spliceVisible);
|
||||
},
|
||||
{ threshold: 0.15 }
|
||||
{ threshold: 0.7 }
|
||||
);
|
||||
io.observe(targetPanel);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<link href="/static/vendor/geist/geist-mono.css" rel="stylesheet">
|
||||
<script src="/static/common/js/theme.js?v=0.1.0"></script>
|
||||
<link href="/static/common/css/common.css?v=0.3.8" rel="stylesheet">
|
||||
<link href="/static/public/css/imagine.css?v=0.5.0" rel="stylesheet">
|
||||
<link href="/static/public/css/imagine.css?v=0.5.1" rel="stylesheet">
|
||||
<link href="/static/common/css/toast.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
@@ -299,12 +299,13 @@
|
||||
<path d="M10 11v6M14 11v6"/><path d="M9 6V4h6v2"/>
|
||||
</svg>
|
||||
</button>
|
||||
<!-- 批量下载 -->
|
||||
<button class="im-icon-btn" id="imBatchBtn" type="button" title="批量下载" aria-label="批量下载">
|
||||
<!-- 批量下载全部(layers 图标,与下载选中区分) -->
|
||||
<button class="im-icon-btn" id="imBatchBtn" type="button" title="批量下载全部" aria-label="批量下载">
|
||||
<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
|
||||
<polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/>
|
||||
<polygon points="12 2 2 7 12 12 22 7 12 2"/>
|
||||
<polyline points="2 17 12 22 22 17"/>
|
||||
<polyline points="2 12 12 17 22 12"/>
|
||||
</svg>
|
||||
</button>
|
||||
<!-- 全选 -->
|
||||
|
||||
@@ -313,21 +313,18 @@
|
||||
</button>
|
||||
<!-- 右:操作区,根据上下文滑动切换 -->
|
||||
<div class="mobile-action-ops">
|
||||
<!-- 生成模式(默认) -->
|
||||
<!-- 生成模式(默认):开始/停止一体切换按钮 -->
|
||||
<div id="mobileBarGenerate" class="mobile-action-slot mobile-action-slot--active">
|
||||
<button id="mobileStartBtn" class="geist-button mobile-action-btn gap-2" type="button">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
<svg class="mobile-gen-play" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
<polygon points="5 3 19 12 5 21 5 3" />
|
||||
</svg>
|
||||
开始生成
|
||||
</button>
|
||||
<button id="mobileStopBtn" class="geist-button-outline mobile-action-btn gap-2 hidden" type="button">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round">
|
||||
<svg class="mobile-gen-stop" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round" style="display:none">
|
||||
<rect x="5" y="5" width="14" height="14" />
|
||||
</svg>
|
||||
停止
|
||||
<span class="mobile-gen-label">开始生成</span>
|
||||
</button>
|
||||
</div>
|
||||
<!-- 延长模式(滚到延长区时) -->
|
||||
@@ -354,7 +351,7 @@
|
||||
<script src="/static/common/js/toast.js"></script>
|
||||
<script src="/static/common/js/prompt-enhancer.js?v=0.1.15"></script>
|
||||
<script src="/static/common/js/pwa.js?v=0.1.1"></script>
|
||||
<script src="/static/public/js/video.js?v=0.6.3"></script>
|
||||
<script src="/static/public/js/video.js?v=0.6.4"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in new issue
Block a user