Update projects.html

This commit is contained in:
LEGALISE_PIRACY 2024-01-26 06:28:32 +00:00
parent a6341bcf05
commit c78c7b5306

View File

@ -111,7 +111,7 @@ There is still an option to disable ads. You can also use an adblocker (which I
<input class="hiddenUpload" type="file" accept=".save" hidden /> <input class="hiddenUpload" type="file" accept=".save" hidden />
<input type="text" id="gamesearch" placeholder="Type here to search.." /> <input type="text" class="searchbar" id="gamesearch" placeholder="Type here to search.." />
<div class="samerow"> <div class="samerow">
<sl-tooltip content="Remember to download your save, so you don't lose your progress." trigger="manual" class="manual-tooltip"> <sl-tooltip content="Remember to download your save, so you don't lose your progress." trigger="manual" class="manual-tooltip">
<button onclick="downloadMainSave()">Download Save</button> <button onclick="downloadMainSave()">Download Save</button>
@ -166,19 +166,22 @@ document.addEventListener("DOMContentLoaded", function () {
</script> </script>
<script> <script>
$(document).ready(function() {
$("#gamesearch").on("input", function() { document.addEventListener('DOMContentLoaded', function () {
var filter = $(this).val().toUpperCase(); var searchbar = document.querySelector('.searchbar');
$(".game").each(function() { var games = document.querySelectorAll('.game');
var title = $(this).find("h1").text().toUpperCase();
if (title.indexOf(filter) > -1) { searchbar.addEventListener('input', function () {
$(this).show(); var filter = searchbar.value.toUpperCase();
} else {
$(this).hide(); games.forEach(function (game) {
} var gameText = game.textContent || game.innerText;
var displayStyle = gameText.toUpperCase().includes(filter) ? '' : 'none';
game.style.display = displayStyle;
}); });
}); });
}); });
</script> </script>
</body> </body>
</html> </html>