Skip to main content
<CodeWithBhurtel/>
HomeLearnProjectsChallengesBlogAboutContactLogin
<CodeWithBhurtel/>

Learn through structured lessons, real projects, and live challenges. Free tutorials for HTML, CSS, JavaScript, and more.

Pages

  • Home
  • Learn
  • Blog
  • Projects
  • Challenges
  • About
  • Contact

Lessons

  • HTML
  • CSS
  • JavaScript

© 2026 CodeWithBhurtel. All rights reserved.

Privacy PolicyTerms & Conditions
Projects

Yeti 404 Page Not Found

IntermediateHTML, CSS, JavaScript

Learn about keyframe animation

Yeti 404 Page Not Found – project preview
Share this project
Follow me on social media

About this project

This project builds an animated 404 error page featuring a yeti character holding a flashlight. Instead of showing a plain error message the page gives users a short animated scene to watch. The yeti swings its flashlight beam across the screen and wherever the beam lands the 404 text briefly appears before going dark again. That reveal and hide cycle is what makes the page feel alive rather than static.

The entire visual is built from two SVG elements stacked on top of each other using absolute positioning. The first SVG holds the yeti, its surroundings and all the character artwork. The second SVG holds the flashlight beam and the 404 text. Separating them into two layers makes it possible to control their visibility and colors independently without affecting each other.

All the animation is handled by GSAP and its MorphSVGPlugin. GSAP timelines sequence every movement in the scene including the yeti's arm raising, its mouth chattering and the flashlight toggling on and off. The mouth chatter works by morphing between different SVG path shapes on each beat rather than swapping images or using CSS transitions. MorphSVGPlugin handles that path interpolation and produces smooth in-between shapes that look like natural movement. The light and dark effect is controlled by two functions called goDark and goLight. When the flashlight turns off goDark hides the beam element and swaps every colored element in the scene to its darker version using gsap.set. When the flashlight turns on goLight reverses that. The color of the yeti's fur, the 404 letters and the environment all switch simultaneously giving a convincing impression that a real light source is turning on and off.

What you will learn

You will learn how GSAP timelines work and how to sequence multiple animations in a precise order. Building yetiTL and chatterTL as separate timelines that run together teaches you how to organize complex multi-part animations without tangling your code. You will understand how MorphSVGPlugin interpolates between SVG path shapes to produce smooth transitions that look like physical movement. That technique applies to any project where you need organic shape changes that CSS cannot handle.

You will learn how layering two SVG elements with absolute positioning lets you control parts of a scene independently. You will also learn how to simulate a dynamic light source purely by toggling visibility and swapping fill colors across multiple elements at the same time rather than using any real lighting system.

Understand with AI

Get an AI-generated overview or a file-by-file code breakdown. Ask questions about the project below the overview.

This project creates an engaging and animated "404 Page Not Found" error page. Its main purpose is to entertain users with a dynamic scene featuring a yeti character. The key features include a flashlight-wielding yeti whose movements are animated, a "404" text reveal that appears and disappears with the flashlight beam, and a dynamic light/dark mode that changes the scene's colors and visibility.

The project's structure is built around HTML, CSS, and JavaScript. The HTML file (index.html) sets up the page, including two main SVG containers: yetiSVG holds all the visual elements of the yeti and its environment, while lightSVG contains the flashlight beam and the "404" text. A simple div provides the textual "Page Not Found" message.

<svg id="yetiSVG" xmlns="http://www.w3.org/2000/svg" ... viewBox="0 0 600 470">
    <!-- SVG content for yeti, blanket, etc. -->
</svg>
<svg id="lightSVG" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 470">
    <!-- SVG content for light beam and 404 text -->
</svg>
<div class="content">
    <h3>Hello?? Is somebody there?!?</h3>
    <p>We know it’s scary, but the page you’re trying to reach can’t be found.</p>
</div>

These SVG elements are positioned absolutely to overlap and fill the viewport, as defined by the style.css. The CSS also handles basic styling for the text content, ensuring readability and visual appeal.

#yetiSVG, #lightSVG {
  width: 600px;
  height: 470px;
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden; /* lightSVG uses overflow: visible */
}

This CSS snippet demonstrates how the SVG containers are positioned on the page.

The core animation logic resides in script.js, which leverages the GreenSock Animation Platform (GSAP) and its MorphSVGPlugin. The JavaScript defines several timelines (yetiTL and chatterTL) to orchestrate complex animations. chatterTL handles the yeti's mouth movements, making it appear to chatter by morphing SVG paths, while yetiTL controls the main sequence, including arm movements, flashlight toggles, eye changes, and the mouth morphing.

gsap.registerPlugin(MorphSVGPlugin);

let yetiTL, chatterTL,
  furLightColor = "#FFF",
  furDarkColor = "#67b1e0",
  // ... other color and shape variables

This snippet shows the registration of the MorphSVGPlugin and the definition of variables used to store colors and SVG path data for animations.

The yetiTL timeline integrates calls to goDark() and goLight() functions, which are crucial for the dynamic light/dark effect. These functions toggle the visibility of the flashlight beam and dynamically change the fill and stroke colors of various SVG elements, including the yeti's fur, skin, and the "404" text, creating the illusion of the flashlight turning on and off.

function goDark() {
  gsap.set('#light', { visibility: "hidden" });
  gsap.set('.lettersSide', { fill: lettersSideDark, stroke: lettersStrokeDark });
  gsap.set('.lettersFront', { fill: lettersFrontDark, stroke: lettersStrokeDark });
  // ... more color changes for yeti parts
}

This goDark function illustrates how the scene's appearance is altered by hiding the light source and applying dark color themes to the "404" letters and other elements.

Ask about this project

Have a question about how this project works? Ask below and get an answer based on the project code.

Code Breakdown

Structured technical breakdown for beginners. Anyone can generate or regenerate; your version is saved in this browser (local storage).

No breakdown yet. Generate one to see a file-by-file explanation. Your version is saved in this browser.

Comments

No comments yet. Sign in to leave a comment.

Sign in to leave a comment.