Gift card with vertical inscription
A drawn card whose cord strokes itself on and whose two vertical lines resize themselves to fit the card.
Links in the preview stay on the block.
Open on its ownThe prompt
One prompt, written to stand on its own: goal, structure, type, colour, spacing, behaviour and the words in square brackets to replace. Paste it into any tool that writes HTML. The Code tab has this block as one file.
773 words
# Gift card with vertical inscription One data component, not a whole page: build it to drop into a page that already exists. Works in Claude, v0, Lovable, Bolt, Cursor or any tool that writes HTML. ## Goal A card figure for a gift or stationery shop: a printed mark in one corner, a tied cord, two lines written down it. ## Structure 1. Sticky column holding the card 2. Card: white panel, 1px border, its own container so type scales with it 3. SVG layer: paper texture, folded mark in the top corner, an empty group for the cord 4. Occasion written down the card near the top, centred 5. Name written down the card below the middle ## Type Kaisei Opti (Google) 400 and 500 headings, Murecho body, Yuji Syuku for the written lines. Body 17px/1.8, .02em. The written lines are sized to the card: occasion 11% of card width, .1em; name 7.2%, .14em; both line height 1. ## Colour Page #F2F0F4, card #FFFFFF, border #DCD7E0, ink #22182B, muted #655D6B, accent #5A3A7A, deeper #432A5C when pressed. Written lines #1E1A22. Folded mark: white, a #A9A0B0 hairline, a #C8102E strip, a white core, a #E2C24F centre. The cord takes two colours: white with #C8102E for an everyday occasion, #A9A0B0 with #E2C24F for a formal one. ## Spacing and lines Section clamp(120px,13vw,200px) tall, container 1320px, gutters clamp(20px,5vw,64px); grid of a 440px column and a free one, gap clamp(48px,8vw,128px). The card column sticks 32px under the header. The card is the smaller of 100%, 420px and the screen height left times 0.714, at 400 by 560, radius 2px. Occasion at 6% from the top in a 27.5% tall band, name at 47% in a 44% band. The cord crosses at 212 of the 560 drawing, five strands a side, 3.3 units wide. ## Behaviour Build each cord strand as a polyline through ten points on the 400 by 560 drawing, mirror it for the other side, stroke the near side light and the far side dark, then draw them on with stroke-dashoffset from full length to zero over 1.8s cubic-bezier(.45,0,.55,1), each strand starting at its own fraction of that time. When the occasion changes, fade the old cord out over 300ms while the new one draws, fade the written lines out over 250ms, swap the text, bring them back over 700ms after a 350ms wait. Fit the lines: set the size in container width units and step down by 0.4 until it fits its band. Rewrite the card's aria-label each time. ## Responsive Under 980px one column: the card stops sticking, sits below the chooser with a 48px top margin, capped at 400px. Under 560px body 16px, that margin 36px. ## Accessibility The card is a div with role img, its aria-label naming occasion, knot and name in the reader's language. The SVG is aria-hidden. Keep the card out of the tab order; the chooser driving it takes real radio semantics. Focus 2px #5A3A7A, offset 3px, radius 4px. ## Built values (from code.html) - Fonts: Kaisei Opti 400, 500 (Google Fonts); Murecho 400, 500 (Google Fonts); Yuji Syuku (Google Fonts). - Colour variables: --ground #F2F0F4, --ink #22182B, --muted #655D6B, --murasaki #5A3A7A, --murasaki-deep #432A5C, --line #DCD7E0, --card #FFFFFF. - Font variables: --display "Kaisei Opti",serif; --text "Murecho",system-ui,sans-serif; --brush "Yuji Syuku",serif. - Size variables: --g clamp(20px,5vw,64px), --nav 72px. - Media queries: max-width 980px, max-width 560px. - No media files. - Script: none, CSS only. ## Script Set the Chinese or Japanese text in a CJK face with its own letter spacing and a looser line height than the Latin text, with strict line breaking and the palt feature on. Latin words inside a CJK line sit on the same baseline. ## Content to replace - [Occasion line]: one to four characters down the card - [Name line]: written below the cord - [Card]: faint paper texture - [Corner mark]: folded, 25 units wide, rotated 9 degrees - [Cord]: five strands a side, two colours - [Label]: what the card shows ## Rules Plain, specific copy that reads as a live product; never the word sample. No shadows, glow, glass, blur, gradient text, emoji or italics. Motion moves transform and opacity, with colour, border, height and stroke transitions on state changes, and holds its end state under prefers-reduced-motion. Text passes WCAG AA. ## Output Return the block in one piece: the markup, one style block with the web fonts imported on its first line, and a small script only if the behaviour needs one. No page wrapper, no framework, no build step. Prefix every class with `blk-` and put the colours and sizes in CSS variables at the top.
More like this
Data
Same page




