Pet Triangle provides two personalization controls — a text input for the pet’s name and a color picker for its fill color. Both controls are rendered directly in the browser with no page reload needed, and their DOM elements are referenced inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/mr-sunset/pet-triangle/llms.txt
Use this file to discover all available pages before exploring further.
script.js for wiring up interactive behavior.
Setting a pet name
The#pet-name input sits above the triangle SVG in the main area. Click or tap anywhere on it to start typing a name for your pet.
- Background: fully transparent, so it inherits the page background.
- Border: none by default — it looks like plain centered text until you interact with it.
- Text alignment: centered, matching the visual balance of the layout.
- Font size:
xx-large, giving the name the same visual weight as the triangle beneath it. - Placeholder:
"Pet name"— shown in the browser’s default placeholder colour until you type. - Maximum length: 30 characters (
max="30"), keeping names from overflowing the layout.
Changing the triangle’s color
The#pet-color input is a standard HTML color picker, styled to look like a pill-shaped swatch rather than the browser’s default square widget.
#pet-color input and the #pet SVG element are both referenced in script.js, ready for color-change logic to be connected. The custom styling applied to the input makes it feel native to the app’s design:
| Property | Value | Effect |
|---|---|---|
width | 200px | Wide enough to show the current colour clearly |
height | 30px | Compact, sits neatly in the actions bar |
border-radius | 20px | Pill shape — fully rounded ends |
border | 2px solid black | Crisp outline matching the action buttons |
overflow | hidden | Keeps the swatch colour contained within the pill shape |
transform: scale(0.95)) over a 0.12s ease transition.
The picker’s internal swatch area is also restyled using vendor-prefixed pseudo-elements to strip browser default padding and borders and enforce the pill shape consistently:
-webkit- rules target Chrome, Edge, and Safari; the -moz- rule targets Firefox. Together they produce a consistent pill-shaped swatch across all major desktop and mobile browsers.
Dark mode
Pet Triangle automatically adapts to your operating system’s colour scheme via the CSSprefers-color-scheme: dark media query. No toggle or setting is required — if your system is in dark mode, the app switches automatically.
- Background: the page background switches from white to
rgb(20, 20, 20)— a near-black that’s easier on the eyes than pure black. - Text: all text, including the pet name input, becomes white.
- Triangle fill: the
#petSVG path fill changes torgb(100, 100, 100), a mid-grey that stands out against the dark background without being harsh. - Action buttons: background becomes black, border and text colour become white — inverting the light-mode scheme.
- Focused name input: the focus outline switches from black to white so it remains visible against dark backgrounds.
- Color picker: the
color-scheme: darkdeclaration on#pet-colorhints to the browser to render the native color picker dialog in dark mode as well.