Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cbdda95

Browse files
stats-preview-component static
1 parent bbff433 commit cbdda95

File tree

14 files changed

+480
-0
lines changed

14 files changed

+480
-0
lines changed
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Lexend+Deca&display=swap");
2+
3+
/* ### Primary
4+
5+
- Very dark blue (main background): hsl(233, 47%, 7%)
6+
- Dark desaturated blue (card background): hsl(244, 38%, 16%)
7+
- Soft violet (accent): hsl(277, 64%, 61%)
8+
9+
### Neutral
10+
11+
- White (main heading, stats): hsl(0, 0%, 100%)
12+
- Slightly transparent white (main paragraph): hsla(0, 0%, 100%, 0.75)
13+
- Slightly transparent white (stat headings): hsla(0, 0%, 100%, 0.6) */
14+
15+
.stats-preview-main {
16+
min-height: 100vh;
17+
display: grid;
18+
place-items: center;
19+
font-size: 15px;
20+
font-family: "Lexend Deca", sans-serif;
21+
font-family: "Inter", sans-serif;
22+
background: hsl(233, 47%, 7%);
23+
padding: 20px;
24+
}
25+
/* CARD */
26+
.stats-preview-card {
27+
display: flex;
28+
background-color: hsl(244, 38%, 16%);
29+
border-radius: 8px;
30+
overflow: hidden;
31+
max-width: 1110px;
32+
}
33+
34+
/* LEFT */
35+
36+
.stats-preview-left {
37+
padding: 71px 71.501px 59px 71px;
38+
}
39+
.stats-preview-left > h2 {
40+
color: hsl(0, 0%, 100%);
41+
font-size: 36px;
42+
line-height: 43.92px;
43+
font-weight: 700;
44+
}
45+
.stats-preview-left > h2 > span {
46+
color: hsl(277, 64%, 61%);
47+
}
48+
.stats-preview-left > p {
49+
color: hsla(0, 0%, 100%, 0.75);
50+
font-size: 1em;
51+
line-height: 25.05px;
52+
max-width: 375px;
53+
margin-top: 25px;
54+
}
55+
56+
/* STATS LIST */
57+
58+
.stats-preview-stats {
59+
display: flex;
60+
margin-top: 70px;
61+
line-height: 32px;
62+
gap: 60px;
63+
justify-content: flex-start;
64+
font-size: 24px;
65+
}
66+
67+
.stats-preview-stat {
68+
}
69+
70+
.stats-preview-stat:first-of-type {
71+
margin-right: 5px;
72+
}
73+
.stats-preview-stat > span {
74+
color: hsl(0, 0%, 100%);
75+
font-size: 24px;
76+
font-weight: 700;
77+
line-height: 16px;
78+
}
79+
.stats-preview-stat > p {
80+
color: hsla(0, 0%, 100%, 0.6);
81+
font-family: "Lexend Deca", sans-serif;
82+
text-transform: uppercase;
83+
font-size: 12px;
84+
line-height: 16px;
85+
letter-spacing: 0.96px;
86+
margin-top: 6px;
87+
}
88+
89+
/* RIGHT */
90+
91+
.stats-preview-right {
92+
max-width: 539.7px;
93+
max-height: 445.75px;
94+
width: 100%;
95+
background-color: hsl(277, 64%, 61%);
96+
}
97+
.stats-preview-right > img {
98+
width: 100%;
99+
height: 100%;
100+
object-fit: cover;
101+
mix-blend-mode: multiply;
102+
opacity: 0.75;
103+
display: block;
104+
}
105+
106+
/* TABLET / MOBILE */
107+
108+
@media only screen and (max-width: 11000px) {
109+
.stats-preview-right {
110+
max-height: unset;
111+
}
112+
}
113+
114+
@media only screen and (max-width: 800px) {
115+
.stats-preview-card {
116+
flex-direction: column-reverse;
117+
overflow: hidden;
118+
}
119+
.stats-preview-right {
120+
overflow: hidden;
121+
max-width: unset;
122+
max-height: 500px;
123+
}
124+
125+
.stats-preview-left {
126+
text-align: center;
127+
}
128+
129+
.stats-preview-stats {
130+
display: flex;
131+
flex-direction: column-reverse;
132+
justify-content: center;
133+
align-items: center;
134+
}
135+
136+
.stats-preview-stat:not(:first-child) {
137+
margin-bottom: 30px;
138+
}
139+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import React, {useState} from 'react'
2+
// import {AnimatePresence, motion} from 'framer-motion'
3+
import './StatsPreview.css'
4+
import img from './assets/stats-preview-card-component-main/images/image-header-desktop.jpg'
5+
// import bgbg from './assets/stats-preview-card-component-main/images/bgbg.jpg'
6+
7+
8+
9+
const StatsPreview = () => {
10+
11+
const statsData = [
12+
{
13+
title: 'companies',
14+
stat: '10k+'
15+
},
16+
{
17+
title: 'templates',
18+
stat: '314'
19+
},
20+
{
21+
title: 'queries',
22+
stat: '12M+'
23+
},
24+
]
25+
26+
return (
27+
<main className='stats-preview-main'>
28+
<h1 class="sr-only">Stats preview card component</h1>
29+
<article className='stats-preview-card'>
30+
<div className="stats-preview-left">
31+
<h2>Get <span> insights</span> that help your business grow.</h2>
32+
<p> Discover the benefits of data analytics and make better decisions regarding revenue, customer
33+
experience, and overall efficiency.
34+
</p>
35+
<ul role='list' className='stats-preview-stats'>
36+
{statsData.map((statItem)=> {
37+
return (
38+
<li role='listitem' className='stats-preview-stat' key={statItem.title}>
39+
<span>{statItem.stat}</span>
40+
<p>{statItem.title}</p>
41+
</li>
42+
)
43+
})}
44+
</ul>
45+
</div>
46+
<div className="stats-preview-right">
47+
<img src={img} alt="An Abstract Photo" />
48+
</div>
49+
</article>
50+
</main>
51+
)
52+
53+
}
54+
55+
export default StatsPreview
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Avoid accidental upload of the Sketch and Figma design files
2+
#####################################################
3+
## Please do not remove lines 5 and 6 - thanks! πŸ™‚ ##
4+
#####################################################
5+
*.sketch
6+
*.fig
7+
8+
# Avoid accidental XD upload if you convert the design file
9+
###############################################
10+
## Please do not remove line 12 - thanks! πŸ™‚ ##
11+
###############################################
12+
*.xd
13+
14+
# Avoid your project being littered with annoying .DS_Store files!
15+
.DS_Store
16+
.prettierignore
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Frontend Mentor - Stats preview card component solution
2+
3+
This is a solution to the [Stats preview card component challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/stats-preview-card-component-8JqbgoU62). Frontend Mentor challenges help you improve your coding skills by building realistic projects.
4+
5+
## Table of contents
6+
7+
- [Overview](#overview)
8+
- [The challenge](#the-challenge)
9+
- [Screenshot](#screenshot)
10+
- [Links](#links)
11+
- [My process](#my-process)
12+
- [Built with](#built-with)
13+
- [What I learned](#what-i-learned)
14+
- [Continued development](#continued-development)
15+
- [Useful resources](#useful-resources)
16+
- [Author](#author)
17+
- [Acknowledgments](#acknowledgments)
18+
19+
**Note: Delete this note and update the table of contents based on what sections you keep.**
20+
21+
## Overview
22+
23+
### The challenge
24+
25+
Users should be able to:
26+
27+
- View the optimal layout depending on their device's screen size
28+
29+
### Screenshot
30+
31+
![](./screenshot.jpg)
32+
33+
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.
34+
35+
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.
36+
37+
Then crop/optimize/edit your image however you like, add it to your project, and update the file path in the image above.
38+
39+
**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.**
40+
41+
### Links
42+
43+
- Solution URL: [Add solution URL here](https://your-solution-url.com)
44+
- Live Site URL: [Add live site URL here](https://your-live-site-url.com)
45+
46+
## My process
47+
48+
### Built with
49+
50+
- Semantic HTML5 markup
51+
- CSS custom properties
52+
- Flexbox
53+
- CSS Grid
54+
- Mobile-first workflow
55+
- [React](https://reactjs.org/) - JS library
56+
- [Next.js](https://nextjs.org/) - React framework
57+
- [Styled Components](https://styled-components.com/) - For styles
58+
59+
**Note: These are just examples. Delete this note and replace the list above with your own choices**
60+
61+
### What I learned
62+
63+
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.
64+
65+
To see how you can add code snippets, see below:
66+
67+
```html
68+
<h1>Some HTML code I'm proud of</h1>
69+
```
70+
```css
71+
.proud-of-this-css {
72+
color: papayawhip;
73+
}
74+
```
75+
```js
76+
const proudOfThisFunc = () => {
77+
console.log('πŸŽ‰')
78+
}
79+
```
80+
81+
If you want more help with writing markdown, we'd recommend checking out [The Markdown Guide](https://www.markdownguide.org/) to learn more.
82+
83+
**Note: Delete this note and the content within this section and replace with your own learnings.**
84+
85+
### Continued development
86+
87+
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.
88+
89+
**Note: Delete this note and the content within this section and replace with your own plans for continued development.**
90+
91+
### Useful resources
92+
93+
- [Example resource 1](https://www.example.com) - This helped me for XYZ reason. I really liked this pattern and will use it going forward.
94+
- [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.
95+
96+
**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.**
97+
98+
## Author
99+
100+
- Website - [Add your name here](https://www.your-site.com)
101+
- Frontend Mentor - [@yourusername](https://www.frontendmentor.io/profile/yourusername)
102+
- Twitter - [@yourusername](https://www.twitter.com/yourusername)
103+
104+
**Note: Delete this note and add/remove/edit lines above based on what links you'd like to share.**
105+
106+
## Acknowledgments
107+
108+
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.
109+
110+
**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.**

0 commit comments

Comments
(0)

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /