Celebrate a logged pee/poo with emoji confetti

Tapping the pee or poo quick-log button now sets off a short burst of 💧/💩
particles from the button — pure DOM + CSS, pointer-events:none so it never
blocks taps, particles self-remove on animation end. It honours
prefers-reduced-motion, and there's a "Pee/poo confetti" switch in Settings
(device-local, on by default) to turn it off.
This commit is contained in:
Alexander Heldt
2026-08-01 18:18:26 +00:00
parent 1ed325b834
commit 52c50c97b1
4 changed files with 87 additions and 2 deletions
+29
View File
@@ -1348,3 +1348,32 @@ section.collapsed > :not(h2) { display: none; }
color: var(--muted);
text-align: center;
}
/* ---- pee/poo confetti ---- */
#confetti-layer {
position: fixed;
inset: 0;
pointer-events: none;
overflow: hidden;
z-index: 9999;
}
.confetti-piece {
position: absolute;
line-height: 1;
will-change: transform, opacity;
animation-name: potty-burst;
animation-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1);
animation-fill-mode: forwards;
}
@keyframes potty-burst {
0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(0deg); }
12% { opacity: 1; }
100% {
opacity: 0;
/* fly out to (dx, dy) then keep falling (gravity) */
transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 150px)) scale(1) rotate(var(--rot));
}
}
@media (prefers-reduced-motion: reduce) {
.confetti-piece { display: none; }
}