Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
36 lines (36 loc) · 2.28 KB
/
Copy pathindex.html
File metadata and controls
36 lines (36 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>React-Countdown-Circle-Timer-Editable Demo</title>
<style>
body { font-family: system-ui, sans-serif; color: #172b45; background: #eef6ff; padding: 24px; }
main { max-width: 650px; margin: auto; padding: 32px; border-radius: 16px; background: white; }
.circle { position: relative; width: 300px; max-width: 100%; }
.initial input-duration { visibility: hidden; }
.circle input-duration[no-microseconds]::part(divider-seconds-milliseconds) { display: inline !important; }
.remaining-display { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; color: #333; font-size: 12px; font-weight: 300; line-height: 1.3; }
.remaining-time { color: #004777; font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.completed-display { color: #a30000; font-size: 14px; }
.edit-circle { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.edit-circle:focus-visible { outline: 3px solid #2563a6; outline-offset: 3px; }
p { line-height: 1.5; }
pre { overflow-x: auto; padding: 16px; background: #f0f4f8; border-radius: 6px; }
</style>
</head>
<body>
<main>
<h1>React-Countdown-Circle-Timer-Editable Demo</h1>
<p>Click the circle to edit the minutes and seconds. Move focus away, press Enter, or press Tab from seconds to start the countdown.</p>
<div id="app"></div>
<h2>Demo code</h2>
<p>The demo uses inputProps to configure the input and circleProps to render the countdown and completion text. It supplies the click-to-edit interaction and starts on blur, Enter, or Tab from seconds. It also uses CSS to show the seconds divider as a suffix when milliseconds are hidden:</p>
<pre><code>.circle input-duration[no-microseconds]::part(divider-seconds-milliseconds) {
display: inline !important;
}</code></pre>
<pre><code id="demo-source"></code></pre>
</main>
<script type="module" src="/demo.js"></script>
</body>
</html>