-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
154 lines (134 loc) · 3.91 KB
/
Copy pathindex.html
File metadata and controls
154 lines (134 loc) · 3.91 KB
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
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Elia Dian - Fotografia</title>
<style>
body {
margin: 0;
font-family: 'Arial', sans-serif;
background-color: #f9f5f0;
color: #333;
}
header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 20px;
background-color: #f4ede7;
}
header h1 {
margin: 0;
font-size: 24px;
cursor: pointer;
color: #333;
text-decoration: none;
}
nav {
display: none;
position: absolute;
top: 40px;
left: 0;
background-color: #f4ede7;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
z-index: 1000;
}
nav a {
display: block;
padding: 10px 20px;
text-decoration: none;
color: #333;
font-size: 16px;
border-bottom: 1px solid #ccc;
transition: background-color 0.3s;
}
nav a:hover {
background-color: #ddd;
}
nav a:last-child {
border-bottom: none;
}
header h1:hover + nav {
display: block;
}
header nav:hover {
display: block;
}
main {
display: flex;
justify-content: center;
align-items: center;
height: calc(100vh - 60px);
background-color: #f9f5f0;
}
img {
max-width: 90%;
max-height: 90%;
cursor: pointer;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
transition: transform 0.3s, box-shadow 0.3s;
}
img:hover {
transform: scale(1.05);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}
footer {
text-align: center;
padding: 10px 0;
background-color: #f4ede7;
}
footer p {
margin: 0;
font-size: 14px;
color: #555;
}
</style>
</head>
<body>
<header>
<h1>Elia Dian</h1>
<nav>
<a href="paesaggi.html">Paesaggi</a>
<a href="ritratti.html">Ritratti</a>
<a href="street.html">Street</a>
<a href="chisono.html">Chi Sono</a>
</nav>
</header>
<main>
<img id="randomImage" src="" alt="Foto casuale">
</main>
<footer>
<p>Elia Dian © 2024 - Tutti i diritti riservati</p>
</footer>
<script>
// Percorsi delle immagini
const images = [
"Foto/VistaFirenze(ColorGraiding).jpg",
"Foto/GiacomoIslanda.jpg",
"Foto/CascateIslanda.jpg",
"Foto/BidoFirenze.jpg",
"Foto/Chiara Telefono.jpg",
"Foto/Martina.jpg",
"Foto/Bacio.jpg",
"Foto/Homeless BW.jpg",
"Foto/Homeless Colori.jpg"
];
// Elemento immagine
const randomImage = document.getElementById("randomImage");
// Funzione per scegliere un'immagine casuale
function getRandomImage() {
const randomIndex = Math.floor(Math.random() * images.length);
return images[randomIndex];
}
// Imposta l'immagine iniziale
randomImage.src = getRandomImage();
// Cambia immagine al click
randomImage.addEventListener("click", () => {
randomImage.src = getRandomImage();
});
</script>
</body>
</html>