CHROMATIC-SYSTEM v1.03_AUTOMATIC_BLOCKQUOTE_PHASER_ENGINE

INFORMATION & CODE

Automatic Quote Phaser

What the Code Does

This code creates a web component called the "Automatic Quote Phaser," which is a rotating carousel of famous quotes. It displays one quote card at a time on the screen against a styled background, and automatically cycles through a collection of five quotes attributed to notable figures (such as Aristotle, Franklin D. Roosevelt, and Walt Disney). As time passes, the currently visible quote smoothly fades out, and the next quote fades in using CSS transitions, creating a polished, slideshow-like effect.

How It Works

The functionality is split across three standard web development languages: HTML, CSS, and JavaScript.

  • HTML (Structure): The HTML document defines five distinct div containers (.blockquoteWrapper), each holding a quote (<blockquote>), a heading, the author's name, a decorative quote symbol, and a numbered button (.dot). It also links to external resources, including Google Fonts ("Press Start 2P" and "VT323") and FontAwesome for iconography.
  • CSS (Styling and Animation): The CSS styles the quote cards to have a retro, retro-arcade aesthetic featuring warm cream backgrounds, double orange borders, and drop shadows. Crucially, the .blockquoteWrapper class includes a transition-duration: 3s; property and an initial opacity: 0; setting. This ensures that whenever the opacity of a wrapper changes via JavaScript, the browser animates the fade rather than snapping it instantly.
  • JavaScript (Behavior): The JavaScript file controls the timing and logic of the rotation. Using setInterval, it repeatedly calls a function named changeBlockquote every 9,000 milliseconds (9 seconds). Inside this function, a loop sets the opacity of all quote wrappers to 0 (hidden), and then sets the opacity of the currently active wrapper (wrap[inc]) to 1 (visible). It then decrements the index counter (inc), looping back to the end of the array once it reaches zero, creating an endless loop of quotes.

How to Use It

To implement and run this code on your own computer, follow these steps:

  1. Set Up Your Files: Create a project folder and save the code into three separate files within that same folder:
    • Save the HTML code as index.html.
    • Save the CSS code as styles.css.
    • Save the JavaScript code as scripts.js.
  2. Verify Asset Links: Ensure the file names match what is referenced in the HTML head and body tags (styles.css and scripts.js).
  3. Run the Project: Open the index.html file in any modern web browser (such as Chrome, Firefox, or Edge).
  4. Observe the Carousel: Once the page loads, you will see one quote displayed. Every 9 seconds, the code will automatically fade out the current quote and fade in the next one in the sequence.

HTML

CSS

JAVASCRIPT

PREVIEW

DARKNESS & LIGHT

It is during our darkest moments that we must focus to see the light."

— Aristotle —

REACHING THE END

When you reach the end of your rope, tie a knot in it and hang on.

— Franklin D. Roosevelt —

HAPPENINGS

Life is what happens when you're busy making other plans.

— John Lennon —

TASTELESS

If life were predictable it would cease to be life, and be without flavour.

— Eleanor Roosevelt —

GETTING STARTED

The way to get started is to quit talking and begin doing.

— Walt Disney —