Skip to content

Commit 5302d64

Browse files
committed
Menambahkan About
1 parent e06f8ca commit 5302d64

File tree

6 files changed

+373
-0
lines changed

6 files changed

+373
-0
lines changed

10-About/app.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const image = document.querySelector('.about-img')
2+
const aboutButton = document.querySelectorAll('.tab-btn')
3+
const contents = document.querySelectorAll('.content')
4+
5+
aboutButton.forEach((button)=>{
6+
button.addEventListener('click', (e)=>{
7+
8+
const target = e.currentTarget
9+
aboutButton.forEach((btn)=>{
10+
btn.classList.remove('active')
11+
})
12+
13+
target.classList.add('active')
14+
image.childNodes[1].setAttribute('src', `./${target.dataset.id}.png`)
15+
16+
contents.forEach((content)=>{
17+
if(content.getAttribute('id') == target.dataset.id){
18+
content.classList.add('active')
19+
}else{
20+
content.classList.remove('active')
21+
}
22+
})
23+
})
24+
})

10-About/ghifari.png

160 KB
Loading

10-About/index.html

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Tabs</title>
7+
8+
<!-- styles -->
9+
<link rel="stylesheet" href="styles.css" />
10+
</head>
11+
<body>
12+
<section class="section">
13+
<div class="title">
14+
<h2>about</h2>
15+
<p>
16+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Earum,
17+
aperiam!
18+
</p>
19+
</div>
20+
21+
<div class="about-center section-center">
22+
<article class="about-img">
23+
<img src="./nadhira.png" alt="" />
24+
</article>
25+
<article class="about">
26+
<!-- btn container -->
27+
<div class="btn-container">
28+
<button class="tab-btn active" data-id="nadhira">Nadhira</button>
29+
<button class="tab-btn" data-id="rafani">Rafani</button>
30+
<button class="tab-btn" data-id="ghifari">Ghifari</button>
31+
</div>
32+
<div class="about-content">
33+
<!-- single item -->
34+
<div class="content active" id="nadhira">
35+
<h4>nadhira</h4>
36+
<p>
37+
I'm baby wolf pickled schlitz try-hard normcore marfa man bun
38+
mumblecore vice pop-up XOXO lomo kombucha glossier bicycle
39+
rights. Umami kinfolk salvia jean shorts offal venmo. Knausgaard
40+
tilde try-hard, woke fixie banjo man bun. Small batch tumeric
41+
mustache tbh wayfarers 8-bit shaman chartreuse tacos. Viral
42+
direct trade hoodie ugh chambray, craft beer pork belly flannel
43+
tacos single-origin coffee art party migas plaid pop-up.
44+
</p>
45+
</div>
46+
<!-- end of single item -->
47+
<!-- single item -->
48+
<div class="content" id="rafani">
49+
<h4>rafani</h4>
50+
<p>
51+
Man bun PBR&B keytar copper mug prism, hell of helvetica. Synth
52+
crucifix offal deep v hella biodiesel. Church-key listicle
53+
polaroid put a bird on it chillwave palo santo enamel pin,
54+
tattooed meggings franzen la croix cray. Retro yr aesthetic four
55+
loko tbh helvetica air plant, neutra palo santo tofu mumblecore.
56+
Hoodie bushwick pour-over jean shorts chartreuse shabby chic.
57+
Roof party hammock master cleanse pop-up truffaut, bicycle
58+
rights skateboard affogato readymade sustainable deep v
59+
live-edge schlitz narwhal.
60+
</p>
61+
<ul>
62+
<li>list item</li>
63+
<li>list item</li>
64+
<li>list item</li>
65+
</ul>
66+
</div>
67+
<!-- end of single item -->
68+
<!-- single item -->
69+
<div class="content" id="ghifari">
70+
<h4>ghifari</h4>
71+
<p>
72+
Chambray authentic truffaut, kickstarter brunch taxidermy vape
73+
heirloom four dollar toast raclette shoreditch church-key.
74+
Poutine etsy tote bag, cred fingerstache leggings cornhole
75+
everyday carry blog gastropub. Brunch biodiesel sartorial mlkshk
76+
swag, mixtape hashtag marfa readymade direct trade man braid
77+
cold-pressed roof party. Small batch adaptogen coloring book
78+
heirloom. Letterpress food truck hammock literally hell of wolf
79+
beard adaptogen everyday carry. Dreamcatcher pitchfork yuccie,
80+
banh mi salvia venmo photo booth quinoa chicharrones.
81+
</p>
82+
</div>
83+
<!-- end of single item -->
84+
</div>
85+
</article>
86+
</div>
87+
</section>
88+
<!-- javascript -->
89+
<script src="app.js"></script>
90+
</body>
91+
</html>

