Merge branch 'master' into master · bartick/30DaysOfJavaScript@4668cf9 · GitHub
Skip to content

Commit 4668cf9

Browse files
Merge branch 'master' into master
2 parents de3f0a8 + f935f62 commit 4668cf9

17 files changed

Lines changed: 721 additions & 4 deletions

File tree

‎15 - Joke Generator/.DS_Store‎

6 KB
Binary file not shown.

‎30DaysOfJavaScript/.DS_Store‎

6 KB
Binary file not shown.
10 KB
Binary file not shown.

‎30DaysOfJavaScript/assets/49.PNG‎

56.5 KB
Loading

‎30DaysOfJavaScript/assets/49.png‎

501 KB
Loading

‎30DaysOfJavaScript/assets/50.PNG‎

56.5 KB
Loading
Lines changed: 37 additions & 0 deletions

‎49 - Content Placeholder/script.js‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const header = document.getElementById('header')
2+
const title = document.getElementById('title')
3+
const excerpt = document.getElementById('excerpt')
4+
const profile_img = document.getElementById('profile_img')
5+
const name = document.getElementById('name')
6+
const date = document.getElementById('date')
7+
8+
const animated_bgs = document.querySelectorAll('.animated-bg')
9+
const animated_bg_texts = document.querySelectorAll('.animated-bg-text')
10+
11+
setTimeout(getData, 2500)
12+
13+
function getData() {
14+
header.innerHTML =
15+
'<img src="https://source.unsplash.com/random/300X300" alt="" />'
16+
title.innerHTML = 'Headline'
17+
excerpt.innerHTML =
18+
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolore perferendis'
19+
profile_img.innerHTML =
20+
'<img src="https://randomuser.me/api/portraits/men/45.jpg" alt="" />'
21+
name.innerHTML = 'Harry Potter'
22+
date.innerHTML = 'Feb 08, 2022'
23+
24+
animated_bgs.forEach((bg) => bg.classList.remove('animated-bg'))
25+
animated_bg_texts.forEach((bg) => bg.classList.remove('animated-bg-text'))
26+
}

‎49 - Content Placeholder/style.css‎

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
2+
3+
* {
4+
box-sizing: border-box;
5+
}
6+
7+
body {
8+
background-color: #ecf0f1;
9+
font-family: 'Roboto', sans-serif;
10+
display: flex;
11+
align-items: center;
12+
justify-content: center;
13+
height: 100vh;
14+
overflow: hidden;
15+
margin: 0;
16+
}
17+
18+
img {
19+
max-width: 100%;
20+
}
21+
22+
.card {
23+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
24+
border-radius: 10px;
25+
overflow: hidden;
26+
width: 350px;
27+
}
28+
29+
.card-header {
30+
height: 200px;
31+
}
32+
33+
.card-header img {
34+
object-fit: cover;
35+
height: 100%;
36+
width: 100%;
37+
}
38+
39+
.card-content {
40+
background-color: #fff;
41+
padding: 30px;
42+
}
43+
44+
.card-title {
45+
height: 20px;
46+
margin: 0;
47+
}
48+
49+
.card-excerpt {
50+
color: #777;
51+
margin: 10px 0 20px;
52+
}
53+
54+
.author {
55+
display: flex;
56+
}
57+
58+
.profile-img {
59+
border-radius: 50%;
60+
overflow: hidden;
61+
height: 40px;
62+
width: 40px;
63+
}
64+
65+
.author-info {
66+
display: flex;
67+
flex-direction: column;
68+
justify-content: space-around;
69+
margin-left: 10px;
70+
width: 100px;
71+
}
72+
73+
.author-info small {
74+
color: #aaa;
75+
margin-top: 5px;
76+
}
77+
78+
.animated-bg {
79+
background-image: linear-gradient(
80+
to right,
81+
#f6f7f8 0%,
82+
#edeef1 10%,
83+
#f6f7f8 20%,
84+
#f6f7f8 100%
85+
);
86+
background-size: 200% 100%;
87+
animation: bgPos 1s linear infinite;
88+
}
89+
90+
.animated-bg-text {
91+
border-radius: 50px;
92+
display: inline-block;
93+
margin: 0;
94+
height: 10px;
95+
width: 100%;
96+
}
97+
98+
@keyframes bgPos {
99+
0% {
100+
background-position: 50% 0;
101+
}
102+
103+
100% {
104+
background-position: -150% 0;
105+
}
106+
}

‎50 - Country Detail/app.js‎

Lines changed: 67 additions & 0 deletions

0 commit comments

Comments
 (0)