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

推荐订阅源

W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
F
Full Disclosure
博客园 - 【当耐特】
C
CERT Recently Published Vulnerability Notes
Engineering at Meta
Engineering at Meta
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Threatpost
I
Intezer
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
小众软件
小众软件
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
N
News | PayPal Newsroom
MyScale Blog
MyScale Blog
AI
AI
Vercel News
Vercel News
Spread Privacy
Spread Privacy
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
U
Unit 42
L
LangChain Blog
Recent Announcements
Recent Announcements

秋記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>