10-About/nadhira.png

380 KB
Loading

10-About/rafani.png

527 KB
Loading

10-About/styles.css

Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
/*
2+
===============
3+
Fonts
4+
===============
5+
*/
6+
@import url("https://fonts.googleapis.com/css?family=Open+Sans|Roboto:400,700&display=swap");
7+
8+
/*
9+
===============
10+
Variables
11+
===============
12+
*/
13+
14+
:root {
15+
/* dark shades of primary color*/
16+
--clr-primary-1: hsl(205, 86%, 17%);
17+
--clr-primary-2: hsl(205, 77%, 27%);
18+
--clr-primary-3: hsl(205, 72%, 37%);
19+
--clr-primary-4: hsl(205, 63%, 48%);
20+
/* primary/main color */
21+
--clr-primary-5: #49a6e9;
22+
/* lighter shades of primary color */
23+
--clr-primary-6: hsl(205, 89%, 70%);
24+
--clr-primary-7: hsl(205, 90%, 76%);
25+
--clr-primary-8: hsl(205, 86%, 81%);
26+
--clr-primary-9: hsl(205, 90%, 88%);
27+
--clr-primary-10: hsl(205, 100%, 96%);
28+
/* darkest grey - used for headings */
29+
--clr-grey-1: hsl(209, 61%, 16%);
30+
--clr-grey-2: hsl(211, 39%, 23%);
31+
--clr-grey-3: hsl(209, 34%, 30%);
32+
--clr-grey-4: hsl(209, 28%, 39%);
33+
/* grey used for paragraphs */
34+
--clr-grey-5: hsl(210, 22%, 49%);
35+
--clr-grey-6: hsl(209, 23%, 60%);
36+
--clr-grey-7: hsl(211, 27%, 70%);
37+
--clr-grey-8: hsl(210, 31%, 80%);
38+
--clr-grey-9: hsl(212, 33%, 89%);
39+
--clr-grey-10: hsl(210, 36%, 96%);
40+
--clr-white: #fff;
41+
--clr-red-dark: hsl(360, 67%, 44%);
42+
--clr-red-light: hsl(360, 71%, 66%);
43+
--clr-green-dark: hsl(125, 67%, 44%);
44+
--clr-green-light: hsl(125, 71%, 66%);
45+
--clr-black: #222;
46+
--ff-primary: "Roboto", sans-serif;
47+
--ff-secondary: "Open Sans", sans-serif;
48+
--transition: all 0.3s linear;
49+
--spacing: 0.25rem;
50+
--radius: 0.5rem;
51+
--light-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
52+
--dark-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
53+
--max-width: 1170px;
54+
--fixed-width: 620px;
55+
}
56+
/*
57+
===============
58+
Global Styles
59+
===============
60+
*/
61+
62+
*,
63+
::after,
64+
::before {
65+
margin: 0;
66+
padding: 0;
67+
box-sizing: border-box;
68+
}
69+
body {
70+
font-family: var(--ff-secondary);
71+
background: var(--clr-grey-10);
72+
color: var(--clr-grey-1);
73+
line-height: 1.5;
74+
font-size: 0.875rem;
75+
}
76+
ul {
77+
list-style-type: none;
78+
}
79+
a {
80+
text-decoration: none;
81+
}
82+
img:not(.logo) {
83+
width: 100%;
84+
}
85+
img {
86+
display: block;
87+
}
88+
89+
h1,
90+
h2,
91+
h3,
92+
h4 {
93+
letter-spacing: var(--spacing);
94+
text-transform: capitalize;
95+
line-height: 1.25;
96+
margin-bottom: 0.75rem;
97+
font-family: var(--ff-primary);
98+
}
99+
h1 {
100+
font-size: 3rem;
101+
}
102+
h2 {
103+
font-size: 2rem;
104+
}
105+
h3 {
106+
font-size: 1.25rem;
107+
}
108+
h4 {
109+
font-size: 0.875rem;
110+
}
111+
p {
112+
margin-bottom: 1.25rem;
113+
color: var(--clr-grey-5);
114+
}
115+
@media screen and (min-width: 800px) {
116+
h1 {
117+
font-size: 4rem;
118+
}
119+
h2 {
120+
font-size: 2.5rem;
121+
}
122+
h3 {
123+
font-size: 1.75rem;
124+
}
125+
h4 {
126+
font-size: 1rem;
127+
}
128+
body {
129+
font-size: 1rem;
130+
}
131+
h1,
132+
h2,
133+
h3,
134+
h4 {
135+
line-height: 1;
136+
}
137+
}
138+
/* global classes */
139+
140+
.btn {
141+
text-transform: uppercase;
142+
background: transparent;
143+
color: var(--clr-black);
144+
padding: 0.375rem 0.75rem;
145+
letter-spacing: var(--spacing);
146+
display: inline-block;
147+
transition: var(--transition);
148+
font-size: 0.875rem;
149+
border: 2px solid var(--clr-black);
150+
cursor: pointer;
151+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
152+
border-radius: var(--radius);
153+
}
154+
.btn:hover {
155+
color: var(--clr-white);
156+
background: var(--clr-black);
157+
}
158+
/* section */
159+
.section {
160+
padding: 5rem 0;
161+
}
162+
163+
.section-center {
164+
width: 90vw;
165+
margin: 0 auto;
166+
max-width: 1170px;
167+
}
168+
@media screen and (min-width: 992px) {
169+
.section-center {
170+
width: 95vw;
171+
}
172+
}
173+
main {
174+
min-height: 100vh;
175+
display: grid;
176+
place-items: center;
177+
}
178+
/*
179+
===============
180+
About
181+
===============
182+
*/
183+
.title {
184+
text-align: center;
185+
margin-bottom: 4rem;
186+
}
187+
.title p {
188+
width: 80%;
189+
margin: 0 auto;
190+
}
191+
192+
.about-img {
193+
margin-bottom: 2rem;
194+
}
195+
.about-img img {
196+
border-radius: var(--radius);
197+
object-fit: cover;
198+
height: 20rem;
199+
}
200+
@media screen and (min-width: 992px) {
201+
.about-img {
202+
margin-bottom: 0;
203+
}
204+
205+
.about-center {
206+
display: grid;
207+
grid-template-columns: 1fr 1fr;
208+
column-gap: 2rem;
209+
}
210+
}
211+
.about {
212+
background: var(--clr-white);
213+
border-radius: var(--radius);
214+
display: grid;
215+
grid-template-rows: auto 1fr;
216+
}
217+
.btn-container {
218+
border-top-left-radius: var(--radius);
219+
border-top-right-radius: var(--radius);
220+
display: grid;
221+
grid-template-columns: 1fr 1fr 1fr;
222+
}
223+
.tab-btn:nth-child(1) {
224+
border-top-left-radius: var(--radius);
225+
}
226+
.tab-btn:nth-child(3) {
227+
border-top-right-radius: var(--radius);
228+
}
229+
.tab-btn {
230+
padding: 1rem 0;
231+
border: none;
232+
text-transform: capitalize;
233+
font-size: 1rem;
234+
display: block;
235+
background: var(--clr-grey-9);
236+
cursor: pointer;
237+
transition: var(--transition);
238+
letter-spacing: var(--spacing);
239+
}
240+
.tab-btn:hover:not(.active) {
241+
background: var(--clr-primary-10);
242+
color: var(--clr-primary-5);
243+
}
244+
.about-content {
245+
border-bottom-left-radius: var(--radius);
246+
border-bottom-right-radius: var(--radius);
247+
padding: 2rem 1.5rem;
248+
}
249+
/* hide content */
250+
.content {
251+
display: none;
252+
}
253+
.tab-btn.active {
254+
background: var(--clr-white);
255+
}
256+
.content.active {
257+
display: block;
258+
}

0 commit comments

Comments
 (0)