-
-
Notifications
You must be signed in to change notification settings - Fork 533
/
Copy pathprojects.html
149 lines (147 loc) · 5.56 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
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Projects | 3kh0</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 3kh0 lite, a lightweight, fast, and clean game site." />
<meta property="og:site_name" content="3kh0.github.io" />
<meta property="og:description" content="Welcome to 3kh0 lite, a lightweight, fast, and clean game site." />
<meta name="description" content="Welcome to 3kh0 lite, a lightweight, fast, and clean game site." />
<meta name="author" content="3kh0" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.ico" />
<link rel="shortcut-icon" href="/favicon.ico" />
<script src="/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: 400px;
width: 300px;
text-decoration: none;
}
.game-tile {
background-color: #949494;
height: 400px;
width: 300px;
border-radius: 30px;
}
.game-icon {
border-radius: 30px;
width: 300px;
height: 300px;
}
.game-title {
font-size: 30px;
font-weight: bold;
color: #000000;
text-align: center;
margin: auto;
}
.flex-container {
display: flex;
flex-direction: row;
order: 0;
flex-grow: 0;
flex-wrap: wrap;
align-items: center;
justify-content: center;
}
.container {
padding: 10px;
}
@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;">Projects</h1>
<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="/index.html" 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 () {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
};
</script>
</body>
</html>