HTML Explanation
01
First, we start with the <!DOCTYPE html> declaration, which defines the document type and version of HTML.
02
The <html> tag wraps all the content on the page, while the <head> section includes meta information like character set, viewport settings for responsiveness, and the title of the webpage.
03
Inside the <head>, we link an external CSS file named style.css using the <link> tag, which allows us to separate content from styling.
04
The <body> tag follows, containing a single <div> with the class stage.
05
This stage contains multiple div elements, each with a class layer.
06
These layers form the core of our 3D effect by using CSS transformations.
07
The style section at the bottom of the HTML file contains some inline CSS.
08
This temporarily overrides any animation settings, ensuring the animation runs smoothly during the page load.
CSS Explanation
01
We begin by importing fonts using @import statements.
02
These fonts give our text a unique look and are fetched from Google Fonts.
03
The body is styled with a height of 100vh and a radial gradient background transitioning from yellow (#ffea5e) to gold (#ffd700), creating a vibrant and engaging atmosphere.
04
The stage class is designed to center our content both vertically and horizontally using Flexbox properties like justify-content and align-items.
05
The perspective property adds a 3D perspective effect, and transform-style: preserve-3d ensures child elements retain their 3D transformations.
06
Each layer is positioned absolutely within the stage, with the transform-style property preserving their 3D nature. The animation property applies a smooth "InOut" animation, alternating between two keyframes over 5 seconds.
07
Each layer uses the :after pseudo-element to display the text "Go Bulldogs!".
08
The font size, color, and text shadow are customized to enhance the 3D effect. Layers are staggered in depth using translateZ, and each layer’s depth increases slightly more than the previous one, creating a dynamic depth effect.
09
The @keyframes InOut animation rotates the layers around the Y and X axes, creating an interactive and visually captivating 3D effect.