Index HTML
Index HTML
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pengumuman Kelulusan SMK</title>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css"/>
<style>
/* general styling */
:root {
--smaller: .75;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html, body {
height: 100%;
margin: 0;
}
body {
margin: 70px 0;
align-items: center;
background-color: green;
display: flex;
font-family: -apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
Oxygen-Sans,
Ubuntu,
Cantarell,
"Helvetica Neue",
sans-serif;
}
input{padding:5px;margin:5px;width:80%}
.container {
color: white;
margin: 0 auto;
text-align: center;
}
h1 {
font-weight: normal;
letter-spacing: .125rem;
text-transform: uppercase;
}
li {
display: inline-block;
font-size: 1em;
list-style-type: none;
padding: 0.5em;
text-transform: uppercase;
}
li span {
display: block;
font-size: 3.5rem;
}
@media all and (max-width: 768px) {
h1 {font-size: calc(1.7rem * var(--smaller));}
li {font-size: calc(1.3rem * var(--smaller));}
li span {font-size: calc(4rem * var(--smaller));}
#borderHitungMundur{width:90%}
#borderHasil{width:90%}
}
.tombol{
color: black;
padding: 0px 10px;
font-size: 1.2em;
background: #FFB43D;
cursor: pointer;
width: fit-content;
margin: 5px auto;
}
#loading{
width:100%;
height:100%;
z-index:999;
background:black;
opacity:0.5;
top:0px;
position:fixed;
text-align: center;
color:white;
display:none;
}
.loadingText{
position:relative;
top:70%;
}
.sekolah{
color:#FFB43D;
}
#cpr a{
color:white;
text-decoration: none;
font-weight:bold;
}
</style>
</head>
<body>
<div id="loading">
<span class="loadingText"><img
src="https://i.gifer.com/origin/34/34338d26023e5515f6cc8969aa027bca_w200.gif"
height="50px"/><br/>Loading Data ... </span>
</div>
<div class="container">
<img
src="https://upload.wikimedia.org/wikipedia/commons/9/9a/Kementerian_Agama_new_logo
.png" height="100px"></img>
<script>
// SETTING (SILAKAN EDIT)
var namaSekolah = "SMK INDONESIA MERDEKA";
var judul1 = "MENUJU PENGUMUMAN KELULUSAN";
var judul2 = "PENGUMUMAN KELULUSAN";
var judul3 = "HASIL PENGUMUMAN KELULUSAN";
var waktuAkhir = new Date("May 24, 2023 20:36:00").getTime();
// Mencari selisih
var selisih = waktuAkhir - sekarang;
function login(){
document.getElementById("loading").style.display="block";
nis = document.getElementById("nis").value;
pass = document.getElementById("pass").value;
if(nis == "" || pass == ""){
document.getElementById("loading").style.display="none";
document.getElementById("peringatan").innerHTML = "TIDAK BOLEH KOSONG";
}else{
//alert("NIS: "+nis+" Pass: "+pass)
google.script.run.withSuccessHandler(hasilLogin).login(nis, pass);
}
}
function hasilLogin(status){
//document.getElementById("peringatan").innerHTML = status;
if(status == "NOUSER"){
document.getElementById("peringatan").innerHTML = "USER TIDAK DITEMUKAN";
document.getElementById("loading").style.display="none";
document.getElementById("nis").value = "";
document.getElementById("pass").value = "";
}else if(status == "FAILED"){
document.getElementById("peringatan").innerHTML = "PASTIKAN USER & PASSWORD
BENAR";
document.getElementById("loading").style.display="none";
document.getElementById("nis").value = "";
document.getElementById("pass").value = "";
}else{
// split status
data = status.split("#");
brs = data[1];
google.script.run.withSuccessHandler(tampilHasil).baca(brs);
//document.getElementById("peringatan").innerHTML = "BERHASIL";
//document.getElementById("loading").style.display="none";
tulisCookie("status","login");
if(bacaCookie("us")==""){
tulisCookie("us",document.getElementById("nis").value);
}
if(bacaCookie("pw")==""){
tulisCookie("pw",document.getElementById("pass").value);
}
document.getElementById("nis").value = "";
document.getElementById("pass").value = "";
}
}
function tampilHasil(status){
document.getElementById("konten").style.display="none";
document.getElementById("cpr").style.display="block";
document.getElementById("pengumuman").style.display="block";
data = status.split("#");
if(data[4] == "" || data[4]===null){
document.getElementById("tampilFoto").innerHTML = '';
}else{
document.getElementById("tampilFoto").innerHTML = '<img src='+data[4]+'
width="200px">';
}
document.getElementById("tampilNama").innerHTML = data[1];
document.getElementById("tampilNis").innerHTML = data[0];
document.getElementById("tampilKelas").innerHTML = data[2];
document.getElementById("tampilLulus").innerHTML = data[3];
document.getElementById("loading").style.display="none";
}
function hapusPeringatan(){
document.getElementById("peringatan").innerHTML = "";
}
function awal(){
document.getElementById("nis").value = "";
document.getElementById("pass").value = "";
document.getElementById("konten").style.display="block";
document.getElementById("pengumuman").style.display="none";
tulisCookie("status","logout");
tulisCookie("us","");
tulisCookie("pw","");
document.getElementById("peringatan").innerHTML = "Anda sudah logout.";
}
</script>
</body>
</html>