<?php /*a:1:{s:77:"/www/wwwroot/103.108.66.222_1111/app/frontend/view/index/AnnieBlue/index.html";i:1736652751;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
      <?php echo head(); ?>
    <link rel="stylesheet" href="/template/AnnieBlue/assets/css/index.css">
</head>

<body>
    <div id="app" data-v-app="">
        <div id="app">
            <div class="header">
                <div class="header_left">
                    <img class="header_logo" src="<?php echo syscfg('site','site_logo'); ?>">
                </div>
                <h1 class="header_title">首页</h1>
                <div class="header_right"></div>
            </div>
            <div class="body accounts-scroll">
                <div class="slideimg">
                    <div class="carousel" id="carousel">
                        <?php foreach($advertise as $k => $v): ?>
                                                    <div class="slide">
                                <a href="<?php echo htmlentities($v['url']); ?>">
                                    <img src="<?php echo htmlentities($v['icon']); ?>" alt="<?php echo htmlentities($v['title']); ?>">
                                </a>
                            </div>
                            <?php endforeach; ?>
                                                   
                                            </div>
                    <div class="dots" id="dots">
                        <?php foreach($advertise as $k => $v): ?>
                                                    <span class="dot <?php if(($k == 0)): ?>active<?php endif; ?>"></span>
                        <?php endforeach; ?>
                                            </div>
                </div>
                <br>
                <div class="marquee-container">
                    <div class="trumpet-icon">
                        <img src="/template/AnnieBlue/assets/img/gundonggonggao.png" alt="" class="noticeimg">
                    </div>
                    <div class="marquee-wrapper">
                        <div class="marquee" style="animation-duration: 10s;"><?php echo syscfg('site','site_seo_desc'); ?></div>
                    </div>
                </div>
                <div class="centerArea">
                    <div class="lbox">
                        <span class="userName"> <?php echo syscfg("site","site_name"); ?></span>
                        <div class="bcontent">
                            <span class="money"><?php echo syscfg('site','site_domain'); ?></span>
                        </div>
                    </div>
                    <div class="robx">
                        <div class="item">
                            <img src="/template/AnnieBlue/assets/img/yaoqing.png" alt="" class="menuImg" onclick="copyDomain()">
                            <span class="b_Text">邀请</span>
                        </div>
                    </div>
                </div>
                <div class="typeMark">
                    <img src="/template/AnnieBlue/assets/img/game.fa92a391.png" alt="" class="l_img">
                    <a href="/frontend/index/youxi" class="allgame">
                        <img src="/template/AnnieBlue/assets/img/quanbuyouxi.png" alt="全部">
                    </a>
                </div>
                <div class="innerBox">
                    	<?php foreach($site as $k => $v): ?>
                                            <div class="game_item">
                            <img src="/template/AnnieBlue/assets/img/rtop.0b49ad02.png" alt="" class="rtop_img">
                            <div class="app_info">
                                <img src="<?php echo htmlentities($v['icon']); ?>" class="app_logo" >
                                <span class="game_name"><?php echo htmlentities($v['title']); ?></span>
                            </div>
                            <span class="gameText"><?php echo $v['description']; ?></span>
                            <a  rel="<?php echo htmlentities($v['rel']); ?>" href="<?php echo htmlentities($v['url']); ?>">
                                <img src="/template/AnnieBlue/assets/img/start.d6d5366e.png" alt="进入" class="start_img">
                            </a>
                        </div>
                        			<?php endforeach; ?>
 
                                                    <div style="clear: both;"></div>
                                                            </div>
        
            </div>
                <div class="bottom-navigation" data-v-1129fe84="">
        <a href="/frontend/index/lianxi" class="nav-item " data-v-1129fe84="">
            <div class="icon icon-contact" data-v-1129fe84=""></div><span data-v-1129fe84="">客服</span>
        </a>
        <a href="" class="nav-item router-link-active router-link-exact-active" data-v-1129fe84="">
            <div class="icon icon-home" data-v-1129fe84=""></div><span data-v-1129fe84="">首页</span>
        </a>
        <a href="/frontend/index/youxi" class="nav-item " data-v-1129fe84="">
            <div class="icon icon-game" data-v-1129fe84=""></div><span data-v-1129fe84="">游戏</span>
        </a>
        <a href="/frontend/index/gongju" class="nav-item " data-v-1129fe84="">
            <div class="icon icon-more" data-v-1129fe84=""></div><span data-v-1129fe84="">工具</span>
        </a>
    </div>
            </div>
    </div>

    <script>
async function copyDomain() {
    try {
        const domainInfo = "\u6211\u53d1\u73b0\u4e00\u4e2a\u597d\u73a9\u7684\u7f51\u7ad9 <?php echo syscfg('site','site_domain'); ?>";
        if (navigator.clipboard && navigator.clipboard.writeText) {
            // 使用 clipboard API 进行复制
            await navigator.clipboard.writeText(domainInfo);
            alert('已复制到剪切板，快去分享给朋友吧！');
        } else {
            // clipboard API 不可用时的备用方案
            const textArea = document.createElement("textarea");
            textArea.value = domainInfo;
            document.body.appendChild(textArea);
            textArea.select();
            document.execCommand('copy');
            document.body.removeChild(textArea);
            alert('已复制到剪切板，快去分享给朋友吧！');
        }
    } catch (err) {
        alert('复制失败: ' + err);
    }
}


        // 自动轮播功能
        let currentIndex = 0;
        const slides = document.querySelectorAll('#carousel .slide');
        const dots = document.querySelectorAll('#dots .dot');
        const intervalTime = 3000; // 轮播间隔时间（毫秒）

        function showSlide(index) {
            slides.forEach((slide, i) => {
                slide.style.opacity = i === index ? 1 : 0;
                slide.style.zIndex = i === index ? 1 : 0;
            });
            dots.forEach((dot, i) => {
                dot.classList.toggle('active', i === index);
            });
        }

        function nextSlide() {
            currentIndex = (currentIndex + 1) % slides.length;
            showSlide(currentIndex);
        }

        setInterval(nextSlide, intervalTime);

        // 支持手动滑动（触摸事件）
        let startX = 0;
        let endX = 0;

        document.querySelector('#carousel').addEventListener('touchstart', (e) => {
            startX = e.touches[0].clientX;
        });

        document.querySelector('#carousel').addEventListener('touchmove', (e) => {
            endX = e.touches[0].clientX;
        });

        document.querySelector('#carousel').addEventListener('touchend', () => {
            if (startX - endX > 50) {
                nextSlide(); // 向左滑动
            } else if (endX - startX > 50) {
                currentIndex = (currentIndex - 1 + slides.length) % slides.length;
                showSlide(currentIndex); // 向右滑动
            }
        });
    </script>
</body>
</html>
