CHROMATIC-SYSTEM v1.03_AUTHOR_CARD_DISPLAY_ENGINE

INFORMATION & CODE

Author Card Display

What the Code Does

This code creates an interactive author profile card featuring a toggleable social media menu. Visually, the component is styled as a content card with a metallic gold gradient background, a circular author profile picture that slightly zooms in when hovered over, descriptive biographical text, and a custom-styled handle. The defining interactive feature of this layout is the social menu, which remains hidden by default and opens up like a dropdown list when the user clicks on the author's social media handle (@hilaryiglesthorpe). Once the menu is visible, clicking on any of the individual platform buttons (Facebook, Twitter, or Pinterest) triggers an event that automatically hides the menu again.

How the Code Works

Technically, the implementation relies on HTML for structure, CSS Grid and custom styling for presentation, and JavaScript for interactivity. The HTML document sets up the card container, embedding the author's image, name, bio, and a hidden container holding buttons with FontAwesome icons. The CSS uses CSS Grid (display: grid) to layout the profile picture alongside the text content, applies a luxurious linear gradient to the outer card, and defines hover states and transitions for the image and buttons. The JavaScript utilizes DOM selection (document.querySelector) and event listeners to toggle the visibility property of the .social-menu element between 'hidden' and 'visible' upon clicking the social handle, while also iterating through the menu buttons to ensure the menu closes when a selection is made.

How to Use the Code

To use this code, you need to set up three separate files in the same directory: an HTML file containing the markup, a stylesheet named styles.css, and a script file named scripts.js containing the respective code blocks. Because the code relies on external assets, you will also need to ensure your project has access to FontAwesome for the social media icons and the "VT323" Google Font for the retro typography used on the buttons and handle. Once the files are linked properly, you can simply open the HTML file in any web browser to view and interact with the profile card.

HTML

CSS

JAVASCRIPT