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

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

秋記Autumn - 中国象棋

暂无文章

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

<!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>