UX: Restore wizard confetti in final step (#23533)

This was accidentally removed as part of the refactoring in fcb4e5a1a1. This commit restores it, and updates it use theme-specific colours.
This commit is contained in:
David Taylor 2023-09-26 12:04:21 +01:00 committed by GitHub
parent 6bcb9f444e
commit 003b44c75c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 13 deletions

View File

@ -7,18 +7,10 @@ const SIZE = 144;
let width, height;
const COLORS = [
"#BF1E2E",
"#F1592A",
"#F7941D",
"#9EB83B",
"#3AB54A",
"#12A89D",
"#25AAE2",
"#0E76BD",
"#652D90",
"#92278F",
"#ED207B",
"#8C6238",
"--tertiary",
"--quaternary",
"--tertiary-medium",
"--quaternary-low",
];
class Particle {
@ -34,7 +26,8 @@ class Particle {
this.ang = Math.random() * 2 * Math.PI;
this.scale = Math.random() * 0.4 + 0.2;
this.radius = Math.random() * 25 + 25;
this.color = COLORS[Math.floor(Math.random() * COLORS.length)];
const colorVar = COLORS[Math.floor(Math.random() * COLORS.length)];
this.color = getComputedStyle(document.body).getPropertyValue(colorVar);
this.flipped = Math.random() > 0.5 ? 1 : -1;
}

View File

@ -0,0 +1,8 @@
import Controller, { inject as controller } from "@ember/controller";
export default class extends Controller {
@controller wizardStep;
get showCanvas() {
return this.wizardStep.get("step.id") === "ready";
}
}

View File

@ -33,6 +33,7 @@ body.wizard {
}
.discourse-logo svg {
position: relative;
height: 70px;
width: auto;
@include breakpoint("mobile-extra-large") {
@ -44,6 +45,12 @@ body.wizard {
}
}
}
.wizard-canvas {
position: fixed;
top: 0;
pointer-events: none;
}
}
// Refactored SCSS