Skip to content

Commit d045b10

Browse files
committed
progressbar + font + rapid media queries
1 parent c069b77 commit d045b10

File tree

8 files changed

+132
-21
lines changed

8 files changed

+132
-21
lines changed

public/fonts/ModernWarfare-8MM6z.ttf

14.1 KB
Binary file not shown.

src/App.jsx

+14-7
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,13 @@ function App() {
112112
return (
113113
<>
114114

115-
<h1>CAMO MW3</h1>
115+
<header className="header">
116+
<h1>CAMO MWIII</h1>
116117

117-
<div className="camo__list-container">
118+
<button onClick={resetAllProgress}>Reset all progress</button>
119+
</header>
120+
121+
<main className="camo__list-container">
118122
<div className="row__title">
119123
<h2 className="weapon">Weapon</h2>
120124
<h2 className="camos">Camos Multiplayer</h2>
@@ -137,12 +141,15 @@ function App() {
137141
</ul>
138142
</div>
139143
))}
140-
</div>
141-
142-
<ProgressBar progress={progress} />
143-
<ProgressBar progress={progressZombie} zombie={true} />
144+
<div className="copyright">
145+
<p>Created by <a href="https://github.com/FabKaiz">FabKaiz</a></p>
146+
</div>
147+
</main>
144148

145-
<button onClick={resetAllProgress}>Reset all progress</button>
149+
<div className="progress__bars-container">
150+
<ProgressBar progress={progress} />
151+
<ProgressBar progress={progressZombie} zombie={true} />
152+
</div>
146153
</>
147154
)
148155
}

src/components/progressBar/ProgressBar.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import "./ProgressBar.scss"
22

