Skip to content
Color & Light

Palette swaps on one scene

The same room under different palettes, side by side.

We keep every demo in a small repository with one folder per post. Each folder has the HTML, the CSS and a short note on what we tried and dropped. Months later, when a reader asks why a tutorial does something a certain way, the note usually has the answer and saves us a long investigation.

4 imagesJPG, 1200 × 1200

Download ZIP 591 KB

SVG is often the better choice for complex scenes. CSS cubes are fun to build and easy to animate, but a city block made of hundreds of divs is hard to change and heavy to render. We draw the static parts in SVG, keep the interactive blocks in CSS, and layer the two together.

Share

Written by

Sam Whitfield

Sam makes tile-based games in the evenings and brings the sorting tricks back to the blog. Currently building a very small harbour.

All 17 posts by Sam Whitfield

3 comments

  1. Eli Novak

    Any plans for a video version of this one?

    Reply to Eli Novak
  2. Rosa Medina

    I teach an intro CSS class and I am going to use this as the final project.

    Reply to Rosa Medina
    1. Soren Dahl

      The templates are in the downloads section of the reference post.

      Reply to Soren Dahl

Leave a comment

Your email address won’t be published. Required fields are marked.