-
Notifications
You must be signed in to change notification settings - Fork 182
/
Copy pathindex.html
395 lines (388 loc) · 15.3 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
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
<!DOCTYPE html>
<html>
<head>
<script
async
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5598129470490010"
crossorigin="anonymous"
></script>
<!-- Google tag (gtag.js) -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-Y71QM9DR66"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "G-Y71QM9DR66");
</script>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<meta
name="description"
content="MacVG is the ultimate gaming platform with 400+ games, unique features, and an engaging gaming experience. Discover, play, and connect with MacVG."
/>
<title class="cloak">Home | MacVG</title>
<link class="favicon" rel="icon" type="image/x-icon" href="/logo.png" />
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="games.css" />
</head>
<body>
<nav class="nav" id="nav">
<div class="overflowm shoot" id="overflowm">
<img src="media/bars-solid.svg" alt="Menu" class="shoot" />
</div>
<a href="/macvg/" class="logo2" style="background-color: transparent">
<img src="/macvg/media/macvg-logo.png" alt="MacVG Logo" />
</a>
<a href="new.html" class="nav-link">New</a>
<a href="trending.html" class="nav-link">Trending</a>
<a href="recent.html" class="nav-link">Recent</a>
<a href="/macvg/settings.html" class="nav-link">Settings</a>
<div class="right">
<div class="select help-menu">
<span class="help-label help-menu">Originals</span>
<img src="media/caret.svg" class="caret help-menu" id="caret" />
<ul id="cats" class="cats help-menu">
<a href="/macvg/originals/atomic/" target="_blank"
>Atomic Clicker</a
>
<a href="/macvg/originals/macboard/" target="_blank">MacBoard</a>
</ul>
</div>
<div class="select help-menu">
<span class="help-label help-menu">Help</span>
<img src="media/caret.svg" class="caret help-menu" id="caret" />
<ul id="cats" class="cats help-menu">
<a href="/macblog/projects/macvg/" target="_blank">About</a>
<a href="/macblog/updates/macvg/" target="_blank">Updates</a>
<a href="/macblog/projects/macvg/" target="_blank">Docs</a>
<a href="https://forms.gle/UpHgbAmLtUPCD5bs8" target="_blank"
>Feedback</a
>
</ul>
</div>
<img src="media/profile.svg" class="profile" id="profile" />
</div>
</nav>
<div class="macsidebar" id="sidebar">
<a href="/"><img src="/logo.png" alt="" /></a>
<a href="/macideas/"><img src="/MacIdeas Logo.png" alt="" /></a>
<a href="/maclearn/"><img src="/MacLearn Logo.png" alt="" /></a>
<a href="/mactime/"><img src="/MacTime Logo.png" alt="" /></a>
<a href="/macvg/"><img src="/MacVG Logo.png" alt="" /></a>
<a href="/macblog/"><img src="/MacBlog Logo.png" alt="" /></a>
</div>
<div class="modal-background">
<div class="modal">
<h2 class="modal-title">MacVG Winter Update</h2>
<img src="media/update.jpg" class="modal-img" />
<p class="modal-des">
HUGE UPDATE: VERSION 3.0, 40+ new games, new features, logo,
improvements, fixes, removed features, and more!
</p>
<a
href="/macblog/updates/macvg/2025/winter.html"
class="modal-link"
target="_blank"
>
What's new
</a>
</div>
</div>
<script>
let updateModal = document.querySelector(".modal-background");
if (localStorage.macvgmodall) {
updateModal.style.display = "none";
}
</script>
<div class="wrap" id="wrap">
<header class="homeheader">
<div class="title" name="Welcome to MacVG!">Welcome to MacVG!</div>
<div class="sub">
<b
style="
font-size: 23px;
margin-bottom: 15px;
display: block;
font-style: italic;
"
>Fun, redefined:</b
>
Hundreds of games, countless features, endless play!
</div>
</header>
<div class="functions" id="functions">
<input
type="text"
id="searchInput"
oninput="search()"
autocomplete="off"
placeholder="Search All Games"
/>
<button class="search-clear" id="search-clear">
<img src="media/close.svg" />
</button>
<button class="random" id="random" title="Random Game Selector">
🎲
</button>
</div>
<div class="filters">
<div class="filter" id="sort">
<div class="label">Sort By: Name</div>
<div class="filter-list">
<li class="filter-item" id="sort-name">Name</li>
<li class="filter-item" id="sort-catagory">Category</li>
</div>
</div>
<div class="filter" id="filter">
<div class="label">Filter All (420)</div>
<div class="filter-list">
<li class="filter-item" id="filter-all">All</li>
<li class="filter-item" id="filter-featured">Featured (50)</li>
<li class="filter-item" id="filter-action">Action (165)</li>
<li class="filter-item" id="filter-strategy">Strategy (136)</li>
<li class="filter-item" id="filter-casual">Casual (64)</li>
<li class="filter-item" id="filter-driving">Driving (55)</li>
<li class="filter-item" id="filter-download">Downloadable (68)</li>
</div>
</div>
<button class="filter direction" id="direction">
<img src="media/up.svg" />
</button>
</div>
<div class="games-container" id="favoriteList" style="position: relative">
<button
id="fvrbtn"
style="position: absolute; top: 0; right: 0"
title="Clear Favorites"
>
<img src="media/trash-solid.svg" />
</button>
</div>
<div class="games-container" id="randomList"></div>
<div class="ad-container">
<!-- MacVG homepage ads -->
<ins
class="adsbygoogle"
data-ad-client="ca-pub-5598129470490010"
data-ad-slot="3087664545"
data-ad-format="auto"
data-full-width-responsive="true"
></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
<div class="games-container" id="list"></div>
<div class="ad-container">
<!-- MacVG homepage ads -->
<ins
class="adsbygoogle"
data-ad-client="ca-pub-5598129470490010"
data-ad-slot="3087664545"
data-ad-format="auto"
data-full-width-responsive="true"
></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</div>
<footer class="footer">
© 2024 <a href="/">MacWeb</a
><span style="color: black; user-select: none; background-color: black"
>MacVG</span
>
All rights reserved<br />
Have fun playing these unblocked fun games!🎮🎮🎮<br
style="margin-bottom: 10px"
/>
<a
href="https://github.com/Mac-Web/macvg"
target="_blank"
style="padding-inline: 10px; text-decoration: underline"
>GitHub</a
>
<a
href="https://www.youtube.com/channel/UCE2BzeKnoYbaL4B2Iidz2ag"
target="_blank"
style="padding-inline: 10px; text-decoration: underline"
>YouTube</a
>
<a
href="https://www.youtube.com/watch?v=xvFZjo5PgG0"
target="_blank"
style="padding-inline: 10px; text-decoration: underline"
>More games!</a
>
</footer>
<script src="/macvg/app.js"></script>
<script>
function launchGame() {
console.log(this.innerHTML);
}
document.addEventListener("DOMContentLoaded", function () {
let updateModal = document.querySelector(".modal-background");
document.addEventListener("click", (e) => {
if (e.target === updateModal) {
e.target.style.display = "none";
localStorage.setItem("macvgmodall", "true");
}
});
});
if (
localStorage.getItem("favorites") === "" ||
localStorage.getItem("favorites") === null
) {
const favoriteList = document.getElementById("favoriteList");
favoriteList.style.display = "none";
localStorage.setItem("favorites", "");
}
document.addEventListener("DOMContentLoaded", function () {
const random = document.getElementById("random");
random.addEventListener("click", select);
const removeFavorites = document.getElementById("fvrbtn");
const lists = document.getElementById("favoriteList");
removeFavorites.addEventListener("click", () => {
if (
confirm(
"Are you sure you want to remove all your favorite games on MacVG?"
)
) {
lists.style.display = "none";
localStorage.removeItem("favorites");
}
});
});
document.addEventListener("click", (e) => {
const label = document.querySelectorAll(".label");
if (e.target.classList.contains("label")) {
let labell = e.target;
labell.parentElement.children[1].style.opacity = 1;
labell.parentElement.children[1].style.pointerEvents = "all";
} else {
label.forEach((item) => {
item.parentElement.children[1].style.opacity = 0;
item.parentElement.children[1].style.pointerEvents = "none";
});
}
});
const filterAll = document.getElementById("filter-all");
const filterFeatured = document.getElementById("filter-featured");
const filterAction = document.getElementById("filter-action");
const filterStrategy = document.getElementById("filter-strategy");
const filterCasual = document.getElementById("filter-casual");
const filterDriving = document.getElementById("filter-driving");
const filterDownload = document.getElementById("filter-download");
const sortName = document.getElementById("sort-name");
const sortCatagory = document.getElementById("sort-catagory");
const directionBtn = document.getElementById("direction");
let filterGamesList = document.getElementById("list");
let newArray = [];
let secondArray = [];
let everythingArray = [];
let data;
fetch("games.json")
.then((response) => response.json())
.then((dataa) => {
data = dataa.games;
for (var i = 0; i < data.length; i++) {
newArray.push(data[i]);
}
everythingArray = newArray;
secondArray = newArray;
sortStuff(secondArray, "name");
const games = document.getElementById("list");
let items = Array.from(games.getElementsByTagName("a"));
items.forEach((item) => {
let itemID = item.getAttribute("id");
data.forEach((dataItem) => {
if (dataItem.id == itemID.slice(4)) {
item.style.backgroundImage = `linear-gradient(
rgba(40, 40, 40, 0.2),
rgba(20, 20, 20, 0.9)
),
url("${dataItem.link + dataItem.thumb}")`;
item.addEventListener("click", () => {
const params = new URLSearchParams({ target: dataItem.id });
window.location.href = `game.html?${params.toString()}`;
});
}
});
});
const favoriteList = document.getElementById("favoriteList");
let favorites = localStorage.favorites;
if (favorites.length > 0) {
let list = favorites.split(",");
const header = document.createElement("h1");
header.innerHTML = "Favorites";
header.classList.add("favorite-h");
favoriteList.appendChild(header);
newArray.forEach((game) => {
if (list.includes(game.id.toString())) {
const clonedItem = document.createElement("a");
clonedItem.href = `game.html?target=${game.id}`;
clonedItem.innerHTML = game.name;
clonedItem.id = `game${game.id}`;
clonedItem.classList.add("game");
console.log(game.link, game.thumb);
clonedItem.style.backgroundImage = `url(${
game.link + game.thumb
})`;
favoriteList.appendChild(clonedItem);
}
});
} else {
favoriteList.display = "none !important";
}
})
.catch((error) => console.error("Error fetching data:", error));
document.addEventListener("click", (e) => {
let eTarget = e.target;
let targetLabel = eTarget.parentElement.parentElement.children[0];
if (eTarget === filterAction) {
filterStuff(everythingArray, "action");
targetLabel.innerHTML = "Action & Adventure (165)";
} else if (eTarget === filterStrategy) {
filterStuff(everythingArray, "strategy");
targetLabel.innerHTML = "Strategy & Puzzle (136)";
} else if (eTarget === filterFeatured) {
filterStuff(everythingArray, "featured");
targetLabel.innerHTML = "Featured Games (50)";
} else if (eTarget === filterCasual) {
filterStuff(everythingArray, "casual");
targetLabel.innerHTML = "Casual & Idle (64)";
} else if (eTarget === filterDriving) {
filterStuff(everythingArray, "driving");
targetLabel.innerHTML = "Driving & Sports (55)";
} else if (eTarget === filterDownload) {
filterStuff(everythingArray, "download");
targetLabel.innerHTML = "Downloadable Games (68)";
} else if (eTarget === filterAll) {
sortStuff(everythingArray, "name");
targetLabel.innerHTML = "Filter All (420)";
} else if (eTarget === sortName) {
targetLabel.innerHTML = "Sort By: Name";
sortStuff(secondArray, "name");
} else if (eTarget === sortCatagory) {
targetLabel.innerHTML = "Sort By: Catagory";
sortStuff(secondArray, "catagory");
}
});
directionBtn.style.transform = "rotateX(180deg)";
directionBtn.addEventListener("click", () => {
let img = directionBtn.children[0];
if (img.style.transform == "rotateX(180deg)") {
img.style.transform = "rotateX(0deg)";
} else {
img.style.transform = "rotateX(180deg)";
}
sortStuff(secondArray, "direction");
});
</script>
</body>
</html>