{"id":259,"date":"2025-07-09T00:36:03","date_gmt":"2025-07-09T00:36:03","guid":{"rendered":"https:\/\/insaatsirketleri.com.tr\/en\/?p=259"},"modified":"2025-07-09T00:36:03","modified_gmt":"2025-07-09T00:36:03","slug":"earthquakes","status":"publish","type":"post","link":"https:\/\/insaatsirketleri.com.tr\/en\/earthquakes\/","title":{"rendered":"Earthquakes"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<script src=\"https:\/\/cdn.tailwindcss.com\"><\/script>\n    <link href=\"https:\/\/fonts.googleapis.com\/css2?family=Inter:wght@400;600;700&#038;display=swap\" rel=\"stylesheet\">\n    <script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-2506329722665303\"\n      crossorigin=\"anonymous\"><\/script>\n    <style>\n        body {\n            font-family: 'Inter', sans-serif;\n            background-color: #f0f2f5;\n            color: #333;\n        }\n        .red-magnitude {\n            color: #ef4444; \/* Tailwind red-500 *\/\n            font-weight: 600;\n        }\n        .container-shadow {\n            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);\n        }\n        .ad-container {\n            background-color: #e2e8f0; \/* Tailwind gray-200 *\/\n            border: 1px dashed #94a3b8; \/* Tailwind slate-400 *\/\n            padding: 1.5rem;\n            text-align: center;\n            color: #64748b; \/* Tailwind slate-500 *\/\n            font-weight: 600;\n            margin-top: 1rem;\n            margin-bottom: 1rem;\n            border-radius: 0.5rem;\n            \/* Reklam\u0131n g\u00f6r\u00fcn\u00fcrl\u00fc\u011f\u00fcn\u00fc sa\u011flamak i\u00e7in minimum y\u00fckseklik *\/\n            min-height: 100px; \/* \u00d6rnek bir de\u011fer, reklam boyutuna g\u00f6re ayarlanabilir *\/\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            overflow: hidden; \/* Reklam i\u00e7eri\u011fi ta\u015farsa gizle *\/\n            width: 100%; \/* Reklam kapsay\u0131c\u0131s\u0131n\u0131n geni\u015fli\u011fini tam olarak ayarlar *\/\n        }\n        .share-button {\n            display: inline-flex;\n            align-items: center;\n            justify-content: center;\n            padding: 0.75rem 1.25rem;\n            border-radius: 0.5rem;\n            font-weight: 600;\n            color: white;\n            text-decoration: none;\n            transition: background-color 0.2s ease-in-out;\n            margin: 0.5rem;\n        }\n        .share-button.twitter {\n            background-color: #1DA1F2;\n        }\n        .share-button.twitter:hover {\n            background-color: #0c85d0;\n        }\n        .share-button.facebook {\n            background-color: #1877F2;\n        }\n        .share-button.facebook:hover {\n            background-color: #145cb3;\n        }\n        .share-button.linkedin {\n            background-color: #0A66C2;\n        }\n        .share-button.linkedin:hover {\n            background-color: #074b8e;\n        }\n    <\/style>\n<\/head>\n<body class=\"p-4 sm:p-6 md:p-8\">\n    <div class=\"max-w-4xl mx-auto bg-white rounded-lg p-6 sm:p-8 container-shadow\">\n        <h1 class=\"text-3xl sm:text-4xl font-bold text-center mb-6 text-gray-800\">Son Depremler<\/h1>\n\n        <div class=\"mb-6\">\n            <label for=\"region-select\" class=\"block text-gray-700 text-sm font-bold mb-2\">B\u00f6lgeye G\u00f6re Filtrele:<\/label>\n            <select id=\"region-select\" class=\"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline\">\n                <option value=\"T\u00fcm\u00fc\">T\u00fcm\u00fc<\/option>\n                <option value=\"T\u00fcrkiye\">T\u00fcrkiye<\/option>\n                <option value=\"USA\">ABD<\/option>\n                <option value=\"Japan\">Japonya<\/option>\n                <option value=\"Indonesia\">Endonezya<\/option>\n                <option value=\"Chile\">\u015eili<\/option>\n                <option value=\"Iran\">\u0130ran<\/option>\n                <option value=\"Greece\">Yunanistan<\/option>\n                <option value=\"Italy\">\u0130talya<\/option>\n                <option value=\"Mexico\">Meksika<\/option>\n                <option value=\"China\">\u00c7in<\/option>\n                <option value=\"Russia\">Rusya<\/option>\n                <option value=\"Canada\">Kanada<\/option>\n            <\/select>\n        <\/div>\n\n        <div id=\"loading\" class=\"text-center text-lg text-gray-600 mb-4\">\n            Deprem verileri y\u00fckleniyor&#8230;\n        <\/div>\n\n        <div id=\"error\" class=\"hidden text-center text-red-600 text-lg mb-4\">\n            Veriler y\u00fcklenirken bir hata olu\u015ftu. L\u00fctfen daha sonra tekrar deneyin.\n        <\/div>\n\n        <div id=\"earthquake-list\" class=\"space-y-4\">\n            <\/div>\n\n        <div class=\"mt-8 pt-4 border-t border-gray-200 text-center\">\n            <h2 class=\"text-xl font-bold mb-4 text-gray-800\">Uygulamay\u0131 Payla\u015f<\/h2>\n            <a href=\"#\" id=\"share-twitter\" class=\"share-button twitter\">Twitter<\/a>\n            <a href=\"#\" id=\"share-facebook\" class=\"share-button facebook\">Facebook<\/a>\n            <a href=\"#\" id=\"share-linkedin\" class=\"share-button linkedin\">LinkedIn<\/a>\n        <\/div>\n    <\/div>\n\n    <script>\n        \/\/ API'den \u00e7ekilen t\u00fcm deprem verilerini saklamak i\u00e7in\n        let allEarthquakeData = [];\n\n        const loadingDiv = document.getElementById('loading');\n        const errorDiv = document.getElementById('error');\n        const earthquakeListDiv = document.getElementById('earthquake-list');\n        const regionSelect = document.getElementById('region-select'); \/\/ B\u00f6lge se\u00e7imi dropdown'\u0131\n\n        \/\/ Payla\u015f\u0131m butonlar\u0131\n        const shareTwitterBtn = document.getElementById('share-twitter');\n        const shareFacebookBtn = document.getElementById('share-facebook');\n        const shareLinkedinBtn = document.getElementById('share-linkedin');\n\n        \/\/ USGS API'sinden son 7 g\u00fcnl\u00fck deprem verilerini \u00e7ekme\n        \/\/ Sadece 1.0 ve \u00fczeri b\u00fcy\u00fckl\u00fckteki depremleri al\u0131yoruz\n        const apiUrl = 'https:\/\/earthquake.usgs.gov\/earthquakes\/feed\/v1.0\/summary\/1.0_week.geojson';\n\n        \/\/ Deprem verilerini getiren fonksiyon\n        async function fetchEarthquakeData() {\n            try {\n                loadingDiv.classList.remove('hidden'); \/\/ Y\u00fckleniyor mesaj\u0131n\u0131 g\u00f6ster\n                errorDiv.classList.add('hidden');       \/\/ Hata mesaj\u0131n\u0131 gizle\n                earthquakeListDiv.innerHTML = '';       \/\/ \u00d6nceki verileri temizle\n\n                const response = await fetch(apiUrl);\n\n                \/\/ HTTP hatas\u0131 kontrol\u00fc\n                if (!response.ok) {\n                    throw new Error(`HTTP hata kodu: ${response.status}`);\n                }\n\n                const data = await response.json();\n                allEarthquakeData = data.features; \/\/ T\u00fcm veriyi sakla\n                filterAndDisplayEarthquakes(); \/\/ Mevcut filtreye g\u00f6re g\u00f6ster\n\n            } catch (error) {\n                console.error('Deprem verileri al\u0131n\u0131rken hata olu\u015ftu:', error);\n                loadingDiv.classList.add('hidden'); \/\/ Y\u00fckleniyor mesaj\u0131n\u0131 gizle\n                errorDiv.classList.remove('hidden'); \/\/ Hata mesaj\u0131n\u0131 g\u00f6ster\n            } finally {\n                loadingDiv.classList.add('hidden'); \/\/ Y\u00fckleniyor mesaj\u0131n\u0131 gizle\n            }\n        }\n\n        \/\/ Depremleri filtreleyip g\u00f6steren fonksiyon\n        function filterAndDisplayEarthquakes() {\n            const selectedRegion = regionSelect.value;\n            let filteredEarthquakes = [];\n\n            if (selectedRegion === 'T\u00fcm\u00fc') {\n                filteredEarthquakes = allEarthquakeData;\n            } else {\n                \/\/ B\u00f6lgeye g\u00f6re filtrele (yer ad\u0131nda b\u00f6lge ad\u0131n\u0131 i\u00e7erenleri)\n                filteredEarthquakes = allEarthquakeData.filter(quake =>\n                    quake.properties.place && quake.properties.place.toLowerCase().includes(selectedRegion.toLowerCase())\n                );\n            }\n            displayEarthquakes(filteredEarthquakes);\n        }\n\n        \/\/ Deprem verilerini ekranda g\u00f6steren fonksiyon\n        function displayEarthquakes(earthquakes) {\n            earthquakeListDiv.innerHTML = ''; \/\/ Listeyi temizle\n\n            if (earthquakes.length === 0) {\n                earthquakeListDiv.innerHTML = '<p class=\"text-center text-gray-500\">Se\u00e7ilen b\u00f6lgede belirtilen b\u00fcy\u00fckl\u00fckte deprem bulunamad\u0131.<\/p>';\n                return;\n            }\n\n            earthquakes.forEach((quake, index) => {\n                const magnitude = quake.properties.mag;\n                const place = quake.properties.place;\n                const time = new Date(quake.properties.time).toLocaleString('tr-TR'); \/\/ Yerel saat dilimine g\u00f6re formatlama\n                const url = quake.properties.url;\n\n                const quakeCard = document.createElement('div');\n                quakeCard.classList.add('bg-gray-50', 'p-4', 'rounded-md', 'border', 'border-gray-200', 'flex', 'flex-col', 'sm:flex-row', 'justify-between', 'items-start', 'sm:items-center');\n\n                \/\/ B\u00fcy\u00fckl\u00fck ve yer bilgisi\n                const magnitudePlaceDiv = document.createElement('div');\n                magnitudePlaceDiv.classList.add('flex-grow', 'mb-2', 'sm:mb-0');\n\n                const magnitudeSpan = document.createElement('span');\n                magnitudeSpan.classList.add('text-xl', 'font-bold', 'mr-2');\n                \/\/ B\u00fcy\u00fckl\u00fck 3 ve \u00fcst\u00fc ise k\u0131rm\u0131z\u0131 yap\n                if (magnitude >= 3.0) {\n                    magnitudeSpan.classList.add('red-magnitude');\n                }\n                magnitudeSpan.textContent = magnitude.toFixed(1); \/\/ B\u00fcy\u00fckl\u00fc\u011f\u00fc bir ondal\u0131k basamakla g\u00f6ster\n\n                const placeParagraph = document.createElement('p');\n                placeParagraph.classList.add('text-gray-700', 'text-base', 'sm:text-lg');\n                placeParagraph.textContent = place;\n\n                magnitudePlaceDiv.appendChild(magnitudeSpan);\n                magnitudePlaceDiv.appendChild(placeParagraph);\n\n                \/\/ Zaman ve detay linki\n                const timeDetailsDiv = document.createElement('div');\n                timeDetailsDiv.classList.add('text-right', 'sm:text-left', 'flex', 'flex-col', 'items-end', 'sm:items-start');\n\n                const timeParagraph = document.createElement('p');\n                timeParagraph.classList.add('text-sm', 'text-gray-500');\n                timeParagraph.textContent = time;\n\n                const detailsLink = document.createElement('a');\n                detailsLink.href = url;\n                detailsLink.target = '_blank'; \/\/ Yeni sekmede a\u00e7\n                detailsLink.rel = 'noopener noreferrer'; \/\/ G\u00fcvenlik i\u00e7in\n                detailsLink.classList.add('text-blue-600', 'hover:underline', 'text-sm', 'mt-1');\n                detailsLink.textContent = 'Detaylar';\n\n                timeDetailsDiv.appendChild(timeParagraph);\n                timeDetailsDiv.appendChild(detailsLink);\n\n                quakeCard.appendChild(magnitudePlaceDiv);\n                quakeCard.appendChild(timeDetailsDiv);\n\n                earthquakeListDiv.appendChild(quakeCard);\n\n                \/\/ Her 10 deprem kart\u0131nda bir reklam yer tutucusu ekle\n                \/\/ \u0130lk reklam 10. depremden sonra (index 9)\n                if ((index + 1) % 10 === 0) {\n                    const adContainer = document.createElement('div');\n                    adContainer.classList.add('ad-container'); \/\/ Yeni stil s\u0131n\u0131f\u0131\n\n                    \/\/ Yeni Google AdSense reklam kodunu ekle\n                    adContainer.innerHTML = `\n                        <ins class=\"adsbygoogle\"\n                            style=\"display:block\"\n                            data-ad-client=\"ca-pub-2506329722665303\"\n                            data-ad-slot=\"1444491293\"\n                            data-ad-format=\"auto\"\n                            data-full-width-responsive=\"true\"><\/ins>\n                        <script>\n                            (adsbygoogle = window.adsbygoogle || []).push({});\n                        <\/script>\n                    `;\n                    earthquakeListDiv.appendChild(adContainer);\n\n                    \/\/ adsbygoogle'\u0131 tetikle\n                    \/\/ setTimeout kullanarak reklam\u0131n DOM'a eklenip geni\u015fli\u011finin hesaplanmas\u0131na izin ver\n                    \/\/ Bu k\u0131s\u0131m, yeni reklam kodu zaten kendi <script> blo\u011funu i\u00e7erdi\u011fi i\u00e7in teknik olarak tekrar gerekli de\u011fildir,\n                    \/\/ ancak AdSense'in do\u011fru tetiklendi\u011finden emin olmak i\u00e7in b\u0131rak\u0131labilir.\n                    \/\/ E\u011fer reklamlar d\u00fczg\u00fcn y\u00fcklenmezse, bu setTimeout'u kald\u0131r\u0131p do\u011frudan adsbygoogle.push({}) deneyebilirsiniz.\n                    setTimeout(() => {\n                        (window.adsbygoogle = window.adsbygoogle || []).push({});\n                    }, 0); \/\/ K\u00fc\u00e7\u00fck bir gecikme\n                }\n            });\n        }\n\n        \/\/ Payla\u015f\u0131m butonlar\u0131na olay dinleyicileri ekle\n        shareTwitterBtn.addEventListener('click', (e) => {\n            e.preventDefault();\n            const text = \"Son deprem bilgilerini takip etmek i\u00e7in bu uygulamay\u0131 kullan\u0131n!\";\n            const url = encodeURIComponent(window.location.href);\n            window.open(`https:\/\/twitter.com\/intent\/tweet?text=${text}&url=${url}`, '_blank', 'width=600,height=400');\n        });\n\n        shareFacebookBtn.addEventListener('click', (e) => {\n            e.preventDefault();\n            const url = encodeURIComponent(window.location.href);\n            window.open(`https:\/\/www.facebook.com\/sharer\/sharer.php?u=${url}`, '_blank', 'width=600,height=400');\n        });\n\n        shareLinkedinBtn.addEventListener('click', (e) => {\n            e.preventDefault();\n            const url = encodeURIComponent(window.location.href);\n            const title = encodeURIComponent(\"Son Deprem Bilgileri Uygulamas\u0131\");\n            const summary = encodeURIComponent(\"B\u00f6lgeye g\u00f6re filtrelenebilir son deprem verilerini anl\u0131k takip edin.\");\n            window.open(`https:\/\/www.linkedin.com\/shareArticle?mini=true&url=${url}&title=${title}&summary=${summary}`, '_blank', 'width=600,height=400');\n        });\n\n\n        \/\/ \u0130lk verileri \u00e7ek ve g\u00f6ster\n        fetchEarthquakeData();\n\n        \/\/ B\u00f6lge se\u00e7imi de\u011fi\u015fti\u011finde filtrelemeyi tetikle\n        regionSelect.addEventListener('change', filterAndDisplayEarthquakes);\n\n        \/\/ Her 20 saniyede bir verileri yenile\n        setInterval(fetchEarthquakeData, 20000); \/\/ 20000 milisaniye = 20 saniye\n    <\/script>\n","protected":false},"excerpt":{"rendered":"<p>Son Depremler B\u00f6lgeye G\u00f6re Filtrele: T\u00fcm\u00fcT\u00fcrkiyeABDJaponyaEndonezya\u015eili\u0130ranYunanistan\u0130talyaMeksika\u00c7inRusyaKanada Deprem verileri y\u00fckleniyor&#8230; Veriler y\u00fcklenirken bir hata olu\u015ftu. L\u00fctfen daha sonra tekrar deneyin. Uygulamay\u0131 Payla\u015f Twitter Facebook LinkedIn `; earthquakeListDiv.appendChild(adContainer); \/\/ adsbygoogle&#8217;\u0131 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-259","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/posts\/259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/comments?post=259"}],"version-history":[{"count":1,"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/posts\/259\/revisions"}],"predecessor-version":[{"id":260,"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/posts\/259\/revisions\/260"}],"wp:attachment":[{"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/media?parent=259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/categories?post=259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/insaatsirketleri.com.tr\/en\/wp-json\/wp\/v2\/tags?post=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}