-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
58 lines (54 loc) · 1.69 KB
/
index.html
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
51
52
53
54
55
56
57
58
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>DeadMart</title>
<link
rel="icon"
id="tab-icon"
type="image/png"
href="public/DeadMart-small.png"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Outfit:[email protected]&family=Six+Caps&display=swap"
rel="stylesheet"
/>
<script>
// Prefetch API data before the app initializes
const API_URL = 'https://assets.deadlock-api.com/v1/icons'
async function fetchAndStoreIcons() {
try {
localStorage.clear()
const response = await fetch(API_URL)
const icons = await response.json()
const filteredIcons = {
vitality: icons.icon_fortitude,
weapon: icons.icon_courage,
spirit: icons.icon_spirit,
rejuvenator: icons.rejuvenator,
}
// Store in localStorage for access in the app
localStorage.setItem('icons', JSON.stringify(filteredIcons))
} catch (error) {
console.error('Error fetching icons:', error)
}
}
// Call the fetch function before the app loads
fetchAndStoreIcons()
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
<script src="https://unpkg.com/page/page.js"></script>
<script>
page('/', function () {
console.log('Home page loaded')
})
page.start()
</script>
</body>
</html>