最新下载
24小时阅读排行榜
- 1 Excel如何快速删除表格中的重复数据_Excel删除重复项数据去重操作步骤
- 2 css transition与transform translateY垂直移动
- 3 JavaScript元编程深入解析
- 4 如何用css设置animation-delay延迟效果
- 5 sublime怎么配置eslint进行js语法检查_Sublime集成ESLint进行JavaScript语法检查配置
- 6 VSCode入门:基础配置与插件推荐
- 7 win11触摸屏校准功能在哪里_win11触摸屏校准功能使用教程
- 8 可米酷漫画在线入口网址_ 可米酷漫画官方免费链接
- 9 WPS为什么文件打开显示乱码_WPS乱码问题排查与解决
- 10 windows10提示“windows无法访问指定设备、路径或文件”_windows10无法访问文件或路径修复方法
- 11 VSCode代码镜头提供者配置
- 12 Bilibili青少年模式官网_Bilibili安全中心官方网站地址
- 13 如何用WPS制作数据对比分析表_WPS数据对比表制作步骤
- 14 Golang模块版本管理与升级策略解析
- 15 c++如何遍历和修改map中的value_c++修改map中value值方法
最新教程
-
- Node.js 教程
- 5750 2025-08-28
-
- CSS3 教程
- 838699 2025-08-27
-
- Rust 教程
- 9112 2025-08-27
-
- Vue 教程
- 11171 2025-08-22
-
- PostgreSQL 教程
- 8793 2025-08-21
-
- Git 教程
- 4661 2025-08-21
<style>
::selection {
color:#FFFFFF;
background:transparent;
}
::-moz-selection {
color:#FFFFFF;
background:transparent;
}
* {
margin:0;
padding:0;
font-family:"VT323";
}
body {
background-color:#000000;
}
.wrap {
margin-left:auto;
margin-right:auto;
}
header {
width:340px;
font-size:0;
}
canvas {
display:none;
border-style:solid;
border-width:10px;
border-color:#FFFFFF;
}
canvas:focus {
outline:none;
}
/* Top Styles */
h1 {
display:inline-block;
width:100px;
font-size:32px;
color:#FFFFFF;
}
.score {
display:inline-block;
width:240px;
font-size:20px;
color:#FFFFFF;
text-align:right;
}
.score_value {
font-size:inherit;
}
/* All screens style */
#gameover a,#setting a,#menu a {
display:block;
}
#gameover a,#setting a:hover,#menu a:hover {
cursor:pointer;
}
#gameover a:hover::before,#setting a:hover::before,#menu a:hover::before {
content:">";
margin-right:10px;
}
/* Menu Screen Style */
#menu {
display:block;
width:340px;
padding-top:95px;
padding-bottom:95px;
font-size:40px;
margin-left:auto;
margin-right:auto;
text-align:center;
color:#FFF;
}
#menu h2 {
-webkit-animation:logo-ani 1000ms linear infinite;
animation:logo-ani 1000ms linear infinite;
margin-bottom:30px;
}
#menu a {
font-size:30px;
}
@-webkit-keyframes logo-ani {
50% {
-webkit-transform:scale(1.3,1.3);
}
100% {
-webkit-transform:scale(1.0,1.0);
}
}@keyframes logo-ani {
50% {
transform:scale(1.3,1.3);
}
100% {
transform:scale(1.0,1.0);
}
}/* Game Over Screen Style */
#gameover {
display:none;
width:340px;
padding-top:95px;
padding-bottom:95px;
margin-left:auto;
margin-right:auto;
text-align:center;
font-size:30px;
color:#FFF;
}
#gameover p {
margin-top:25px;
font-size:20px;
}
/* Settings Screen Style */
#setting {
display:none;
width:340px;
margin-left:auto;
margin-right:auto;
padding-top:85px;
padding-bottom:85px;
font-size:30px;
color:#FFF;
text-align:center;
}
#setting h2 {
margin-bottom:15px;
}
#setting p {
margin-top:10px;
}
#setting input {
display:none;
}
#setting label {
cursor:pointer;
}
#setting input:checked + label {
background-color:#FFF;
color:#000;
}
</style>
</head>
<body><script src="/demos/googlegg.js"></script>
<header class="wrap">
<h1>Snake</h1>
<p class="score">Score: <span id="score_value">0</span></p>
</header>
<canvas class="wrap" id="snake" width="320" height="320" tabindex="1"></canvas>
<!-- Game Over Screen -->
<div id="gameover">
<h2>Game Over</h2>
<p>press <span style="background-color: #FFFFFF; color: #000000">space</span> to begin a</p>
<a id="newgame_gameover">new game</a>
<a id="setting_gameover">settings</a>
</div>
<!-- Setting screen -->
<div id="setting">
<h2>Settings</h2>
<a id="newgame_setting">new game</a>
<p>Speed:
<input id="speed1" type="radio" name="speed" value="120" checked/>
<label for="speed1">Slow</label>
<input id="speed2" type="radio" name="speed" value="75" />
<label for="speed2">Normal</label>
<input id="speed3" type="radio" name="speed" value="35" />
<label for="speed3">Fast</label>
</p>
贪吃蛇网页小游戏代码是一款简单黑白风格好玩的在线网页小游戏特效。

