-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
30 lines (24 loc) · 770 Bytes
/
app.js
File metadata and controls
30 lines (24 loc) · 770 Bytes
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
import renderCards from "./renderCards.js";
import renderFilters from "./renderFilters.js";
const URL = "https://restcountries.com/v3.1/all";
const initialize = (countriesDra) => {
const countries = countriesDra;
renderCards(countries);
renderFilters(countries);
};
fetch(URL)
.then((res) => res.json())
.then((data) => initialize(data))
.catch((err) => console.log(err));
// // INPUT FOCUSS
// const focus = function (e) {
// let inputVal = e.target;
// if (!isNaN) e.target.value = "";
// else e.target.value = inputVal = "";
// };
// searchEl.addEventListener("focusout", focus);
// const keydown = function (e) {
// if (e.key === "Enter") e.target.blur();
// };
// searchEl.addEventListener("keydown", keydown);
// };