Commit ·
2cc3573
1
Parent(s): 4492eda
テーマ切り替えボタンを設定画面へ移行し、トグルスイッチ化
Browse files- templates/base.html +5 -26
- templates/settings/index.html +16 -0
templates/base.html
CHANGED
|
@@ -388,10 +388,6 @@
|
|
| 388 |
<i class="bi {{ icon }}"></i>{{ label }}
|
| 389 |
</a>
|
| 390 |
{% endfor %}
|
| 391 |
-
<button onclick="toggleTheme()" class="theme-toggle-btn border-0 text-start bg-transparent d-flex align-items-center gap-2 w-100" style="margin: 1px .75rem; border-radius: var(--radius-md); font-size: .88rem; font-weight: 500; font-family: inherit;">
|
| 392 |
-
<i class="bi bi-moon-stars-fill theme-toggle-icon"></i>
|
| 393 |
-
<span class="theme-text">ダークモード</span>
|
| 394 |
-
</button>
|
| 395 |
{% if auth_enabled %}
|
| 396 |
<a href="{{ url_for('auth.logout') }}" class="logout-btn" style="margin: 1px .75rem;">
|
| 397 |
<i class="bi bi-box-arrow-right"></i>ログアウト
|
|
@@ -451,14 +447,6 @@
|
|
| 451 |
</div>
|
| 452 |
</a>
|
| 453 |
{% endfor %}
|
| 454 |
-
<a href="javascript:void(0)" onclick="toggleTheme()"
|
| 455 |
-
style="border-top:1px solid rgba(255,255,255,.06)">
|
| 456 |
-
<i class="bi bi-moon-stars-fill theme-toggle-icon"></i>
|
| 457 |
-
<div>
|
| 458 |
-
<div class="theme-text">ダークモード</div>
|
| 459 |
-
<div style="font-size:.73rem;color:#94a3b8;font-weight:400;margin-top:1px">外観テーマの切り替え</div>
|
| 460 |
-
</div>
|
| 461 |
-
</a>
|
| 462 |
{% if auth_enabled %}
|
| 463 |
<a href="{{ url_for('auth.logout') }}" onclick="closeDrawer()"
|
| 464 |
style="border-top:1px solid rgba(255,255,255,.06)">
|
|
@@ -529,20 +517,11 @@
|
|
| 529 |
};
|
| 530 |
|
| 531 |
function updateThemeUI(theme) {
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
} else {
|
| 538 |
-
icon.classList.remove('bi-sun-fill');
|
| 539 |
-
icon.classList.add('bi-moon-stars-fill');
|
| 540 |
-
icon.style.color = '#64748b';
|
| 541 |
-
}
|
| 542 |
-
});
|
| 543 |
-
document.querySelectorAll('.theme-text').forEach(el => {
|
| 544 |
-
el.textContent = theme === 'dark' ? 'ライトモード' : 'ダークモード';
|
| 545 |
-
});
|
| 546 |
}
|
| 547 |
})();
|
| 548 |
|
|
|
|
| 388 |
<i class="bi {{ icon }}"></i>{{ label }}
|
| 389 |
</a>
|
| 390 |
{% endfor %}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 391 |
{% if auth_enabled %}
|
| 392 |
<a href="{{ url_for('auth.logout') }}" class="logout-btn" style="margin: 1px .75rem;">
|
| 393 |
<i class="bi bi-box-arrow-right"></i>ログアウト
|
|
|
|
| 447 |
</div>
|
| 448 |
</a>
|
| 449 |
{% endfor %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 450 |
{% if auth_enabled %}
|
| 451 |
<a href="{{ url_for('auth.logout') }}" onclick="closeDrawer()"
|
| 452 |
style="border-top:1px solid rgba(255,255,255,.06)">
|
|
|
|
| 517 |
};
|
| 518 |
|
| 519 |
function updateThemeUI(theme) {
|
| 520 |
+
// 設定画面のトグルスイッチの同期
|
| 521 |
+
const switchEl = document.getElementById('theme-switch');
|
| 522 |
+
if (switchEl) {
|
| 523 |
+
switchEl.checked = (theme === 'dark');
|
| 524 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 525 |
}
|
| 526 |
})();
|
| 527 |
|
templates/settings/index.html
CHANGED
|
@@ -240,6 +240,22 @@
|
|
| 240 |
</div>
|
| 241 |
</div>
|
| 242 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 243 |
<!-- ベータ機能 -->
|
| 244 |
<div class="card mb-3">
|
| 245 |
<div class="card-body">
|
|
|
|
| 240 |
</div>
|
| 241 |
</div>
|
| 242 |
|
| 243 |
+
<!-- 表示テーマ -->
|
| 244 |
+
<div class="card mb-3">
|
| 245 |
+
<div class="card-body">
|
| 246 |
+
<h6 class="card-title text-muted mb-3">表示テーマ</h6>
|
| 247 |
+
<div class="d-flex align-items-center justify-content-between">
|
| 248 |
+
<div>
|
| 249 |
+
<span class="small fw-semibold text-muted d-block">ダークモード</span>
|
| 250 |
+
<span class="text-muted small mb-0">画面全体の表示テーマをライト・ダークで切り替えます。</span>
|
| 251 |
+
</div>
|
| 252 |
+
<div class="form-check form-switch fs-4">
|
| 253 |
+
<input class="form-check-input" type="checkbox" role="switch" id="theme-switch" onchange="toggleTheme()">
|
| 254 |
+
</div>
|
| 255 |
+
</div>
|
| 256 |
+
</div>
|
| 257 |
+
</div>
|
| 258 |
+
|
| 259 |
<!-- ベータ機能 -->
|
| 260 |
<div class="card mb-3">
|
| 261 |
<div class="card-body">
|