<html lang="tr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Modern İslami Rehber Uygulaması - Tam Sürüm</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=Amiri:wght@ 400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
/* GENEL STİLLER */
body {
font-family: 'Roboto', sans-serif;
margin: 0;
padding: 0;
background-image: linear-gradient(to right bottom, #e8f5e9, #d4edda); /* Hafif gradyan arka plan */
color: #333;
line-height: 1.6;
display: flex;
flex-direction: column;
min-height: 100vh;
overflow-x: hidden; /* Yatay kaydırmayı engelle */
-webkit-tap-highlight-color: transparent; /* Mobil tıklama vurgusunu kaldır */
}
/* UYGULAMA BAŞLIĞI / HEADER */
header {
background-color: #388E3C; /* Koyu yeşil */
color: white;
padding: 1.2rem 0;
text-align: center;
box-shadow: 0 4px 10px rgba(0,0,0,0.25);
position: sticky;
top: 0;
z-index: 1000;
background-image: linear-gradient(to right, #4CAF50, #388E3C); /* Gradyan başlık */
}
header h1 {
margin: 0;
font-size: 2em;
letter-spacing: 1.5px;
text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}
/* NAVİGASYON MENÜSÜ */
nav.app-nav {
display: flex;
justify-content: space-around;
background-color: #2E7D32; /* Daha koyu yeşil */
padding: 0.5rem 0;
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
nav.app-nav button {
background: none;
border: none;
color: white;
padding: 12px 10px;
font-size: 0.9em;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease, border-bottom 0.3s ease;
flex-grow: 1;
border-bottom: 3px solid transparent;
display: flex;
flex-direction: column;
align-items: center;
gap: 5px;
white-space: nowrap; /* Metni tek satırda tut */
}
nav.app-nav button i {
font-size: 1.2em;
}
nav.app-nav button:hover {
background-color: #216D25;
transform: translateY(-2px);
}
nav.app-nav button.active {
background-color: #216D25;
border-bottom: 3px solid #FFD700; /* Seçili butonun altında altın sarısı çizgi */
font-weight: bold;
}
/* ANA İÇERİK ALANI */
main.app-content {
flex-grow: 1;
padding: 25px;
max-width: 950px;
margin: 25px auto;
background-color: white;
border-radius: 15px;
box-shadow: 0 8px 30px rgba(0,0,0,0.1);
position: relative;
overflow: hidden; /* İçerik geçişlerinde taşmayı önler */
}
/* HER BÖLÜM (SECTIONS) */
section {
display: none;
padding: 15px 0;
opacity: 0; /* Geçiş için başlangıç */
transform: translateY(20px); /* Geçiş için başlangıç */
transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
section.active {
display: block;
opacity: 1; /* Geçiş için bitiş */
transform: translateY(0); /* Geçiş için bitiş */
}
section h2 {
color: #4CAF50;
border-bottom: 2px solid #E0E0E0;
padding-bottom: 12px;
margin-top: 0;
font-size: 1.8em;
position: relative;
}
section h2::after {
content: '';
position: absolute;
left: 0;
bottom: -2px;
width: 50px;
height: 4px;
background-color: #FFD700; /* Altın sarısı vurgu */
border-radius: 2px;
}
section p {
margin-bottom: 15px;
color: #555;
}
section ul {
list-style: none;
padding: 0;
}
section ul li {
background-color: #f5f5f5;
padding: 10px 15px;
border-radius: 8px;
margin-bottom: 8px;
display: flex;
align-items: center;
gap: 10px;
}
section ul li i {
color: #4CAF50;
}
/* GÜNLÜK BİLGİ KUTUSU */
.daily-info-box {
background-color: #e3f2fd; /* Açık mavi tonu */
border-left: 5px solid #2196F3; /* Mavi vurgu */
padding: 20px;
margin-bottom: 25px;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.daily-info-box h3 {
color: #1976D2;
margin-top: 0;
margin-bottom: 10px;
font-size: 1.3em;
}
.daily-info-box .arabic-text {
font-family: 'Amiri', serif;
font-size: 1.5em;
direction: rtl;
text-align: right;
margin-bottom: 10px;
line-height: 1.6;
}
.daily-info-box p {
font-style: italic;
color: #444;
}
.daily-info-box small {
display: block;
text-align: right;
color: #777;
}
/* KUR'AN AYETİ / HADİS STİLİ */
.quran-verse, .hadith-text {
background-color: #fdfdfd;
border-left: 6px solid #8BC34A; /* Açık yeşil vurgu */
padding: 20px;
margin-bottom: 20px;
border-radius: 8px;
font-style: italic;
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
position: relative;
}
.quran-verse .arabic-text {
font-family: 'Amiri', serif;
font-size: 1.8em;
direction: rtl;
text-align: right;
margin-bottom: 15px;
line-height: 1.8;
color: #222;
}
.quran-verse small, .hadith-text small {
display: block;
text-align: right;
margin-top: 10px;
color: #777;
font-style: normal;
}
.hadith-text p {
font-style: italic;
color: #444;
}
.audio-player {
display: flex;
align-items: center;
gap: 10px;
margin-top: 15px;
background-color: #f0f0f0;
padding: 8px 15px;
border-radius: 5px;
}
.audio-player button {
background-color: #4CAF50;
color: white;
border: none;
padding: 8px 12px;
border-radius: 5px;
cursor: pointer;
font-size: 1em;
transition: background-color 0.3s ease;
}
.audio-player button:hover {
background-color: #388E3C;
}
/* NAMAZ VAKİTLERİ STİLİ */
.prayer-times-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 15px;
margin-top: 20px;
}
.prayer-time-item {
background-color: #f9f9f9;
padding: 15px;
border-radius: 10px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
text-align: center;
border: 1px solid #eee;
}
.prayer-time-item h3 {
margin-top: 0;
color: #4CAF50;
font-size: 1.1em;
margin-bottom: 5px;
}
.prayer-time-item .time {
font-size: 1.8em;
font-weight: bold;
color: #333;
}
#citySelectContainer {
margin-bottom: 15px;
text-align: center;
}
#citySelect {
padding: 8px 12px;
border-radius: 5px;
border: 1px solid #ccc;
font-size: 1em;
}
/* KIBLE PUSULASI */
.qibla-compass {
text-align: center;
margin-top: 20px;
background-color: #fdfdfd;
padding: 25px;
border-radius: 12px;
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
border: 1px solid #eee;
}
.compass-dial {
width: 200px;
height: 200px;
border: 10px solid #4CAF50;
border-radius: 50%;
margin: 20px auto;
position: relative;
background-color: #e8f5e9;
box-shadow: inset 0 0 15px rgba(0,0,0,0.1);
}
.compass-arrow {
width: 10px;
height: 90px;
background-color: #D32F2F; /* Kırmızı ok */
position: absolute;
top: 50%;
left: 50%;
transform-origin: 50% 100%; /* Okun dibinden dönsün */
transform: translate(-50%, -100%) rotate(0deg);
border-radius: 5px 5px 0 0;
transition: transform 0.2s ease-out; /* Yumuşak dönüş */
}
.compass-arrow::before {
content: '';
position: absolute;
top: -10px;
left: -10px;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 20px solid #D32F2F;
}
.qibla-direction-text {
font-size: 1.2em;
font-weight: bold;
color: #4CAF50;
margin-top: 15px;
}
.qibla-error {
color: #D32F2F;
margin-top: 10px;
font-weight: bold;
}
/* İSLAMİ TAKVİM */
.calendar-info {
background-color: #e0f2f7; /* Açık mavi */
padding: 20px;
border-radius: 10px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
margin-top: 20px;
}
.calendar-info h3 {
color: #0288D1;
margin-top: 0;
margin-bottom: 10px;
}
.islamic-date {
font-size: 1.5em;
font-weight: bold;
color: #4CAF50;
margin-bottom: 10px;
}
.islamic-events ul {
list-style-type: disc;
margin-left: 20px;
}
.islamic-events li {
background-color: transparent; /* Üstteki li stilini ezer */
padding: 5px 0;
margin-bottom: 5px;
border-radius: 0;
box-shadow: none;
}
/* ZİKİRMATİK / TESBİH STİLLERİ */
.counter-area {
text-align: center;
padding: 30px;
border: 2px dashed #BDBDBD;
border-radius: 12px;
background-color: #fafffa; /* Çok açık yeşil */
margin-top: 30px;
position: relative;
overflow: hidden;
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.count-display {
font-size: 4.5em; /* Daha büyük sayaç */
font-weight: bold;
color: #4CAF50;
margin-bottom: 25px;
min-height: 1.5em;
display: block;
text-shadow: 2px 2px 5px rgba(0,0,0,0.1);
}
.counter-buttons button {
background-color: #4CAF50;
color: white;
padding: 15px 30px;
font-size: 1.4em;
border: none;
border-radius: 50px;
cursor: pointer;
margin: 0 15px;
transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
box-shadow: 0 5px 15px rgba(0,0,0,0.25);
outline: none; /* Odaklanma çizgisini kaldır */
}
.counter-buttons button:hover {
background-color: #388E3C;
transform: translateY(-5px) scale(1.02); /* Hafif yukarı kalkma ve büyüme */
box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}
.counter-buttons button:active { /* Butona basıldığında */
transform: translateY(-2px) scale(0.98); /* Hafif içeri çökme */
box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.counter-buttons button.reset-btn {
background-color: #F44336;
}
.counter-buttons button.reset-btn:hover {
background-color: #D32F2F;
}
.zikir-goal-info {
margin-top: 20px;
font-size: 1em;
color: #777;
}
.zikir-selector {
margin-bottom: 20px;
}
.zikir-selector select {
padding: 10px 15px;
border-radius: 8px;
border: 1px solid #ccc;
font-size: 1.1em;
background-color: #fff;
color: #333;
appearance: none; /* Varsayılan select stilini kaldır */
-webkit-appearance: none;
-moz-appearance: none;
background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org% 2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D% 22292.4%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D% 22M287%2C114.7L146.2%2C255.5L5.4%2C114.7L25.9%2C94 .2l120.3%2C120.3L266.5%2C94.2L287%2C114.7z%22%2F%3 E%3C%2Fsvg%3E'); /* Özel ok */
background-repeat: no-repeat;
background-position: right 10px center;
background-size: 12px;
cursor: pointer;
}
.tesbih-goal-input {
margin-top: 15px;
}
.tesbih-goal-input label {
display: block;
margin-bottom: 5px;
color: #555;
}
.tesbih-goal-input input {
padding: 8px 12px;
border-radius: 5px;
border: 1px solid #ccc;
width: 80px;
text-align: center;
}
/* TESBİH ÖZEL GÖRSEL EFEKTLERİ */
#tesbih .tesbih-bead {
position: absolute;
width: 25px;
height: 25px;
background-color: #8BC34A; /* Tesbih tanesi rengi */
border-radius: 50%;
opacity: 0;
animation: popAndFade 0.6s ease-out forwards; /* Animasyon */
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
z-index: 1; /* Sayaçtan altta kalsın */
}
@keyframes popAndFade {
0% {
transform: scale(0) translateY(0);
opacity: 0;
}
50% {
transform: scale(1.2) translateY(-20px); /* Hafif yukarı fırlama */
opacity: 1;
}
100% {
transform: scale(1) translateY(0);
opacity: 0;
}
}
.tesbih-circle { /* Bu artık kullanılmıyor olabilir ama durabilir */
width: 200px; /* Tesbih dairesinin boyutu */
height: 200px;
border: 5px solid #E0E0E0;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 0;
box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
display: flex;
justify-content: center;
align-items: center;
font-size: 1.2em;
color: #999;
}
#tesbih .tesbih-circle span {
display: none;
}
/* FOOTER */
footer {
background-color: #333;
color: white;
text-align: center;
padding: 1.2rem 0;
margin-top: auto;
box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
}
/* RESPONSIVE TASARIM */
@media (max-width: 768px) {
header h1 {
font-size: 1.5em;
}
nav.app-nav {
flex-wrap: wrap;
padding: 0.2rem 0;
}
nav.app-nav button {
flex-basis: 33%; /* Üçer üçer sıralama */
margin-bottom: 5px;
font-size: 0.8em;
padding: 10px 5px;
}
nav.app-nav button i {
font-size: 1em;
}
main.app-content {
margin: 15px;
padding: 20px;
}
section h2 {
font-size: 1.5em;
}
.count-display {
font-size: 3.5em;
}
.counter-buttons button {
padding: 12px 25px;
font-size: 1.2em;
margin: 0 8px;
}
.tesbih-circle {
width: 150px;
height: 150px;
}
.quran-verse .arabic-text, .daily-info-box .arabic-text {
font-size: 1.3em;
}
}
@media (max-width: 480px) {
nav.app-nav button {
flex-basis: 50%; /* İkişer ikişer sıralama */
}
.counter-buttons button {
width: calc(100% - 20px); /* Paddingi düşün */
margin: 5px 10px;
display: block;
}
.zikir-selector select, #citySelect {
width: calc(100% - 40px);
}
.qibla-compass {
padding: 15px;
}
.compass-dial {
width: 150px;
height: 150px;
border-width: 8px;
}
.compass-arrow {
height: 70px;
}
.compass-arrow::before {
border-left-width: 12px;
border-right-width: 12px;
border-bottom-width: 16px;
top: -8px;
}
.tesbih-goal-input input {
width: 60px;
}
}
</style>
</head>
<body>
<header>
<h1>Modern İslami Rehber</h1>
</header>
<nav class="app-nav">
<button onclick="showSection('anasayfa', this)">
<i class="fas fa-home"></i> Anasayfa
</button>
<button onclick="showSection('kuran', this)">
<i class="fas fa-book-open"></i> Kur'an
</button>
<button onclick="showSection('hadisler', this)">
<i class="fas fa-quote-right"></i> Hadisler
</button>
<button onclick="showSection('dualar', this)">
<i class="fas fa-hands-praying"></i> Dualar
</button>
<button onclick="showSection('namaz', this)">
<i class="fas fa-mosque"></i> Namaz
</button>
<button onclick="showSection('zikirmatik', this)">
<i class="fas fa-star-and-crescent"></i> Zikirmatik
</button>
<button onclick="showSection('tesbih', this)">
<i class="fas fa-dharmachakra"></i> Tesbih
</button>
<button onclick="showSection('kible', this)">
<i class="fas fa-compass"></i> Kıble
</button>
<button onclick="showSection('takvim', this)">
<i class="fas fa-calendar-alt"></i> Takvim
</button>
</nav>
<main class="app-content">
<section id="anasayfa" class="active">
<h2>Hoş Geldiniz!</h2>
<div class="daily-info-box">
<h3 id="dailyInfoTitle">Günün Ayeti</h3>
<div class="arabic-text" id="dailyInfoArabic"></div>
<p id="dailyInfoTurkish"></p>
<small id="dailyInfoSource"></small>
<div class="audio-player" id="dailyInfoAudioPlayer" style="display:none;">
<button onclick="playDailyInfoAudio()"><i class="fas fa-volume-up"></i> Dinle</button>
<span id="dailyAudioStatus"></span>
</div>
</div>
<p>Bu modern İslami rehber uygulaması, günlük ibadetlerinizi kolaylaştırmak ve manevi bilginizi artırmak için tasarlandı. İçeriğimize göz atın ve zengin özelliklerimizi keşfedin.</p>
<p>Amacımız, İslam'ın güzelliklerini erişilebilir ve kullanıcı dostu bir platformda sunmaktır.</p>
</section>
<section id="kuran">
<h2>Kur'an-ı Kerim</h2>
<div class="quran-verse">
<div class="arabic-text">بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ</div>
<p>Anlamı: Rahmân ve Rahîm olan Allahın adıyla.</p>
<small>(Fatiha Suresi, 1. Ayet)</small>
<div class="audio-player">
<button onclick="playAudio('fatiha_1')"><i class="fas fa-volume-up"></i> Dinle</button>
</div>
</div>
<div class="quran-verse">
<div class="arabic-text">قُلْ هُوَ اللَّهُ أَحَدٌ</div>
<p>Anlamı: De ki: O Allah bir tektir.</p>
<small>(İhlas Suresi, 1. Ayet)</small>
<div class="audio-player">
<button onclick="playAudio('ihlas_1')"><i class="fas fa-volume-up"></i> Dinle</button>
</div>
</div>
<h3>Popüler Sureler:</h3>
<ul>
<li><i class="fas fa-arrow-right"></i> Fatiha Suresi</li>
<li><i class="fas fa-arrow-right"></i> Bakara Suresi'nden Seçmeler</li>
<li><i class="fas fa-arrow-right"></i> Yasin Suresi</li>
<li><i class="fas fa-arrow-right"></i> Rahman Suresi</li>
</ul>
</section>
<section id="hadisler">
<h2>Hadisler</h2>
<div class="hadith-text">
<p>Allah Resûlü (s.a.v.) şöyle buyurdu: "Ameller ancak niyetlere göredir. Herkesin niyeti ne ise, eline geçecek olan da odur."</p>
<small>(Buhârî, Bedül-vahy 1; Müslim, İmâret 155)</small>
</div>
<div class="hadith-text">
<p>Allah Resûlü (s.a.v.) buyurdu ki: "Sizin en hayırlınız, Kuranı öğrenen ve öğreteninizdir."</p>
<small>(Buhârî, Fedâilül-Kurân 21)</small>
</div>
<h3>Konulara Göre Hadisler:</h3>
<ul>
<li><i class="fas fa-lightbulb"></i> İlim ve Amel</li>
<li><i class="fas fa-handshake"></i> Komşuluk Hakları</li>
<li><i class="fas fa-heart"></i> Ahlak ve Adalet</li>
</ul>
</section>
<section id="dualar">
<h2>Dualar</h2>
<div class="quran-verse">
<div class="arabic-text">رَبَّنَا آتِنَا فِي الدُّنْيَا حَسَنَةً وَفِي الْآخِرَةِ حَسَنَةً وَقِنَا عَذَابَ النَّارِ</div>
<p>Anlamı: Ey Rabbimiz! Bize dünyada da iyilik ver, ahirette de iyilik ver ve bizi cehennem azabından koru.</p>
<small>(Bakara Suresi, 201. Ayet)</small>
</div>
<h3>Popüler Dualar:</h3>
<ul>
<li><i class="fas fa-praying-hands"></i> Namaz Sonrası Duaları</li>
<li><i class="fas fa-leaf"></i> Sabah ve Akşam Duaları</li>
<li><i class="fas fa-shield-alt"></i> Korunma Duaları</li>
<li><i class="fas fa-child"></i> Çocuklar İçin Dualar</li>
</ul>
<p>Daha fazla duaya ve anlamlarına buradan ulaşabilirsiniz.</p>
</section>
<section id="namaz">
<h2>Namaz Vakitleri</h2>
<div id="citySelectContainer">
<label for="citySelect">Şehir Seçin:</label>
<select id="citySelect" onchange="getPrayerTimes()">
</select>
</div>
<div class="prayer-times-grid" id="prayerTimesDisplay">
<p>Namaz vakitleri yükleniyor...</p>
</div>
<p id="prayerTimesError" style="color: #D32F2F; text-align: center; margin-top: 15px; display: none;">Namaz vakitleri alınamadı. Lütfen daha sonra tekrar deneyin veya farklı bir şehir seçin.</p>
<small style="display: block; text-align: center; margin-top: 10px; color: #777;">Vakitler Diyanet İşleri Başkanlığı verilerine göre sağlanmaktadır.</small>
</section>
<section id="zikirmatik">
<h2>Zikirmatik</h2>
<div class="counter-area">
<div class="zikir-selector">
<label for="zikirType">Zikir Seçin:</label>
<select id="zikirType" onchange="loadZikirCounter()">
<option value="subhanallah">Sübhanallah</option>
<option value="elhamdulillah">Elhamdülillah</option>
<option value="allahuakbar">Allahuekber</option>
<option value="lailaheillallah">Lâ ilâhe illallah</option>
<option value="estagfirullah">Estağfirullah</option>
<option value="salavat">Salavât</option>
</select>
</div>
<span id="zikirCount" class="count-display">0</span>
<div class="counter-buttons">
<button onclick="incrementCounter('zikir')">Zikir Çek</button>
<button class="reset-btn" onclick="resetCounter('zikir')">Sıfırla</button>
</div>
<p class="zikir-goal-info">Seçili zikir için geçerli sayacınız.</p>
</div>
</section>
<section id="tesbih">
<h2>Tesbih Çek</h2>
<div class="counter-area" id="tesbih-counter-area">
<span id="tesbihCount" class="count-display">0</span>
<div class="tesbih-goal-input">
<label for="tesbihGoal">Hedef Sayı (örn: 33, 99):</label>
<input type="number" id="tesbihGoal" value="33" min="1">
</div>
<div class="counter-buttons">
<button id="tesbihClickBtn" onclick="incrementCounter('tesbih')">Tesbih Çek</button>
<button class="reset-btn" onclick="resetCounter('tesbih')">Sıfırla</button>
</div>
<p class="zikir-goal-info" id="tesbihGoalInfo">Hedef: 33. Hedefe ulaştığınızda uyarılacaksınız.</p>
</div>
</section>
<section id="kible">
<h2>Kıble Pusulası</h2>
<div class="qibla-compass">
<div class="compass-dial">
<div class="compass-arrow" id="qiblaArrow"></div>
</div>
<p class="qibla-direction-text" id="qiblaDirectionText">Yön Belirleniyor...</p>
<p class="qibla-error" id="qiblaError" style="display: none;">Konum veya cihaz yön bilgisi alınamadı. Lütfen konum servislerini etkinleştirin.</p>
<small style="display: block; margin-top: 10px; color: #777;">Bu özellik, cihazınızın konum ve hareket sensörlerini kullanır.</small>
</div>
</section>
<section id="takvim">
<h2>İslami Takvim</h2>
<div class="calendar-info">
<h3>Bugünün Tarihi</h3>
<p class="islamic-date" id="gregorianDate">Miladi Tarih: </p>
<p class="islamic-date" id="hijriDate">Hicri Tarih: </p>
</div>
<div class="calendar-info">
<h3>Yaklaşan Önemli İslami Günler</h3>
<ul id="islamicEventsList">
</ul>
</div>
</section>
</main>
<footer>
<p>© 2025 Modern İslami Rehber Uygulaması. Tüm Hakları Saklıdır.</p>
</footer>
<script>
// --- Uygulama Verileri ---
const appData = {
dailyInfos: [
{ type: 'ayet', title: 'Günün Ayeti', arabic: 'بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ', turkish: 'Rahmân ve Rahîm olan Allahın adıyla.', source: '(Fatiha Suresi, 1. Ayet)', audio: 'fatiha_1' },
{ type: 'ayet', title: 'Günün Ayeti', arabic: 'قُلْ هُوَ اللَّهُ أَحَدٌ', turkish: 'De ki: O Allah bir tektir.', source: '(İhlas Suresi, 1. Ayet)', audio: 'ihlas_1' },
{ type: 'hadis', title: 'Günün Hadisi', arabic: '', turkish: 'Ameller ancak niyetlere göredir. Herkesin niyeti ne ise, eline geçecek olan da odur.', source: '(Buhârî, Müslim)' },
{ type: 'hadis', title: 'Günün Hadisi', arabic: '', turkish: 'Sizin en hayırlınız, Kuranı öğrenen ve öğreteninizdir.', source: '(Buhârî)' },
{ type: 'dua', title: 'Günün Duası', arabic: 'رَبَّنَا آتِنَا فِي الدُّنْيَا حَسَنَةً وَفِي الْآخِرَةِ حَسَنَةً وَقِنَا عَذَابَ النَّارِ', turkish: 'Ey Rabbimiz! Bize dünyada da iyilik ver, ahirette de iyilik ver ve bizi cehennem azabından koru.', source: '(Bakara Suresi, 201. Ayet)', audio: 'bakara_201' }
],
zikirTypes: {
'subhanallah': { name: 'Sübhanallah', turkish: 'Allah noksan sıfatlardan münezzehtir.', audio: 'data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU1QAAAAPU09GVFdBUkU9TG FTb25pYy44NQEAAAAxSkxBTUUzLjEwMFVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVWVWRhdGEAAAAAAAAAAHBsYXN0aW MgY2xpY2sgc291bmQK' }, // Örnek ses
'elhamdulillah': { name: 'Elhamdülillah', turkish: 'Hamd Allah'adır.', audio: '' },
'allahuakbar': { name: 'Allahuekber', turkish: 'Allah en büyüktür.', audio: '' },
'lailaheillallah': { name: 'Lâ ilâhe illallah', turkish: 'Allah'tan başka ilah yoktur.', audio: '' },
'estagfirullah': { name: 'Estağfirullah', turkish: 'Allah'tan bağışlanma dilerim.', audio: '' },
'salavat': { name: 'Salavât', turkish: 'Allahümme salli ala seyyidina Muhammed', audio: '' }
},
islamicEvents: [
{ name: 'Kurban Bayramı', date: '2025-06-06' }, // Örnek tarihler (Miladi olarak)
{ name: 'Ramazan Bayramı', date: '2026-03-20' },
{ name: 'Regaip Kandili', date: '2025-01-28' },
{ name: 'Mirac Kandili', date: '2025-02-17' },
{ name: 'Berat Kandili', date: '2025-03-06' },
{ name: 'Mevlid Kandili', date: '2025-09-06' },
{ name: 'Aşure Günü', date: '2025-07-06' }
],
// Ses dosyaları için placeholder Base64 verileri (gerçek sesler daha büyük olur)
audioSamples: {
'click': 'data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU1QAAAAPU09GVFdBUkU9TG FTb25pYy44NQEAAAAxSkxBTUUzLjEwMFVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVWVWRhdGEAAAAAAAAAAHBsYXN0aW MgY2xpY2sgc291bmQK',
'fatiha_1': 'data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU1QAAAAPU09GVFdBUkU9TG FTb25pYy44NQEAAAAxSkxBTUUzLjEwMFVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVWVWRhdGEAAAAAAAAAAHBsYXN0aW MgY2xpY2sgc291bmQK', // Yer tutucu
'ihlas_1': 'data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU1QAAAAPU09GVFdBUkU9TG FTb25pYy44NQEAAAAxSkxBTUUzLjEwMFVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVWVWRhdGEAAAAAAAAAAHBsYXN0aW MgY2xpY2sgc291bmQK', // Yer tutucu
'bakara_201': 'data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU1QAAAAPU09GVFdBUkU9TG FTb25pYy44NQEAAAAxSkxBTUUzLjEwMFVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVWVWRhdGEAAAAAAAAAAHBsYXN0aW MgY2xpY2sgc291bmQK' // Yer tutucu
},
prayerTimesCities: [ // Diyanet API'sinden şehir ID'leri
{ id: 9611, name: "İstanbul" },
{ id: 9541, name: "Ankara" },
{ id: 9553, name: "İzmir" },
{ id: 9699, name: "Bursa" },
{ id: 9580, name: "Antalya" },
{ id: 9647, name: "Konya" },
{ id: 8527, name: "Sofya (Bulgaristan)" }, // Şimdiki konumumuz
{ id: 8503, name: "Plovdiv (Bulgaristan)" },
{ id: 8505, name: "Varna (Bulgaristan)" },
{ id: 8511, name: "Burgas (Bulgaristan)" }
]
};
// --- Global Değişkenler ---
let zikirCounters = JSON.parse(localStorage.getItem('zikirCounters')) || {};
let currentZikirType = localStorage.getItem('currentZikirType') || 'subhanallah';
let tesbihCounter = parseInt(localStorage.getItem('tesbihCounter') || '0');
let tesbihGoal = parseInt(localStorage.getItem('tesbihGoal') || '33');
let currentQiblaAngle = 0; // Kıble pusulası için
// --- Uygulama Fonksiyonları ---
// Sayfa bölümlerini yönetme
function showSection(sectionId, clickedButton) {
document.querySelectorAll('section').forEach(secti on => {
section.classList.remove('active');
});
const targetSection = document.getElementById(sectionId);
if (targetSection) {
targetSection.classList.add('active');
}
document.querySelectorAll('.app-nav button').forEach(button => {
button.classList.remove('active');
});
if (clickedButton) {
clickedButton.classList.add('active');
}
// Kıble pusulası görünür olduğunda güncellemeyi başlat
if (sectionId === 'kible') {
initQiblaCompass();
} else {
stopQiblaCompass();
}
}
// Ses çalma
function playSound(audioKey) {
const audioUrl = appData.audioSamples[audioKey] || audioKey; // doğrudan URL veya Base64
if (audioUrl) {
const audio = new Audio(audioUrl);
audio.volume = 0.3;
audio.play().catch(e => console.error("Ses çalma hatası:", e));
}
}
function playDailyInfoAudio() {
const currentDailyInfo = JSON.parse(localStorage.getItem('currentDailyInfo' ));
if (currentDailyInfo && currentDailyInfo.audio) {
document.getElementById('dailyAudioStatus').innerT ext = 'Çalıyor...';
const audio = new Audio(appData.audioSamples[currentDailyInfo.audio] || currentDailyInfo.audio);
audio.volume = 0.5;
audio.play().catch(e => {
console.error("Günlük bilgi sesi çalma hatası:", e);
document.getElementById('dailyAudioStatus').innerT ext = 'Ses çalınamadı.';
});
audio.onended = () => {
document.getElementById('dailyAudioStatus').innerT ext = '';
};
audio.onerror = () => {
document.getElementById('dailyAudioStatus').innerT ext = 'Ses yüklenemedi.';
};
}
}
// Genel ses çalma fonksiyonu (Kuran ayetleri için)
function playAudio(audioId) {
playSound(audioId);
}
// Cihaz titreşimi (mobil için)
function vibrate(duration = 50) {
if (navigator.vibrate) {
navigator.vibrate(duration);
}
}
// Sayaçları artırma ve sıfırlama
function incrementCounter(type) {
playSound('click'); // Her tıklamada ses
vibrate(30); // Hafif titreşim
if (type === 'zikir') {
zikirCounters[currentZikirType] = (zikirCounters[currentZikirType] || 0) + 1;
document.getElementById('zikirCount').innerText = zikirCounters[currentZikirType];
localStorage.setItem('zikirCounters', JSON.stringify(zikirCounters));
} else if (type === 'tesbih') {
tesbihCounter++;
document.getElementById('tesbihCount').innerText = tesbihCounter;
localStorage.setItem('tesbihCounter', tesbihCounter);
// Tesbih görsel efekti
const tesbihArea = document.getElementById('tesbih-counter-area');
const bead = document.createElement('div');
bead.classList.add('tesbih-bead');
const buttonRect = document.getElementById('tesbihClickBtn').getBound ingClientRect();
// Buton etrafında rastgele konumda belirsin
const randomX = buttonRect.left + (Math.random() * buttonRect.width) - tesbihArea.getBoundingClientRect().left - 12.5;
const randomY = buttonRect.top + (Math.random() * buttonRect.height) - tesbihArea.getBoundingClientRect().top - 12.5;
bead.style.left = `${randomX}px`;
bead.style.top = `${randomY}px`;
tesbihArea.appendChild(bead);
bead.addEventListener('animationend', () => {
bead.remove();
});
if (tesbihCounter >= tesbihGoal) {
alert(`Tebrikler! ${tesbihGoal} tesbihi tamamladınız.`);
vibrate(200); // Hedefe ulaşınca uzun titreşim
// İsteğe bağlı: Otomatik sıfırlama veya devam etme
// resetCounter('tesbih');
}
}
}
function resetCounter(type) {
if (type === 'zikir') {
zikirCounters[currentZikirType] = 0;
document.getElementById('zikirCount').innerText = zikirCounters[currentZikirType];
localStorage.setItem('zikirCounters', JSON.stringify(zikirCounters));
} else if (type === 'tesbih') {
tesbihCounter = 0;
document.getElementById('tesbihCount').innerText = tesbihCounter;
localStorage.setItem('tesbihCounter', tesbihCounter);
}
}
// Zikirmatik için zikir tipi değiştirme
function loadZikirCounter() {
currentZikirType = document.getElementById('zikirType').value;
localStorage.setItem('currentZikirType', currentZikirType);
document.getElementById('zikirCount').innerText = zikirCounters[currentZikirType] || 0;
const zikirInfo = appData.zikirTypes[currentZikirType].turkish;
document.querySelector('#zikirmatik .zikir-goal-info').innerText = zikirInfo ? `Anlamı: ${zikirInfo}` : "Seçili zikir için geçerli sayacınız.";
}
// Tesbih hedefi ayarlama
function updateTesbihGoal() {
const input = document.getElementById('tesbihGoal');
let newGoal = parseInt(input.value);
if (isNaN(newGoal) || newGoal <= 0) {
newGoal = 33; // Geçersizse varsayılan
input.value = 33;
}
tesbihGoal = newGoal;
localStorage.setItem('tesbihGoal', tesbihGoal);
document.getElementById('tesbihGoalInfo').innerTex t = `Hedef: ${tesbihGoal}. Hedefe ulaştığınızda uyarılacaksınız.`;
}
// --- Günlük Ayet/Hadis/Dua ---
function displayDailyInfo() {
const today = new Date().toDateString();
let lastDisplayDate = localStorage.getItem('lastDailyInfoDate');
let dailyInfoIndex = parseInt(localStorage.getItem('dailyInfoIndex') || '0');
if (lastDisplayDate !== today) {
// Her gün farklı bir bilgi göster
dailyInfoIndex = (dailyInfoIndex + 1) % appData.dailyInfos.length;
localStorage.setItem('lastDailyInfoDate', today);
localStorage.setItem('dailyInfoIndex', dailyInfoIndex);
}
const info = appData.dailyInfos[dailyInfoIndex];
localStorage.setItem('currentDailyInfo', JSON.stringify(info));
document.getElementById('dailyInfoTitle').innerTex t = info.title;
document.getElementById('dailyInfoArabic').innerTe xt = info.arabic;
document.getElementById('dailyInfoTurkish').innerT ext = info.turkish;
document.getElementById('dailyInfoSource').innerTe xt = info.source;
document.getElementById('dailyInfoAudioPlayer').st yle.display = info.audio ? 'flex' : 'none';
}
// --- Namaz Vakitleri ---
// Şehirleri dropdown'a yükle
function populateCities() {
const citySelect = document.getElementById('citySelect');
appData.prayerTimesCities.forEach(city => {
const option = document.createElement('option');
option.value = city.id;
option.innerText = city.name;
citySelect.appendChild(option);
});
const savedCityId = localStorage.getItem('selectedCityId');
if (savedCityId) {
citySelect.value = savedCityId;
}
}
async function getPrayerTimes() {
const cityId = document.getElementById('citySelect').value;
localStorage.setItem('selectedCityId', cityId);
const displayDiv = document.getElementById('prayerTimesDisplay');
const errorDiv = document.getElementById('prayerTimesError');
displayDiv.innerHTML = '<p>Namaz vakitleri yükleniyor...</p>';
errorDiv.style.display = 'none';
// Diyanet API URL'si
const apiUrl = `https://ezanvakti.herokuapp.com/vakitler/${cityId}`;
try {
const response = await fetch(apiUrl);
if (!response.ok) {
throw new Error(`HTTP Hata kodu: ${response.status}`);
}
const data = await response.json();
if (data && data.length > 0) {
const todayData = data[0]; // Bugünün vakitleri
displayDiv.innerHTML = `
<div class="prayer-time-item"><h3>İmsak</h3><span class="time">${todayData.Imsak}</span></div>
<div class="prayer-time-item"><h3>Güneş</h3><span class="time">${todayData.Gunes}</span></div>
<div class="prayer-time-item"><h3>Öğle</h3><span class="time">${todayData.Ogle}</span></div>
<div class="prayer-time-item"><h3>İkindi</h3><span class="time">${todayData.Ikindi}</span></div>
<div class="prayer-time-item"><h3>Akşam</h3><span class="time">${todayData.Aksam}</span></div>
<div class="prayer-time-item"><h3>Yatsı</h3><span class="time">${todayData.Yatsi}</span></div>
`;
} else {
displayDiv.innerHTML = '';
errorDiv.innerText = 'Seçilen şehir için namaz vakitleri bulunamadı.';
errorDiv.style.display = 'block';
}
} catch (error) {
console.error("Namaz vakitleri alınırken hata oluştu:", error);
displayDiv.innerHTML = '';
errorDiv.innerText = 'Namaz vakitleri alınamadı. İnternet bağlantınızı kontrol edin veya farklı bir şehir seçin.';
errorDiv.style.display = 'block';
}
}
// --- Kıble Pusulası ---
const qiblaArrow = document.getElementById('qiblaArrow');
const qiblaDirectionText = document.getElementById('qiblaDirectionText');
const qiblaError = document.getElementById('qiblaError');
let currentHeading = 0; // Cihazın mevcut yönü
let qiblaAngle = 0; // Kıbleye göre açı
// Kullanıcının mevcut konumunu al (Kıble açısını hesaplamak için)
function getDeviceLocation() {
return new Promise((resolve, reject) => {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
position => resolve({
latitude: position.coords.latitude,
longitude: position.coords.longitude
}),
error => reject(error),
{ enableHighAccuracy: true, timeout: 5000, maximumAge: 0 }
);
} else {
reject(new Error("Tarayıcınız konum servislerini desteklemiyor."));
}
});
}
// Kıble açısını hesapla (Kaç derece dönülmesi gerektiği)
function calculateQiblaAngle(latitude, longitude) {
const KAABA_LAT = 21.4225; // Kabe enlem
const KAABA_LON = 39.8262; // Kabe boylam
const latRad = latitude * Math.PI / 180;
const lonRad = longitude * Math.PI / 180;
const kaabaLatRad = KAABA_LAT * Math.PI / 180;
const kaabaLonRad = KAABA_LON * Math.PI / 180;
const deltaLon = kaabaLonRad - lonRad;
const y = Math.sin(deltaLon);
const x = Math.cos(latRad) * Math.tan(kaabaLatRad) - Math.sin(latRad) * Math.cos(deltaLon);
let angle = Math.atan2(y, x) * 180 / Math.PI;
if (angle < 0) {
angle += 360;
}
return angle; // Kuzey'e göre Kabe açısı
}
// Pusulayı güncelle
function updateCompass() {
// Cihazın kuzeye göre yönü (heading) ile kıble açısını birleştir
// qiblaArrow'u döndür
const rotateAngle = (qiblaAngle - currentHeading + 360) % 360;
qiblaArrow.style.transform = `translate(-50%, -100%) rotate(${rotateAngle}deg)`;
qiblaDirectionText.innerText = `Kıble Yönü: Yaklaşık ${Math.round(rotateAngle)}°`;
qiblaError.style.display = 'none';
}
// Cihaz yön bilgisini al
function handleOrientation(event) {
// Beta ve Gamma açıları cihazın eğimini verir, Alpha cihazın kuzeye göre yönünü verir (0-360)
if (event.alpha !== null) {
currentHeading = event.alpha; // Alpha, cihazın kuzeye göre yönü
updateCompass();
}
}
// Kıble pusulasını başlat
async function initQiblaCompass() {
qiblaError.style.display = 'none';
qiblaDirectionText.innerText = 'Konum alınıyor...';
try {
const location = await getDeviceLocation();
qiblaAngle = calculateQiblaAngle(location.latitude, location.longitude);
qiblaDirectionText.innerText = 'Cihaz yönü bekleniyor...';
if (window.DeviceOrientationEvent) {
window.addEventListener('deviceorientation', handleOrientation);
} else {
throw new Error("Cihazınızın yön sensörleri desteklenmiyor.");
}
} catch (error) {
console.error("Kıble pusulası hatası:", error);
qiblaError.innerText = `Hata: ${error.message || 'Konum veya yön bilgisi alınamadı.'}`;
qiblaError.style.display = 'block';
qiblaDirectionText.innerText = 'Kıble Yönü: Bilgi Yok';
qiblaArrow.style.transform = `translate(-50%, -100%) rotate(0deg)`; // Oku sıfırla
}
}
// Kıble pusulasını durdur (performans için)
function stopQiblaCompass() {
if (window.DeviceOrientationEvent) {
window.removeEventListener('deviceorientation', handleOrientation);
}
}
// --- İslami Takvim ---
// Basic Hijri Calendar conversion (simplified for demonstration)
// For accurate conversion, a dedicated library is recommended (e.g., moment-hijri)
function gregorianToHijri(date) {
// This is a very simplified placeholder. Real conversion is complex.
// Based on approximation for current date in Bulgaria.
// July 25, 2025 (Gregorian) is roughly 29 Dhul-Hijjah 1446 (Islamic)
// or 1 Muharram 1447 (if 25th is first day of Muharram).
// A precise calculation needs an algorithm or a library.
const today = new Date();
const year = today.getFullYear();
const month = today.getMonth() + 1; // 0-indexed
const day = today.getDate();
// Placeholder for Hijri date calculation
// This needs to be replaced with a proper algorithm or library for accuracy
let hijriYear = 1446;
let hijriMonth = "Zilhicce";
let hijriDay = 29;
// Simple estimation for the given example date range
if (year === 2025 && month >= 7) { // July 2025 onwards
// Muharram 1447 starts around July 26, 2025
if (month === 7 && day >= 26) {
hijriYear = 1447;
hijriMonth = "Muharrem";
hijriDay = day - 25; // Roughly
} else if (month > 7) {
hijriYear = 1447;
// Placeholder for other months
hijriMonth = "Muharrem (devam)";
hijriDay = Math.floor(Math.random() * 29) + 1; // Just a random day for later months
}
} else if (year > 2025) {
hijriYear = 1447 + (year - 2025); // very rough
hijriMonth = "Tahmini";
hijriDay = Math.floor(Math.random() * 29) + 1;
}
return `${hijriDay} ${hijriMonth} ${hijriYear} H.`;
}
function displayIslamicCalendar() {
const today = new Date();
document.getElementById('gregorianDate').innerText = `Miladi Tarih: ${today.toLocaleDateString('tr-TR', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })}`;
document.getElementById('hijriDate').innerText = `Hicri Tarih: ${gregorianToHijri(today)}`;
const eventsList = document.getElementById('islamicEventsList');
eventsList.innerHTML = '';
const upcomingEvents = appData.islamicEvents.filter(event => new Date(event.date) >= today)
.sort((a, b) => new Date(a.date) - new Date(b.date));
if (upcomingEvents.length > 0) {
upcomingEvents.slice(0, 5).forEach(event => { // Yaklaşan ilk 5 olayı göster
const eventDate = new Date(event.date);
const li = document.createElement('li');
li.innerHTML = `<i class="fas fa-calendar-check"></i> <strong>${event.name}:</strong> ${eventDate.toLocaleDateString('tr-TR', { day: 'numeric', month: 'long', year: 'numeric' })}`;
eventsList.appendChild(li);
});
} else {
eventsList.innerHTML = '<li>Yaklaşan önemli İslami gün bulunmamaktadır.</li>';
}
}
// --- Başlangıç Yüklemeleri ---
document.addEventListener('DOMContentLoaded', () => {
// Varsayılan olarak Anasayfa'yı göster
showSection('anasayfa', document.querySelector('.app-nav button:first-child'));
// Günlük bilgi yükle
displayDailyInfo();
// Zikirmatik başlangıç ayarları
document.getElementById('zikirType').value = currentZikirType;
loadZikirCounter(); // Başlangıç zikir sayacını yükle
// Tesbih hedefi başlangıç ayarları
document.getElementById('tesbihGoal').value = tesbihGoal;
updateTesbihGoal(); // Bilgi metnini güncelle
document.getElementById('tesbihGoal').addEventList ener('change', updateTesbihGoal);
// Şehirleri yükle ve namaz vakitlerini al
populateCities();
getPrayerTimes();
// İslami takvimi yükle
displayIslamicCalendar();
// Cihazın konum ve yön sensörleri için izin iste
if (window.DeviceOrientationEvent || navigator.geolocation) {
// Sadece kullanıcı Kıble bölümüne gittiğinde tetiklemek daha iyi bir UX olabilir
// initQiblaCompass(); // Eğer uygulama açılır açılmaz başlamasını isterseniz
}
});
</script>
</body>
</html>







Selamlar yapay zeka ile islami site yaptık geliştirme isteyenler için kodları bıraktım iyi forumlar hayırlı cumalar
