-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
201 lines (194 loc) Β· 6.09 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="favicon.ico" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>Silvanus</title>
<meta name="description" content="π³ Grow your metaverse tree" />
<meta name="twitter:card" content="summary_large_image" />
<meta property="og:title" content="Silvanus" />
<meta property="og:description" content="π³ Silvanus" />
<meta property="twitter:image" content="" />
<meta property="og:image" content="" />
<meta name="robots" content="index,follow" />
<meta name="url" content="http://needle.tools" />
<script
src="https://cdn.ethers.io/lib/ethers-5.2.umd.min.js"
type="application/javascript"
></script>
<link rel="stylesheet" href="./src/styles/style.css" />
</head>
<body>
<script type="module" src="./src/scripts/web3Connect.js"></script>
<script>
// hack for simple-peer
window.global = window;
var parcelRequire;
function showCredits(evt) {
evt.preventDefault();
const credits = document.getElementById('credits-view');
if (credits) {
if (credits.style.display === 'block') credits.style.display = 'none';
else credits.style.display = 'block';
}
}
function closeCredits(evt) {
evt.preventDefault();
const credits = document.getElementById('credits-view');
if (credits) credits.style.display = 'none';
}
function showConnects(evt) {
evt.preventDefault();
const credits = document.getElementById('connects-view');
if (credits) {
if (credits.style.display === 'block') credits.style.display = 'none';
else credits.style.display = 'block';
}
}
function closeConnects(evt) {
evt.preventDefault();
const credits = document.getElementById('connects-view');
if (credits) credits.style.display = 'none';
}
</script>
<script type="module" src="./src/generated/gen.js"></script>
<script type="module" src="./src/main.ts"></script>
<script></script>
<!-- <script type="module" src="./include/silvanu.js"></script> -->
<div id="main">
<needle-engine id="tiny">
<div
class="desktop overlay"
style="
position: absolute;
z-index: 100;
visibility: visible;
display: block;
"
>
<div id="ui">
<div class="credits-menu blurred-background">
<button class="room-button" onclick="showCredits(event)">
π³ <strong>Silvanus</strong>
</button>
<button id="join-room-button" class="room-button">
<!-- onclick="clickedJoinRoomButton(event)" -->
<span class="text">Create Room</span>
<p class="tooltip" id="join-room-button-tooltip">
Click to create a multi-user room. You can invite friends!
</p>
</button>
<button
class="room-button"
id="connect-to-metamask"
onclick="showConnects(event)"
>
<span class="text">Connect</span>
<p class="tooltip" id="connect-to-metamask-tooltip">
Connect to optimism
</p>
</button>
<button
class="room-button"
id="audio-toggle"
onclick="toggleAudio(event)"
>
<span>π</span>
<p class="tooltip">Music on/off</p>
</button>
</div>
</div>
<div id="credits-view" class="credits-overlay blurred-background">
<p class="close" href="#" onclick="closeCredits(event)">β</p>
<h1>Silvanus <span>NFT tree</span></h1>
<h2>How To Play</h2>
<p>
<button
onclick="mintTree()"
style="
border: 0px;
background-color: #0000;
cursor: pointer;
color: gray;
"
>
[Mint Tree]
</button>
&
<strong>Grow your own meta tree!</strong> Drag the vess and water
your NFT plant, by hovering over it. A request will be sent to
metamask for approval. <br />Works on
<strong>Desktop, Mobile, VR, AR</strong>, all right in your
browser.
</p>
<p>
<strong>Invite your friends!</strong> Click
<em>Create Room</em> to be put into a live, multi-user space β
just copy the URL, send it to a friend and they join you
automatically.<br />
</p>
<h2>Game tokens</h2>
<p>
To track game tokens in your metamask wallet
<button
onclick="addTokens()"
style="
border: 0px;
background-color: #0000;
cursor: pointer;
color: gray;
border-bottom: 2px dotted black;
"
>
click here
</button>
and confirm on metamask.
</p>
<!-- <p>
<h2>Info</h2>
This page was authored in
<a href="https://unity.com" target="_blank">Unity</a> and exported
to
<a href="https://threejs.org" target="_blank">three.js</a> using
tools and technologies by π΅ <a
href="https://needle.tools"
target="_blank"
>needle</a
>.
</p>
<p>
There are a lot of open technologies involved: 3D models are in
<a href="https://github.com/KhronosGroup/glTF" target="_blank"
>glTF format</a
>, the render engine is
<a href="https://threejs.org" target="_blank">three.js</a>, VR and
AR are using
<a href="https://immersiveweb.dev/" target="_blank">WebXR</a>. The
networking server runs on
<a href="https://glitch.com" target="_blank">Glitch</a>, and audio
is sent over WebRTC using
<a href="https://peerjs.com/">PeerJS</a>.
</p> -->
<h2>Get in touch π³</h2>
<p>
<strong>Follow us</strong> on Twitter for more! @<a
href="https://twitter.com/silvanu_Tree"
>Silvanus_Tree</a
>
</p>
</div>
<div id="connects-view" class="connects-overlay blurred-background">
<p class="close" href="#" onclick="closeConnects(event)">β</p>
<h2>Connect wallet</h2>
<p>
<button class="room-button" onclick="walletConn(event)">
<strong>MetaMask Connect</strong>
</button>
</p>
</div>
</div>
</needle-engine>
</div>
</body>
</html>