✨ 更新日志
🚀 安装部署
✒ 写作指引
🛠 站点配置
📊 网站统计
⭐ 主题配置
📩 评论插件
🧷 外部插件
🔊 站点订阅
⌨ 开发指引
👨👦👦 联系方式
🤝 购买服务
Game主题
category
tags
type
status
slug
date
password
Last edited time
Apr 2, 2024 10:09 AM
summary
icon
年龄大了,只能玩得动一点小游戏。
可以搭建网页小游戏网站的主题。在线预览:https://games.tangly1024.com/。
对应示例数据库,完全开放可复制:
开启方式
更新代码至最新的4.4.1;并配置主题为game即可。
Game 主题概要
特色:
- 支持在线预览游戏的视频
- 在线游玩
- 显示最近游戏记录
- 将游戏保存到桌面快捷方式(PWA)。
1.最近访问
顶栏会记录最近访问的页面,该数据存在浏览器的localstorage中
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F6c096b44-beb9-48ee-8f92-1efdde47f3a3%2Fc8830699-d3a6-4cee-8b43-6c719e606315%2FUntitled.png?table=block&id=35577615-a9f1-40b6-8e96-a4637bb4ce9d&t=35577615-a9f1-40b6-8e96-a4637bb4ce9d&width=743.328125&cache=v2)
2.数据库Ext字段
数据库新增字段ext,用来存放一些扩展的字段功能。
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F6c096b44-beb9-48ee-8f92-1efdde47f3a3%2Fdd288bc7-6daa-4e34-9515-8a3cb0388318%2FUntitled.png?table=block&id=0b9af7ee-faaf-4363-92e2-43cd56af8252&t=0b9af7ee-faaf-4363-92e2-43cd56af8252&width=708&cache=v2)
用json-string格式存放game的详细配置(
游戏地址
与预览视频
)例如以下json:href
是游戏播放的地址;video
是鼠标悬停在游戏封面上的预览视频。3.游戏内嵌功能
href
默认填写外部地址,例如 “https://unblocked-games.s3.amazonaws.com/games/2023/q/1/tap-tap-shots/index.html
” 就是一个可以直接嵌入的在线游戏地址。为什么我的示例数据库中href是
/games-external/common/index.htm?n=
https://unblocked-games.s3.amazonaws.com/games/2023/q/1/tap-tap-shots/index.html
这个格式呢?/games-external/common/index.htm?n=
这一串代表什么?games-external 组件
我在项目的
/public/games-external/common/index.htm
中加入了一个装饰脚本页面,访问此页面时加载路径中的
?n=[外部域名]
会被当做一个iframe嵌入到页面中。通过装饰脚本页面的方式引入外部链接,可以方便后续扩展做一些定制化与检测的功能。直接访问 [站点]/games-external/common/index.htm?n=[一个域名] ,可以直接将一个外部网址当做iframe嵌入到项目。例如 https://games.tangly1024.com/games-external/common/index.htm?n=https://www.tangly1024.com ,就是将 www.tangly1024.com这个网页当做iframe嵌入。
目前该脚本页面的唯一功能是:向嵌入的iframe添加了一个toggleFullscreen() 函数,便于我在NotionNext的文章详情页可以直接调用iframe的全屏功能:
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F6c096b44-beb9-48ee-8f92-1efdde47f3a3%2Ff499ebbf-5d50-4108-9ebc-68efd7f04ecb%2FUntitled.png?table=block&id=df66f733-61b6-435e-b447-fd7e2dfab0b8&t=df66f733-61b6-435e-b447-fd7e2dfab0b8&width=432&cache=v2)
详情可以在源码中找到。
嵌入iframe相关源码
4. 支持保存到桌面快捷方式
采用渐进式WEB应用,PWA的方式,点击浏览器地址栏右侧的安装按钮,即可添加到桌面快捷方式,一键启动。
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F6c096b44-beb9-48ee-8f92-1efdde47f3a3%2F657db81d-ce11-4bfc-b093-2f8196821de7%2FUntitled.png?table=block&id=8545bb49-8e45-4ca5-8e0e-7cfc25b4a1ff&t=8545bb49-8e45-4ca5-8e0e-7cfc25b4a1ff&width=432&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F6c096b44-beb9-48ee-8f92-1efdde47f3a3%2F1f86cd98-6f8a-4ca0-8c9f-f89d38328170%2FUntitled.png?table=block&id=4c07b0e2-d91c-4267-ad32-04f1e8e6495b&t=4c07b0e2-d91c-4267-ad32-04f1e8e6495b&width=384&cache=v2)
关于游戏
游戏来源
游戏主要来源于 crazygames , poki , gameis 和 iogames、regtrogames.cc 这些网站,更多游戏网站可以通过similarweb查找对标。
游戏推荐
- 拳皇97(风云再起)
引入了retrogames的模拟器游戏,有趣的是支持创建房间、支持存档、联网对战,可以在游戏中设置键位,以及创建房间。
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F6c096b44-beb9-48ee-8f92-1efdde47f3a3%2Fcedfa108-e026-4b2e-a20f-b7faf9ed4ac4%2FUntitled.png?table=block&id=2627479e-701b-4456-b86a-aadce3d01184&t=2627479e-701b-4456-b86a-aadce3d01184&width=1681&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F6c096b44-beb9-48ee-8f92-1efdde47f3a3%2F62766048-860f-4d7d-ab8d-d2aeff28ccaa%2FUntitled.png?table=block&id=cbd6641b-a1ab-4e66-9e0b-91ee8e7b5ad6&t=cbd6641b-a1ab-4e66-9e0b-91ee8e7b5ad6&width=1666&cache=v2)
- Block Post
一款像素风射击游戏。玩法丰富:炸弹模式、武器模式、团队死斗模式;体验流畅:游戏打开速度快、单局节奏快、对电脑配置要求低,对战的网速也不错。和CSGO这款老牌反恐枪战游戏有很多神似:peek闪身、预瞄、搜点、提前枪、爆头线、手雷道具、压枪、开箱子、各种皮肤武器在这里都能体验,老少皆宜。
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F6c096b44-beb9-48ee-8f92-1efdde47f3a3%2Fc12cb28c-ccad-4263-a1be-04a857cb8509%2FUntitled.png?table=block&id=14de1921-37b1-41c9-b9ce-e2f89e9d70b0&t=14de1921-37b1-41c9-b9ce-e2f89e9d70b0&width=1920&cache=v2)
![游戏中的开箱子画面](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F6c096b44-beb9-48ee-8f92-1efdde47f3a3%2F73486b2c-68d6-496f-9bad-ebb5e858539f%2FUntitled.png?table=block&id=b20ff1e5-63f5-44f9-a0c2-2ef9d340f424&t=b20ff1e5-63f5-44f9-a0c2-2ef9d340f424&width=1461&cache=v2)
Loading...
Last update: