-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgalleryAssist.js
122 lines (107 loc) · 5.15 KB
/
galleryAssist.js
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
async function getLinks(linkfle) {
var links = await fetch(`/${linkfle}`).then(response => response.json());
return links;
}
function MasterGOTO(uri) {
var messageBlock = {
event: "goto",
data: uri
}
window.postMessage(btoa(JSON.stringify(messageBlock)), '*');
}
async function NoRegistration() {
window.alert("No Registration Required");
}
async function a(key, links, _isTogether = false) {
if (history.scrollRestoration) {
history.scrollRestoration = 'manual';
}
else {
window.onbeforeunload = function () {
window.scrollTo(0, 0);
}
}
// console.log(loc[loc.length - 1]);
var event = (key).split('&')[0].replace('#', '');
var picsN = (key).split('&')[1];
picsN++;
var fileType = (key).split('&')[2];
console.log(event, picsN, fileType);
var pics = [];
var links = await getLinks(links);
console.log(links);
for (let i = 1; i < picsN; i++) {
pics.push('/assets/' + event + '/' + i + '.' + fileType);
}
// console.log(pics);
var globalID = "VOLTAIR" + event;
if (!_isTogether) {
for (let i = 0; i < pics.length; i++) {
var from;
var id = event + "gnx" + i;
if (i % 3 == 0) {
from = "right"
}
if (i % 3 == 1) {
from = "bottom"
}
if (i % 3 == 2) {
from = 'left'
}
if (links[i].link == "NO_REGISTRATION") {
document.getElementById('gallerya').innerHTML += `<img id="${id}"src="` + pics[i] + `" style="width: 100%;height: auto;" onclick="NoRegistration()" from="${from}"
onMouseEnter ='elem("${id}").style.transform = "scale(1.2)"' onMouseLeave='elem("${id}").style.transform = "scale(1)"'
>`;
} else {
document.getElementById('gallerya').innerHTML += `<img id="${id}"src="` + pics[i] + `" style="width: 100%;height: auto;" onclick="MasterGOTO('${links[i].link}')" from="${from}"
onMouseEnter ='elem("${id}").style.transform = "scale(1.2)"' onMouseLeave='elem("${id}").style.transform = "scale(1)"'
>`;
}
trackBeacon(id);
}
} else {
if (links[0].link == "NO_REGISTRATION") {
document.getElementById('gallerya').innerHTML += `<div style="grid-column: 1/4;display:grid; grid-template-columns: repeat(3, 1fr);grd-template-rows:1fr;gap:0px;transition:500ms" id="${globalID}" >
<img id="${globalID}+${0}" src="` + pics[0] + `" style="height:auto;width:100%;transition: 500ms;" onclick="NoRegistration()" from="left"
onMouseEnter ='elem("${globalID}").style.transform = "scale(1.1)"'
onMouseLeave='elem("${globalID}").style.transform = "scale(1)"';'
>
<img id="${globalID}+${1}" src="` + pics[1] + `" style="height:auto;width:100%;transition: 500ms;" onclick="NoRegistration()" from="bottom"
onMouseEnter ='elem("${globalID}").style.transform = "scale(1.1)"'
onMouseLeave='elem("${globalID}").style.transform = "scale(1)"';'
>
<img id="${globalID}+${2}" src="` + pics[2] + `" style="height:auto;width:100%;transition: 500ms;" onclick="NoRegistration()" from="right"
onMouseEnter ='elem("${globalID}").style.transform = "scale(1.1)"'
onMouseLeave='elem("${globalID}").style.transform = "scale(1)"';'
>
</div>`;
} else {
document.getElementById('gallerya').innerHTML += `<div style="grid-column: 1/4;display:grid; grid-template-columns: repeat(3, 1fr);grd-template-rows:1fr;gap:0px;transition:500ms" id="${globalID}" >
<img id="${globalID}+${0}" src="` + pics[0] + `" style="height:auto;width:100%;transition: 500ms;" onclick="MasterGOTO('${links[0].link}')" from="left"
onMouseEnter ='elem("${globalID}").style.transform = "scale(1.1)"'
onMouseLeave='elem("${globalID}").style.transform = "scale(1)"';'
>
<img id="${globalID}+${1}" src="` + pics[1] + `" style="height:auto;width:100%;transition: 500ms;" onclick="MasterGOTO('${links[0].link}')" from="bottom"
onMouseEnter ='elem("${globalID}").style.transform = "scale(1.1)"'
onMouseLeave='elem("${globalID}").style.transform = "scale(1)"';'
>
<img id="${globalID}+${2}" src="` + pics[2] + `" style="height:auto;width:100%;transition: 500ms;" onclick="MasterGOTO('${links[0].link}" from="right"
onMouseEnter ='elem("${globalID}").style.transform = "scale(1.1)"'
onMouseLeave='elem("${globalID}").style.transform = "scale(1)"';'
>
</div>`;
}
trackBeacon(`${globalID}+${0}`);
trackBeacon(`${globalID}+${1}`);
trackBeacon(`${globalID}+${2}`);
}
}
async function setup() {
trackBeacon("viva")
trackBeacon("tiftle")
trackBeacon("subtitle")
await a("#daksha&12&webp", "dakshaEve.json")
await a("#merch&3&webp", "merch.json", true)
await a("#yanthra&36&webp", "yanthraEve.json")
}
setup();