finished product challenge, added light dark mode
|
@ -2,6 +2,9 @@
|
|||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
},
|
||||
{
|
||||
"path": "projects/FrontendMentor/junior/advice-generator-app"
|
||||
}
|
||||
],
|
||||
"settings": {}
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
# Frontend Mentor - Product preview card component
|
||||
|
||||
![Design preview for the Product preview card component coding challenge](./design/desktop-preview.jpg)
|
||||
|
||||
## Welcome! 👋
|
||||
|
||||
Thanks for checking out this front-end coding challenge.
|
||||
|
||||
[Frontend Mentor](https://www.frontendmentor.io) challenges help you improve your coding skills by building realistic projects.
|
||||
|
||||
**To do this challenge, you need a basic understanding of HTML and CSS.**
|
||||
|
||||
## The challenge
|
||||
|
||||
Your challenge is to build out this product preview card component and get it looking as close to the design as possible.
|
||||
|
||||
You can use any tools you like to help you complete the challenge. So if you've got something you'd like to practice, feel free to give it a go.
|
||||
|
||||
Your users should be able to:
|
||||
|
||||
- View the optimal layout depending on their device's screen size
|
||||
- See hover and focus states for interactive elements
|
||||
|
||||
Want some support on the challenge? [Join our Slack community](https://www.frontendmentor.io/slack) and ask questions in the **#help** channel.
|
||||
|
||||
## Where to find everything
|
||||
|
||||
Your task is to build out the project to the designs inside the `/design` folder. You will find both a mobile and a desktop version of the design.
|
||||
|
||||
The designs are in JPG static format. Using JPGs will mean that you'll need to use your best judgment for styles such as `font-size`, `padding` and `margin`.
|
||||
|
||||
If you would like the design files (we provide Sketch & Figma versions) to inspect the design in more detail, you can [subscribe as a PRO member](https://www.frontendmentor.io/pro).
|
||||
|
||||
You will find all the required assets in the `/images` folder. The assets are already optimized.
|
||||
|
||||
There is also a `style-guide.md` file containing the information you'll need, such as color palette and fonts.
|
||||
|
||||
## Building your project
|
||||
|
||||
Feel free to use any workflow that you feel comfortable with. Below is a suggested process, but do not feel like you need to follow these steps:
|
||||
|
||||
1. Initialize your project as a public repository on [GitHub](https://github.com/). Creating a repo will make it easier to share your code with the community if you need help. If you're not sure how to do this, [have a read-through of this Try Git resource](https://try.github.io/).
|
||||
2. Configure your repository to publish your code to a web address. This will also be useful if you need some help during a challenge as you can share the URL for your project with your repo URL. There are a number of ways to do this, and we provide some recommendations below.
|
||||
3. Look through the designs to start planning out how you'll tackle the project. This step is crucial to help you think ahead for CSS classes to create reusable styles.
|
||||
4. Before adding any styles, structure your content with HTML. Writing your HTML first can help focus your attention on creating well-structured content.
|
||||
5. Write out the base styles for your project, including general content styles, such as `font-family` and `font-size`.
|
||||
6. Start adding styles to the top of the page and work down. Only move on to the next section once you're happy you've completed the area you're working on.
|
||||
|
||||
## Deploying your project
|
||||
|
||||
As mentioned above, there are many ways to host your project for free. Our recommend hosts are:
|
||||
|
||||
- [GitHub Pages](https://pages.github.com/)
|
||||
- [Vercel](https://vercel.com/)
|
||||
- [Netlify](https://www.netlify.com/)
|
||||
|
||||
You can host your site using one of these solutions or any of our other trusted providers. [Read more about our recommended and trusted hosts](https://medium.com/frontend-mentor/frontend-mentor-trusted-hosting-providers-bf000dfebe).
|
||||
|
||||
## Create a custom `README.md`
|
||||
|
||||
We strongly recommend overwriting this `README.md` with a custom one. We've provided a template inside the [`README-template.md`](./README-template.md) file in this starter code.
|
||||
|
||||
The template provides a guide for what to add. A custom `README` will help you explain your project and reflect on your learnings. Please feel free to edit our template as much as you like.
|
||||
|
||||
Once you've added your information to the template, delete this file and rename the `README-template.md` file to `README.md`. That will make it show up as your repository's README file.
|
||||
|
||||
## Submitting your solution
|
||||
|
||||
Submit your solution on the platform for the rest of the community to see. Follow our ["Complete guide to submitting solutions"](https://medium.com/frontend-mentor/a-complete-guide-to-submitting-solutions-on-frontend-mentor-ac6384162248) for tips on how to do this.
|
||||
|
||||
Remember, if you're looking for feedback on your solution, be sure to ask questions when submitting it. The more specific and detailed you are with your questions, the higher the chance you'll get valuable feedback from the community.
|
||||
|
||||
## Sharing your solution
|
||||
|
||||
There are multiple places you can share your solution:
|
||||
|
||||
1. Share your solution page in the **#finished-projects** channel of the [Slack community](https://www.frontendmentor.io/slack).
|
||||
2. Tweet [@frontendmentor](https://twitter.com/frontendmentor) and mention **@frontendmentor**, including the repo and live URLs in the tweet. We'd love to take a look at what you've built and help share it around.
|
||||
3. Share your solution on other social channels like LinkedIn.
|
||||
4. Blog about your experience building your project. Writing about your workflow, technical choices, and talking through your code is a brilliant way to reinforce what you've learned. Great platforms to write on are [dev.to](https://dev.to/), [Hashnode](https://hashnode.com/), and [CodeNewbie](https://community.codenewbie.org/).
|
||||
|
||||
We provide templates to help you share your solution once you've submitted it on the platform. Please do edit them and include specific questions when you're looking for feedback.
|
||||
|
||||
The more specific you are with your questions the more likely it is that another member of the community will give you feedback.
|
||||
|
||||
## Got feedback for us?
|
||||
|
||||
We love receiving feedback! We're always looking to improve our challenges and our platform. So if you have anything you'd like to mention, please email hi[at]frontendmentor[dot]io.
|
||||
|
||||
This challenge is completely free. Please share it with anyone who will find it useful for practice.
|
||||
|
||||
**Have fun building!** 🚀
|
|
@ -1,111 +0,0 @@
|
|||
# Frontend Mentor - Product preview card component solution
|
||||
|
||||
This is a solution to the [Product preview card component challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/product-preview-card-component-GO7UmttRfa). Frontend Mentor challenges help you improve your coding skills by building realistic projects.
|
||||
|
||||
## Table of contents
|
||||
|
||||
- [Overview](#overview)
|
||||
- [The challenge](#the-challenge)
|
||||
- [Screenshot](#screenshot)
|
||||
- [Links](#links)
|
||||
- [My process](#my-process)
|
||||
- [Built with](#built-with)
|
||||
- [What I learned](#what-i-learned)
|
||||
- [Continued development](#continued-development)
|
||||
- [Useful resources](#useful-resources)
|
||||
- [Author](#author)
|
||||
- [Acknowledgments](#acknowledgments)
|
||||
|
||||
**Note: Delete this note and update the table of contents based on what sections you keep.**
|
||||
|
||||
## Overview
|
||||
|
||||
### The challenge
|
||||
|
||||
Users should be able to:
|
||||
|
||||
- View the optimal layout depending on their device's screen size
|
||||
- See hover and focus states for interactive elements
|
||||
|
||||
### Screenshot
|
||||
|
||||
![](./screenshot.jpg)
|
||||
|
||||
Add a screenshot of your solution. The easiest way to do this is to use Firefox to view your project, right-click the page and select "Take a Screenshot". You can choose either a full-height screenshot or a cropped one based on how long the page is. If it's very long, it might be best to crop it.
|
||||
|
||||
Alternatively, you can use a tool like [FireShot](https://getfireshot.com/) to take the screenshot. FireShot has a free option, so you don't need to purchase it.
|
||||
|
||||
Then crop/optimize/edit your image however you like, add it to your project, and update the file path in the image above.
|
||||
|
||||
**Note: Delete this note and the paragraphs above when you add your screenshot. If you prefer not to add a screenshot, feel free to remove this entire section.**
|
||||
|
||||
### Links
|
||||
|
||||
- Solution URL: [Add solution URL here](https://your-solution-url.com)
|
||||
- Live Site URL: [Add live site URL here](https://your-live-site-url.com)
|
||||
|
||||
## My process
|
||||
|
||||
### Built with
|
||||
|
||||
- Semantic HTML5 markup
|
||||
- CSS custom properties
|
||||
- Flexbox
|
||||
- CSS Grid
|
||||
- Mobile-first workflow
|
||||
- [React](https://reactjs.org/) - JS library
|
||||
- [Next.js](https://nextjs.org/) - React framework
|
||||
- [Styled Components](https://styled-components.com/) - For styles
|
||||
|
||||
**Note: These are just examples. Delete this note and replace the list above with your own choices**
|
||||
|
||||
### What I learned
|
||||
|
||||
Use this section to recap over some of your major learnings while working through this project. Writing these out and providing code samples of areas you want to highlight is a great way to reinforce your own knowledge.
|
||||
|
||||
To see how you can add code snippets, see below:
|
||||
|
||||
```html
|
||||
<h1>Some HTML code I'm proud of</h1>
|
||||
```
|
||||
```css
|
||||
.proud-of-this-css {
|
||||
color: papayawhip;
|
||||
}
|
||||
```
|
||||
```js
|
||||
const proudOfThisFunc = () => {
|
||||
console.log('🎉')
|
||||
}
|
||||
```
|
||||
|
||||
If you want more help with writing markdown, we'd recommend checking out [The Markdown Guide](https://www.markdownguide.org/) to learn more.
|
||||
|
||||
**Note: Delete this note and the content within this section and replace with your own learnings.**
|
||||
|
||||
### Continued development
|
||||
|
||||
Use this section to outline areas that you want to continue focusing on in future projects. These could be concepts you're still not completely comfortable with or techniques you found useful that you want to refine and perfect.
|
||||
|
||||
**Note: Delete this note and the content within this section and replace with your own plans for continued development.**
|
||||
|
||||
### Useful resources
|
||||
|
||||
- [Example resource 1](https://www.example.com) - This helped me for XYZ reason. I really liked this pattern and will use it going forward.
|
||||
- [Example resource 2](https://www.example.com) - This is an amazing article which helped me finally understand XYZ. I'd recommend it to anyone still learning this concept.
|
||||
|
||||
**Note: Delete this note and replace the list above with resources that helped you during the challenge. These could come in handy for anyone viewing your solution or for yourself when you look back on this project in the future.**
|
||||
|
||||
## Author
|
||||
|
||||
- Website - [Add your name here](https://www.your-site.com)
|
||||
- Frontend Mentor - [@yourusername](https://www.frontendmentor.io/profile/yourusername)
|
||||
- Twitter - [@yourusername](https://www.twitter.com/yourusername)
|
||||
|
||||
**Note: Delete this note and add/remove/edit lines above based on what links you'd like to share.**
|
||||
|
||||
## Acknowledgments
|
||||
|
||||
This is where you can give a hat tip to anyone who helped you out on this project. Perhaps you worked in a team or got some inspiration from someone else's solution. This is the perfect place to give them some credit.
|
||||
|
||||
**Note: Delete this note and edit this section's content as necessary. If you completed this challenge by yourself, feel free to delete this section entirely.**
|
|
@ -1,92 +1,64 @@
|
|||
# Frontend Mentor - Product preview card component
|
||||
# Frontend Mentor - Product preview card component solution
|
||||
|
||||
![Design preview for the Product preview card component coding challenge](./design/desktop-preview.jpg)
|
||||
This is a solution to the [Product preview card component challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/product-preview-card-component-GO7UmttRfa). Frontend Mentor challenges help you improve your coding skills by building realistic projects.
|
||||
|
||||
## Welcome! 👋
|
||||
## Table of contents
|
||||
|
||||
Thanks for checking out this front-end coding challenge.
|
||||
- [Frontend Mentor - Product preview card component solution](#frontend-mentor---product-preview-card-component-solution)
|
||||
- [Table of contents](#table-of-contents)
|
||||
- [Overview](#overview)
|
||||
- [The challenge](#the-challenge)
|
||||
- [Screenshot](#screenshot)
|
||||
- [Links](#links)
|
||||
- [My process](#my-process)
|
||||
- [Built with](#built-with)
|
||||
- [Author](#author)
|
||||
- [Acknowledgments](#acknowledgments)
|
||||
|
||||
[Frontend Mentor](https://www.frontendmentor.io) challenges help you improve your coding skills by building realistic projects.
|
||||
**Note: Delete this note and update the table of contents based on what sections you keep.**
|
||||
|
||||
**To do this challenge, you need a basic understanding of HTML and CSS.**
|
||||
## Overview
|
||||
|
||||
## The challenge
|
||||
### The challenge
|
||||
|
||||
Your challenge is to build out this product preview card component and get it looking as close to the design as possible.
|
||||
|
||||
You can use any tools you like to help you complete the challenge. So if you've got something you'd like to practice, feel free to give it a go.
|
||||
|
||||
Your users should be able to:
|
||||
Users should be able to:
|
||||
|
||||
- View the optimal layout depending on their device's screen size
|
||||
- See hover and focus states for interactive elements
|
||||
|
||||
Want some support on the challenge? [Join our Slack community](https://www.frontendmentor.io/slack) and ask questions in the **#help** channel.
|
||||
### Screenshot
|
||||
|
||||
## Where to find everything
|
||||
![Mobile](screenshots/mobile.png)
|
||||
![Mobile Dark](screenshots/mobile-dark.png)
|
||||
![Desktop](screenshots/desktop.png)
|
||||
![Desktop Dark](screenshots/desktop-dark.png)
|
||||
|
||||
Your task is to build out the project to the designs inside the `/design` folder. You will find both a mobile and a desktop version of the design.
|
||||
### Links
|
||||
|
||||
The designs are in JPG static format. Using JPGs will mean that you'll need to use your best judgment for styles such as `font-size`, `padding` and `margin`.
|
||||
- Solution URL: [Github](https://github.com/tarasis/tarasis.github.io/tree/main/projects/FrontendMentor/newbie/product-preview-card-component)
|
||||
- Live Site URL: [tarasis.github.io](http://tarasis.github.io/FrontendMentor/newbie/product-preview-card-component)
|
||||
|
||||
If you would like the design files (we provide Sketch & Figma versions) to inspect the design in more detail, you can [subscribe as a PRO member](https://www.frontendmentor.io/pro).
|
||||
## My process
|
||||
|
||||
You will find all the required assets in the `/images` folder. The assets are already optimized.
|
||||
Standard for me so far. Set up CSS properties for most things.
|
||||
Then I built the mobile version of the page.
|
||||
Made minor changes for the desktop version.
|
||||
Added a Light/Dark switcher, just to show updating the variables to change the colors.
|
||||
|
||||
There is also a `style-guide.md` file containing the information you'll need, such as color palette and fonts.
|
||||
### Built with
|
||||
|
||||
## Building your project
|
||||
- Semantic HTML5 markup
|
||||
- CSS custom properties
|
||||
- Flexbox (for some alignment)
|
||||
- CSS Grid (just for putting in the middle of the page)
|
||||
- Mobile-first workflow
|
||||
|
||||
Feel free to use any workflow that you feel comfortable with. Below is a suggested process, but do not feel like you need to follow these steps:
|
||||
## Author
|
||||
|
||||
1. Initialize your project as a public repository on [GitHub](https://github.com/). Creating a repo will make it easier to share your code with the community if you need help. If you're not sure how to do this, [have a read-through of this Try Git resource](https://try.github.io/).
|
||||
2. Configure your repository to publish your code to a web address. This will also be useful if you need some help during a challenge as you can share the URL for your project with your repo URL. There are a number of ways to do this, and we provide some recommendations below.
|
||||
3. Look through the designs to start planning out how you'll tackle the project. This step is crucial to help you think ahead for CSS classes to create reusable styles.
|
||||
4. Before adding any styles, structure your content with HTML. Writing your HTML first can help focus your attention on creating well-structured content.
|
||||
5. Write out the base styles for your project, including general content styles, such as `font-family` and `font-size`.
|
||||
6. Start adding styles to the top of the page and work down. Only move on to the next section once you're happy you've completed the area you're working on.
|
||||
- Website - [Robert McGovern](https://tarasis.net)
|
||||
- Frontend Mentor - [@tarasis](https://www.frontendmentor.io/profile/tarasis)
|
||||
- Twitter - [@tarasis](https://www.twitter.com/tarasis)
|
||||
|
||||
## Deploying your project
|
||||
## Acknowledgments
|
||||
|
||||
As mentioned above, there are many ways to host your project for free. Our recommend hosts are:
|
||||
|
||||
- [GitHub Pages](https://pages.github.com/)
|
||||
- [Vercel](https://vercel.com/)
|
||||
- [Netlify](https://www.netlify.com/)
|
||||
|
||||
You can host your site using one of these solutions or any of our other trusted providers. [Read more about our recommended and trusted hosts](https://medium.com/frontend-mentor/frontend-mentor-trusted-hosting-providers-bf000dfebe).
|
||||
|
||||
## Create a custom `README.md`
|
||||
|
||||
We strongly recommend overwriting this `README.md` with a custom one. We've provided a template inside the [`README-template.md`](./README-template.md) file in this starter code.
|
||||
|
||||
The template provides a guide for what to add. A custom `README` will help you explain your project and reflect on your learnings. Please feel free to edit our template as much as you like.
|
||||
|
||||
Once you've added your information to the template, delete this file and rename the `README-template.md` file to `README.md`. That will make it show up as your repository's README file.
|
||||
|
||||
## Submitting your solution
|
||||
|
||||
Submit your solution on the platform for the rest of the community to see. Follow our ["Complete guide to submitting solutions"](https://medium.com/frontend-mentor/a-complete-guide-to-submitting-solutions-on-frontend-mentor-ac6384162248) for tips on how to do this.
|
||||
|
||||
Remember, if you're looking for feedback on your solution, be sure to ask questions when submitting it. The more specific and detailed you are with your questions, the higher the chance you'll get valuable feedback from the community.
|
||||
|
||||
## Sharing your solution
|
||||
|
||||
There are multiple places you can share your solution:
|
||||
|
||||
1. Share your solution page in the **#finished-projects** channel of the [Slack community](https://www.frontendmentor.io/slack).
|
||||
2. Tweet [@frontendmentor](https://twitter.com/frontendmentor) and mention **@frontendmentor**, including the repo and live URLs in the tweet. We'd love to take a look at what you've built and help share it around.
|
||||
3. Share your solution on other social channels like LinkedIn.
|
||||
4. Blog about your experience building your project. Writing about your workflow, technical choices, and talking through your code is a brilliant way to reinforce what you've learned. Great platforms to write on are [dev.to](https://dev.to/), [Hashnode](https://hashnode.com/), and [CodeNewbie](https://community.codenewbie.org/).
|
||||
|
||||
We provide templates to help you share your solution once you've submitted it on the platform. Please do edit them and include specific questions when you're looking for feedback.
|
||||
|
||||
The more specific you are with your questions the more likely it is that another member of the community will give you feedback.
|
||||
|
||||
## Got feedback for us?
|
||||
|
||||
We love receiving feedback! We're always looking to improve our challenges and our platform. So if you have anything you'd like to mention, please email hi[at]frontendmentor[dot]io.
|
||||
|
||||
This challenge is completely free. Please share it with anyone who will find it useful for practice.
|
||||
|
||||
**Have fun building!** 🚀
|
||||
Two articles gave me the setup for the Light / Dark switcher I've set up. The first by [Musthaq Ahamad](https://medium.com/@haxzie/dark-and-light-theme-switcher-using-css-variables-and-pure-javascript-zocada-dd0059d72fa2) gave the JavaScript, but I didn't want to have it as a sliding button and with using a class for dark mode. For handling that I used ideas from [Luke Lowrey's](https://lukelowrey.com/css-variable-theme-switcher/) implementation, using data attributes.
|
|
@ -0,0 +1,314 @@
|
|||
/*
|
||||
* design sizing
|
||||
* Desktop: 1440x800
|
||||
* Mobile: 375x667
|
||||
*/
|
||||
|
||||
*,
|
||||
::before,
|
||||
::after {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
:root {
|
||||
/* Colors */
|
||||
/*I know style guide says dark cyan, but come on its dark green) */
|
||||
--col-primary-dark-green: hsl(158, 36%, 37%);
|
||||
--col-primary-darker-green: #1a4032;
|
||||
--col-primary-cream: hsl(30, 38%, 92%);
|
||||
|
||||
--col-neutral-very-dark-blue: hsl(212, 21%, 14%);
|
||||
--col-neutral-dark-grayish-blue: hsl(228, 12%, 48%);
|
||||
--col-neutral-white: hsl(0, 0%, 100%);
|
||||
|
||||
--col-page-background: var(--col-primary-cream);
|
||||
--col-card-background: var(--col-neutral-white);
|
||||
--col-button-text: var(--col-neutral-white);
|
||||
--col-button-background: var(--col-primary-dark-green);
|
||||
--col-button-background-hover: var(--col-primary-darker-green);
|
||||
--col-product-name: var(--col-neutral-very-dark-blue);
|
||||
--col-product-description: var(--col-neutral-dark-grayish-blue);
|
||||
--col-category-name: var(--col-neutral-dark-grayish-blue);
|
||||
--col-price-current: var(--col-primary-dark-green);
|
||||
--col-price-old: var(--col-neutral-dark-grayish-blue);
|
||||
|
||||
/* Typography */
|
||||
--ff-category: "Montserrat", sans-serif;
|
||||
--ff-product-name: "Fraunces", serif;
|
||||
--ff-product-description: "Montserrat", sans-serif;
|
||||
--ff-price-current: "Fraunces", serif;
|
||||
--ff-price-old: "Montserrat", sans-serif;
|
||||
--ff-button: "Montserrat", sans-serif;
|
||||
|
||||
--fs-category-name: 0.75rem;
|
||||
--lh-category-name: 0.9375rem;
|
||||
--ls-category-name: 5px;
|
||||
--fw-category-name: 500;
|
||||
|
||||
--fs-product-name: 2rem;
|
||||
--lh-product-name: 2rem;
|
||||
--fw-product-name: 700;
|
||||
|
||||
--fs-product-description: 0.875rem;
|
||||
--lh-product-description: 1.4375rem;
|
||||
--fw-product-description: 500;
|
||||
|
||||
--fs-price-current: 2rem;
|
||||
--lh-price-current: 2rem;
|
||||
--fw-price-current: 700;
|
||||
|
||||
--fs-price-old: 0.8125rem;
|
||||
--lh-price-old: 1.4375rem;
|
||||
--fw-price-old: 500;
|
||||
|
||||
--fs-button: 0.875rem;
|
||||
--lh-button: 1.0625rem;
|
||||
--fw-button: 700;
|
||||
|
||||
/* Styling */
|
||||
--border-radius-card: 0.625rem;
|
||||
--border-radius-button: 0.5rem;
|
||||
/* Positioning */
|
||||
--padding-product-details: 1.5rem;
|
||||
|
||||
--width-product-card: 21.4375rem; /* 343px mobile */
|
||||
|
||||
--margin-bottom-product-card__details: 1.5rem;
|
||||
--margin-bottom-product-card__category: 0.75rem;
|
||||
--margin-bottom-product-card__name: 1rem;
|
||||
--margin-bottom-product-card__description: 1.5rem;
|
||||
--margin-bottom-product-card__price-block: 1.25rem;
|
||||
|
||||
/* Other */
|
||||
--img-desktop: url(images/image-product-desktop.jpg);
|
||||
--img-mobile: url(images/image-product-mobile.jpg);
|
||||
--image-filter: none;
|
||||
}
|
||||
|
||||
body {
|
||||
min-height: 100vh;
|
||||
|
||||
display: grid;
|
||||
place-content: center;
|
||||
|
||||
background-color: var(--col-page-background);
|
||||
}
|
||||
|
||||
.product-card {
|
||||
border-radius: var(--border-radius-card);
|
||||
background-color: var(--col-card-background);
|
||||
|
||||
max-width: var(--width-product-card);
|
||||
}
|
||||
.product-card__image img {
|
||||
border-radius: var(--border-radius-card) var(--border-radius-card) 0 0;
|
||||
width: 100%;
|
||||
filter: var(--image-filter);
|
||||
/* filter: saturate(1.3); */
|
||||
}
|
||||
.product-card__details {
|
||||
padding: var(--padding-product-details);
|
||||
}
|
||||
.product-card__category {
|
||||
font-family: var(--ff-category);
|
||||
font-size: var(--fs-category-name);
|
||||
line-height: var(--lh-category-name);
|
||||
font-weight: var(--fw-category-name);
|
||||
letter-spacing: var(--ls-category-name);
|
||||
|
||||
text-transform: uppercase;
|
||||
|
||||
color: var(--col-category-name);
|
||||
|
||||
margin-bottom: var(--margin-bottom-product-card__category);
|
||||
}
|
||||
.product-card__name {
|
||||
font-family: var(--ff-product-name);
|
||||
font-size: var(--fs-product-name);
|
||||
line-height: var(--lh-product-name);
|
||||
font-weight: var(--fw-product-name);
|
||||
|
||||
color: var(--col-product-name);
|
||||
|
||||
margin-bottom: var(--margin-bottom-product-card__name);
|
||||
}
|
||||
.product-card__description {
|
||||
font-family: var(--ff-product-description);
|
||||
font-size: var(--fs-product-description);
|
||||
line-height: var(--lh-product-description);
|
||||
font-weight: var(--fw-product-description);
|
||||
|
||||
color: var(--col-product-description);
|
||||
|
||||
margin-bottom: var(--margin-bottom-product-card__description);
|
||||
}
|
||||
.product-card__price-block {
|
||||
display: flex;
|
||||
gap: 1.1875rem;
|
||||
align-items: center;
|
||||
|
||||
margin-bottom: var(--margin-bottom-product-card__price-block);
|
||||
}
|
||||
.product-card__price-current {
|
||||
font-family: var(--ff-price-current);
|
||||
font-size: var(--fs-price-current);
|
||||
line-height: var(--lh-price-current);
|
||||
font-weight: var(--fw-price-current);
|
||||
|
||||
color: var(--col-price-current);
|
||||
}
|
||||
.product-card__price-old {
|
||||
font-family: var(--ff-price-old);
|
||||
font-size: var(--fs-price-old);
|
||||
line-height: var(--lh-price-old);
|
||||
font-weight: var(--fw-price-old);
|
||||
|
||||
text-decoration: line-through;
|
||||
|
||||
color: var(--col-price-old);
|
||||
}
|
||||
.product-card__button-buy {
|
||||
font-family: var(--ff-button);
|
||||
font-size: var(--fs-button);
|
||||
line-height: var(--lh-button);
|
||||
font-weight: var(--fw-button);
|
||||
|
||||
color: var(--col-button-text);
|
||||
background-color: var(--col-button-background);
|
||||
|
||||
border-radius: var(--border-radius-button);
|
||||
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
gap: 0.75rem;
|
||||
|
||||
outline: none;
|
||||
border: none;
|
||||
padding: 0.9375rem 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.product-card__button-buy:has(:focus, :hover) {
|
||||
background-color: var(--col-button-background-hover);
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1000px) {
|
||||
:root {
|
||||
--padding-product-details: 2rem 2rem 1.875rem 2rem;
|
||||
--width-product-card: 37.5rem;
|
||||
|
||||
--margin-bottom-product-card__details: 0;
|
||||
--margin-bottom-product-card__category: 1.25rem;
|
||||
--margin-bottom-product-card__name: 1.5rem;
|
||||
--margin-bottom-product-card__description: 1.8125rem;
|
||||
--margin-bottom-product-card__description: 1.875rem;
|
||||
}
|
||||
|
||||
.product-card {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.product-card__image img {
|
||||
border-radius: var(--border-radius-card) 0 0 var(--border-radius-card);
|
||||
width: 18.75rem;
|
||||
margin-bottom: unset;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.product-card__button-buy {
|
||||
padding: 0.9375rem 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* For Light / Dark button */
|
||||
|
||||
/* Update styling for checkbox */
|
||||
html[data-theme="theme-dark"] {
|
||||
--col-light-yellow: rgb(201, 175, 103);
|
||||
--col-other-yellow: rgb(210, 169, 4);
|
||||
--col-page-background: var(--col-neutral-very-dark-blue);
|
||||
--col-card-background: rgb(97, 83, 83);
|
||||
--col-button-text: rgb(40, 4, 4);
|
||||
/* --col-button-background: rgb(48, 166, 48); */
|
||||
--col-button-background: rgb(48, 166, 48);
|
||||
|
||||
--col-button-background-hover: rgba(7, 225, 7, 0.828);
|
||||
--col-product-name: var(--col-other-yellow);
|
||||
--col-product-description: var(--col-light-yellow);
|
||||
--col-category-name: var(--col-light-yellow);
|
||||
--col-price-current: var(--col-other-yellow);
|
||||
--col-price-old: var(--col-light-yellow);
|
||||
--image-filter: saturate(1.6);
|
||||
}
|
||||
|
||||
.switch {
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
|
||||
z-index: 30;
|
||||
}
|
||||
|
||||
/* Hide default HTML checkbox */
|
||||
.switch input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: white;
|
||||
-webkit-transition: 0.4s;
|
||||
transition: 0.4s;
|
||||
}
|
||||
|
||||
.slider:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
height: 40px;
|
||||
width: 40px;
|
||||
left: 0px;
|
||||
bottom: 4px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto 0;
|
||||
-webkit-transition: 0.4s;
|
||||
transition: 0.4s;
|
||||
box-shadow: 0 0px 15px #2020203d;
|
||||
background-image: url("../images/bs-moon-stars-fill.svg");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
/* input:checked + .slider {
|
||||
background-color: #2196f3;
|
||||
}
|
||||
|
||||
input:focus + .slider {
|
||||
box-shadow: 0 0 1px #2196f3;
|
||||
} */
|
||||
|
||||
input:checked + .slider:before {
|
||||
color: green;
|
||||
background-image: url("../images/bs-sun-fill.svg");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
.slider.round {
|
||||
border-radius: 34px;
|
||||
}
|
||||
|
||||
.slider.round:before {
|
||||
border-radius: 50%;
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-moon-stars-fill" viewBox="0 0 16 16">
|
||||
<path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"/>
|
||||
<path d="M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
|
@ -0,0 +1,4 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-moon-stars" viewBox="0 0 16 16">
|
||||
<path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278zM4.858 1.311A7.269 7.269 0 0 0 1.025 7.71c0 4.02 3.279 7.276 7.319 7.276a7.316 7.316 0 0 0 5.205-2.162c-.337.042-.68.063-1.029.063-4.61 0-8.343-3.714-8.343-8.29 0-1.167.242-2.278.681-3.286z"/>
|
||||
<path d="M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-sun-fill" viewBox="0 0 16 16">
|
||||
<path d="M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 788 B |
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-sun" viewBox="0 0 16 16">
|
||||
<path d="M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 816 B |
|
@ -1 +1 @@
|
|||
<svg width="15" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M14.383 10.388a2.397 2.397 0 0 0-1.518-2.222l1.494-5.593a.8.8 0 0 0-.144-.695.8.8 0 0 0-.631-.28H2.637L2.373.591A.8.8 0 0 0 1.598 0H0v1.598h.983l1.982 7.4a.8.8 0 0 0 .799.59h8.222a.8.8 0 0 1 0 1.599H1.598a.8.8 0 1 0 0 1.598h.943a2.397 2.397 0 1 0 4.507 0h1.885a2.397 2.397 0 1 0 4.331-.376 2.397 2.397 0 0 0 1.12-2.021ZM11.26 7.99H4.395L3.068 3.196h9.477L11.26 7.991Zm-6.465 6.392a.8.8 0 1 1 0-1.598.8.8 0 0 1 0 1.598Zm6.393 0a.8.8 0 1 1 0-1.598.8.8 0 0 1 0 1.598Z" fill="#FFF"/></svg>
|
||||
<svg width="15" height="16" xmlns="http://www.w3.org/2000/svg" fill="currentColor" ><path d="M14.383 10.388a2.397 2.397 0 0 0-1.518-2.222l1.494-5.593a.8.8 0 0 0-.144-.695.8.8 0 0 0-.631-.28H2.637L2.373.591A.8.8 0 0 0 1.598 0H0v1.598h.983l1.982 7.4a.8.8 0 0 0 .799.59h8.222a.8.8 0 0 1 0 1.599H1.598a.8.8 0 1 0 0 1.598h.943a2.397 2.397 0 1 0 4.507 0h1.885a2.397 2.397 0 1 0 4.331-.376 2.397 2.397 0 0 0 1.12-2.021ZM11.26 7.99H4.395L3.068 3.196h9.477L11.26 7.991Zm-6.465 6.392a.8.8 0 1 1 0-1.598.8.8 0 0 1 0 1.598Zm6.393 0a.8.8 0 1 1 0-1.598.8.8 0 0 1 0 1.598Z" /></svg>
|
Before Width: | Height: | Size: 557 B After Width: | Height: | Size: 567 B |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M421.6 379.9c-.6641 0-1.35 .0625-2.049 .1953c-11.24 2.143-22.37 3.17-33.32 3.17c-94.81 0-174.1-77.14-174.1-175.5c0-63.19 33.79-121.3 88.73-152.6c8.467-4.812 6.339-17.66-3.279-19.44c-11.2-2.078-29.53-3.746-40.9-3.746C132.3 31.1 32 132.2 32 256c0 123.6 100.1 224 223.8 224c69.04 0 132.1-31.45 173.8-82.93C435.3 389.1 429.1 379.9 421.6 379.9zM255.8 432C158.9 432 80 353 80 256c0-76.32 48.77-141.4 116.7-165.8C175.2 125 163.2 165.6 163.2 207.8c0 99.44 65.13 183.9 154.9 212.8C298.5 428.1 277.4 432 255.8 432z"/></svg>
|
After Width: | Height: | Size: 795 B |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M505.2 324.8l-47.73-68.78l47.75-68.81c7.359-10.62 8.797-24.12 3.844-36.06c-4.969-11.94-15.52-20.44-28.22-22.72l-82.39-14.88l-14.89-82.41c-2.281-12.72-10.76-23.25-22.69-28.22c-11.97-4.936-25.42-3.498-36.12 3.844L256 54.49L187.2 6.709C176.5-.6016 163.1-2.039 151.1 2.896c-11.92 4.971-20.4 15.5-22.7 28.19l-14.89 82.44L31.15 128.4C18.42 130.7 7.854 139.2 2.9 151.2C-2.051 163.1-.5996 176.6 6.775 187.2l47.73 68.78l-47.75 68.81c-7.359 10.62-8.795 24.12-3.844 36.06c4.969 11.94 15.52 20.44 28.22 22.72l82.39 14.88l14.89 82.41c2.297 12.72 10.78 23.25 22.7 28.22c11.95 4.906 25.44 3.531 36.09-3.844L256 457.5l68.83 47.78C331.3 509.7 338.8 512 346.3 512c4.906 0 9.859-.9687 14.56-2.906c11.92-4.969 20.4-15.5 22.7-28.19l14.89-82.44l82.37-14.88c12.73-2.281 23.3-10.78 28.25-22.75C514.1 348.9 512.6 335.4 505.2 324.8zM456.8 339.2l-99.61 18l-18 99.63L256 399.1L172.8 456.8l-18-99.63l-99.61-18L112.9 255.1L55.23 172.8l99.61-18l18-99.63L256 112.9l83.15-57.75l18.02 99.66l99.61 18L399.1 255.1L456.8 339.2zM256 143.1c-61.85 0-111.1 50.14-111.1 111.1c0 61.85 50.15 111.1 111.1 111.1s111.1-50.14 111.1-111.1C367.1 194.1 317.8 143.1 256 143.1zM256 319.1c-35.28 0-63.99-28.71-63.99-63.99S220.7 192 256 192s63.99 28.71 63.99 63.1S291.3 319.1 256 319.1z"/></svg>
|
After Width: | Height: | Size: 1.5 KiB |
|
@ -1,36 +1,89 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- displays site properly based on user's device -->
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<!-- displays site properly based on user's device -->
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="./images/favicon-32x32.png">
|
||||
|
||||
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Fraunces:wght@700&family=Montserrat:wght@500;700&display=swap"
|
||||
rel="stylesheet">
|
||||
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
|
||||
<script src="js/script.js" defer></script>
|
||||
<title>Frontend Mentor | Product preview card component</title>
|
||||
|
||||
<!-- Feel free to remove these styles or customise in your own stylesheet 👍 -->
|
||||
<style>
|
||||
.attribution { font-size: 11px; text-align: center; }
|
||||
.attribution a { color: hsl(228, 45%, 44%); }
|
||||
.attribution {
|
||||
font-size: 11px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.attribution a {
|
||||
color: hsl(228, 45%, 44%);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<label id="switch" class="switch" aria-hidden="true">
|
||||
<input type="checkbox" id="theme-toggle" aria-label="Light / Dark mode switcher">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
|
||||
Preview
|
||||
<main>
|
||||
|
||||
Gabrielle Essence Eau De Parfum
|
||||
<section class="product-card">
|
||||
<picture class="product-card__image">
|
||||
<source srcset="images/image-product-desktop.jpg" media="(min-width: 1000px)" />
|
||||
<img src="images/image-product-mobile.jpg" aria-hidden="true" alt="" class="" />
|
||||
</picture>
|
||||
<div class="product-card__details">
|
||||
<p class="product-card__category">
|
||||
perfume
|
||||
</p>
|
||||
<!-- should probably be an h2, but to shut FEM validation up -->
|
||||
<h1 class="product-card__name">
|
||||
Gabrielle Essence Eau De Parfum
|
||||
</h1>
|
||||
<p class="product-card__description">
|
||||
A floral, solar and voluptuous interpretation composed by Olivier Polge,
|
||||
Perfumer-Creator for the House of CHANEL.
|
||||
</p>
|
||||
<div class="product-card__price-block">
|
||||
<div class="product-card__price-current">
|
||||
$149.99
|
||||
</div>
|
||||
<div class="product-card__price-old">
|
||||
$169.99
|
||||
</div>
|
||||
</div>
|
||||
|
||||
A floral, solar and voluptuous interpretation composed by Olivier Polge,
|
||||
Perfumer-Creator for the House of CHANEL.
|
||||
<button class="product-card__button-buy">
|
||||
<svg width="15" height="16" xmlns="http://www.w3.org/2000/svg" fill="currentColor">
|
||||
<path
|
||||
d="M14.383 10.388a2.397 2.397 0 0 0-1.518-2.222l1.494-5.593a.8.8 0 0 0-.144-.695.8.8 0 0 0-.631-.28H2.637L2.373.591A.8.8 0 0 0 1.598 0H0v1.598h.983l1.982 7.4a.8.8 0 0 0 .799.59h8.222a.8.8 0 0 1 0 1.599H1.598a.8.8 0 1 0 0 1.598h.943a2.397 2.397 0 1 0 4.507 0h1.885a2.397 2.397 0 1 0 4.331-.376 2.397 2.397 0 0 0 1.12-2.021ZM11.26 7.99H4.395L3.068 3.196h9.477L11.26 7.991Zm-6.465 6.392a.8.8 0 1 1 0-1.598.8.8 0 0 1 0 1.598Zm6.393 0a.8.8 0 1 1 0-1.598.8.8 0 0 1 0 1.598Z" />
|
||||
</svg>
|
||||
<p>
|
||||
Add to Cart
|
||||
</p>
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
$149.99
|
||||
$169.99
|
||||
<!-- <footer>
|
||||
|
||||
Add to Cart
|
||||
|
||||
<div class="attribution">
|
||||
Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>.
|
||||
Coded by <a href="#">Your Name Here</a>.
|
||||
</div>
|
||||
<div class="attribution">
|
||||
Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>.
|
||||
Coded by <a href="#">Your Name Here</a>.
|
||||
</div>
|
||||
</footer> -->
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
const toggle = document.getElementById("theme-toggle");
|
||||
toggle.addEventListener("click", toggleTheme);
|
||||
|
||||
// function to set a given theme/color-scheme
|
||||
function setTheme(themeName) {
|
||||
localStorage.setItem("theme", themeName);
|
||||
document.documentElement.setAttribute("data-theme", themeName);
|
||||
}
|
||||
|
||||
// function to toggle between light and dark theme
|
||||
function toggleTheme() {
|
||||
if (localStorage.getItem("theme") === "theme-dark") {
|
||||
setTheme("theme-light");
|
||||
} else {
|
||||
setTheme("theme-dark");
|
||||
}
|
||||
}
|
||||
|
||||
// Immediately invoked function to set the theme on initial load
|
||||
(function () {
|
||||
if (localStorage.getItem("theme") === "theme-dark") {
|
||||
setTheme("theme-dark");
|
||||
document.getElementById("theme-toggle").checked = false;
|
||||
} else {
|
||||
setTheme("theme-light");
|
||||
document.getElementById("theme-toggle").checked = true;
|
||||
}
|
||||
})();
|
After Width: | Height: | Size: 625 KiB |
After Width: | Height: | Size: 599 KiB |
After Width: | Height: | Size: 350 KiB |
After Width: | Height: | Size: 340 KiB |
|
@ -0,0 +1,75 @@
|
|||
<!-- Please update value in the {} -->
|
||||
|
||||
<h1 align="center">{Your project name}</h1>
|
||||
|
||||
<div align="center">
|
||||
Solution for a challenge from <a href="http://devchallenges.io" target="_blank">Devchallenges.io</a>.
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
<h3>
|
||||
<a href="https://{your-demo-link.your-domain}">
|
||||
Demo
|
||||
</a>
|
||||
<span> | </span>
|
||||
<a href="https://{your-url-to-the-solution}">
|
||||
Solution
|
||||
</a>
|
||||
<span> | </span>
|
||||
<a href="https://devchallenges.io/challenges/hhmesazsqgKXrTkYkt0U">
|
||||
Challenge
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<!-- TABLE OF CONTENTS -->
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Built With](#built-with)
|
||||
- [Features](#features)
|
||||
- [Contact](#contact)
|
||||
- [Acknowledgements](#acknowledgements)
|
||||
|
||||
<!-- OVERVIEW -->
|
||||
|
||||
## Overview
|
||||
|
||||
![screenshot](https://user-images.githubusercontent.com/16707738/92399059-5716eb00-f132-11ea-8b14-bcacdc8ec97b.png)
|
||||
|
||||
Introduce your projects by taking a screenshot or a gif. Try to tell visitors a story about your project by answering:
|
||||
|
||||
- Where can I see your demo?
|
||||
- What was your experience?
|
||||
- What have you learned/improved?
|
||||
- Your wisdom? :)
|
||||
|
||||
### Built With
|
||||
|
||||
<!-- This section should list any major frameworks that you built your project using. Here are a few examples.-->
|
||||
|
||||
- [React](https://reactjs.org/)
|
||||
- [Vue.js](https://vuejs.org/)
|
||||
- [Tailwind](https://tailwindcss.com/)
|
||||
|
||||
## Features
|
||||
|
||||
<!-- List the features of your application or follow the template. Don't share the figma file here :) -->
|
||||
|
||||
This application/site was created as a submission to a [DevChallenges](https://devchallenges.io/challenges) challenge. The [challenge](https://devchallenges.io/challenges/hhmesazsqgKXrTkYkt0U) was to build an application to complete the given user stories.
|
||||
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
<!-- This section should list any articles or add-ons/plugins that helps you to complete the project. This is optional but it will help you in the future. For exmpale -->
|
||||
|
||||
- [Steps to replicate a design with only HTML and CSS](https://devchallenges-blogs.web.app/how-to-replicate-design/)
|
||||
- [Node.js](https://nodejs.org/)
|
||||
- [Marked - a markdown parser](https://github.com/chjj/marked)
|
||||
|
||||
## Contact
|
||||
|
||||
- Website [your-website.com](https://{your-web-site-link})
|
||||
- GitHub [@your-username](https://{github.com/your-usermame})
|
||||
- Twitter [@your-twitter](https://{twitter.com/your-username})
|
After Width: | Height: | Size: 1.6 KiB |
|
@ -0,0 +1,95 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1,
|
||||
maximum-scale=5"
|
||||
/>
|
||||
|
||||
<link rel="icon" href="devchallenges.png" />
|
||||
|
||||
<link
|
||||
rel="shortcut icon"
|
||||
type="image/x-icon"
|
||||
href="https://devchallenges.io/"
|
||||
/>
|
||||
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
|
||||
<title>Devchallenges</title>
|
||||
|
||||
<style>
|
||||
body {
|
||||
font-family: "Poppins", sans-serif;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-left: 24px;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.welcome {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.welcome-text {
|
||||
margin-top: 30vh;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.welcome-text p {
|
||||
font-size: 1rem;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.welcome-text h1 {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.welcome-text a {
|
||||
color: #f7542e;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="welcome">
|
||||
<div class="welcome-text">
|
||||
<h1>
|
||||
Welcome to
|
||||
<a href="https://devchallenges.io/" target="_blank"
|
||||
>devchallenges.io</a
|
||||
>
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
If you have any questions, don't hesitate to ask on Discord. Here are
|
||||
7 general steps to complete the challenge:
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><b>Step 1:</b> Create a new repository on github</li>
|
||||
<li><b>Step 2:</b> Copy resources, README.md to your repository</li>
|
||||
<li>
|
||||
<b>Step 3:</b> Login to Figma to checkout font, color, spacing,..
|
||||
</li>
|
||||
<li><b>Step 4:</b> Complete all user stories</li>
|
||||
<li><b>Step 5:</b> Update README.md</li>
|
||||
<li><b>Step 6:</b> Deploy your app and submit your solution</li>
|
||||
<li>
|
||||
<b>Step 7:</b> Share your solution on Discord, Twitter and other
|
||||
platforms to ask for feedback
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
After Width: | Height: | Size: 390 KiB |
After Width: | Height: | Size: 307 KiB |
After Width: | Height: | Size: 366 KiB |
After Width: | Height: | Size: 398 KiB |
After Width: | Height: | Size: 534 KiB |
After Width: | Height: | Size: 456 KiB |
|
@ -29,6 +29,18 @@
|
|||
"title": "Newbie",
|
||||
"cssClass": "frontEndMentorChallenges",
|
||||
"challenges": [
|
||||
{
|
||||
"title": "Product Preview Card Component",
|
||||
"url": "/FrontendMentor/newbie/product-preview-card-component/",
|
||||
"description": "",
|
||||
"techUsed": [
|
||||
"html5",
|
||||
"css3",
|
||||
"js"
|
||||
],
|
||||
"screenshotURL": "/FrontendMentor/newbie/product-preview-card-component/screenshots/desktop.png",
|
||||
"screenshotAltText": "Product Preview Card Component Challenge from FrontendMentor"
|
||||
},
|
||||
{
|
||||
"title": "QR Code Component",
|
||||
"url": "/FrontendMentor/newbie/qr-code-component/",
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-moon-stars-fill" viewBox="0 0 16 16">
|
||||
<path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"/>
|
||||
<path d="M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.0 KiB |
|
@ -0,0 +1,4 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-moon-stars" viewBox="0 0 16 16">
|
||||
<path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278zM4.858 1.311A7.269 7.269 0 0 0 1.025 7.71c0 4.02 3.279 7.276 7.319 7.276a7.316 7.316 0 0 0 5.205-2.162c-.337.042-.68.063-1.029.063-4.61 0-8.343-3.714-8.343-8.29 0-1.167.242-2.278.681-3.286z"/>
|
||||
<path d="M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-sun-fill" viewBox="0 0 16 16">
|
||||
<path d="M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 788 B |
|
@ -0,0 +1,3 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-sun" viewBox="0 0 16 16">
|
||||
<path d="M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 816 B |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M223.5 32C100 32 0 132.3 0 256S100 480 223.5 480c60.6 0 115.5-24.2 155.8-63.4c5-4.9 6.3-12.5 3.1-18.7s-10.1-9.7-17-8.5c-9.8 1.7-19.8 2.6-30.1 2.6c-96.9 0-175.5-78.8-175.5-176c0-65.8 36-123.1 89.3-153.3c6.1-3.5 9.2-10.5 7.7-17.3s-7.3-11.9-14.3-12.5c-6.3-.5-12.6-.8-19-.8z"/></svg>
|
After Width: | Height: | Size: 561 B |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M421.6 379.9c-.6641 0-1.35 .0625-2.049 .1953c-11.24 2.143-22.37 3.17-33.32 3.17c-94.81 0-174.1-77.14-174.1-175.5c0-63.19 33.79-121.3 88.73-152.6c8.467-4.812 6.339-17.66-3.279-19.44c-11.2-2.078-29.53-3.746-40.9-3.746C132.3 31.1 32 132.2 32 256c0 123.6 100.1 224 223.8 224c69.04 0 132.1-31.45 173.8-82.93C435.3 389.1 429.1 379.9 421.6 379.9zM255.8 432C158.9 432 80 353 80 256c0-76.32 48.77-141.4 116.7-165.8C175.2 125 163.2 165.6 163.2 207.8c0 99.44 65.13 183.9 154.9 212.8C298.5 428.1 277.4 432 255.8 432z"/></svg>
|
After Width: | Height: | Size: 795 B |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M361.5 1.2c5 2.1 8.6 6.6 9.6 11.9L391 121l107.9 19.8c5.3 1 9.8 4.6 11.9 9.6s1.5 10.7-1.6 15.2L446.9 256l62.3 90.3c3.1 4.5 3.7 10.2 1.6 15.2s-6.6 8.6-11.9 9.6L391 391 371.1 498.9c-1 5.3-4.6 9.8-9.6 11.9s-10.7 1.5-15.2-1.6L256 446.9l-90.3 62.3c-4.5 3.1-10.2 3.7-15.2 1.6s-8.6-6.6-9.6-11.9L121 391 13.1 371.1c-5.3-1-9.8-4.6-11.9-9.6s-1.5-10.7 1.6-15.2L65.1 256 2.8 165.7c-3.1-4.5-3.7-10.2-1.6-15.2s6.6-8.6 11.9-9.6L121 121 140.9 13.1c1-5.3 4.6-9.8 9.6-11.9s10.7-1.5 15.2 1.6L256 65.1 346.3 2.8c4.5-3.1 10.2-3.7 15.2-1.6zM352 256c0 53-43 96-96 96s-96-43-96-96s43-96 96-96s96 43 96 96zm32 0c0-70.7-57.3-128-128-128s-128 57.3-128 128s57.3 128 128 128s128-57.3 128-128z"/></svg>
|
After Width: | Height: | Size: 953 B |
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M505.2 324.8l-47.73-68.78l47.75-68.81c7.359-10.62 8.797-24.12 3.844-36.06c-4.969-11.94-15.52-20.44-28.22-22.72l-82.39-14.88l-14.89-82.41c-2.281-12.72-10.76-23.25-22.69-28.22c-11.97-4.936-25.42-3.498-36.12 3.844L256 54.49L187.2 6.709C176.5-.6016 163.1-2.039 151.1 2.896c-11.92 4.971-20.4 15.5-22.7 28.19l-14.89 82.44L31.15 128.4C18.42 130.7 7.854 139.2 2.9 151.2C-2.051 163.1-.5996 176.6 6.775 187.2l47.73 68.78l-47.75 68.81c-7.359 10.62-8.795 24.12-3.844 36.06c4.969 11.94 15.52 20.44 28.22 22.72l82.39 14.88l14.89 82.41c2.297 12.72 10.78 23.25 22.7 28.22c11.95 4.906 25.44 3.531 36.09-3.844L256 457.5l68.83 47.78C331.3 509.7 338.8 512 346.3 512c4.906 0 9.859-.9687 14.56-2.906c11.92-4.969 20.4-15.5 22.7-28.19l14.89-82.44l82.37-14.88c12.73-2.281 23.3-10.78 28.25-22.75C514.1 348.9 512.6 335.4 505.2 324.8zM456.8 339.2l-99.61 18l-18 99.63L256 399.1L172.8 456.8l-18-99.63l-99.61-18L112.9 255.1L55.23 172.8l99.61-18l18-99.63L256 112.9l83.15-57.75l18.02 99.66l99.61 18L399.1 255.1L456.8 339.2zM256 143.1c-61.85 0-111.1 50.14-111.1 111.1c0 61.85 50.15 111.1 111.1 111.1s111.1-50.14 111.1-111.1C367.1 194.1 317.8 143.1 256 143.1zM256 319.1c-35.28 0-63.99-28.71-63.99-63.99S220.7 192 256 192s63.99 28.71 63.99 63.1S291.3 319.1 256 319.1z"/></svg>
|
After Width: | Height: | Size: 1.5 KiB |