-
Notifications
You must be signed in to change notification settings - Fork 179
/
Copy pathrecent.html
206 lines (199 loc) · 7.33 KB
/
recent.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
<!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" />
<title class="cloak">Recent | 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="wrap" id="wrap">
<header class="homeheader">
<div class="title" name="Recent Games">Recent Games</div>
<div class="sub" style="text-align: left">
With the Recent tab, you can quickly access the games you've recently
played, making it easy to jump right back and continue playing them
without browsing through every game to find them!
<p
style="
text-decoration: underline;
cursor: pointer;
display: inline-block;
"
onclick="clearRecents()"
>
Clear Recents
</p>
</div>
</header>
<div
id="recentList"
class="games-container"
style="color: white; font-size: 20px; margin-block: 30px"
>
You haven't played any games yet! Browse our games on the homepage or
from the tabs above.
</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="app.js"></script>
<script>
const recentList = document.getElementById("recentList");
const gamess = document.getElementById("list");
function clearRecents() {
if (
confirm("Are you sure you want to clear your recent play history?")
) {
localStorage.removeItem("macvgRecents");
recentList.innerHTML = "You haven't played any games yet! Browse our games on the homepage or from the tabs above.";
}
}
let newArray = [];
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;
let recents = localStorage.macvgRecents;
let list = recents.split(",");
let selectedGames = [];
console.log(list);
if (list) {recentList.innerHTML = ""}
list.forEach((one) => {
everythingArray.forEach((game) => {
let item = game.id;
if (item == one) {
console.log(game.name);
const newGame = document.createElement("a");
newGame.classList.add("game");
newGame.setAttribute("id", `game${game.id}`);
newGame.setAttribute("name", game.name);
newGame.innerHTML = game.name;
newGame.style.backgroundImage = `linear-gradient(
rgba(40, 40, 40, 0.2),
rgba(20, 20, 20, 0.9)
),
url("${game.link + game.thumb}")`;
newGame.addEventListener("click", () => {
const params = new URLSearchParams({ target: game.id });
window.location.href = `game.html?${params.toString()}`;
});
recentList.appendChild(newGame);
}
});
});
})
.catch((error) => console.error("Error fetching data:", error));
</script>
</body>
</html>