-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html-bkp20220423
439 lines (360 loc) · 17.9 KB
/
index.html-bkp20220423
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CRYPTOMURALS</title>
<link rel="icon" href="./resources/favicon.ico" />
<link rel="stylesheet" href="./navBar.css">
<link rel="stylesheet" href="./main.css">
<link rel="stylesheet" href="./hamburger.css">
<style>
/* fixes */
/* .mcontent.isOpen */
#navContainer, #main{
transition: transform 0.3s;
}
#navContainer{
display: grid;
/* grid-template-columns: 1fr repeat(3, auto) 1fr; */
grid-template-columns: 1fr 2fr 1fr;
grid-column-gap: 5px;
justify-items: center;
grid-template-areas: "icon logo logbutton";
}
#logo{
grid-area: logo;
}
#logbutton{
grid-area: logbutton;
}
.navIsOpen{
transform: scale(0.8);
opacity: 0.6;
transition: transform 0.3s;
}
#main-navbar{
width: 100vw!important
overflow:hidden;
}
#addr{
font-size: 0.81em;
margin-left: 30px;
margin-right: 30px;
line-height: 80px;
}
#addrCont{
width:100%
}
/* @media (max-width: 680px){ */
@media (max-width: 768px){
#navContainer{
/* background-color: red; */
flex-direction:column!important;
/* margin-left: 0!important; */
}
.hamburguer-menu-container{
position: absolute;
top: 40px;
}
#addr{
line-height: 42px;
}
}
</style>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.all.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
<script src="https://unpkg.com/moralis/dist/moralis.js"></script>
</head>
<body>
<!-- MENU -->
<div style="display: inline-flex;flex: 1" class="menu">
<!-- 1 icono y city -->
<div style="display: flex" class='hamburguer-menu-container'>
<div style="align-self: center; width: 100px;" class='hamburger hamburger--vortex-r hamburguer-menu'>
<div class='hamburger-box'>
<div class='hamburger-inner'></div>
</div>
</div>
<div style=" margin: auto; color: white; text-decoration: underline; font-family: Monoton; " class='mn city-layout'> CITY </div>
</div>
<!-- 2 menu contents -->
<div style=" position: fixed; top: 90px; left: 0px; width: 600px; z-index: 999" class="menu-main hidden">
<div class='options-menu'>Home</div>
<div class='options-menu'><a href="https://gardens.1hive.org/#/matic/garden/0x963d4a1cd9fb345a624e46c9470df572f0b35a72" target="_blank">Join the DAO</a></div>
<div class='options-menu'><a href="" target="_blank">WHITEPAPER - WIP</a></div>
</div>
</div>
<!-- HEAD -->
<!-- <div id="main-navbar"> -->
<div id='navContainer' class=''>
<!-- 1 LOGO -->
<div id="logo" class='' >
<div style="justify-content: center">
<img class='logo-cryptomurals' width='100%' height='100px' src="./resources/logo_cryptomurals.svg"
alt="logo cryptomurals" />
</div>
</div>
<!-- 2 LOGIN/OUT -->
<div id='logbutton' style=" display: flex; flex-direction: row; margin: 0 auto; justify-content: flex-end; text-align: center;">
<div id="logg" style="align-self: center; width: auto" class='btn-connect-container'>
<button style=" border-radius: 25px; border: none; font-family: Monda; background-Image: linear-gradient(90deg, rgba(46,167,227, 1) 0%, rgba(46, 167,227,1) 10%, rgba(250,4,254,1) 90%); color: white; word-spacing: 5px;" class='btn-connect-wallet'
onclick="login()"> Connect Wallet </button>
</div>
</div>
</div>
<main id="main" class='mn' style="height: 100%; flex-direction: column; display: flex">
<div style="display: flex; flex: 1">
<div style="margin: auto">
<div class="white-grad">
<div style=" margin: 0px auto; text-align: center; justify-content: center; display: flex; height: 100%; align-items: center; color: white; font-size: 30px; display: flex; flex-direction: column; ">
<div class="circle-main-container-first">
<div style=" font-family: Monoton; display: flex; word-spacing: 10px; " class='circle-main'> DISCOVER THE <br /> MURALS OF </div>
<div style="position: relative; min-width: 240px">
<div style=" border: 2px solid #c2c2c2; background-color: #525252; border-radius: 25px; padding-right: 10px; padding-left: 10px; display: flex; flex-direction: row; " onclick="showOptionsCity()">
<div style=" flex: 1; font-family: Monoton; color: #1ae2bd; " class='circle-select'> THE WORLD </div>
<div style="fontSize: 14px; align-self: center">▼</div>
</div>
<div class="options-city-container">
</div>
</div>
<div style=" font-family: Monoton; word-spacing: 10px; " class='circle-main'> & COLLECT THEM </div>
</div>
<div style=" font-family: Monoton; flex-direction: column; word-spacing: 10px; " class='circle-main circle-main-container-second hidden'> WELCOME TO <br /> <div class="city-circle"></div> <br />
<!-- <a style="font-family: Monda;letter-spacing: 3px;" class='link-city' href="/gallery"> -->
<p style="font-family: Monda;letter-spacing: 3px;" class='link-city' > COMING SOON! </p>
<br>
<a href="https://gardens.1hive.org/#/matic/garden/0x963d4a1cd9fb345a624e46c9470df572f0b35a72" target="_blank">Join the DAO</a>
</div>
</div>
</div>
</div>
</div>
<!-- UNLOCKABLE CONTENT -->
<div style=" display: none; text-align: center; align-self: center; margin: 20px; flex: 1; " class="community-symbol">
<div style=" border-radius: 50%; width: 100px; height: 100px; background-Image: linear-gradient( 90deg, rgba(79, 143, 106, 1) 0%, rgba(55, 135, 127, 1) 26%, rgba(30, 127, 147, 1) 100%); color: white; text-align: center; display: flex; ">
<div style=" flex: 1; justify-self: center; align-self: center; font-family: Monda; font-size: 18px; ">
community unlockable content
</div>
</div>
</div>
<!-- SOCIAL ICONS -->
<div class='container-icon-social-networks'>
<div>
<a href="https://www.instagram.com/cryptomurals/" target="_blank">
<img width="24px" height="24px" color="white" src='./resources/twitter-brands.svg'
style="margin: 10px; left: 0px" class='icon-social-networks' />
</a>
<a href="https://discord.com/invite/rv5kY7dGE4" target="_blank">
<img width="24px" height="24px" color="white" src='./resources/discord-brands.svg'
style="margin: 10px; left:34px" class='icon-social-networks' />
</a>
<a href="https://www.instagram.com/cryptomurals/" target="_blank">
<img width="24px" height="24px" color="white" src='./resources/instagram-brands.svg'
style="margin: 10px; left: 68px" class='icon-social-networks' />
</a>
<a href="https://www.youtube.com/channel/UCTFJhD1wGT_stDUk3_dnwAw" target="_blank">
<Img width="24px" height="24px" color="white" src='./resources/youtube-brands.svg'
style="margin: 10px; left: 102px" class='icon-social-networks' />
</a>
<a href="https://join.status.im/c/0x03855e1dffc64d7647c7c043a5666f6f0384c1caa943ad848c63a0a51687436b55" target="_blank">
<Img width="24px" height="24px" color="white" src='./resources/Status-logo_white.svg'
style="margin: 10px; left: 136px" class='icon-social-networks' />
</a>
</div>
</div>
</main>
<!-- </div> -->
<script>
const _btnHamburguerMenu = document.querySelector('.hamburguer-menu');
const menuMain = document.querySelector('.menu-main');
const cities = ['THE WORLD','PARIS', 'ROMA'];
let city = 'THE WORLD';
let resolutionSmall = false;
let showOptions = false;
// effect
// const main = document.querySelector('.mn');
_btnHamburguerMenu.addEventListener('click', (e) => {
console.log('nav clicked');
_btnHamburguerMenu.classList.toggle('is-active');
menuMain.classList.toggle('hidden');
// $("li").velocity("transition.slideLeftIn", { stagger: 250, drag: true });
// menuMain.classList.toggle('animate__fadeInLeft');
// menuMain.classList.add('animate__animated', 'animate__fadeInLeft');
// animateCSS('.menu-main', 'bounce');
// effect
navContainer.classList.toggle('navIsOpen');
main.classList.toggle('navIsOpen');
// main.classList.toggle('navIsOpen');
});
// const _btnConnectWallet = document.querySelector('.btn-connect-wallet');
// const _btnDisconnectWallet = document.querySelector('.btn-disconnect');
function ConnectWallet() {
console.log('login!');
login()
// _btnConnectWallet.classList.toggle('hidden');
// _btnDisconnectWallet.classList.toggle('hidden');
}
function disconnectWallet() {
logOut();
// _btnConnectWallet.classList.toggle('hidden');
// _btnDisconnectWallet.classList.toggle('hidden');
}
/*********************************************************************************************
.) LOGG stuff
**********************************************************************************************/
// 0. Check moralis
const serverUrl = "https://hyorvrgxcdmm.usemoralis.com:2053/server";
const appId = "Lx28OvD1jYsfl8Q52brKgUbJ1yGP9kWgffDg2hrU";
// Moralis.start({ serverUrl, appId });
// const CHAIN = "mumbai";
// const TOKEN_CONTRACT_ADDRESS = "0x41854405916B936Eb079F9F83d8077d67b72bCC9";
const init = async () => {
await Moralis.start({
appId : appId,
serverUrl: serverUrl
});
Moralis.initPlugins();
};
init();
// LOGIN
async function login() {
console.log('login tryied');
let user = Moralis.User.current();
if (!user) {
try {
let user = await Moralis.authenticate({
signingMessage: "Hello from cryoptomurals!"
})
let userAddress = user.get('ethAddress');
var x = userAddress;
// var shortAddr = x.substring(0, 8) + "...";
var shortAddr = x.substring(0, 6) + "..."+x.substring(38, 42);
// document.getElementById("logg").innerHTML = "<p class='loged btn-grad-inv'>" + shortAddr + " <i class='logout fa fa-sign-out' aria-hidden='true' onclick='event.stopPropagation();logOut()'></i> </p> <p style='display:none' class='responsiveloged btn-grad-inv'> <i class='logout fa fa-sign-out' aria-hidden='true' onclick='event.stopPropagation();logOut()'></i> </p>";
// document.getElementById("logg").innerHTML=` <div style="width:auto;height: 50px" class="" onclick="logOut()">
// <div style="border-radius: 50%; background-image: linear-gradient(90deg, rgba(46,167,227, 1) 0%, rgba(46, 167,227,1) 10%, rgba(250,4,254,1) 90%); color: white;" class='btn-connected'></div>
// <div style="font-family:Monda; color: white"> ${shortAddr}</div>
// </div>`
document.getElementById("logg").innerHTML=` <div style="width:auto;height: 50px" class="" onclick="logOut()">
<div id='addrCont' style="border-radius: 50%; background-image: linear-gradient(90deg, rgba(46,167,227, 1) 0%, rgba(46, 167,227,1) 10%, rgba(250,4,254,1) 90%); color: white;" class='btn-connected'>
<div id='addr' style="font-family:Monda; color: white"> ${shortAddr}</div>
</div>
</div>`
console.log('User address: ', userAddress);
} catch (error) {
console.log(error)
}
} else {
console.log('user is already here...');
Moralis.enableWeb3(); //if user has a sesion authenticate is not called so metamaks is not initiated, here we fix this
let userAddress = user.get('ethAddress');
var x = userAddress;
// var shortAddr = x.substring(0, 8) + "...";
var shortAddr = x.substring(0, 6) + "..."+x.substring(38, 42);
document.getElementById("logg").innerHTML=` <div style="width:auto;height: 50px" class="" onclick="logOut()">
<div id='addrCont' style="border-radius: 50%; background-image: linear-gradient(90deg, rgba(46,167,227, 1) 0%, rgba(46, 167,227,1) 10%, rgba(250,4,254,1) 90%); color: white;" class='btn-connected'>
<div id='addr' style="font-family:Monda; color: white"> ${shortAddr}</div>
</div>
</div>`
}
}
// LOGOUT
async function logOut() {
await Moralis.User.logOut();
// document.getElementById("logg").innerHTML = `<button class="btn-grad" onclick="login();">Connect</button>`;
document.getElementById("logg").innerHTML = ` <button style=" border-radius: 25px; border: none; font-family: Monda; background-Image: linear-gradient(90deg, rgba(46,167,227, 1) 0%, rgba(46, 167,227,1) 10%, rgba(250,4,254,1) 90%); color: white; word-spacing: 5px;" class='btn-connect-wallet'
onclick="login()"> Connect Wallet </button>`
console.log("logged out");
}
// ------------
function showOptionsCity() {
showOptions = !showOptions;
let _optionsMenuCity = document.querySelector('.options-city-container');
if (showOptions) {
_optionsMenuCity.innerHTML = `<div style="background-color: #525252;
position: absolute;
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
text-align: center;"
class="city-options">
${cities.map((optionNext, index) => {
return (
`<div
key="${optionNext}"
style="font-family: Monoton"
class='circle-select'
onclick="selectCity(${Number(index)})"
>
${optionNext}
</div>`
);
}).join(" ")}
</div>`
} else {
_optionsMenuCity.innerHTML = '';
}
}
function selectCity(index) {
index = Number(index);
city = cities[index];
showOptionsCity();
const _cicleSelect = document.querySelector('.circle-select');
_cicleSelect.textContent = city;
const _logoMenu = document.querySelector('.logo-cryptomurals');
const _citySelected = document.querySelector('.city-layout');
_citySelected.textContent = city;
const _circle = document.querySelector('.white-grad');
const _cicleMainContainerFirst = document.querySelector('.circle-main-container-first');
const _cicleMainContainerSecond = document.querySelector('.circle-main-container-second');
const _circleCity = document.querySelector('.city-circle');
_circleCity.textContent = city;
const _community = document.querySelector('community-symbol');
if (city != "THE WORLD") {
_logoMenu.classList.remove('hidden');
_circle.classList.add('white-grad-select');
_cicleMainContainerFirst.classList.add('hidden');
_cicleMainContainerSecond.classList.remove('hidden');
// _community.classList.remove('content-unlock');
// _community.classList.add('content-unlock-hidden');
} else {
_logoMenu.classList.add('hidden');
_circle.classList.remove('white-grad-select');
_cicleMainContainerFirst.classList.remove('hidden');
_cicleMainContainerSecond.classList.add('hidden');
_community.classList.add('content-unlock');
_community.classList.remove('content-unlock-hidden');
var _cityCircle = document.querySelector('city-circle');
_cityCircle.textContent = city;
}
}
window.addEventListener('resize', (e) => {
resizeWindow();
});
function resizeWindow() {
if (window.innerWidth <= 768) {
resolutionSmall = true
} else {
resolutionSmall = false
}
const navLayout = document.querySelector('.nav-layout');
console.log(navLayout.style.flexDirection);
// // const _containerBtnConnect = document.querySelector('.btn-connect-container');
// const _btnDisconnectWallet = document.querySelector(
// '.btn-disconnect'); //width: navPosition && city === 'THE WORLD' ? 200 : 'auto',
// if (resolutionSmall && city === 'THE WORLD') {
// navLayout.style.flexDirection = 'column';
// _btnDisconnectWallet.style.width = '200px';
// _containerBtnConnect.style.width = '200px';
// } else {
// navLayout.style.flexDirection = 'row';
// _btnDisconnectWallet.style.width = 'auto';
// _containerBtnConnect.style.width = 'auto';
// }
}
resizeWindow();
</script>
</body>
</html>