This is a responsive Share Content Card Component built using HTML, Sass, and JavaScript. It allows users to share content on social media platforms (e.g., Facebook, Twitter, Instagram) and provides a "Copy" button to copy a shareable link to the clipboard. The project includes hover effects, clipboard functionality, and responsiveness for various screen sizes.
This project is a solution for the Share Content Card Component Challenge on FrontendPro. The challenge focuses on creating an interactive component for sharing links, improving frontend skills with HTML, CSS, and JavaScript, and incorporating a CSS preprocessor like Sass.
- HTML5: Markup structure.
- Sass: For advanced styling (CSS preprocessor).
- JavaScript (Vanilla): Clipboard API and interactivity.
- FontAwesome: For social media icons.
Do watch the Live Preview.
- Social Sharing: Share content on platforms like Facebook, Twitter, Instagram, LinkedIn, Pinterest, and Telegram.
- Copy Button: Copies a predefined link to the clipboard.
- Hover Effects: Interactive and smooth hover transitions for buttons and icons.
- Responsive Design: Adapts to various screen sizes.
- Sass-Based Styling: Includes reusable variables, nesting, and mixins for better code organization.
You’ll need to install Sass to compile the .scss
files into .css
. Here’s how:
- Install Sass Globally (requires Node.js):
npm install -g sass
- Check if Sass is installed:
sass --version
- Compile the
style.scss
file intostyle.css
:sass style.scss style.css
Alternatively, if you don’t want to install Sass, you can use the precompiled style.css
file included in the project. Simply skip the Sass compilation step.
-
Clone this repository:
git clone https://github.com/Yashi-Singh-9/Share-Content-Card-Component.git
-
Navigate to the project directory:
cd Share-Content-Card-Component
-
(Optional) If you have Sass installed and want to recompile the styles, run:
sass style.scss style.css
-
Open
index.html
in your browser to view the component.
- Hover over social media icons to see the hover effects.
- Click the Copy button to copy the link to your clipboard.
- Resize your browser or use different devices to test the responsiveness.
├── index.html # HTML structure
├── style.scss # Main Sass file
├── style.css # Compiled CSS (output)
├── script.js # JavaScript for interactivity
├── README.md # Project documentation
- Challenge Link: Share Content Card Component Challenge
- Install Sass: sass-lang.com
- FontAwesome Icons: FontAwesome
- Clipboard API: MDN Clipboard API Documentation
This challenge is part of the FrontendPro platform. Thank you to the community for creating beginner-friendly and engaging challenges.