<!DOCTYPE html>
<html lang="bg">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Маршрут в София - 100 грама сладки</title>
    <style>
        /* Основен стил */
        html, body {
            -webkit-text-size-adjust: 100%;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            box-sizing: border-box;
            margin: 0;
            font-size: 14px;
            line-height: 1.42857143;
            background-color: #fff;
            font-family: 'Avanti', sans-serif;
            color: #6D6E71;
            text-align: center;
            overflow: hidden;
        }

        /* Меню */
        .menu {
            background-color: #f8f8f8;
            padding: 10px;
            border-bottom: 1px solid #ccc;
            position: relative;
        }

        .menu a {
            text-decoration: none;
            color: #b22222;
            font-weight: bold;
            margin: 0 15px;
            position: relative;
            display: inline-block; /* Added for layout */
        }

        .menu ul {
            list-style-type: none;
            padding: 0;
            display: none; /* Keep submenus hidden by default */
            position: absolute;
            background-color: #fff;
            box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
            z-index: 1000;
            margin-top: 5px;
            left: 0; /* Align submenus to the left */
        }

        .menu a:hover > ul {
            display: block; /* Show submenu on hover over the parent link */
        }

        .menu ul li {
            padding: 10px;
        }

        .menu ul li a {
            color: #6D6E71;
            display: block; /* Make the entire area of submenu items clickable */
        }

        .menu ul li a:hover {
            background-color: #f0f0f0; /* Add hover effect for submenu items */
        }

        /* Снежинки */
        .snowflake {
            position: absolute;
            color: #fff;
            font-size: 1.5em;
            animation: fall linear infinite;
            z-index: 999;
        }

        .snowflake:nth-child(1) { left: 10%; animation-duration: 10s; animation-delay: 0s; }
        .snowflake:nth-child(2) { left: 20%; animation-duration: 12s; animation-delay: 2s; }
        .snowflake:nth-child(3) { left: 30%; animation-duration: 14s; animation-delay: 4s; }
        .snowflake:nth-child(4) { left: 40%; animation-duration: 16s; animation-delay: 6s; }
        .snowflake:nth-child(5) { left: 50%; animation-duration: 18s; animation-delay: 8s; }
        .snowflake:nth-child(6) { left: 60%; animation-duration: 20s; animation-delay: 10s; }
        .snowflake:nth-child(7) { left: 70%; animation-duration: 22s; animation-delay: 12s; }
        .snowflake:nth-child(8) { left: 80%; animation-duration: 24s; animation-delay: 14s; }

        @keyframes fall {
            0% { top: -5%; transform: rotate(0deg); }
            100% { top: 105%; transform: rotate(360deg); }
        }

        /* Лого */
        .logo {
            position: fixed;
            top: 10px;
            left: 10px;
            z-index: 1000;
        }

        .logo img {
            width: 150px;
            height: auto;
        }

        /* Заглавие и текст */
        h1 {
            color: #b22222;
            font-size: 2.5em;
            margin-top: 50px;
        }

        p {
            font-size: 1.1em;
            margin-bottom: 20px;
            color: #8b0000;
        }

        textarea {
            width: 90%;
            height: 120px;
            padding: 10px;
            border-radius: 8px;
            border: 1px solid #ccc;
            font-size: 1em;
            background-color: #fff8dc;
        }

        button {
            background-color: #b22222;
            color: white;
            padding: 12px 25px;
            font-size: 1em;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            margin-top: 15px;
            transition: background-color 0.3s, transform 0.2s;
        }

        button:hover {
            background-color: #8b0000;
            transform: scale(1.05);
        }

        /* Контакт */
        .contact {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background-color: #fff0f5;
            padding: 10px 20px;
            border-radius: 8px;
            box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 1.2em;
            font-weight: bold;
            color: #b22222;
        }

        .contact i {
            font-size: 1.5em;
            color: #8b0000;
        }

        /* Анимация на бус */
        .bus {
            position: absolute;
            bottom: 0;
            left: -200px;
            width: 200px;
            height: auto;
            animation: drive 12s linear infinite;
        }

        @keyframes drive {
            0% { left: -200px; }
            100% { left: 100%; }
        }

        /* Мобилна оптимизация */
        @media (max-width: 768px) {
            h1 { font-size: 2em; }
            p { font-size: 1em; }
            textarea { height: 100px; }
            button { padding: 10px 20px; }
            .contact { font-size: 1em; gap: 5px; }
            .contact i { font-size: 1.2em; }
            .bus { width: 150px; }
            .snowflake { font-size: 1.2em; }
        }
    </style>
