CHROMATIC-SYSTEM v1.03_FLIP_IMAGE_DISPLAY_ENGINE

INFORMATION & CODE

Flip Image Display

What the Code Does

This code creates an interactive webpage that allows users to manipulate the orientation of an image using a set of styled buttons. The user interface displays a central photograph accompanied by four retro-styled buttons labeled "Default," "Horizontal," "Verticle," and "Both." The CSS styles these buttons with a vibrant blue gradient, rounded corners, and a custom arcade-style font ("VT323") sourced from Google Fonts, while also including a temporary squeezing effect when the image itself is clicked.

The functionality is driven by JavaScript, which selects the image and all four buttons using the Document Object Model (DOM). It assigns specific click event listeners to each button to dynamically alter the CSS transform property of the image. The first button resets the image to its original state, the second flips it horizontally along the X-axis using scaleX(-1), the third flips it vertically along the Y-axis using scaleY(-1), and the fourth inverses the image in both directions simultaneously using scale(-1).

To use this code, save the HTML, CSS, and JavaScript snippets into three separate files named index.html, styles.css, and scripts.js respectively, ensuring they are placed in the same folder. You will also need to create a placeholder JavaScript file named scripts.js (or ensure your HTML correctly links to it) so the event listeners can properly attach. Once the files are set up, simply open the index.html file in any modern web browser to view the page and click the buttons to see the image transform.

HTML

CSS

JAVASCRIPT

PREVIEW

The blogger