-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
50 lines (43 loc) · 1.51 KB
/
Copy pathscript.js
File metadata and controls
50 lines (43 loc) · 1.51 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// import PhotoManager from "./PhotoManager";
import DateManager from "./DateManager.js";
import NewsManager from "./NewsManager.js";
import QuoteManager from './QuoteManager.js';
// deprecated code that was used for the photo manager
// function initializePhotoFeatures() {
// const body = document.querySelector("body");
// const photoManager = new PhotoManager();
// photoManager.getPhotoFromUnsplash();
// photoManager.getPhotoURL();
// photoManager.setBackground(body);
// }
function initializeDateFeatures() {
const dateManager = new DateManager();
const dateWrapper = document.querySelector(".header-text");
dateManager.setFormattedDate();
dateManager.appendFormattedDateToDOM(dateWrapper);
const timeWrapper = document.querySelector(".time");
setInterval(() => {
dateManager.getCurrentDate();
dateManager.appendFormattedTimeToDOM(timeWrapper);
}, 1000);
}
async function initializeNewsFeatures() {
const newsManager = new NewsManager();
const newsWrapper = document.querySelector('#news')
await newsManager.getNews();
newsManager.getProcessedNews();
newsManager.appendAllNewsArticlesToElement(newsWrapper)
}
async function initializeQuoteFeatures() {
const quoteManager = new QuoteManager();
const quoteWrapper = document.querySelector('.quote')
await quoteManager.getQuote()
quoteManager.appendQuoteToDOM(quoteWrapper)
}
function main() {
// initializePhotoFeatures();
initializeDateFeatures();
// initializeNewsFeatures();
// initializeQuoteFeatures();
}
main();