Editor: fade the play-area hint behind the clock and make it unselectable
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c8a2af1f1a
commit
3241c06114
1 file changed
+23
-7
+23
-7
@@ -10,17 +10,17 @@
|
||||
:root {
|
||||
color-scheme: light dark;
|
||||
--bg: #f6f5f1; --panel: #ffffff; --text: #222; --muted: #666; --line: #dcd8cf;
|
||||
--accent: #9b452e; --accent-text: #fff; --code: #f1efe9; --focus: #2f6fd6; --ok: #2e7d4a;
|
||||
--accent: #9b452e; --accent-text: #fff; --code: #f1efe9; --focus: #2f6fd6; --ok: #2e7d4a; --hint: #c4c4c4;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-bg="light"]) {
|
||||
--bg: #17181b; --panel: #222327; --text: #e9e7e2; --muted: #a5a29b; --line: #3a3b40;
|
||||
--accent: #e08a6c; --accent-text: #1a1a1a; --code: #2b2c31; --focus: #7fb0ff; --ok: #7ccf97;
|
||||
--accent: #e08a6c; --accent-text: #1a1a1a; --code: #2b2c31; --focus: #7fb0ff; --ok: #7ccf97; --hint: #4a4b51;
|
||||
}
|
||||
}
|
||||
:root[data-bg="dark"] {
|
||||
--bg: #17181b; --panel: #222327; --text: #e9e7e2; --muted: #a5a29b; --line: #3a3b40;
|
||||
--accent: #e08a6c; --accent-text: #1a1a1a; --code: #2b2c31; --focus: #7fb0ff; --ok: #7ccf97;
|
||||
--accent: #e08a6c; --accent-text: #1a1a1a; --code: #2b2c31; --focus: #7fb0ff; --ok: #7ccf97; --hint: #4a4b51;
|
||||
color-scheme: dark;
|
||||
}
|
||||
:root[data-bg="light"] { color-scheme: light; }
|
||||
@@ -63,7 +63,11 @@
|
||||
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 20px; }
|
||||
.card h2 { margin: 0 0 8px; font-size: 1.15rem; }
|
||||
.play { min-height: 320px; position: relative; touch-action: pan-y; display: grid; place-items: center; text-align: center; border: 2px dashed var(--line); border-radius: 12px; color: var(--muted); padding: 20px; }
|
||||
.play strong { color: var(--text); font-size: 1.1rem; display: block; }
|
||||
.play { -webkit-user-select: none; user-select: none; }
|
||||
/* 說明只是背景提示:很淡、在時鐘下層、不擋操作、不會被反白 */
|
||||
.play-hint { position: relative; z-index: 0; color: var(--hint); font-size: .85rem; pointer-events: none; transition: opacity .3s; }
|
||||
.play-hint strong { color: inherit; font-size: 1rem; font-weight: 600; display: block; }
|
||||
.play.is-moving .play-hint { opacity: .45; }
|
||||
.bgswitch { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: .9rem; }
|
||||
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
|
||||
.tabs [role="tab"][aria-selected="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }
|
||||
@@ -82,8 +86,9 @@
|
||||
/* 單欄時試玩區吸附在畫面上方,往下調設定時一直看得到 */
|
||||
.play-card { position: sticky; top: 0; z-index: 20; margin: 0 -16px 16px; padding: 8px 16px 6px; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); box-shadow: 0 6px 14px -8px rgba(0,0,0,.35); }
|
||||
.play-card h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
||||
.play { min-height: 0; height: min(36vh, 300px); height: min(36svh, 300px); padding: 8px; font-size: .8rem; line-height: 1.5; }
|
||||
.play strong { font-size: .9rem; }
|
||||
.play { min-height: 0; height: min(36vh, 300px); height: min(36svh, 300px); padding: 8px; line-height: 1.5; }
|
||||
.play-hint { font-size: .78rem; }
|
||||
.play-hint strong { font-size: .9rem; }
|
||||
.play .more { display: none; }
|
||||
.bgswitch { margin-top: 10px; gap: 10px; font-size: .8rem; }
|
||||
.bgswitch input { margin: 0 2px 0 0; vertical-align: -2px; }
|
||||
@@ -103,7 +108,7 @@
|
||||
<section class="card play-card" id="playCard" aria-labelledby="playTitle">
|
||||
<h2 id="playTitle">試玩區</h2>
|
||||
<div class="play" id="play">
|
||||
<div>
|
||||
<div class="play-hint">
|
||||
<strong>移動滑鼠,或用手指在畫面上滑動</strong>
|
||||
時鐘會跟著你。電腦在游標右下方,手機在手指上方。<br>
|
||||
<span class="more">這裡的時鐘只在框內預覽;放到你的網站上會跟著整個頁面移動。</span>
|
||||
@@ -488,6 +493,17 @@
|
||||
});
|
||||
});
|
||||
|
||||
// ---- 時鐘移動中,說明再淡一點 ----
|
||||
var moveTimer = null;
|
||||
function moving() {
|
||||
$('play').classList.add('is-moving');
|
||||
clearTimeout(moveTimer);
|
||||
moveTimer = setTimeout(function () { $('play').classList.remove('is-moving'); }, 1200);
|
||||
}
|
||||
$('play').addEventListener('pointermove', moving, { passive: true });
|
||||
$('play').addEventListener('pointerdown', moving, { passive: true });
|
||||
$('play').addEventListener('touchmove', moving, { passive: true });
|
||||
|
||||
// ---- 面板收合提示 ----
|
||||
$('panel').addEventListener('toggle', function () { $('panelHint').textContent = $('panel').open ? '點這裡收合' : '點這裡展開'; });
|
||||
|
||||
|
||||
Reference in new issue
Block a user