forked from Scratch-Empires/website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
188 lines (165 loc) · 8.45 KB
/
index.html
File metadata and controls
188 lines (165 loc) · 8.45 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wght@8..144,100..1000&display=swap" rel="stylesheet">
<title>Scratch Empires Website</title>
<link rel="icon" type="image/x-icon" href="/images/Favicon.png">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styleA.css">
</head>
<body>
<div class="navbar">
<a href="./admins.html" id="otheritem">Admins</a>
<a href="./news.html">Announcements</a>
<a href="./contact.html">Contact</a>
<a href="./seasons.html">Seasons</a>
</div>
<div class="container">
<div class="main-content">
<h1>Welcome to Scratch Empires</h1>
<img src="./images/SE4LOGO.png" alt="Scratch Empires Season 4 Logo" onclick="openFullscreen(this)">
<div class="caption">Scratch Empires 4, the current iteration of Scratch Empires.</div>
<p>Welcome to Scratch Empires, the ultimate Minecraft server where creativity meets strategy! Here, you can create your own nation and conquer the world. Join us in Season 4, where new challenges, features, and adventures await you as you build and expand your empire. Whether you’re forming alliances or waging wars, the power to shape your destiny is in your hands. Are you ready to rise to the top?</p>
</div>
<div class="gallery">
<img src="images/image1.png" alt="Gallery Image 1" onclick="openFullscreen(this)">
<img src="images/image2.png" alt="Gallery Image 2" onclick="openFullscreen(this)">
<img src="images/image3.png" alt="Gallery Image 3" onclick="openFullscreen(this)">
</div>
<button class="view-all-button" onclick="openModal()">View All</button>
<div id="myModal" class="modal">
<span class="close" onclick="closeModal()">×</span>
<div class="modal-content">
<img src="images/image1.png" alt="Gallery Image 1" onclick="openFullscreen(this)">
<img src="images/image2.png" alt="Gallery Image 2" onclick="openFullscreen(this)">
<img src="images/image3.png" alt="Gallery Image 3" onclick="openFullscreen(this)">
<img src="images/image4.png" alt="Gallery Image 4" onclick="openFullscreen(this)">
<img src="images/image5.png" alt="Gallery Image 5" onclick="openFullscreen(this)">
<img src="images/image6.png" alt="Gallery Image 6" onclick="openFullscreen(this)">
<img src="images/image7.png" alt="Gallery Image 7" onclick="openFullscreen(this)">
<img src="images/image8.png" alt="Gallery Image 8" onclick="openFullscreen(this)">
<img src="images/image9.png" alt="Gallery Image 9" onclick="openFullscreen(this)">
<img src="images/image10.png" alt="Gallery Image 10" onclick="openFullscreen(this)">
</div>
</div>
<style>
.fullscreen-modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
justify-content: center;
align-items: center;
overflow: hidden;
z-index: 1000;
}
.fullscreen-modal img {
position: relative;
max-width: none;
max-height: none;
transition: transform 0.2s;
cursor: grab;
}
.fullscreen-modal img:active {
cursor: grabbing;
}
.fullscreen-modal .close,
.fullscreen-modal .zoom-in,
.fullscreen-modal .zoom-out {
position: absolute;
top: 20px;
color: white;
font-size: 30px;
font-weight: bold;
padding: 10px;
cursor: pointer;
z-index: 1001;
}
.fullscreen-modal .close {
right: 20px;
}
.fullscreen-modal .zoom-in {
right: 60px;
}
.fullscreen-modal .zoom-out {
right: 100px;
}
</style>
<body>
<div id="fullscreenModal" class="fullscreen-modal">
<span class="close" onclick="closeFullscreen()">×</span>
<span class="zoom-in" onclick="zoomIn()">+</span>
<span class="zoom-out" onclick="zoomOut()">-</span>
<img id="fullscreenImage" src="" alt="Fullscreen Image">
</div>
<script>
let isDragging = false;
let startX, startY, initialLeft, initialTop;
function openModal() {
document.getElementById("myModal").style.display = "flex";
}
function closeModal() {
document.getElementById("myModal").style.display = "none";
}
function openFullscreen(img) {
const fullscreenModal = document.getElementById("fullscreenModal");
const fullscreenImage = document.getElementById("fullscreenImage");
fullscreenImage.draggable = false;
fullscreenImage.src = img.src;
fullscreenModal.style.display = "flex";
fullscreenImage.style.transform = "scale(1)";
fullscreenImage.style.left = '0px';
fullscreenImage.style.top = '0px';
}
function closeFullscreen() {
document.getElementById("fullscreenModal").style.display = "none";
}
function zoomIn() {
const img = document.getElementById("fullscreenImage");
const currScale = getCurrentScale(img);
img.style.transform = "scale(" + (currScale + 0.1) + ")";
}
function zoomOut() {
const img = document.getElementById("fullscreenImage");
const currScale = getCurrentScale(img);
img.style.transform = "scale(" + Math.max(currScale - 0.1, 1) + ")";
}
function getCurrentScale(element) {
const style = window.getComputedStyle(element);
const matrix = new WebKitCSSMatrix(style.transform);
return matrix.a; // Returns the current scale
}
function startDrag(event) {
isDragging = true;
startX = event.clientX;
startY = event.clientY;
const fullscreenImage = document.getElementById("fullscreenImage");
initialLeft = parseInt(window.getComputedStyle(fullscreenImage).left, 10) || 0;
initialTop = parseInt(window.getComputedStyle(fullscreenImage).top, 10) || 0;
fullscreenImage.style.cursor = 'grabbing';
}
function stopDrag() {
isDragging = false;
const fullscreenImage = document.getElementById("fullscreenImage");
fullscreenImage.style.cursor = 'grab';
}
function drag(event) {
if (isDragging) {
const dx = event.clientX - startX;
const dy = event.clientY - startY;
const fullscreenImage = document.getElementById("fullscreenImage");
fullscreenImage.style.left = initialLeft + dx + 'px';
fullscreenImage.style.top = initialTop + dy + 'px';
}
}
document.getElementById('fullscreenImage').addEventListener('mousedown', startDrag);
document.addEventListener('mouseup', stopDrag);
document.addEventListener('mousemove', drag);
</script>
</body></html>