<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>漏洩情報確認くん【PC版】</title>
    <style>
        body {
            background-color: black;  
            color: #00FF00;
            font-family: "Arial", sans-serif;
            font-size: 1.2em;
            position: relative;
        }
        h1, h2 {
            text-align: center;
            text-shadow: 0 0 10px #00FF00;
            margin: 0;
        }
        .info-section {
            width: 80%;
            margin: 20px auto;
            padding: 20px;
            border: 1px solid #00FF00;
            background-color: #111;
            box-shadow: 0 0 15px #00FF00;
        }
        .info-item {
            margin: 10px 0;
            font-size: 1.1em;
        }
        .highlight {
            color: #00FF00;
            font-weight: bold;
        }
        #loading {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: black;
            color: #FFFFFF;
            text-align: center;
            font-size: 1.4em;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            font-family: "Helvetica Neue", sans-serif;
        }
        #map {
            width: 100%;
            height: 400px;
            display: none;
            border: 2px solid #00FF00;
            margin-top: 20px;
        }
        .footer-note {
            position: fixed;
            bottom: 10px;
            left: 10px;
            color: white;
            text-shadow: 1px 1px 0 black, -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black, 0 0 5px white;
            font-size: 0.9em;
            z-index: 1000; /* スクロールで動かないように固定 */
        }
        .logo-vpc {
            position: fixed;
            bottom: 10px;
            right: 50px;
            color: #00FF00;
            text-shadow: 0 0 10px #00FF00;
            font-family: "Courier New", Courier, monospace;
            font-size: 1em;
            z-index: 1000; /* スクロールで動かないように固定 */
        }
    </style>
</head>
<body>
    <div id="loading">サイトにはフィルタが掛かっているため、許可してご使用ください。</div>
    <h1>漏洩情報確認くん【PC版】</h1>
    <h2>あなたの漏洩情報</h2>
    <div class="info-section">
        <div class="info-item">IPアドレス: <span id="ip" class="highlight">取得中...</span></div>
        <div class="info-item">ブラウザ情報: <span id="userAgent" class="highlight"></span></div>
        <div class="info-item">画面解像度: <span id="resolution" class="highlight"></span></div>
        <div class="info-item">言語設定: <span id="language" class="highlight"></span></div>
        <div class="info-item">リファラ: <span id="referer" class="highlight"></span></div>
        <div class="info-item">位置情報: <span id="location" class="highlight">位置情報の許可を求めています...</span></div>
        <div class="info-item" id="address-message"><br>以下があなたの大体の住所です</div>
        <div id="map"></div>
    </div><br><br><br>
    <div class="footer-note" id="footer-note">※取得した情報は悪用しませんのでご安心ください<br>製作者:S.R.</div>
    <div class="logo-vpc">v.PC</div>

    <script>
        const API_URL = 'https://api.ipify.org/?format=json';
        fetch(API_URL)
            .then(res => res.json())
            .then(data => {
                document.getElementById('ip').textContent = data.ip;
            });

        document.getElementById('userAgent').textContent = navigator.userAgent;
        document.getElementById('resolution').textContent = window.screen.width + " x " + window.screen.height;
        document.getElementById('language').textContent = navigator.language;
        document.getElementById('referer').textContent = document.referrer ? document.referrer : "リファラはありません";

        if (navigator.geolocation) {
            document.getElementById('loading').style.display = 'flex';
            navigator.geolocation.getCurrentPosition(
                function(position) {
                    const lat = position.coords.latitude;
                    const lon = position.coords.longitude;
                    document.getElementById('location').textContent = "緯度: " + lat + ", 経度: " + lon;

                    fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${lat}&lon=${lon}&zoom=18&addressdetails=1`)
                        .then(response => response.json())
                        .then(data => {
                            const addressDetails = data.address;
                            const formattedAddress = `${addressDetails.state || ""} ${addressDetails.city || ""} ${addressDetails.town || ""} ${addressDetails.road || ""} ${addressDetails.house_number || ""}`.trim();
                            document.getElementById('map').style.display = 'block';
                            initMap(lat, lon);
                        })
                        .catch(() => {
                            document.getElementById('location').textContent = "住所の取得に失敗しました";
                        })
                        .finally(() => {
                            document.getElementById('loading').style.display = 'none';
                        });
                },
                function(error) {
                    document.getElementById('location').textContent = "位置情報の取得が拒否されました";
                    document.getElementById('map').style.display = 'none';
                    document.getElementById('address-message').style.display = 'none';
                    document.getElementById('loading').style.display = 'none';
                }
            );
        } else {
            document.getElementById('location').textContent = "お使いのブラウザは位置情報に対応していません";
            document.getElementById('loading').style.display = 'none';
        }

        function initMap(lat, lon) {
            const map = L.map('map').setView([lat, lon], 16);
            L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
                maxZoom: 19,
                attribution: '© OpenStreetMap'
            }).addTo(map);
            L.marker([lat, lon]).addTo(map);
        }

        window.addEventListener('scroll', function() {
            const mapElement = document.getElementById('map');
            const footerNote = document.getElementById('footer-note');
            const mapPosition = mapElement.getBoundingClientRect().top;
            const screenPosition = window.innerHeight;
            if (mapPosition < screenPosition) {
                footerNote.style.display = 'block';
            }
        });
    </script>
    <link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
    <script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
</body>
</html>
