-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhomepage.html
More file actions
88 lines (83 loc) · 2.13 KB
/
Copy pathhomepage.html
File metadata and controls
88 lines (83 loc) · 2.13 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html lang="zh-Hant">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-D664ZD319N"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-D664ZD319N');
</script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Liker Land 書店</title>
<style>
body {
width: 100vw;
height: 100vh;
margin: 0;
padding: 0;
}
a img {
width: 100%;
height: 100%;
display: block;
border: none;
}
a::after {
pointer-events: none;
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
transition-duration: 1500ms;
transition: all .4s;
}
a:hover::after {
background-color: rgba(0, 0, 0, 0.3);
}
img {
object-fit: cover;
}
</style>
</head>
<body>
<script>
const images = [
'likenft1d2jhjhysl5630c20575da3e3d8ssjl74jur59kqf5urg73wx36wsfvlvsa',
'likenft1d2jhjhysl5630c20575da3e3d8ssjl74jur59kqf5urg73wx36wsfvlvsa',
].map((classId, index) => {
const searchParams = new URLSearchParams(window.location.search);
const utmSource = searchParams.get('utm_source');
const url = new URL(`https://liker.land/nft/class/${classId}`);
url.searchParams.set('utm_medium', 'website');
url.searchParams.set('utm_campaign', 'thewitness-ad');
url.searchParams.set('utm_source', 'thewitness-homepage');
url.searchParams.set('price_index', 0);
url.searchParams.set('from', 'liker_land');
return {
id: index,
link: url.href,
src: `${classId}.jpg`
};
});
function displayImage(index) {
const anchorElement = document.createElement('a');
anchorElement.href = images[index].link;
anchorElement.target = '_blank';
const imgElement = document.createElement('img');
imgElement.src = images[index].src;
anchorElement.appendChild(imgElement);
document.body.appendChild(anchorElement);
}
const randomIndex = Math.floor(Math.random() * images.length); // Choose a random index
displayImage(randomIndex);
gtag('event', 'display_homepage_ad', {
'classId': images[randomIndex].id,
});
</script>
</body>
</html>