CHROMATIC-SYSTEM v1.03_3D_ROTATING_CARDS_DISPLAY_ENGINE

INFORMATION & CODE

Rotating 3D Cards display

What the Code Does

The code creates an interactive 3D-style rotating information card using HTML, CSS, and JavaScript. The HTML provides the structure: a main heading, an instruction paragraph, and a card made from two layers. The .back-wrapper contains the image, while the .front-wrapper contains the title and descriptive text. Clicking the front of the card hides it so the image underneath can be seen; clicking the image brings the text layer back.

How the Code Works

The CSS controls the card's appearance and animation. The .wrapper creates the main card area, while the two wrapper elements are positioned on top of each other. The @keyframes bkgd and @keyframes frnt animations repeatedly rotate and skew the image and text layers in opposite directions, creating the illusion of a moving or rotating card. The box-shadow changes during the animation to enhance the 3D effect.

The JavaScript calculates the card's dimensions when the page loads. It obtains the width of .wrapper and then uses that value to set the heights of the card and its two layers, maintaining approximately a 4:3 proportion. The frontAction() function hides the text layer when the front is clicked, revealing the image. The backAction() function makes the text layer visible again when the image is clicked.

How to Use the Code

To use the component, place the HTML in your webpage, put the CSS in styles.css, and put the JavaScript in scripts.js. Replace the Google Drive image URL in .back-wrapper with the URL of your own image if required. You can also change the <h2> and <p> content to display your own message. The user interaction is simple: click the text/card to reveal the image, then click the image to reveal the text again.

HTML

CSS

JAVASCRIPT

PREVIEW

3D Rotating Information Cards

Click on the card to see the image then click on the image to view the text.

3D Rotating Cards

How about using these rotating cards to get your message across to your readers in an eyecatching way.