Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Midnight Fridge Raid — comfort food isn't a dish, it's 2am

Description and use

A responsive, accessible CSS art scene of a midnight fridge raid, using only CSS primitives to realistically render light, depth, and interactivity.

Problem

Create a realistic, light-focused CSS art scene of a midnight fridge raid without using images or SVG, ensuring depth, lighting, and interactivity while keeping the code responsive and accessible.

Outcome

A fully responsive, accessible CSS art scene that realistically portrays light, depth, and interactivity in a midnight kitchen, meeting the challenge brief while avoiding common pitfalls like flat lighting and lack of depth.

Workflow

  • 1. Define a single container with container-type: inline-size and use cqw units for all dimensions.
  • 2. Build the fridge as a div with two faces (door__outer, door__face) using backface visibility and transform to create a natural swing without JS thresholds.
  • 3. Create light cones with radial gradients anchored at the fridge opening, adjusting angles to match real light falloff.
  • 4. Use clip-path and mask-image to shape light cones and soften edges while preserving hard edges.
  • 5. Add depth by layering shelves, backrows, and crisper drawer with brightness and blur filters to simulate distance.
  • 6. Enhance realism with dust motes and a cold vent using simple CSS and optional JS for random scattering.
  • 7. Ensure accessibility: mark the art as role="img" with an aria-label, hide internal elements with aria-hidden, provide a real <button> to toggle the door, and respect prefers-reduced-motion.
  • 8. Test responsiveness across viewports; the single container query ensures no media queries are needed.
  • 9. Deploy the final CodePen demo and host the source on GitHub under MIT license.

Evidence

Everything in the scene is a div, a gradient, a clip-path or a shadow. No SVG, no images, no canvas.

Source

A single container query, zero breakpoints. Every dimension is in cqw — 1% of the scene's own width — off a single container-type: inline-size.

Source

  • Record date: 2026-09-15T19:01:26.477Z