<!DOCTYPE html>
<html>
<head>
<title>Numeroloji Hesaplama</title>
</head>
<body>
<h1>Numeroloji Hesaplama</h1>
<p>Doğum tarihinizi girin (GG AA YYYY formatında):</p>
<input type="date" id="tarihInput">
<button onclick="hesaplaNumeroloji()">Hesapla</button>
<p>Sonuç: <span id="sonuc"></span></p>
<script>
function hesaplaNumeroloji() {
var tarih = document.getElementById("tarihInput").value;
var toplam = 0;
// Doğum tarihindeki her bir rakamı alarak toplamı hesapla
for (var i = 0; i < tarih.length; i++) {
var rakam = parseInt(tarih[i]);
if (!isNaN(rakam)) {
toplam += rakam;
}
}
// Toplam 10'dan büyükse tekrar rakamları topla
while (toplam >= 10) {
var yeniToplam = 0;
while (toplam > 0) {
yeniToplam += toplam % 10;
toplam = Math.floor(toplam / 10);
}
toplam = yeniToplam;
}
document.getElementById("sonuc").textContent = toplam;
}
</script>
</body>
</html>