-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprojects.html
198 lines (181 loc) · 6.17 KB
/
projects.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
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>games | bryce's games</title>
<meta name="keywords" content="front-end web developer, unblocked, games, google sites, unblocked games mom, ublocked, code, coding, programmer, development, javascript, jquery, bootstrap, sass, less, git" />
<meta property="og:title" content="welcome to bryce's games, a fast, clean game site." />
<meta property="og:site_name" content="bryce's games" />
<meta property="og:description" content="welcome to bryce's games, a fast, clean game site." />
<meta name="description" content="welcome to bryce's games, a fast, clean game site." />
<meta name="author" content="bryce" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/games/favicon.png" />
<link rel="shortcut-icon" href="/games/favicon.png" />
<script src="/games/js/main.js"></script>
<style>
p {
text-align: center;
max-width: 600px;
margin: 20px auto;
}
button {
cursor: pointer;
background-color: #22c55e;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
border-radius: 20px;
margin-top: 20px;
}
.game-link {
height: 300px;
width: 225px;
text-decoration: none;
display: inline-block;
transition: transform 0.3s, box-shadow 0.3s;
box-sizing: border-box;
}
.game-link:hover {
transform: scale(1.05);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.game-tile {
background-color: #949494;
height: 100%;
width: 100%;
border-radius: 20px;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
transition: box-shadow 0.3s;
}
.game-icon {
width: 100%;
height: 225px;
object-fit: cover;
border-radius: 20px 20px 0 0;
}
.game-title {
font-size: 20px;
font-weight: bold;
color: #000000;
text-align: center;
margin: auto;
transition: text-shadow 0.3s;
}
.game-link:hover .game-title {
text-shadow: 0 0 10px #ffffff;
}
.flex-container {
display: flex;
flex-direction: row;
order: 0;
flex-grow: 0;
flex-wrap: wrap;
align-items: center;
justify-content: center;
}
.container {
padding: 10px;
box-sizing: border-box;
}
.small-text {
font-size: 0.8em;
color: #ffffff;
margin-top: 10px;
}
.small-text a {
color: #3498db;
text-decoration: none;
}
.small-text a:hover {
text-decoration: underline;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body style="background-color: #121212; color: #ffffff; font-family: sans-serif; text-decoration: none; text-align: center;">
<h1 style="font-size: 3em; text-align: center;">Games</h1>
<p class="small-text">Want a specific game? To request games, fill out <a href="https://your-google-form-link-here" target="_blank">THIS</a> form!</p>
<input type="text" id="search" onkeyup="searchGames()" placeholder="Search for games..." style="width: 100%; font-size: 18px; padding: 6px 20px; margin: auto; border-radius: 30px; max-width: 600px; margin-bottom: 10px;" />
<div id="loader" style="display: block; border: 16px solid #f3f3f3; border-top: 16px solid #3498db; border-radius: 50%; width: 120px; height: 120px; animation: spin 0.3s linear infinite; margin: auto; margin-top: 1rem;"></div>
<div id="game-container" class="flex-container"></div>
<p class="text-center">
<a href="/games" style="text-decoration: none;">
<button style="cursor: pointer; background-color: #b625cc; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; border-radius: 20px; margin-top: 5px;">
Go to the homepage
</button>
</a>
</p>
<button id="back-to-top" style="display: none; position: fixed; bottom: 20px; right: 20px;">Back to top</button>
<script>
let games = [];
fetch("config/games.json")
.then((response) => response.json())
.then((data) => {
games = data;
const container = document.getElementById("game-container");
data.forEach((project) => {
const game = document.createElement("a");
game.href = project.link;
game.className = "game-link container";
game.innerHTML = `
<div class="game-tile">
<img class="game-icon" src="${project.imgSrc}" alt="icon" />
<p class="game-title">${project.title}</p>
</div>`;
container.appendChild(game);
});
document.getElementById("loader").style.display = "none";
})
.catch((error) => console.error("Error:", error));
function searchGames() {
const input = document.getElementById("search");
const filter = input.value.toUpperCase();
const container = document.getElementById("game-container");
container.innerHTML = "";
games
.filter((game) => game.title.toUpperCase().includes(filter))
.forEach((project) => {
const game = document.createElement("a");
game.href = project.link;
game.className = "game-link container";
game.innerHTML = `
<div class="game-tile">
<img class="game-icon" src="${project.imgSrc}" alt="icon" loading="lazy" />
<p class="game-title">${project.title}</p>
</div>`;
container.appendChild(game);
});
}
const backToTopButton = document.getElementById('back-to-top');
window.onscroll = function () {
if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
backToTopButton.style.display = "block";
} else {
backToTopButton.style.display = "none";
}
};
backToTopButton.onclick = function () {
window.scrollTo({
top: 0,
behavior: 'smooth'
});
};
</script>
</body>
</html>