新增: 相册展示模块(左侧幻灯片+进度条+目录选择)
- 左侧固定卡片展示照片幻灯片,淡入淡出切换 - 进度条动画显示当前照片剩余时间 - 设置窗口支持选择图片目录和切换间隔(5/10/15/20/30/60秒) - Win32 SHBrowseForFolderW 目录选择对话框 - Go 端管理幻灯片状态,按间隔推送照片 data URI
This commit is contained in:
@@ -330,6 +330,31 @@ input[type="text"]:focus { border-color: var(--input-border-focus); }
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 相册 -->
|
||||
<div class="section">
|
||||
<div class="section-label">相册</div>
|
||||
<div class="card">
|
||||
<div class="item">
|
||||
<div class="item-desc" id="photoDirDisplay">未选择目录</div>
|
||||
<div class="btn-group">
|
||||
<button class="btn" id="btnPickPhotoDir">选择目录</button>
|
||||
<button class="btn btn-sm" id="btnClearPhotoDir" style="display:none">清除</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<div class="item-label">切换间隔</div>
|
||||
<select id="photoInterval">
|
||||
<option value="5">5 秒</option>
|
||||
<option value="10">10 秒</option>
|
||||
<option value="15" selected>15 秒</option>
|
||||
<option value="20">20 秒</option>
|
||||
<option value="30">30 秒</option>
|
||||
<option value="60">60 秒</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 星座 + 城市 -->
|
||||
<div class="section">
|
||||
<div class="section-label">个性化</div>
|
||||
@@ -462,6 +487,26 @@ document.getElementById('themeSelect').addEventListener('change', function() {
|
||||
document.getElementById('textInputRow').style.display = this.value === 'text' ? 'flex' : 'none';
|
||||
});
|
||||
|
||||
document.getElementById('btnPickPhotoDir').addEventListener('click', function() {
|
||||
if (!window.pickPhotoDir) return;
|
||||
window.pickPhotoDir().then(function(dir) {
|
||||
if (dir) {
|
||||
document.getElementById('photoDirDisplay').textContent = dir;
|
||||
document.getElementById('btnClearPhotoDir').style.display = '';
|
||||
}
|
||||
});
|
||||
});
|
||||
document.getElementById('btnClearPhotoDir').addEventListener('click', function() {
|
||||
if (!window.clearPhotoDir) return;
|
||||
window.clearPhotoDir().then(function() {
|
||||
document.getElementById('photoDirDisplay').textContent = '未选择目录';
|
||||
document.getElementById('btnClearPhotoDir').style.display = 'none';
|
||||
});
|
||||
});
|
||||
document.getElementById('photoInterval').addEventListener('change', function() {
|
||||
if (window.savePhotoInterval) window.savePhotoInterval(parseInt(this.value));
|
||||
});
|
||||
|
||||
var textTimer = null;
|
||||
document.getElementById('wallpaperText').addEventListener('input', function() {
|
||||
clearTimeout(textTimer);
|
||||
@@ -672,6 +717,12 @@ if (window.loadAllSettings) {
|
||||
if (s.knowledgeKeyword) document.getElementById('knowledgeKeyword').value = s.knowledgeKeyword;
|
||||
if (s.knowledgePrompt) document.getElementById('knowledgePrompt').value = s.knowledgePrompt;
|
||||
if (s.theme === 'text') document.getElementById('textInputRow').style.display = 'flex';
|
||||
// Photo state
|
||||
if (s.photoDir) {
|
||||
document.getElementById('photoDirDisplay').textContent = s.photoDir;
|
||||
document.getElementById('btnClearPhotoDir').style.display = '';
|
||||
}
|
||||
if (s.photoInterval) document.getElementById('photoInterval').value = s.photoInterval;
|
||||
// Color state
|
||||
if (s.color1) { currentColor1 = s.color1; currentColor2 = s.color2 || ''; currentGradient = s.colorGradient || false; }
|
||||
if (s.wallpaperType === 'color') updateColorPreview();
|
||||
|
||||
Reference in New Issue
Block a user