-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathscript.js
More file actions
27 lines (23 loc) · 1.09 KB
/
script.js
File metadata and controls
27 lines (23 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const header = document.getElementById(`header`);
const title = document.getElementById(`title`);
const excerpt = document.getElementById(`excerpt`);
const profile_img = document.getElementById(`profile_img`);
const name = document.getElementById(`name`);
const date = document.getElementById(`date`);
const animated_bgs = document.querySelectorAll(`.animated-bg`);
const animated_bg_texts = document.querySelectorAll(`.animated-bg-text`);
setTimeout(getData, 2500);
function getData() {
header.innerHTML = '<img src="https://th.bing.com/th/id/OIP.UGiZv-3wR2nW-Gadf7NtngHaE9?pid=Api&rs=1" alt="" />';
title.innerHTML = `Lorem ipsum dolor sit amet`;
excerpt.innerHTML = `Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolore perferendis`;
profile_img.innerHTML = `<img src="https://randomuser.me/api/portraits/men/4.jpg" alt="" />`;
name.innerHTML = `John Doe`;
date.innerHTML = `Jan 24,2021`;
animated_bgs.forEach((bg) => {
bg.classList.remove(`animated-bg`);
})
animated_bg_texts.forEach((bg) => {
bg.classList.remove(`animated-bg-text`);
})
}