Skip to content

Commit 495b6a3

Browse files
committed
feat: building a carousel component
1 parent 8a29140 commit 495b6a3

File tree

2 files changed

+201
-0
lines changed

2 files changed

+201
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<link rel="preconnect" href="https://fonts.googleapis.com" />
5+
<meta charset="UTF-8" />
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>Carousel Component</title>
9+
<link
10+
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap"
11+
rel="stylesheet"
12+
/>
13+
14+
<link rel="stylesheet" href="style.css" />
15+
</head>
16+
<body>
17+
<div class="carousel">
18+
<img src="../maria.jpg" alt="Maria de Almeida" />
19+
<blockquote class="testimonial">
20+
<p class="testimonial-text">
21+
"Lorem ipsum dolor, sit amet consectetur adipisicing elit. Saepe,
22+
dignissimos itaque minima aut. Rerum odit qui nostrum officia fugit,
23+
quae sit ut consequuntur."
24+
</p>
25+
<p class="testimonial-author">Maria de Almeida</p>
26+
<p class="testimonial-job">Senior Product Manager at EDP Comercial</p>
27+
</blockquote>
28+
29+
<button class="btn btn--left">
30+
<svg
31+
xmlns="http://www.w3.org/2000/svg"
32+
fill="none"
33+
viewBox="0 0 24 24"
34+
stroke-width="1.5"
35+
stroke="currentColor"
36+
class="btn-icon"
37+
>
38+
<path
39+
stroke-linecap="round"
40+
stroke-linejoin="round"
41+
d="M15.75 19.5L8.25 12l7.5-7.5"
42+
/>
43+
</svg>
44+
</button>
45+
46+
<button class="btn btn--right">
47+
<svg
48+
xmlns="http://www.w3.org/2000/svg"
49+
fill="none"
50+
viewBox="0 0 24 24"
51+
stroke-width="1.5"
52+
stroke="currentColor"
53+
class="btn-icon"
54+
>
55+
<path
56+
stroke-linecap="round"
57+
stroke-linejoin="round"
58+
d="M8.25 4.5l7.5 7.5-7.5 7.5"
59+
/>
60+
</svg>
61+
</button>
62+
63+
<div class="dots">
64+
<button class="dot dot--fill">&nbsp;</button>
65+
<button class="dot">&nbsp;</button>
66+
<button class="dot">&nbsp;</button>
67+
<button class="dot">&nbsp;</button>
68+
</div>
69+
</div>
70+
</body>
71+
</html>
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
/*
2+
SPACING SYSTEM (px)
3+
2 / 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 / 80 / 96 / 128
4+
5+
FONT SIZE SYSTEM (px)
6+
10 / 12 / 14 / 16 / 18 / 20 / 24 / 30 / 36 / 44 / 52 / 62 / 74 / 86 / 98
7+
*/
8+
9+
/*
10+
MAIN COLOR: #087f5b
11+
GREY COLOR: #343a40
12+
*/
13+
14+
* {
15+
margin: 0;
16+
padding: 0;
17+
box-sizing: border-box;
18+
}
19+
20+
/* ------------------------ */
21+
/* GENERAL STYLES */
22+
/* ------------------------ */
23+
body {
24+
font-family: "Inter", sans-serif;
25+
color: #343a40;
26+
line-height: 1;
27+
}
28+
29+
.carousel {
30+
width: 800px;
31+
margin: 100px auto;
32+
background-color: #087f5b;
33+
padding: 32px 48px 32px 86px;
34+
border-radius: 8px;
35+
36+
display: flex;
37+
align-items: center;
38+
gap: 86px;
39+
40+
position: relative;
41+
}
42+
43+
img {
44+
height: 200px;
45+
border-radius: 8px;
46+
transform: scale(1.5);
47+
48+
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
49+
}
50+
51+
.testimonial {
52+
}
53+
54+
.testimonial-text {
55+
font-size: 18px;
56+
font-weight: 500;
57+
line-height: 1.5;
58+
margin-bottom: 32px;
59+
color: #e6fcf5;
60+
}
61+
62+
.testimonial-author {
63+
font-size: 14px;
64+
margin-bottom: 4px;
65+
color: #c3fae8;
66+
}
67+
68+
.testimonial-job {
69+
font-size: 12px;
70+
color: #c3fae8;
71+
}
72+
73+
.btn {
74+
background-color: #fff;
75+
border: none;
76+
width: 40px;
77+
height: 40px;
78+
border-radius: 50%;
79+
position: absolute;
80+
top: 50%;
81+
82+
cursor: pointer;
83+
84+
display: flex;
85+
align-items: center;
86+
justify-content: center;
87+
88+
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
89+
}
90+
91+
.btn--left {
92+
left: 0;
93+
transform: translate(-50%, -50%);
94+
}
95+
96+
.btn--right {
97+
right: 0;
98+
transform: translate(50%, -50%);
99+
}
100+
101+
.btn-icon {
102+
height: 24px;
103+
width: 24px;
104+
105+
stroke: #087f5b;
106+
}
107+
108+
.dots {
109+
position: absolute;
110+
left: 50%;
111+
bottom: 0;
112+
transform: translate(-50%, 32px);
113+
114+
display: flex;
115+
gap: 12px;
116+
}
117+
118+
.dot {
119+
height: 12px;
120+
width: 12px;
121+
122+
background-color: #fff;
123+
border: 2px solid #087f5b;
124+
border-radius: 50%;
125+
cursor: pointer;
126+
}
127+
128+
.dot--fill {
129+
background-color: #087f5b;
130+
}

0 commit comments

Comments
 (0)