Add files via upload

This commit is contained in:
Andyyy7666
2022-07-08 23:18:25 +02:00
committed by GitHub
parent 3ff2e7967a
commit d5d3b85d1a
8 changed files with 417 additions and 95 deletions

View File

@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="script.js" type="text/javascript"></script>
</head>
<body>
<form id="overlay">
<p id="title">Jailing Interface</p>
<hr id="line">
<div class="infoBox">
<label class="text" for="playerid">Player id</label>
<select id="id" class="input" name="Player" style="width: 96%; height: 3vh;" required>
</select>
<label class="text" for="jailtime">Time</label>
<input id="time" class="input" type="number" placeholder="In seconds" name="jailtime" min="10" required>
<label class="text" for="fine">Fine</label>
<input id="fine" class="input" type="number" placeholder="In seconds" name="fine" max="" required>
<label class="text" for="reason">Reason</label>
<input id="reason" class="input" type="text" placeholder="short reason" name="reason" required>
</div>
<hr id="line" style="position: absolute; margin: auto; left: 0; right: 0; bottom: 15%;">
<p id="error"></p>
<button class="resetButton" type="reset">Close</button>
<button class="submitButton" type="submit" form="overlay">Jail</button>
</form>
</body>
</html>

View File

@@ -0,0 +1,61 @@
$(document).ready(function() {
function display(bool) {
if (bool) {
$("#overlay").fadeIn("slow");
} else {
$("#overlay").fadeOut("slow");
}
}
display(false);
window.addEventListener('message', function(event) {
var item = event.data;
if (item.type === "ui") {
if (item.status == true) {
display(true);
} else {
display(false);
}
}
$("#error").text(item.error);
if (item.type === "players") {
$("#id").append($("<option>", {
text: item.players
}));
}
if (item.type === "clean") {
$("#id, #time, #reason").val("");
}
})
$("#overlay").submit(function() {
let id = $("#id").val();
let time = $("#time").val();
let fine = $("#fine").val();
let reason = $("#reason").val();
$.post(`https://${GetParentResourceName()}/sumbit`, JSON.stringify({
id: id,
time: time,
fine: fine,
reason: reason
}));
return false;
})
$(".resetButton").click(function() {
$.post(`https://${GetParentResourceName()}/close`);
$("#id, #time, #reason").val("");
return;
})
document.onkeyup = function(data) {
if (data.which == 27) {
$.post(`https://${GetParentResourceName()}/close`);
$("#id, #time, #reason").val("");
return;
}
};
});

View File

@@ -0,0 +1,98 @@
#overlay {
display: none;
position: absolute;
margin: auto;
inset: 0;
height: 45vh;
width: 38vw;
background-color: rgba(2, 2, 2, 0.911);
border-radius: 25px;
}
#title {
margin-left: 4%;
color: white;
font-size: 120%;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
font-weight: bold;
}
#line {
background: rgb(255, 255, 255);
background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(255,255,255,1) 15%, rgba(255,255,255,1) 85%, rgba(0, 0, 0, 0) 100%);
height: 0.1vh;
width: 95%;
border: none;
border-radius: 2vh;
}
.infoBox {
position: absolute;
margin: auto;
left: 4%;
}
.text {
color: white;
display: inline-block;
margin: 1vh 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
font-weight: bold;
}
.input {
background: white;
color: black;
display: inline-block;
border: none;
border-radius: 5px;
height: 2.5vh;
width: 95%;
outline: none;
padding: 0.5%;
}
.submitButton {
position: absolute;
left: 4%;
width: 45%;
background-color: rgb(17, 113, 238);
}
.resetButton {
position: absolute;
right: 4%;
width: 45%;
background-color: rgb(231, 50, 50);
}
.submitButton, .resetButton {
bottom: 2.5vh;
height: 3vh;
color: white;
font-weight: bold;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
border: none;
border-radius: 1vh;
transition: 0.3s;
}
.submitButton:hover, .resetButton:hover {
transition: 0.3s;
opacity: 0.7;
}
.submitButton:active, .resetButton:active {
transition: none;
opacity: 1;
}
#error {
position: absolute;
margin: auto;
bottom: 18%;
right: 0;
left: 0;
text-align: center;
color: white;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
font-weight: bold;
}