-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharticle.html
74 lines (69 loc) · 1.93 KB
/
article.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!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;
}
img {
object-fit: contain;
}
</style>
</head>
<body>
<script>
const images = [
'likenft154xhw0qyds5pgvsyc7379lnkyvwqkvv2zvmmh2gn5qrewljeqwys2sju6x',
'likenft154xhw0qyds5pgvsyc7379lnkyvwqkvv2zvmmh2gn5qrewljeqwys2sju6x',
].map((classId, index) => {
const searchParams = new URLSearchParams(window.location.search);
const utmSource = searchParams.get('utm_source');
const url = new URL(`https://api.like.co/likernft/book/purchase/${classId}/new`);
url.searchParams.set('utm_medium', 'website');
url.searchParams.set('utm_campaign', 'thewitness-ad');
url.searchParams.set('utm_source', 'thewitness-article');
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_article_ad', {
'classId': images[randomIndex].classId,
});
</script>
</body>
</html>