| 278 | |
| 279 | // Import the data to customize and insert them into page |
| 280 | const fetchData = () => { |
| 281 | fetch("customize.json") |
| 282 | .then(data => data.json()) |
| 283 | .then(data => { |
| 284 | Object.keys(data).map(customData => { |
| 285 | if (data[customData] !== "") { |
| 286 | if (customData === "imagePath") { |
| 287 | document |
| 288 | .getElementById(customData) |
| 289 | .setAttribute("src", data[customData]); |
| 290 | } else { |
| 291 | document.getElementById(customData).innerText = data[customData]; |
| 292 | } |
| 293 | } |
| 294 | }); |
| 295 | }); |
| 296 | }; |
| 297 | |
| 298 | // Run fetch and animation in sequence |
| 299 | const resolveFetch = () => { |