Pending changes exported from your codespace
This commit is contained in:
1 parent
9176308ea9
commit
ca8dbddf87
37 files changed
+379
-11546
No files matched your search
@@ -5,27 +5,33 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="/WebGames-master/WebGames-master/main.css">
|
||||
<style>
|
||||
.one {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
.game {
|
||||
flex: 1 1 150px;
|
||||
text-align: center;
|
||||
}
|
||||
.no-results {
|
||||
display: none;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function setCookie(name, value, days) {
|
||||
const d = new Date();
|
||||
d.setTime(d.getTime() + (days * 24 * 60 * 60 * 1000));
|
||||
const expires = "expires=" + d.toUTCString();
|
||||
document.cookie = name + "=" + value + ";" + expires + ";path=/";
|
||||
}
|
||||
|
||||
function getCookie(name) {
|
||||
const cname = name + "=";
|
||||
const decodedCookie = decodeURIComponent(document.cookie);
|
||||
const ca = decodedCookie.split(';');
|
||||
for (let i = 0; i < ca.length; i++) {
|
||||
let c = ca[i];
|
||||
while (c.charAt(0) == ' ') {
|
||||
c = c.substring(1);
|
||||
}
|
||||
if (c.indexOf(cname) == 0) {
|
||||
return c.substring(cname.length, c.length);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
function filterGames() {
|
||||
const searchInput = document.getElementById('searchBar').value.toLowerCase();
|
||||
setCookie('searchInput', searchInput, 7);
|
||||
const games = document.querySelectorAll('.game');
|
||||
let hasResults = false;
|
||||
|
||||
@@ -47,6 +53,14 @@
|
||||
noResultsElement.style.display = hasResults ? 'none' : 'flex';
|
||||
oneContainer.style.display = hasResults ? 'flex' : 'none';
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
const savedSearchInput = getCookie('searchInput');
|
||||
if (savedSearchInput) {
|
||||
document.getElementById('searchBar').value = savedSearchInput;
|
||||
filterGames();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<center>
|
||||
@@ -74,9 +88,6 @@
|
||||
<div class="game">
|
||||
<a href="games/Snow-Rider3D-main/Snow-Rider3D-main/index.html"><img src="assets/snnowriders3d.jpeg" alt="snow rider" width="150" height="150"></a>
|
||||
</div>
|
||||
<div class="game">
|
||||
<a href="games/Snow-Rider3D-main/Snow-Rider3D-main/index.html"><img src="assets/snnowriders3d.jpeg" alt="snow rider" width="150" height="150"></a>
|
||||
</div>
|
||||
<div class="game">
|
||||
<a href="games/HexGL-master/HexGL-master/index.html"><img src="assets/HexGL256.png" alt="hex gl" width="150" height="150"></a>
|
||||
</div>
|
||||
@@ -158,19 +169,6 @@
|
||||
</div>
|
||||
</body>
|
||||
</center>
|
||||
<style>
|
||||
.version {
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
right: 10px;
|
||||
background-color: #f1f1f1;
|
||||
padding: 5px 10px;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="version" id="versionDisplay"></div>
|
||||
|
||||
@@ -65,4 +65,35 @@ img {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.one {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.game {
|
||||
flex: 1 1 150px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.no-results {
|
||||
display: none;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.version {
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
right: 10px;
|
||||
background-color: #f1f1f1;
|
||||
padding: 5px 10px;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
}
|
||||
Reference in new issue
Block a user