mirror of
https://gitlab.com/skysthelimit.dev/selenite.git
synced 2025-06-16 02:22:07 -05:00
search bar
This commit is contained in:
parent
fae4582e46
commit
e5fd028a18
31
games.json
31
games.json
@ -1,12 +1,37 @@
|
||||
[
|
||||
{
|
||||
"name": "Testing 1",
|
||||
"name": "this is a new name",
|
||||
"directory": "adofai",
|
||||
"image": "icon.png"
|
||||
},
|
||||
{
|
||||
"name": "Online Minecraft",
|
||||
"directory": "resent-client",
|
||||
"image": "logo.png"
|
||||
},
|
||||
{
|
||||
"name": "lorem ipsum",
|
||||
"directory": "vex2",
|
||||
"image": "icon.png"
|
||||
},
|
||||
{
|
||||
"name": "unique name",
|
||||
"directory": "vex2",
|
||||
"image": "icon.png"
|
||||
},
|
||||
{
|
||||
"name": "new name",
|
||||
"directory": "vex2",
|
||||
"image": "icon.png"
|
||||
},
|
||||
{
|
||||
"name": "name 38",
|
||||
"directory": "vex",
|
||||
"image": "icon.png"
|
||||
},
|
||||
{
|
||||
"name": "Testing 2",
|
||||
"directory": "vex2",
|
||||
"name": "amshduijasdhuihasd",
|
||||
"directory": "vex",
|
||||
"image": "icon.png"
|
||||
}
|
||||
]
|
1
img/search.svg
Normal file
1
img/search.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M796-121 533-384q-30 26-69.959 40.5T378-329q-108.162 0-183.081-75Q120-479 120-585t75-181q75-75 181.5-75t181 75Q632-691 632-584.85 632-542 618-502q-14 40-42 75l264 262-44 44ZM377-389q81.25 0 138.125-57.5T572-585q0-81-56.875-138.5T377-781q-82.083 0-139.542 57.5Q180-666 180-585t57.458 138.5Q294.917-389 377-389Z"/></svg>
|
After Width: | Height: | Size: 415 B |
14
index.html
14
index.html
@ -25,9 +25,10 @@
|
||||
<meta name="author" content="Website Creator" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
|
||||
<script src="/js/cookie.js"></script>
|
||||
<script src="/js/games.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
|
||||
<script src="./js/cookie.js"></script>
|
||||
<script src="./js/games.js"></script>
|
||||
<script src="./js/search.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
@ -35,12 +36,13 @@
|
||||
<input class="hiddenUpload" type="file" accept=".save" hidden>
|
||||
|
||||
|
||||
<div class="title"><img src="/favicon.png" style="width:4%;"><h2 style="font-size:50px">e-gamepass</h2></div>
|
||||
<p><a href="/bookmarklets.html">Click here for bookmarklets that you can use even if we get blocked!</a> - <a href="https://forms.gle/iBAbXvEDaYTLuEcdA">Want a game to be added? Suggest here!</a> - <a href="https://github.com/skysthelimitt/e-gamepass">Want to help me develop the website? Click here!</a></p>
|
||||
<div class="title"><img src="./favicon.png" style="width:4%;"><h2 style="font-size:50px">e-gamepass</h2></div>
|
||||
<p><a href="./bookmarklets.html">Click here for bookmarklets that you can use even if we get blocked!</a> - <a href="https://forms.gle/iBAbXvEDaYTLuEcdA">Want a game to be added? Suggest here!</a> - <a href="https://github.com/skysthelimitt/e-gamepass">Want to help me develop the website? Click here!</a></p>
|
||||
<p><a href="javascript:downloadMainSave()">Download Save</a> - <a href="javascript:uploadMainSave()">Upload Save</a></p><br>
|
||||
<p>Welcome to the new and updated e-gamepass!</p>
|
||||
<input type="text" id="gamesearch" placeholder="Type here to search..">
|
||||
<p class="uploadResult" style="font-size:20px"></p>
|
||||
<br>
|
||||
|
||||
<div id="games"></div>
|
||||
</div>
|
||||
</body>
|
||||
|
15
js/games.js
15
js/games.js
@ -3,7 +3,8 @@ $.getJSON("/games.json", function (data) {
|
||||
$('#games').append(
|
||||
$('<div>').prop({
|
||||
id: 'game',
|
||||
style: 'cursor: pointer;'
|
||||
style: 'cursor: pointer;',
|
||||
dir: data[i].directory
|
||||
}).append(
|
||||
$('<img>').prop({
|
||||
src: data[i].directory + "/" + data[i].image
|
||||
@ -13,4 +14,14 @@ $.getJSON("/games.json", function (data) {
|
||||
)
|
||||
);
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$(document).on("click", "#game", function(event) {
|
||||
redirectGame($(this).attr("dir"));
|
||||
});
|
||||
});
|
||||
|
||||
function redirectGame(dir) {
|
||||
window.location.href = window.location.origin + "/" + dir + "/index.html";
|
||||
}
|
||||
|
11
js/search.js
Normal file
11
js/search.js
Normal file
@ -0,0 +1,11 @@
|
||||
$(document).ready(function() {
|
||||
$('#gamesearch').on('input propertychange paste', function() {
|
||||
$('#games #game').hide();
|
||||
var txt = $('#gamesearch').val();
|
||||
$('#games #game').each(function(){
|
||||
if($(this).text().toUpperCase().indexOf(txt.toUpperCase()) != -1){
|
||||
$(this).show();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
19
style.css
19
style.css
@ -113,3 +113,22 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
input[type=text] {
|
||||
width: 50%;
|
||||
box-sizing: border-box;
|
||||
font-size: 25px;
|
||||
background-color: rgba(89, 110, 177, 0.274);
|
||||
padding: 0.8% 0.8%;
|
||||
text-align: center;
|
||||
color: white;
|
||||
border: 2px solid #527ac4aa;
|
||||
border-radius: 5px;
|
||||
outline: none;
|
||||
opacity: 50%;
|
||||
transition: opacity .75s ease-in-out;
|
||||
}
|
||||
|
||||
input[type=text]:focus {
|
||||
opacity: 100%;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user