A daylight study slider that sweeps the sun across a minimalist villa elevation, stretching and warming the cast shadow in real time. It drops straight into property detail pages or hero sections to let buyers feel how light moves through a home over the day.
// Drop the standalone golden-hour-sun-sweep.html into /public/effects/golden-hour-sun-sweep.html
// Or copy the HTML/CSS/JS tab directly into your component — zero external dependencies.
export function GoldenHourSunSweepEmbed() {
return (
<div className="relative min-h-[480px] w-full overflow-hidden rounded-2xl border border-white/10">
<iframe
src="/effects/golden-hour-sun-sweep.html"
title="Golden Hour Sun Sweep"
className="h-full min-h-[480px] w-full border-0"
loading="lazy"
/>
</div>
)
}Loading single-file HTML…
Build a "Golden Hour Sun Sweep" component: a warm limestone-paper card (#f3efe7) containing a minimalist villa elevation drawn as thin inline SVG lines (0.8–1.2px strokes, #0f172a at 55% opacity) — flat roof, two windows, a doorway, and a slim tree. Behind the house sits a soft sun disc with a concentric glow. Beneath the drawing, a horizontal track holds a draggable sun knob. Interaction: on pointerdown/pointermove (and touch), map the knob's x position (0–100%) to a sun angle from 6° (dawn, left, cool #b45309→#e8b878) through 90° (noon, high, short shadow) to 180° (dusk, right, long warm shadow). Translate the sun SVG group along an arc path; skew and scale a cast-shadow polygon (a parallelepiped under the house + tree) using `transform: skewX(calc(...)) scaleX(...)` where the skew is derived from the sun angle and the scale from `1/sin(angle)`, clamped. Interpolate window glow fill opacity and shadow color (from #a8a29e to #b45309 at 28% alpha) via CSS custom properties set in JS. Add a readout label like "14:20 · West light". Use requestAnimationFrame throttling, `touch-action: none` on the knob, and honor `prefers-reduced-motion` by snapping to steps instead of continuous travel. Palette: #f3efe7 surface, #0f172a ink, #b45309 amber sun, #0f766e teal accent for the noon marker. Zero dependencies, single file, responsive from 390px.
WHY THIS WORKS IN PRODUCTION
- Drag-to-sweep sun with angle-derived shadow skew & scale
- Window glow and shadow warmth interpolate from dawn to dusk
- Time-of-day readout (e.g. 14:20 · West light) updates live
- prefers-reduced-motion snaps to stepped sun positions
DROP-IN SPECS // WEB & MOBILE FIT