33
const ProgressBar = ({progress, zombie}) => {
44
return (
5-
<div className="progress-bar-container">
6-
<div className="progress-bar" style={{width: `${progress}%`}}>
5+
<div className="progress__bar-container">
6+
<div className={zombie ? "progress-bar zombie" : "progress-bar"} style={{width: `${progress}%`}}>
77
<span>{zombie ? "Progress zombie" : "Progress"}: {progress.toFixed(2)}%</span>
88
</div>
99
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@import "../../styles/global/helpers.scss";
2+
3+
.progress__bar-container {
4+
position: relative;
5+
background: #212121;
6+
7+
.progress-bar {
8+
background-image: $gradient-multiplayer;
9+
padding: 1.5rem 0;
10+
transition: width 1s ease;
11+
12+
&.zombie {
13+
background-image: $gradient-zombie;
14+
}
15+
}
16+
17+
span {
18+
white-space: nowrap;
19+
text-shadow: #212121 1px 1px 4px;
20+
21+
position: absolute;
22+
top: 50%;
23+
left: 50%;
24+
transform: translate(-50%, -50%);
25+
}
26+
}

src/components/weaponItem/WeaponItem.scss

+11-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66

77
border-radius: 0.4rem;
88
margin-bottom: 1rem;
9-
overflow: hidden;
9+
//overflow-x: scroll;
10+
@include media-up(md) {
11+
overflow: hidden;
12+
}
1013

1114
h3 {
1215
background: $dark-grey;
@@ -88,9 +91,14 @@
8891
&:hover {
8992
&:after {
9093
opacity: 1;
94+
}
95+
}
9196

92-
// Remove
93-
//background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="%23ee5253"><path d="M13.41,12l4.3-4.29a1,1,0,1,0-1.42-1.42L12,10.59,7.71,6.29A1,1,0,0,0,6.29,7.71L10.59,12l-4.3,4.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L12,13.41l4.29,4.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Z"></path></svg>');
97+
&.active {
98+
&:hover {
99+
&:after {
100+
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="%23ee5253"><path d="M13.41,12l4.3-4.29a1,1,0,1,0-1.42-1.42L12,10.59,7.71,6.29A1,1,0,0,0,6.29,7.71L10.59,12l-4.3,4.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L12,13.41l4.29,4.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Z"></path></svg>');
101+
}
94102
}
95103
}
96104
}

src/styles/global/_colors.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ $grey: #C4C4C4;
55
$dark-grey: #2a2a2a;
66

77
$zombie: #11373b;
8-
$multiplayer: #241649;
8+
$multiplayer: #241649;
9+
10+
$gradient-zombie: linear-gradient(49deg, rgba(174, 227, 238, 1) 0%, rgba(148, 187, 233, 1) 56%, rgba(181, 220, 203, 1) 100%);
11+
$gradient-multiplayer: linear-gradient(83deg, rgba(48,3,68,1) 0%, rgba(73,18,94,1) 33%, rgba(129,15,67,1) 71%, rgba(93,19,89,1) 97%);

src/styles/global/_fonts.scss

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
22

3-
$font-base: 'Roboto', sans-serif;
3+
$font-base: 'Roboto', sans-serif;
4+
$font-custom: 'MW', sans-serif;
5+
6+
7+
@font-face {
8+
font-family: 'MW';
9+
font-style: normal;
10+
font-weight: 400;
11+
src: local('MW'), url('fonts/ModernWarfare-8MM6z.ttf') format('truetype');
12+
}

src/styles/main.scss

+65-7
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,45 @@
44
background: $black;
55
color: $white;
66

7-
h1 {
8-
font-size: 3.5rem;
9-
text-align: center;
10-
margin: 1rem 0;
7+
.header {
8+
display: flex;
9+
justify-content: space-between;
10+
align-items: center;
11+
padding: 1rem 2rem;
12+
13+
h1 {
14+
font-size: 3.5rem;
15+
text-align: center;
16+
margin: 1rem 0;
17+
font-family: $font-custom;
18+
}
19+
20+
button {
21+
background: none;
22+
border: none;
23+
color: $white;
24+
font-size: 1.25rem;
25+
cursor: pointer;
26+
transition: all 0.2s ease;
27+
font-family: $font-custom;
28+
29+
&:hover {
30+
color: $grey;
31+
}
32+
}
1133
}
1234

1335
.camo__list-container {
1436
max-width: 1200px;
15-
margin: 0 auto;
37+
margin: 0 auto 6rem;
1638
width: 100%;
17-
padding: 0 5rem;
39+
overflow-x: scroll;
40+
padding: 0 1rem;
41+
42+
@include media-up(sm) {
43+
padding: 0 5rem;
44+
overflow: unset;
45+
}
1846

1947
.separator {
2048
background: linear-gradient(to right, $multiplayer 0%, $zombie 100%);
@@ -30,25 +58,37 @@
3058
z-index: 1;
3159
margin-bottom: 2rem;
3260
border-radius: 0.4rem;
33-
overflow: hidden;
61+
//overflow-x: scroll;
62+
@include media-up(md) {
63+
overflow: hidden;
64+
}
3465

3566
.separator {
3667

3768
}
3869

3970
.weapon {
4071
background: #313030;
72+
font-family: $font-custom;
4173
padding: 1rem;
74+
display: flex;
75+
justify-content: center;
76+
align-items: center;
4277
}
4378

4479
.camos {
4580
background: $multiplayer;
81+
font-family: $font-custom;
4682
padding: 1rem;
83+
min-width: 200px;
4784
}
4885

4986
.zombies {
87+
font-family: $font-custom;
5088
background: $zombie;
5189
padding: 1rem;
90+
min-width: 200px;
91+
border-radius: 0 0.4rem 0.4rem 0;
5292
}
5393

5494
}
@@ -62,4 +102,22 @@
62102
}
63103
}
64104
}
105+
106+
.progress__bars-container {
107+
display: grid;
108+
grid-template-columns: repeat(2, 1fr);
109+
position: fixed;
110+
bottom: 0;
111+
left: 0;
112+
width: 100%;
113+
}
114+
115+
.copyright {
116+
color: #C4C4C4;
117+
118+
a {
119+
color: #e3d6ff;
120+
font-family: $font-custom;
121+
}
122+
}
65123
}

0 commit comments

Comments
 (0)