feat: replace completion animation with Gemini-style rotating gradient glow
- Remove bouncing "CRISPY" text animation (dvd-bounce) - Add rotating conic-gradient border with glow effect - Colors: purple (#9b59b6), magenta (#e040fb), cyan (#00bcd4), violet (#7c4dff) - Animation plays once (2.5s) then fades out so students can continue - Update success colors from green to purple theme: - success-color: #9b6dd4 - success-color-dark: #7c4dff - success-color-light: #c9b8e8 - Uses CSS @property for animating conic-gradient angle - Two layers: blurred glow + crisp border using mask-composite 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This commit is contained in:
@@ -626,11 +626,11 @@ function runCode() {
|
|||||||
elements.nextBtn.classList.add("success");
|
elements.nextBtn.classList.add("success");
|
||||||
elements.taskInstruction.classList.add("success-instruction");
|
elements.taskInstruction.classList.add("success-instruction");
|
||||||
|
|
||||||
// Show match animation (DVD-style bouncing)
|
// Show match animation (rotating gradient glow)
|
||||||
elements.previewWrapper?.classList.add("matched");
|
elements.previewWrapper?.classList.add("matched");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
elements.previewWrapper?.classList.remove("matched");
|
elements.previewWrapper?.classList.remove("matched");
|
||||||
}, 10000);
|
}, 3000);
|
||||||
|
|
||||||
updateNavigationButtons();
|
updateNavigationButtons();
|
||||||
updateProgressDisplay();
|
updateProgressDisplay();
|
||||||
|
|||||||
124
src/main.css
124
src/main.css
@@ -28,9 +28,9 @@
|
|||||||
|
|
||||||
/* Status colors */
|
/* Status colors */
|
||||||
--info-color: #7a93fe;
|
--info-color: #7a93fe;
|
||||||
--success-color: #58b890;
|
--success-color: #9b6dd4;
|
||||||
--success-color-dark: #3d8d6a;
|
--success-color-dark: #7c4dff;
|
||||||
--success-color-light: #a3e6c8;
|
--success-color-light: #c9b8e8;
|
||||||
--error-color: #cb6e75;
|
--error-color: #cb6e75;
|
||||||
--danger-color: #dc3545;
|
--danger-color: #dc3545;
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
--primary-bg-light: rgba(94, 75, 139, 0.05);
|
--primary-bg-light: rgba(94, 75, 139, 0.05);
|
||||||
--primary-bg-medium: rgba(94, 75, 139, 0.1);
|
--primary-bg-medium: rgba(94, 75, 139, 0.1);
|
||||||
--primary-bg-instruction: rgba(125, 92, 203, 0.9);
|
--primary-bg-instruction: rgba(125, 92, 203, 0.9);
|
||||||
--success-bg-light: rgba(88, 184, 144, 0.15);
|
--success-bg-light: rgba(155, 109, 212, 0.15);
|
||||||
--modal-bg: rgba(0, 0, 0, 0.5);
|
--modal-bg: rgba(0, 0, 0, 0.5);
|
||||||
|
|
||||||
/* Typography */
|
/* Typography */
|
||||||
@@ -596,50 +596,98 @@ kbd {
|
|||||||
border-radius: var(--border-radius-sm);
|
border-radius: var(--border-radius-sm);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Success Match Animation */
|
/* Success Match Animation - Gemini-style rotating gradient glow */
|
||||||
|
@property --gradient-angle {
|
||||||
|
syntax: "<angle>";
|
||||||
|
initial-value: 0deg;
|
||||||
|
inherits: false;
|
||||||
|
}
|
||||||
|
|
||||||
.preview-wrapper.matched {
|
.preview-wrapper.matched {
|
||||||
box-shadow: 0 0 0 3px var(--success-color);
|
--glow-size: 3px;
|
||||||
|
--glow-spread: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.preview-wrapper.matched::after {
|
/* Glow layer (blurred background) */
|
||||||
content: "CRISPY ٩( ◕‿◕ )۶";
|
.preview-wrapper.matched::before {
|
||||||
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background: var(--success-color-dark);
|
inset: calc(var(--glow-size) * -1);
|
||||||
color: white;
|
border-radius: calc(var(--border-radius-md) + var(--glow-size));
|
||||||
padding: var(--spacing-sm) var(--spacing-lg);
|
background: conic-gradient(
|
||||||
border-radius: var(--border-radius-lg);
|
from var(--gradient-angle, 0deg),
|
||||||
font-weight: bold;
|
#9b59b6,
|
||||||
font-size: 1.3rem;
|
#e040fb,
|
||||||
animation: dvd-bounce 8s ease-in-out infinite;
|
#00bcd4,
|
||||||
z-index: 10;
|
#7c4dff,
|
||||||
white-space: nowrap;
|
#9b59b6
|
||||||
|
);
|
||||||
|
z-index: -1;
|
||||||
|
filter: blur(var(--glow-spread));
|
||||||
|
opacity: 0;
|
||||||
|
animation: glow-fade 2.5s ease-out forwards;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes dvd-bounce {
|
/* Border layer (crisp rotating gradient) */
|
||||||
|
.preview-wrapper.matched::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
inset: calc(var(--glow-size) * -1);
|
||||||
|
border-radius: calc(var(--border-radius-md) + var(--glow-size));
|
||||||
|
background: conic-gradient(
|
||||||
|
from var(--gradient-angle, 0deg),
|
||||||
|
#9b59b6,
|
||||||
|
#e040fb,
|
||||||
|
#00bcd4,
|
||||||
|
#7c4dff,
|
||||||
|
#9b59b6
|
||||||
|
);
|
||||||
|
z-index: -1;
|
||||||
|
padding: var(--glow-size);
|
||||||
|
-webkit-mask:
|
||||||
|
linear-gradient(#fff 0 0) content-box,
|
||||||
|
linear-gradient(#fff 0 0);
|
||||||
|
-webkit-mask-composite: xor;
|
||||||
|
mask-composite: exclude;
|
||||||
|
opacity: 0;
|
||||||
|
animation: border-rotate 2.5s ease-out forwards;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes border-rotate {
|
||||||
0% {
|
0% {
|
||||||
top: 15%;
|
--gradient-angle: 0deg;
|
||||||
left: 15%;
|
opacity: 1;
|
||||||
transform: translate(-50%, -50%) scale(1);
|
|
||||||
}
|
}
|
||||||
25% {
|
70% {
|
||||||
top: 75%;
|
opacity: 1;
|
||||||
left: 85%;
|
|
||||||
transform: translate(-50%, -50%) scale(1.1);
|
|
||||||
}
|
|
||||||
50% {
|
|
||||||
top: 25%;
|
|
||||||
left: 75%;
|
|
||||||
transform: translate(-50%, -50%) scale(0.95);
|
|
||||||
}
|
|
||||||
75% {
|
|
||||||
top: 70%;
|
|
||||||
left: 20%;
|
|
||||||
transform: translate(-50%, -50%) scale(1.05);
|
|
||||||
}
|
}
|
||||||
100% {
|
100% {
|
||||||
top: 15%;
|
--gradient-angle: -360deg;
|
||||||
left: 15%;
|
opacity: 0;
|
||||||
transform: translate(-50%, -50%) scale(1);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes glow-fade {
|
||||||
|
0% {
|
||||||
|
--gradient-angle: 0deg;
|
||||||
|
opacity: 0;
|
||||||
|
filter: blur(var(--glow-spread));
|
||||||
|
}
|
||||||
|
15% {
|
||||||
|
opacity: 0.7;
|
||||||
|
filter: blur(calc(var(--glow-spread) * 1.5));
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
opacity: 0.5;
|
||||||
|
filter: blur(var(--glow-spread));
|
||||||
|
}
|
||||||
|
70% {
|
||||||
|
opacity: 0.3;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
--gradient-angle: -360deg;
|
||||||
|
opacity: 0;
|
||||||
|
filter: blur(calc(var(--glow-spread) * 0.5));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user