forked from Ayushparikh-code/Web-dev-mini-projects
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Ayushparikh-code#383 from Ahsan-Ehtesham/ahsan
Pricing Component added
- Loading branch information
Showing
18 changed files
with
708 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Avoid accidental upload of the Sketch and Figma design files | ||
##################################################### | ||
## Please do not remove lines 5 and 6 - thanks! 🙂 ## | ||
##################################################### | ||
*.sketch | ||
*.fig | ||
|
||
# Avoid accidental XD upload if you convert the design file | ||
############################################### | ||
## Please do not remove line 12 - thanks! 🙂 ## | ||
############################################### | ||
*.xd | ||
|
||
# Avoid your project being littered with annoying .DS_Store files! | ||
.DS_Store | ||
.prettierignore |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Frontend Mentor - Interactive pricing component | ||
|
||
![Design preview for the Interactive pricing component coding challenge](./design/desktop-preview.jpg) | ||
|
||
Made with 💙 by Ahsan Ehtesham | ||
|
||
To support me: | ||
|
||
[Github](https://github.com/Ahsan-Ehtesham/) | ||
|
||
[Linkedin](https://www.linkedin.com/in/ahsan-ehtesham-a6810018b/) | ||
|
||
## Welcome! 👋 | ||
|
||
Thanks for checking out this front-end coding challenge. | ||
|
||
[Frontend Mentor](https://www.frontendmentor.io) challenges allow you to improve your skills in a real-life workflow. | ||
|
||
**To do this challenge, you need a basic understanding of HTML, CSS and JavaScript.** | ||
|
||
## The challenge | ||
|
||
Your challenge is to build out this interactive pricing 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 for the app depending on their device's screen size | ||
- See hover states for all interactive elements on the page | ||
- Use the slider and toggle to see prices for different page view numbers (details provided below) | ||
|
||
Want some support on the challenge? [Join our Slack community](https://www.frontendmentor.io/slack) and ask questions in the **#help** channel. | ||
|
||
### Page view and pricing totals | ||
|
||
Here are the different page view ranges and the corresponding monthly price totals: | ||
|
||
- 10K pageviews / $8 per month | ||
- 50K pageviews / $12 per month | ||
- 100K pageviews / $16 per month | ||
- 500k pageviews / $24 per month | ||
- 1M pageviews / $36 per month | ||
|
||
If the visitor switches the toggle to yearly billing, a 25% discount should be applied to all prices. | ||
|
||
## 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 to work to. | ||
|
||
The designs are in JPG static format. This will mean that you'll need to use your best judgment for styles such as `font-size`, `padding` and `margin`. This should help train your eye to perceive differences in spacings and sizes. | ||
|
||
If you would like the design files (we provide Sketch & Figma versions) in order 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, which contains 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/). This will make it easier to share your code with the community if you need some 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 URL. 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, but we recommend using [Vercel](https://bit.ly/fem-vercel). We've got more information about deploying your project with Vercel 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 that you could create to make 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 a number of ways to host your project for free. We recommend using [Vercel](https://bit.ly/fem-vercel) as it's an amazing service and extremely simple to get set up with. If you'd like to use Vercel, here are some steps to follow to get started: | ||
|
||
1. [Sign up to Vercel](https://bit.ly/fem-vercel-signup) and go through the onboarding flow, ensuring your GitHub account is connected by using their [Vercel for GitHub](https://vercel.com/docs/v2/git-integrations/vercel-for-github) integration. | ||
2. Connect your project to Vercel from the ["Import project" page](https://vercel.com/import), using the "From Git Repository" button and selecting the project you want to deploy. | ||
3. Once connected, every time you `git push`, Vercel will create a new [deployment](https://vercel.com/docs/v2/platform/deployments) and the deployment URL will be shown on your [Dashboard](https://vercel.com/dashboard). You will also receive an email for each deployment with the URL. | ||
|
||
## Sharing your solution | ||
|
||
There are multiple places you can share your solution: | ||
|
||
1. Submit it on the platform so that other users will see your solution on the site. Here's our ["Complete guide to submitting solutions"](https://medium.com/frontend-mentor/a-complete-guide-to-submitting-solutions-on-frontend-mentor-ac6384162248) to help you do that. | ||
2. Share your solution page in the **#finished-projects** channel of the [Slack community](https://www.frontendmentor.io/slack). | ||
3. 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. | ||
|
||
## Giving feedback | ||
|
||
Feedback is always welcome, so if you have any to give on this challenge 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!** 🚀 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<!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 --> | ||
|
||
<link rel="icon" type="image/png" sizes="32x32" href="./images/AE-web-logo.png"> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" | ||
integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com"> | ||
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@600;800&display=swap" rel="stylesheet"> | ||
<link rel="stylesheet" href="https://unpkg.com/@coreui/coreui/dist/css/coreui.min.css"> | ||
<link href="style.css" rel="stylesheet"> | ||
|
||
<title>AE | Interactive pricing component</title> | ||
|
||
<!-- Feel free to remove these styles or customise in your own stylesheet 👍 --> | ||
<style> | ||
.attribution { | ||
font-size: 11px; | ||
text-align: center; | ||
position: fixed; | ||
left: 0; | ||
bottom: 0; | ||
right: 0; | ||
} | ||
|
||
.attribution a { | ||
color: hsl(228, 45%, 44%); | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
|
||
<div class="container head-container"> | ||
<h1 id="head">Simple, traffic-based pricing</h1> | ||
<p class="lead head-text">Sign-up for our 30-day trial. No credit card required.</p> | ||
</div> | ||
<div class="container"> | ||
<div class="card"> | ||
<div class="row mb-4"> | ||
<div class="col pageview text-uppercase"> | ||
<p class="font-weight-bold">100K Pageviews</p> | ||
</div> | ||
<div class="col month"> | ||
<p>$ <span id="op"></span> /month</p> | ||
</div> | ||
</div> | ||
<div class="rangecontainer mb-4"> | ||
<input type="range" min="1" max="100" value="1" class="range rounded-circle" id="myRange"> | ||
</div> | ||
<div class="switch-inline"> | ||
<span class="text-a mr-2">Monthly Billing</span> | ||
<label class="switch"> | ||
<input type="checkbox"> | ||
<span class="slider round"></span> | ||
</label> | ||
<span class="text-b ml-2">Yearly Billing <span class="discount ml-2">25% discount</span></span> | ||
</div> | ||
<div class="section mt-4"> | ||
<div class="row"> | ||
<div class="col sectiona"> | ||
<ul class="list-group"> | ||
<li class="list-group-item borderless"><span class="icon"></span> Unlimited websites</li> | ||
<li class="list-group-item borderless"><span class="icon"></span> 100% data ownership</li> | ||
<li class="list-group-item borderless"><span class="icon"></span> Email reports</li> | ||
</ul> | ||
</div> | ||
<div class="col sectionb"> | ||
<a class="btn" href="#" role="button">Start my trial</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- | ||
Unlimited websites | ||
100% data ownership | ||
Email reports | ||
Start my trial --> | ||
|
||
<div class="attribution"> | ||
Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>. | ||
Coded by <a href="#">Ahsan Ehtesham</a>. | ||
</div> | ||
</body> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" | ||
integrity="sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0" crossorigin="anonymous"></script> | ||
<script src="https://unpkg.com/@coreui/coreui/dist/js/coreui.min.js"></script> | ||
<script> | ||
var slider = document.getElementById("myRange"); | ||
var output = document.getElementById("op"); | ||
output.innerHTML = slider.value; // Display the default slider value | ||
|
||
// Update the current slider value (each time you drag the slider handle) | ||
slider.oninput = function () { | ||
output.innerHTML = this.value; | ||
} | ||
slider.addEventListener("mousemove", function () { | ||
var x = slider.value; | ||
var color = 'linear-gradient(90deg, hsl(174, 77%, 80%)' + x + '%, hsl(224, 65%, 95%)' + x + '%)'; | ||
slider.style.background = color; | ||
}) | ||
</script> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Front-end Style Guide | ||
|
||
## Layout | ||
|
||
The designs were created to the following widths: | ||
|
||
- Mobile: 375px | ||
- Desktop: 1440px | ||
|
||
## Colors | ||
|
||
### Primary | ||
|
||
- Soft Cyan (Full Slider Bar): hsl(174, 77%, 80%) | ||
- Strong Cyan (Slider Background): hsl(174, 86%, 45%) | ||
- Light Grayish Red (Discount Background): hsl(14, 92%, 95%) | ||
- Light Red (Discount Text): hsl(15, 100%, 70%) | ||
- Pale Blue (CTA Text): hsl(226, 100%, 87%) | ||
|
||
### Neutral | ||
|
||
- White (Pricing Component Background): hsl (0, 0%, 100%) | ||
- Very Pale Blue (Main Background): hsl(230, 100%, 99%) | ||
- Light Grayish Blue (Empty Slider Bar): hsl(224, 65%, 95%) | ||
- Light Grayish Blue (Toggle Background): hsl(223, 50%, 87%) | ||
- Grayish Blue (Text): hsl(225, 20%, 60%) | ||
- Dark Desaturated Blue (Text & CTA Background): hsl(227, 35%, 25%) | ||
|
||
## Typography | ||
|
||
### Body Copy | ||
|
||
- Font size (Introductory Paragraph): 15px | ||
|
||
### Font | ||
|
||
- Family: [Manrope](https://fonts.google.com/specimen/Manrope) | ||
- Weights: 600, 800 |
Oops, something went wrong.