Skip to content

Commit fc533e8

Browse files
committed
ch. 90: Building a Carousel - Part 2
1 parent 4cdd7d7 commit fc533e8

File tree

1 file changed

+70
-11
lines changed

1 file changed

+70
-11
lines changed

starter/06-Components/02-carousel.html

Lines changed: 70 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<style>
1212
/*
1313
SPACING SYSTEM (px)
14-
2 / 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 / 80 / 96 / 128
14+
2 / 4 / 8 / 12 / 16 / 24 / 32 / 40 / 48 / 64 / 80 / 96 / 128
1515
1616
FONT SIZE SYSTEM (px)
1717
10 / 12 / 14 / 16 / 18 / 20 / 24 / 30 / 36 / 44 / 52 / 62 / 74 / 86 / 98
@@ -41,9 +41,10 @@
4141
width: 800px;
4242
margin: 100px auto;
4343
background-color: #087f5b;
44-
padding: 32px;
45-
padding-left: 86px;
44+
padding: 32px 48px 32px 86px;
4645
border-radius: 8px;
46+
position: relative;
47+
4748
display: flex;
4849
align-items: center;
4950
gap: 86px;
@@ -75,9 +76,62 @@
7576
color: #c3fae8;
7677
}
7778

78-
.btn {}
79+
/* Controls */
80+
81+
.btn {
82+
background-color: #fff;
83+
border: none;
84+
height: 40px;
85+
width: 40px;
86+
border-radius: 50%;
87+
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
88+
position: absolute;
89+
top: 50%;
90+
cursor: pointer;
91+
92+
display: flex;
93+
align-items: center;
94+
justify-content: center;
95+
}
7996

80-
.btn-icon {}
97+
.btn--left {
98+
left: 0;
99+
transform: translate(-50%, -50%);
100+
}
101+
102+
.btn--right {
103+
right: 0;
104+
transform: translate(50%, -50%);
105+
}
106+
107+
.btn-icon {
108+
height: 24px;
109+
width: 24px;
110+
stroke: #087f5b;
111+
}
112+
113+
.dots {
114+
position: absolute;
115+
left: 50%;
116+
bottom: 0;
117+
transform: translate(-50%, 32px);
118+
119+
display: flex;
120+
gap: 12px;
121+
}
122+
123+
.dot {
124+
height: 12px;
125+
width: 12px;
126+
background-color: #fff;
127+
border: 2px solid #087f5b;
128+
border-radius: 50%;
129+
cursor: pointer;
130+
}
131+
132+
.dot--filled {
133+
background-color: #087f5b;
134+
}
81135
</style>
82136
</head>
83137

@@ -87,26 +141,31 @@
87141
<img src="maria.jpg" alt="Maria de Almeida">
88142
<blockquote class="testimonial">
89143
<p class="testimonial-text">
90-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quibusdam voluptatum cumque, aspernatur iusto
91-
mollitia sunt magnam. Pariatur alias esse aperiam non magnam! Ratione voluptatibus voluptates
92-
perspiciatis delectus vel veritatis quas?
144+
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Quibusdam voluptatum cumque, aspernatur iusto
145+
mollitia sunt magnam."
93146
</p>
94147
<p class="testimonial-author">Maria de Almeida</p>
95148
<p class="testimonial-job">Senior Product Manager at EDP Comercial</p>
96149
</blockquote>
97-
<button class="btn">
98-
<svg class="btn-icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5}
150+
<button class="btn btn--left">
151+
<svg class="btn-icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
99152
stroke="currentColor">
100153
<path strokeLinecap="round" strokeLinejoin="round" d="M15.75 19.5 8.25 12l7.5-7.5" />
101154
</svg>
102155
</button>
103156

104-
<button class="btn">
157+
<button class="btn btn--right">
105158
<svg class="btn-icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
106159
stroke="currentColor">
107160
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" />
108161
</svg>
109162
</button>
163+
<div class="dots">
164+
<button class="dot dot--filled">&nbsp;</button>
165+
<button class="dot">&nbsp;</button>
166+
<button class="dot">&nbsp;</button>
167+
<button class="dot">&nbsp;</button>
168+
</div>
110169
</div>
111170
</body>
112171

0 commit comments

Comments
 (0)