donation & roadmap page, automation

This commit is contained in:
Aliberk Sandıkçı 2023-11-26 20:46:01 +03:00
parent 8e7b7b470a
commit 0fc120e3f5
Signed by: asandikci
GPG Key ID: 25C67A03B5666BC1
4 changed files with 221 additions and 19 deletions

View File

@ -66,11 +66,12 @@ if (!$_SERVER['DOCUMENT_ROOT']) {
<div><span>IBAN: </span><span style="margin-top: 0px;text-decoration:none;"> <b class="copy_element" id="IBAN" onclick="copy2Clipboard('IBAN')">TR63 0082 9000 0949 1444 3182 51</b><span id="IBAN-tip"></span></span></div>
<div><span>Papara Numarası: </span><span style="margin-top: 0px;text-decoration:none;"> <b class="copy_element" id="Papara" onclick="copy2Clipboard('Papara')">14444318251</b><span id="Papara-tip"></span></span></div>
<div><sup>ıklama Kısmını <span style="font-weight:800;">Gözükmesini İstediğiniz İsim - Bağış</span> şeklinde doldurunuz. Anonim Kalmak için <span style="font-weight:800;">Anonim - Bağış</span> Yazabilirsiniz</sup></div>
<p></p>
<hr style="width: 100%;"><br>
<h1 style="font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-weight: 800; ">Bağışçılar</h1>
<h1 style="font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-weight: 800; margin-top:1px; margin-bottom:1px;">Bağışçılar</h1>
<div id="current-goal"><label id="label1" for="pprogress">Sıradaki Hedef: </label><progress id="pprogress"><span></span></progress> <label id="label2" for="pprogress">x/y</label><br>
<p id="next-todo" style="margin-top:0px;font-size:15px;">Sırada Yapılacaklar: Ders Programı Görüntüleme</p>
<p id="next-todo" style="margin-top:0px; margin-bottom:0px;font-size:15px;">Sırada Yapılacaklar: <b><span id="sirada-yapilacaklar"></span></b><br>
<sup>daha fazlası için <a href="../iflpanel/path.php">yol haritasına</a> bakabilirsiniz</sup>
</p>
</div>
<div id="bagiscilar" style="text-align: left;"></div>
@ -83,9 +84,10 @@ if (!$_SERVER['DOCUMENT_ROOT']) {
<ul style="text-align:left;">
<li>SSA VPN</li>
<li>Tahta Arkaplanı</li>
<li><del>İFL Kütüphane</del</li>
<li><del>İFL Kütüphane</del< /li>
<li><del>İFL Galeri</del></li>
</ul>
Sponsorluklar ve Bağışlar ile devam ettireceğim İFL/Eğitim Odaklı projelerime <a href="../iflpanel/path.php">buradan</a> ulaşabilirsiniz.<br>
Sponsor olabileceğiniz diğer projelerime <a href="https://github.com/asandikci">GitHub</a> veya <a href="https://git.aliberksandikci.com.tr">Forgejo</a> adresi üzerinden ulaşabilirsiniz.</p>
</div>
<br>
@ -119,6 +121,15 @@ if (!$_SERVER['DOCUMENT_ROOT']) {
} ?>
<script>
function b64DecodeUnicode(str) {
// Going backwards: from bytestream, to percent-encoding, to original string.
return decodeURIComponent(atob(str).split('').map(function(c) {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
}
var curAmount = 0
var goalAmount = 0;
let localtest = 0;
let url = 'https://git.aliberksandikci.com.tr/api/v1/repos/asandikci.com/www/contents/donations.json';
// let url = "http://127.0.0.1:PORT/donations.json";
@ -128,22 +139,19 @@ if (!$_SERVER['DOCUMENT_ROOT']) {
.then(res => res.json())
.then(out => {
var lastjson;
console.log(out);
if (localtest) {
lastjson = out;
} else {
var cnt = out.content;
console.log("base64: " + cnt);
lastjson = JSON.parse(atob(cnt));
console.log(lastjson);
lastjson = JSON.parse(b64DecodeUnicode(cnt));
}
console.log(lastjson);
lastjson.sort(function(a, b) {
return a.amount < b.amount;
});
var curAmount = 0;
for (let i = 0; i < lastjson.length; i++) {
const s = lastjson[i];
const curId = s.place + s.name;
@ -193,18 +201,60 @@ if (!$_SERVER['DOCUMENT_ROOT']) {
document.getElementById(curId).style.color = "#ffff00";
document.getElementById(curId).style.fontSize = "34px";
document.getElementById(curId).style.fontWeight = "800";
} else if (s.amount <= 500) {
} else {
document.getElementById(curId).style.color = "#ffff00";
document.getElementById(curId).style.fontSize = "36px";
document.getElementById(curId).style.fontWeight = "900";
document.getElementById(curId).style.textDecoration = "underline";
}
let progbar = document.getElementById("pprogress")
progbar.max = goalAmount;
progbar.value = curAmount;
progbar.labels[1].innerHTML = curAmount + "/" + goalAmount + "";
}
let goalAmount = 100;
let progbar = document.getElementById("pprogress");
})
.catch(err => {
throw err
});
//
// PUBLIC DATA
//
let url2 = 'https://git.aliberksandikci.com.tr/api/v1/repos/asandikci.com/www/contents/public-data.json';
// let url2 = "http://127.0.0.1:PORT/public-data.json";
// localtest = 1;
fetch(url2)
.then(res => res.json())
.then(out => {
var publicjson;
if (localtest) {
publicjson = out[0]["public-todo"];
} else {
var cnt = out.content;
console.log("base64: " + cnt);
publicjson = JSON.parse(b64DecodeUnicode(cnt))[0]["public-todo"];
}
publicjson.sort(function(a, b) {
return Number(Object.keys(a)) > Number(Object.keys(b));
});
console.log(publicjson);
var curi = 0;
for (let i = 0; i < publicjson.length; i++) {
const element = Number(Object.keys(publicjson[i]));
if (curAmount < element) {
goalAmount = element;
curi = i;
break;
}
}
console.log(goalAmount);
document.getElementById("sirada-yapilacaklar").innerHTML = publicjson[i][goalAmount][0];
let progbar = document.getElementById("pprogress")
progbar.max = goalAmount;
progbar.value = curAmount;
progbar.labels[1].innerHTML = curAmount + "/" + goalAmount + "";
})
.catch(err => {

148
iflpanel/path.php Normal file
View File

@ -0,0 +1,148 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<?php
### ERROR HANDLING ###
function warnError($errno, $errstr, $errfile, $errline)
{
echo "<br><p style='padding:0px;margin:0px;background-color:white;color:black;'><b style='color:red;'>Error:</b> [$errno] $errstr <br> in file <b style='color:blue'>$errfile</b> line <b style='color:red'>$errline</b></p>";
}
set_error_handler("warnError");
if (!$_SERVER['DOCUMENT_ROOT']) {
$_SERVER['DOCUMENT_ROOT'] = '/weblink';
}
# TODO separate file
?>
<head>
<!-- Meta Content -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="İFL/Eğitim odaklı geliştirme yol haritası">
<meta name="keywords" content="roadmap,yol haritası">
<meta name="author" content="Aliberk Sandıı">
<!-- CSS Files -->
<link rel="stylesheet" type="text/css" href="/iflpanel/ssavpn/assets/css/main.css"> <!-- INNER CSS !!! -->
<link rel="stylesheet" type="text/css" href="/assets/css/extra_without_scss.css">
<style>
.inner-xy{
list-style-position: inside;
}
</style>
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u = "//stats.aliberksandikci.com.tr/";
_paq.push(['setTrackerUrl', u + 'matomo.php']);
_paq.push(['setSiteId', '3']);
var d = document,
g = d.createElement('script'),
s = d.getElementsByTagName('script')[0];
g.async = true;
g.src = u + 'matomo.js';
s.parentNode.insertBefore(g, s);
})();
</script>
<!-- End Matomo Code -->
<title>
Yol Haritası | Aliberk Sandıı
</title>
<link rel="shortcut icon" href="/assets/images/icons/favicon.ico" type="image/x-icon">
</head>
<body>
<header>
<a href="/" id="hlogo" style="margin:auto;"><img src="/assets/images/icons/favicon.png"></a>
</header>
<div class="main-scrollable">
<article class="plain" style="text-align:center;align-items:center;">
<h1 style="margin-bottom:0px;">Yol Haritası</h1>
<p>Yapacağım geliştirmelerde bana yardımcı olmak için <a href="../bagis/">bağışta</a> bulunabilirsiniz</p>
<sup>Değerlere ulaşıldıkça gerekli özellikler için çalışılmaya başlanacaktır. Bu, özelliklerin getirileceğini garanti etmez!</sup>
<div id="roadmap">
</div>
</article>
<footer>
<div class="tmpinfo">2023 &#x1f12f; Aliberk Sandıı</div>
</footer>
</div>
<?php
$dir = new DirectoryIterator($_SERVER['DOCUMENT_ROOT'] . "/assets/js");
foreach ($dir as $file) {
if ((!$file->isDot()) && str_ends_with($file, ".js") && $file != "jquery.js") {
echo '<script src="/assets/js/' . $file . '"></script>' . PHP_EOL . ' ';
}
} ?>
<script>
function b64DecodeUnicode(str) {
// Going backwards: from bytestream, to percent-encoding, to original string.
return decodeURIComponent(atob(str).split('').map(function(c) {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
}
//
// PUBLIC DATA
//
var localtest = 0;
var activeUntil;
var untilAmount;
let url2 = 'https://git.aliberksandikci.com.tr/api/v1/repos/asandikci.com/www/contents/public-data.json';
// let url2 = "http://127.0.0.1:PORT/public-data.json";
// localtest = 1;
fetch(url2)
.then(res => res.json())
.then(out => {
var publicjson;
if (localtest) {
publicjson = out[0]["public-todo"];
activeUntil = out[0]["todo-active-until"];
} else {
var cnt = out.content;
console.log("base64: " + cnt);
publicjson = JSON.parse(b64DecodeUnicode(cnt))[0]["public-todo"];
activeUntil = JSON.parse(b64DecodeUnicode(cnt))[0]["todo-active-until"];
}
publicjson.sort(function(a, b) {
return Number(Object.keys(a)) > Number(Object.keys(b));
});
console.log(publicjson);
untilAmount = Number(activeUntil);
console.log(untilAmount);
var curi = 0;
for (let i = 0; i < publicjson.length; i++) {
const element = Number(Object.keys(publicjson[i]));
document.getElementById("roadmap").innerHTML += "<p style='text-align:left; font-size:25px; font-weight: 700px; color:orange;'>"+element+"</p><ul>";
for (let j = 0; j < publicjson[i][element].length; j++) {
const elin = publicjson[i][element][j];
document.getElementById("roadmap").innerHTML += "<li class='inner-xy'>" + elin + "</li>";
}
document.getElementById("roadmap").innerHTML += "</ul>";
if (element >= untilAmount) {
break;
}
}
})
.catch(err => {
throw err
});
</script>
</body>
</html>

View File

@ -66,7 +66,7 @@ if (!$_SERVER['DOCUMENT_ROOT']) {
<p>You can learn more about me in <a href="about/">about me</a> page</p>
<p>You can find my all links in the internet with this <a href="link/">link</a></p>
<p>You can see my current works in <a href="now/">now</a> page</p>
<p>Also you can support my works/projects or help me cover my server costs in <a href="bagis/">donation</a> page</p>
<p>Also you can support my works/projects or help me cover my server costs in <a href="bagis/">donations</a> page</p>
</article>
<sup style="text-align:center; color:grey;">WIP for website UI/content</sup>
<footer>

View File

@ -4,8 +4,8 @@
"public-todo": [
{
"100": [
"Tahta Arkaplanı - Yeni Tuş Düzeni",
"Tahta Arkaplanı - Ders Programı Menüsü"
"Tahta Arkaplanı - Ders Programı Menüsü",
"Tahta Arkaplanı - Yeni Tuş Düzeni"
]
},
{
@ -98,10 +98,14 @@
"İFL HUB (Sistem, Tahta/Bilgisayar/Telefon Uygulaması) - Diğer İFL uygulamalarının birleştirilmiş hâli. Üstün forum özellikleri, soru sorma, kaynak paylaşma, soru yazabilme/çözebilme/paylaşabilme, öğretmenlerin öğrencileri değerlendirebilmeleri/test gönderebilmeleri... (EBA + Sınavza + Pakodemy + Soru Çözüm Uygulamaları + Wikipedia + EÖdev) - (IFL TAHTA, IFLSOR, IFL'm ... uyumlu)"
]
}
],
"personal-todo": [ "BURADA YAZILANLAR KİŞİSEL NOTLARDIR, DİKKATE ALMAYINIZ",
"VPN Troubleshooting açıklamaları", "Auto todos fetch", "Ödeme için QR Code", "Bağışlar için otomatik API?", "Hedef para miktarı oto arttırma ve toplanan miktara göre path.php dosyasında daha da ileriyi gösterme, daha fazlası için de ufak bir buton", "Bağış sonrası zorunlu olmadığını yaz da sıkıntı çıkmasın sonra"
"personal-todo": [
"BURADA YAZILANLAR KİŞİSEL NOTLARDIR, DİKKATE ALMAYINIZ",
"VPN Troubleshooting açıklamaları",
"Auto todos fetch",
"Ödeme için QR Code",
"Bağışlar için otomatik API?"
"Kopyala, Kopyalandı bilgi kutucukları için özelleştirmeler(mobil/mouse)"
]
}
]