update styles and cautions

This commit is contained in:
Aliberk Sandıkçı 2024-01-10 19:06:33 +03:00
parent 59f2c716dd
commit 3099ab1244
Signed by: asandikci
GPG Key ID: 25C67A03B5666BC1
2 changed files with 31 additions and 21 deletions

View File

@ -47,7 +47,7 @@
<div style="text-align:center;">Son veri güncelleme: <span id="latest-data"></span>
</div>
</div>
<div style="text-align: center;align-self:center;"><a href="https://asandikci.com/bagis/">Bana Bi' Kahve Ismarla </a></div>
<div style="text-align: center;align-self:center;background-color: darkblue;border-radius:10px; padding:1px;"><a style="color: orange;font-weight:800;" href="https://asandikci.com/bagis/">👉 Bana Bi' Kahve Ismarla </a></div>
</article>
<footer>
@ -107,20 +107,20 @@
function updateData() {
xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var response = xmlHttp.responseText
if (response.includes("parseError") ){
console.error("VERİLER YANLIŞ ŞEKİLDE GİRİLMİŞ, GÖTÜNÜ SİKEYİM KELO");
console.warn(response);
} else if (response.includes("fileError")){
console.error("VERİ DOSYASI SUNUCUDA BULUNAMADI, SUNUCUYU KONTROL EDİNİZ");
console.warn(response);
} else if (response.includes("success")) {
console.info("VERİLER BAŞARIYLA GÜNCELLENDİ")
} else {
console.warn("VERİ GÜNCELLENİRKEN BİR HATA OLUŞTU, SAYFAYI YENİLEMEYİ DENEYİN");
}
if (this.readyState == 4 && this.status == 200) {
var response = xmlHttp.responseText
if (response.includes("parseError")) {
console.error("VERİLER YANLIŞ ŞEKİLDE GİRİLMİŞ, GÖTÜNÜ SİKEYİM KELO");
console.warn(response);
} else if (response.includes("fileError")) {
console.error("VERİ DOSYASI SUNUCUDA BULUNAMADI, SUNUCUYU KONTROL EDİNİZ");
console.warn(response);
} else if (response.includes("success")) {
console.info("VERİLER BAŞARIYLA GÜNCELLENDİ")
} else {
console.warn("VERİ GÜNCELLENİRKEN BİR HATA OLUŞTU, SAYFAYI YENİLEMEYİ DENEYİN");
}
}
};
params = "updateData=yes";
xmlHttp.open("POST", "src/server.php", true);
@ -436,9 +436,24 @@
}
const persons2 = <?php echo json_encode(getAllPersonNames(), JSON_UNESCAPED_UNICODE) ?>;
person2.sort();
persons2.sort();
autocomplete(document.getElementById("mainInput"), persons2);
</script>
<script>
var t = setInterval(tick, 1000);
function tick(){
var curTime = new Date();
if (curTime.getHours() == 0 && curTime.getMinutes() == 0 && curTime.getSeconds() > 1 && curTime.getSeconds() < 3){
console.debug("Kullanıcının Ekranııkken Farklı Bir Güne Geçiş Yapıldı, Statlar Sıfırlanıyor ve Kullanıcı Bilgilendiriliyor");
localStorage.removeItem("guesses");
localStorage.removeItem("latest_guess");
localStorage.removeItem("win");
document.getElementById("tebriks").style.display = "none";
document.getElementById("tahminler").innerHTML = "<h2 style='text-align:center;'>Gece Yarısını Geçtiniz, Lütfen Sayfayı Yenile<span style='color:red;'>ME</span>den direkt yeni tahminizde bulununuz👆</h2><p style='text-align:center;'>Kullanıcının cihazının saati baz alınmıştır, sunucunun yenilenmesi için birkaç saniye daha beklemeniz gerekebilir</p>"
}
}
</script>
<script src="https://cdn.jsdelivr.net/npm/@tsparticles/confetti@3.0.3/tsparticles.confetti.bundle.min.js"></script>
</html>
</html>

View File

@ -206,8 +206,3 @@ function parseTOML()
$array = $parser::ParseFile(__DIR__ . "/../data.toml");
return $array;
}
if ($_POST['updateData'] != null && $_POST['updateData'] == "yes") {
updateRemoteData();
}