-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
253 lines (207 loc) · 5.6 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
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
<!DOCTYPE html>
<html>
<style>
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
button {
border: none;
background-color: darkred;
/* Colore di sfondo */
color: white;
padding: 10px 24px;
/* Spazio interno */
text-align: center;
/* Allinea il testo al centro */
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 10px;
/* Arrotonda gli angoli */
box-shadow: 0 9px #999;
/* Ombra inferiore */
}
button:hover {
/* Colore di sfondo scuro quando passi il mouse sopra */
box-shadow: 0 6px #666;
/* Ombra inferiore più scura */
transform: translateY(3px);
/* Trasla verso il basso per creare l'effetto 3D */
background-color: #4CAF50;
box-shadow: 0 9px #999, ;
/* Adding a white box-shadow when hovering*/
}
#myBtn:focus {
outline: none;
}
#myBtn.clicked {
animation: pulse 0.5s;
}
@keyframes pulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.2);
}
100% {
transform: scale(1);
}
}
#container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
@font-face {
font-family: 'Minecraft';
src: url('/img/minecraft.ttf');
}
h1 {
font-family: 'Minecraft', sans-serif;
text-align: center;
top: 25px;
font-size: 400%;
}
body {
background-image: url('/img/castle.png');
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
}
img {
width: 150px;
height: 150px;
}
#arrow:hover {
opacity: 0.9;
filter: brightness(90%);
}
table {
position: relative;
/* posizione relativa per spostare la tabella */
align-items: center;
}
#immagine {
width: 350px;
height: 250px;
}
#arrow {
width: 150px;
height: 150px;
}
img:hover {
background-color: 0082cf;
}
input[type=text] {
/* spostare input al centro */
padding: 10px;
border: solid #ccc;
text-align: center;
font-size: 20px;
font-family: Minecraft, sans-serif;
color: #555;
width: 300px;
}
</style>
<head>
<script>
// posizione iniziale dell'immagine
var immagini = ["fisherKing", "guineyvere", "ladyOfTheLake", "lancelot", "merlin", "arthurPendragon"];
var posizione = 0;
function avanti() { // funzione per andare avanti
posizione++;
if (posizione >= immagini.length) {
posizione = 0;
}
document.getElementById("immagine").src = "img/" + immagini[posizione] + ".gif";
}
function indietro() { // funzione per andare indietro
posizione--;
if (posizione < 0) {
posizione = immagini.length - 1;
}
document.getElementById("immagine").src = "img/" + immagini[posizione] + ".gif";
}
</script>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
var campoTesto = document.getElementById("campo_texto");
var pulsanteSubmit = document.getElementById("myBtn");
pulsanteSubmit.addEventListener("click", function () {
var urlDestinazione = 'entry.html?' + campoTesto.value + "/" + immagini[posizione];
window.location.href = urlDestinazione;
});
});
function clickTest() {
// Crea l'URL di destinazione con il parametro della query string
var urlDestinazione = 'indexOriginal.html?' + campoTesto.value;
// Reindirizza l'utente alla pagina di destinazione
window.location.href = urlDestinazione;
}
</script>
</head>
<body>
<h1>Dungeons Castle</h1>
<h2 style="font-family: Minecraft, sans-serif; text-align: center; font-size: 36px;">
The castle has been infected with a demonic force and your army is turning against you. <br>
Dress the role of the hero and protect your kingdom ... fast!
</h2>
<table style="margin: 0 auto;">
<tr>
<td colspan="2">
<img id="immagine" src="img/FisherKing.gif">
</td>
</tr>
<tr>
<td style="text-align: left;">
<a href="#" onclick="indietro()"><img id="arrow" src="/img/ArrowSX.png"></a>
<!-- pulsante per andare indietro -->
</td>
<td style="text-align: right;">
<a href="#" onclick="avanti()"><img id="arrow" src="/img/ArrowDX.png"></a> <!-- pulsante per andare indietro -->
</td>
</tr>
</table>
<table style="margin: 0 auto;">
<tr>
<td style="text-align: center;">
<!-- if an argument is passed in the url, create a input text box with that argument just filled -->
<script type="text/javascript">
var url = window.location.href;
var room = url.split('?')[1];
if (room != null) {
document.write('<input type="text" value="' + room + '" id="campo_texto" placeholder="Insert the Room..."><br><br>');
} else {
document.write('<input type="text" value="" id="campo_texto" placeholder="Insert the Room name..."><br><br>');
}
</script>
<!-- <input type="text" value="" id="campo_texto" placeholder="Insert the Room..."><br><br> -->
<button id="myBtn" style="font-family: Minecraft, sans-serif; ">Enter</button>
</td>
</tr>
</table>
<!-- visualizza l'immagine mov.png, la scritta Move, l'immagine mapc.png e la scritta Attack in una riga -->
<table style="margin: 0 auto;">
<tr>
<td style="text-align: center;">
<img src="/img/map.png" style="width: fit-content; height: 150px;">
</td>
<td style="text-align: center;">
<h3 style="font-family: Minecraft, sans-serif; text-align: center; font-size: 24px; color: lightgray">Move</h3>
</td>
<td style="text-align: center;">
<img src="/img/mapc.png" style="width: fit-content; height: 150px;">
</td>
<td style="text-align: center;">
<h3 style="font-family: Minecraft, sans-serif; text-align: center; font-size: 24px; color: lightgray">Attack</h3>
</td>
</tr>
</body>
</html>