惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
T
Threat Research - Cisco Blogs
小众软件
小众软件
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Tailwind CSS Blog
Cisco Talos Blog
Cisco Talos Blog
V
V2EX
博客园 - 【当耐特】
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
The Last Watchdog
The Last Watchdog
Simon Willison's Weblog
Simon Willison's Weblog
T
Threatpost
S
Secure Thoughts
O
OpenAI News
P
Proofpoint News Feed
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
宝玉的分享
宝玉的分享
Scott Helme
Scott Helme
T
Tenable Blog
A
Arctic Wolf
L
LINUX DO - 热门话题
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
Hacker News: Ask HN
Hacker News: Ask HN
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
博客园 - Franky
WordPress大学
WordPress大学
Know Your Adversary
Know Your Adversary
博客园_首页
雷峰网
雷峰网
IT之家
IT之家
PCI Perspectives
PCI Perspectives
L
LINUX DO - 最新话题
H
Heimdal Security Blog

秋記Autumn - HTML5源码

暂无文章

中国象棋 · 完美居中版- HTML5源码
秋記Autumn · 2026-03-31 · via 秋記Autumn - HTML5源码

<!DOCTYPE HTML>

<html>

<head>

<meta charset="UTF-8">

<title>中国象棋 1.5 倍版</title>

<meta name="viewport" content="width=device-width; initial-scale=1.0" />

<link href="css/chess.css" rel="stylesheet" type="text/css">

</head>

<body>

<div id="chessBox" class="chess_box">

    <canvas id="chess"></canvas>

    <div class="left-buttons">

        <button class="side-btn" id="indexDy">人机对弈</button>

        <button class="side-btn" id="indexQj">挑战棋局</button>

    </div>

    <div class="right-buttons">

        <button class="side-btn" id="restartBtn">重新开始</button>

        <button class="side-btn" id="regretBtn">悔棋</button>

    </div>

    <audio src="audio/click.wav" id="clickAudio" preload="auto"></audio>

    <audio src="audio/select.wav" id="selectAudio" preload="auto"></audio>

</div>

<div id="dyPopup" class="popup-menu">

    <div class="close-btn" id="closeDy"></div>

    <div class="menu-info">

        <label><input name="depth" type="radio" value="2"> 菜鸟水平</label>

        <label><input name="depth" type="radio" value="3" checked> 中级水平</label>

        <label><input name="depth" type="radio" value="4"> 高手水平</label>

    </div>

    <div class="menu-btn" id="playBtn">开始对弈</div>

</div>

<div id="qjPopup" class="popup-menu">

    <div class="close-btn" id="closeQj"></div>

    <div class="menu-info">

        <label><input name="clasli" type="radio" value="0" checked> 八卦阵法</label>

        <label><input name="clasli" type="radio" value="1"> 很二棋局</label>

        <label><input name="clasli" type="radio" value="2"> 七星会阵</label>

    </div>

    <div class="menu-btn" id="clasliBtn">开始挑战</div>

</div>

<script type="text/javascript" src="js/common.js"></script>

<script type="text/javascript" src="js/play.js"></script>

<script type="text/javascript" src="js/AI.js"></script>

<script type="text/javascript" src="js/gambit.js"></script>

<script type="text/javascript" src="js/clasli.js"></script>

<script>

// 确保所有按钮正常工作

(function() {

    // 等待所有脚本加载完成

    window.addEventListener('load', function() {

        console.log('页面加载完成,初始化按钮...');

        // 获取元素

        var chessBox = document.getElementById('chessBox');

        var dyPopup = document.getElementById('dyPopup');

        var qjPopup = document.getElementById('qjPopup');

        // 默认直接开始人机对弈(中级)

        setTimeout(function() {

            if (typeof play !== 'undefined' && play.init) {

                play.isPlay = true;

                play.init(3);

                chessBox.style.display = 'block';

            }

        }, 500);

        // 人机对弈按钮

        document.getElementById('indexDy').onclick = function(e) {

            e.stopPropagation();

            qjPopup.style.display = 'none';

            dyPopup.style.display = 'block';

        };

        // 挑战棋局按钮

        document.getElementById('indexQj').onclick = function(e) {

            e.stopPropagation();

            dyPopup.style.display = 'none';

            qjPopup.style.display = 'block';

        };

        // 关闭弹出菜单

        document.getElementById('closeDy').onclick = function() {

            dyPopup.style.display = 'none';

        };

        document.getElementById('closeQj').onclick = function() {

            qjPopup.style.display = 'none';

        };

        // 点击空白处关闭菜单

        window.onclick = function(e) {

            if (!e.target.closest('.popup-menu') &&

                !e.target.closest('#indexDy') &&

                !e.target.closest('#indexQj')) {

                dyPopup.style.display = 'none';

                qjPopup.style.display = 'none';

            }

        };

        // 开始对弈按钮

        document.getElementById('playBtn').onclick = function() {

            var depth = 3;

            var radios = document.getElementsByName('depth');

            for (var i = 0; i < radios.length; i++) {

                if (radios[i].checked) depth parseInt(radios[i].value, 10);

            }

            if (typeof play !== 'undefined' && play.init) {

                play.isPlay true;

                play.init(depth);

                chessBox.style.display 'block';

                dyPopup.style.display 'none';

            }

        };

        // 开始挑战按钮

        document.getElementById('clasliBtn').onclick function() {

            var clasli 0;

            var radios document.getElementsByName('clasli');

            for (var i 0; i < radios.length; i++) {

                if (radios[i].checked) clasli parseInt(radios[i].value, 10);

            }

            if (typeof play !== 'undefined' && play.init && typeof com.clasli !== 'undefined') {

                play.isPlay true;

                play.init(4, com.clasli[clasli].map);

                chessBox.style.display 'block';

                qjPopup.style.display 'none';

            }

        };

        // 重新开始

        document.getElementById('restartBtn').onclick function() {

            if (confirm('是否确定要重新开始?')) {

                if (typeof play !== 'undefined') {

                    play.isPlay true;

                    play.init(play.depth || 3, play.nowMap);

                }

            }

        };

        // 悔棋

        document.getElementById('regretBtn').onclick function() {

            if (typeof play !== 'undefined' && play.regret) {

                play.regret();

            }

        };

    });

})();

</script>

</body>

</html>