Add a star rating style to scale slides
Scales can now be shown as stars (1 to n) instead of numbered steps: participants tap stars, the stage shows the average as partly filled stars and the distribution as bars from most to fewest stars, and the evaluation page and PDF export print ratings as stars. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1ee870d67c
commit
c1f9be2eef
14 files changed
+400
-31
No files matched your search
@@ -30,6 +30,8 @@
|
||||
--qa: #1f6bb0; /* Q&A accent, AA contrast with white text */
|
||||
--notice-bg: #fff6e0;
|
||||
--notice-ink: #6b4a00;
|
||||
--star: #d48500; /* star rating, 3:1 against light surfaces */
|
||||
--star-empty: #c3c8da;
|
||||
color-scheme: light;
|
||||
}
|
||||
|
||||
@@ -50,6 +52,8 @@
|
||||
--shadow: none;
|
||||
--notice-bg: #3a2f12;
|
||||
--notice-ink: #f3d98f;
|
||||
--star: #ffc233;
|
||||
--star-empty: #464a66;
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
||||
@@ -67,6 +71,8 @@
|
||||
--shadow: none;
|
||||
--notice-bg: #3a2f12;
|
||||
--notice-ink: #f3d98f;
|
||||
--star: #ffc233;
|
||||
--star-empty: #464a66;
|
||||
color-scheme: dark;
|
||||
}
|
||||
}
|
||||
@@ -298,12 +304,12 @@ textarea { resize: vertical; }
|
||||
.order-option__pos { min-width: 2em; text-align: right; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
|
||||
.order-options.error .order-options__list input[type=text] { border-color: var(--danger); }
|
||||
|
||||
/* dashboard: PDF export, choice between public and complete version */
|
||||
.export-choice { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
|
||||
.export-choice legend { font-weight: 600; margin-bottom: 4px; }
|
||||
.export-choice label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 2px solid var(--border); border-radius: 8px; cursor: pointer; }
|
||||
.export-choice label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
|
||||
.export-choice input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--primary); }
|
||||
/* radio cards: PDF export (public/complete version), scale style (numbers/stars) */
|
||||
.export-choice, .scale-style { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
|
||||
.export-choice legend, .scale-style legend { font-weight: 600; margin-bottom: 4px; }
|
||||
.export-choice label, .scale-style label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 2px solid var(--border); border-radius: 8px; cursor: pointer; }
|
||||
.export-choice label:has(input:checked), .scale-style label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
|
||||
.export-choice input, .scale-style input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--primary); }
|
||||
.export-choice strong { display: block; }
|
||||
.export-choice .hint { display: block; margin: 2px 0 0; }
|
||||
|
||||
@@ -352,6 +358,20 @@ textarea { resize: vertical; }
|
||||
.scale__step input:checked + span { border-color: var(--primary); background: var(--primary); color: #fff; }
|
||||
.scale__step input:focus-visible + span { outline: 3px solid var(--primary-soft); }
|
||||
.scale__labels { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); }
|
||||
/* star rating: stars up to the checked (or hovered) one are filled; :has() keeps the DOM order 1..n for arrow keys */
|
||||
.stars { display: flex; justify-content: center; margin: 20px 0 6px; }
|
||||
.stars__star { position: relative; padding: 0 4px; cursor: pointer; font-size: clamp(2.4rem, 13vw, 3.4rem); line-height: 1; color: var(--star); }
|
||||
.stars--many .stars__star { padding: 0 1px; font-size: clamp(1.5rem, 7.5vw, 2.4rem); }
|
||||
.stars__star input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
|
||||
.stars__icon { display: block; transition: color .15s, transform .15s; }
|
||||
/* :where() keeps these weaker than the hover preview below */
|
||||
:where(.stars:not(:has(input:checked))) .stars__star, :where(.stars__star:has(input:checked)) ~ .stars__star { color: var(--star-empty); }
|
||||
.stars__star:has(input:focus-visible) .stars__icon { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
|
||||
@media (hover: hover) {
|
||||
.stars:hover .stars__star { color: var(--star); }
|
||||
.stars .stars__star:hover ~ .stars__star { color: var(--star-empty); }
|
||||
.stars__star:hover .stars__icon { transform: scale(1.12); }
|
||||
}
|
||||
.done { font-size: 1.1rem; font-weight: 600; color: var(--ok); }
|
||||
.waiting { padding: 48px 24px; }
|
||||
.pulse { width: 18px; height: 18px; border-radius: 50%; background: var(--primary); margin: 0 auto 24px; animation: pulse 1.6s infinite; }
|
||||
@@ -432,6 +452,12 @@ textarea { resize: vertical; }
|
||||
.average__track { position: relative; height: 12px; border-radius: 99px; background: linear-gradient(90deg, var(--bg), var(--c1)); box-shadow: inset 0 0 0 1px var(--border); }
|
||||
.average__marker { position: absolute; top: 50%; width: 1.6em; height: 1.6em; margin: -.8em 0 0 -.8em; border-radius: 50%; background: var(--c1); border: .25em solid var(--bg); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); transition: left .6s ease; }
|
||||
.average__ends { display: flex; justify-content: space-between; margin-top: 8px; font-size: .85rem; font-weight: 700; color: var(--muted); }
|
||||
/* star rating results: average as partly filled stars, bars from most to fewest stars */
|
||||
.star-meter { position: relative; display: inline-block; font-size: 2.6rem; line-height: 1; letter-spacing: .08em; white-space: nowrap; }
|
||||
.star-meter__base { color: var(--star-empty); }
|
||||
.star-meter__fill { position: absolute; top: 0; left: 0; overflow: hidden; color: var(--star); transition: width .6s ease; }
|
||||
.bar--star .bar__fill { background: var(--star); }
|
||||
.stars-legend { margin: 10px 0 0; font-size: .85rem; color: var(--muted); }
|
||||
|
||||
.cloud { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .2em .6em; line-height: 1.15; padding: 8px; }
|
||||
.cloud__word { font-weight: 800; color: var(--c0); transition: font-size .6s ease; }
|
||||
@@ -576,6 +602,7 @@ button.qa-steps__step:hover:not(:disabled) { color: var(--text); border-color: v
|
||||
.scale-table th, .scale-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
|
||||
.scale-table td:last-child { width: 50%; }
|
||||
.scale-table__bar { display: block; height: 6px; min-width: 2px; margin-bottom: 4px; border-radius: 3px; background: var(--c2); }
|
||||
.rating-stars { color: var(--star); letter-spacing: .05em; white-space: nowrap; }
|
||||
|
||||
/* ---------------------------------------------------------------- presenter */
|
||||
/* Dark by default (beamer); the presenter's own switch can make it light (data-theme="light"). */
|
||||
@@ -588,6 +615,8 @@ body.present {
|
||||
--stage-glow: #2a1f6e;
|
||||
--stage-ok: #3ddc97; /* brighter green for contrast on the dark stage */
|
||||
--overlay-bg: rgba(8, 9, 20, .92);
|
||||
--star: #ffc233;
|
||||
--star-empty: #3a3d60;
|
||||
background: radial-gradient(1200px 600px at 10% -10%, var(--stage-glow) 0%, transparent 60%), var(--bg);
|
||||
color: var(--text);
|
||||
overflow: hidden;
|
||||
@@ -602,6 +631,8 @@ body.present {
|
||||
--stage-glow: #dcd8ff;
|
||||
--stage-ok: var(--ok);
|
||||
--overlay-bg: rgba(245, 246, 251, .95);
|
||||
--star: #d48500;
|
||||
--star-empty: #c3c8da;
|
||||
}
|
||||
.stage__top { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: clamp(1rem, 1.6vw, 1.4rem); color: var(--muted); }
|
||||
.stage__top strong { color: var(--text); }
|
||||
@@ -627,6 +658,9 @@ body.present {
|
||||
.stage .average__label, .stage .average__count, .stage .average__ends { font-size: clamp(.85rem, 1.2vw, 1.1rem); }
|
||||
.stage .average__track { height: .7em; box-shadow: none; background: linear-gradient(90deg, var(--surface-2), var(--c1)); }
|
||||
.stage .average__ends { margin-top: 4px; }
|
||||
.stage .star-meter { font-size: clamp(2.4rem, 5.5vw, 5rem); }
|
||||
.stage .bars--stars { gap: 1.2vh; }
|
||||
.stage .stars-legend { font-size: clamp(.85rem, 1.2vw, 1.1rem); }
|
||||
.stage .cloud { font-size: clamp(1.4rem, 2.6vw, 2.6rem); }
|
||||
.stage .answers { columns: 340px; }
|
||||
.stage .quiz-timer { font-size: clamp(3rem, 7vw, 6rem); }
|
||||
|
||||
Reference in new issue
Block a user