Vote, and the bars fill to what everyone else said.
The prompt21,154 characters
Add the "Poll" component from notboring to my project.
It is licensed for use in my projects — notboring.dev/license. Please:
1. Create the component at a sensible path for this
project, named Poll, from the source below.
2. Install what it needs: npm i framer-motion
3. Add the CSS to the project's stylesheet.
4. THE PART THAT NEEDS YOUR JUDGMENT. The CSS reads
these custom properties and does not define them:
--card
--card-rgb
--font-ui
--ink
--ink-3
--ink-4
--ink-rgb
They are notboring's design tokens. Map each one to
whatever this project already uses for the same
job — its own ink, ground, surface and UI font —
rather than defining them as new globals. If the
project has no equivalent, define it locally on
the component's own root so nothing leaks out.
Anything ending -rgb wants three bare numbers,
because the CSS builds rgba() from it.
Keep the comments. They say why the numbers are what
they are, and they are most of what makes this worth
copying rather than rewriting.
--- Poll.tsx ---
import { useEffect, useRef, useState } from "react";
import { AnimatePresence, animate, motion, useMotionValue, useTransform } from "framer-motion";
/* ══ Poll ═════════════════════════════════════════════════
A question, four answers, and what everyone else said.
THE RESULT IS A CONSEQUENCE OF THE VOTE, NOT A PAGE YOU
ARE SENT TO. The obvious build swaps the buttons for a
chart, and a chart appearing where buttons were is two
things: the thing you pressed leaving and a picture
arriving. Here the rows stay exactly where they are and
FILL — the answer you gave grows an ink bar from its own
left edge and the others grow gray ones, on one clock,
the top row a beat ahead of the bottom. The buttons
become the chart, which is the honest shape of "here is
how it went".
THE FIGURES ARE COMPUTED, NEVER TYPED. Four base counts,
plus your vote in the row you chose; the percentages fall
out of the sum with the largest-remainder rule so they
always add to a hundred, and the count in the footer is
the same sum. Nothing in this file can disagree with
anything else in it.
The rest — the source and its comments — is what you are buying.