</head>
<body>
    <!-- Меню -->
    <div class="menu">
        <a href="#">Online Пазаруване
            <ul>
                <li><a href="#">Пазарувайте сега</a></li>
                <li><a href="#">Нашите продукти</a></li>
                <li><a href="#">Преглед на поръчки</a></li>
                <li><a href="#">Отстъпки и акции</a></li>
                <li><a href="#">Често задавани въпроси</a></li>
            </ul>
        </a>
        <a href="#">Нашите сладкарници
            <ul>
                <li><a href="#">Сладкарница в София</a></li>
                <li><a href="#">Сладкарница в Пловдив</a></li>
                <li><a href="#">Сладкарница в Варна</a></li>
                <li><a href="#">Сладкарница в Бургас</a></li>
                <li><a href="#">Сладкарница в Русе</a></li>
            </ul>
        </a>
        <a href="#">Събития
            <ul>
                <li><a href="#">Празнични събития</a></li>
                <li><a href="#">Проби на сладки</a></li>
                <li><a href="#">Теми за рождени дни</a></li>
                <li><a href="#">Семинари по сладкарство</a></li>
                <li><a href="#">Специални предложения</a></li>
            </ul>
        </a>
        <a href="#">Контакт
            <ul>
                <li><a href="#">Свържете се с нас</a></li>
                <li><a href="#">Обратна връзка</a></li>
                <li><a href="#">Партньорства</a></li>
                <li><a href="#">Работни места</a></li>
                <li><a href="#">Често задавани въпроси</a></li>
            </ul>
        </a>
        <a href="#">Новини
            <ul>
                <li><a href="#">Последни новини</a></li>
                <li><a href="#">Блог</a></li>
                <li><a href="#">Акции</a></li>
                <li><a href="#">Мероприятия</a></li>
                <li><a href="#">Актуализации</a></li>
            </ul>
        </a>
    </div>

    <!-- Лого -->
    <a href="https://100gramasladki.com/" target="_blank" class="logo">
        <img src="https://100gramasladki.com/plugins/p100gr-customs/eshop/images/logos.png" alt="Лого на 100 грама сладки">
    </a>

    <h1>🎄 Коледен маршрут в София 🎁</h1>
    <p><strong>"100 грама сладки"</strong>. Въведете адресите, които трябва да посетите, и маршрутът ще бъде автоматично генериран.</p>

    <textarea id="addresses" placeholder="Въведете адреси, всеки на нов ред"></textarea>
    <br>
    <button onclick="generateRoute()">Генерирай маршрут 🎅</button>

    <div class="contact">
        <i>📞</i> 0887 101 900
    </div>

    <!-- Снежинки -->
    <div class="snowflake">❄</div>
    <div class="snowflake">❄</div>
    <div class="snowflake">❄</div>
    <div class="snowflake">❄</div>
    <div class="snowflake">❄</div>
    <div class="snowflake">❄</div>
    <div class="snowflake">❄</div>
    <div class="snowflake">❄</div>

    <!-- Движещ се бус -->
    <img src="https://png.pngtree.com/png-vector/20240204/ourmid/pngtree-cargo-van-isolated-3d-rendering-illustration-png-image_11612921.png" alt="Бус" class="bus">

    <script>
        function generateRoute() {
            navigator.geolocation.getCurrentPosition(function(position) {
                const latitude = position.coords.latitude;
                const longitude = position.coords.longitude;

                const addresses = document.getElementById('addresses').value.trim().split('\n');
                if (addresses.length === 0 || !addresses[0]) {
                    alert('Моля, въведете поне един адрес.');
                    return;
                }

                let mapsUrl = `https://www.google.com/maps/dir/?api=1&origin=${latitude},${longitude}&destination=${addresses[addresses.length - 1]}&travelmode=driving&waypoints=`;

                if (addresses.length > 1) {
                    const waypoints = addresses.slice(0, -1).join('|');
                    mapsUrl += encodeURIComponent(waypoints);
                }

                window.open(mapsUrl, '_blank');
            }, function(error) {
                alert('Не успяхме да определим местоположението ви. Моля, позволете достъп до геолокацията и опитайте отново.');
            });
        }
    </script>
</body>
<!DOCTYPE html>
<html lang="bg">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Разрешаване на местоположение</title>
</head>
<body>

    <h1>Добре дошли на нашия сайт!</h1>
    <p>Ние бихме искали да знаем вашето местоположение. Желаете ли да го споделите с нас?</p>

    <!-- Бутон за искане на местоположение -->
    <button onclick="getLocation()">Позволи местоположение</button>

    <!-- Място за показване на резултат -->
    <p id="location-info"></p>

    <script>
        // Функция за получаване на местоположението
        function getLocation() {
            if (navigator.geolocation) {
                // Искане на местоположение от браузъра
                navigator.geolocation.getCurrentPosition(showPosition, showError);
            } else {
                document.getElementById("location-info").innerHTML = "Вашият браузър не поддържа геолокация.";
            }
        }

        // Функция за показване на координатите, ако местоположението е успешно получено
        function showPosition(position) {
            var lat = position.coords.latitude;  // Географска ширина
            var lon = position.coords.longitude; // Географска дължина
            document.getElementById("location-info").innerHTML = "Вашето местоположение е: " + lat + "° , " + lon + "°";
        }

        // Функция за обработка на грешки
        function showError(error) {
            switch(error.code) {
                case error.PERMISSION_DENIED:
                    document.getElementById("location-info").innerHTML = "Вие отказахте да споделите местоположението си.";
                    break;
                case error.POSITION_UNAVAILABLE:
                    document.getElementById("location-info").innerHTML = "Не можем да определим вашето местоположение.";
                    break;
                case error.TIMEOUT:
                    document.getElementById("location-info").innerHTML = "Изтече времето за заявка на местоположение.";
                    break;
                case error.UNKNOWN_ERROR:
                    document.getElementById("location-info").innerHTML = "Се случи неизвестна грешка.";
                    break;
            }
        }
    </script>
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:;">

</body>
</html>

</html>