Skip to content

Commit 25c1069

Browse files
authored
Merge pull request #43 from yuchanns/doc/add-website
doc: add play online
2 parents 46138ae + fad2e80 commit 25c1069

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

.github/assets/index.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,25 @@
5757
opacity: 0.85;
5858
margin: 0;
5959
}
60+
#source-link {
61+
position: fixed;
62+
top: 20px;
63+
right: 20px;
64+
display: inline-flex;
65+
color: inherit;
66+
text-decoration: none;
67+
}
68+
#source-link svg {
69+
width: 24px;
70+
height: 24px;
71+
fill: currentColor;
72+
transition: transform 0.2s ease, opacity 0.2s ease;
73+
}
74+
#source-link:hover svg,
75+
#source-link:focus svg {
76+
transform: scale(1.05);
77+
opacity: 0.85;
78+
}
6079
</style>
6180
<script src="./coi-serviceworker.min.js"></script>
6281
</head>
@@ -69,13 +88,24 @@ <h1 id="overlay-title"></h1>
6988
</div>
7089
</div>
7190
<canvas id="canvas" oncontextmenu="event.preventDefault()"></canvas>
91+
<a
92+
id="source-link"
93+
href="https://github.com/cloudwu/deepfuture"
94+
target="_blank"
95+
rel="noopener noreferrer"
96+
>
97+
<svg viewBox="0 0 16 16" aria-hidden="true">
98+
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8" />
99+
</svg>
100+
</a>
72101

73102
<script>
74103
(function () {
75104
const overlay = document.getElementById('overlay');
76105
const titleEl = document.getElementById('overlay-title');
77106
const introEl = document.getElementById('overlay-intro');
78107
const statusEl = document.getElementById('overlay-status');
108+
const sourceLinkEl = document.getElementById('source-link');
79109

80110
const locale = (navigator.language || navigator.userLanguage || 'en').toLowerCase();
81111
const isChinese = locale.startsWith('zh');
@@ -86,6 +116,7 @@ <h1 id="overlay-title"></h1>
86116
'拓殖星球,发展科技,永无止境地进化你银河系的深远未来。',
87117
'《深远未来》是桌游的数字化版本,带来“边玩边创造”的独特体验,每一局都能拓展属于你的银河文明。'
88118
],
119+
sourceAriaLabel: '查看源码',
89120
checkingWebGPU: '正在检查 WebGPU 支持…',
90121
webgpuMissingTitle: '当前浏览器未开启 WebGPU 支持',
91122
webgpuMissingDetail: '请在支持 WebGPU 的浏览器中打开,或者在浏览器设置中启用 WebGPU 后刷新页面。',
@@ -101,6 +132,7 @@ <h1 id="overlay-title"></h1>
101132
'Settle worlds, advance techs, and endlessly evolve your galaxy\'s deep future.',
102133
'Deep Future is the digital take on the make-as-you-play board game where every session grows your galactic civilization.'
103134
],
135+
sourceAriaLabel: 'Source code on GitHub',
104136
checkingWebGPU: 'Checking for WebGPU support…',
105137
webgpuMissingTitle: 'WebGPU is not enabled in this browser',
106138
webgpuMissingDetail: 'Open the page in a browser with WebGPU support or enable it in your browser settings, then reload.',
@@ -114,6 +146,7 @@ <h1 id="overlay-title"></h1>
114146

115147
titleEl.textContent = strings.gameTitle;
116148
introEl.innerHTML = strings.intro.map(text => '<p>' + text + '</p>').join('');
149+
sourceLinkEl.setAttribute('aria-label', strings.sourceAriaLabel);
117150

118151
function setStatus(message) {
119152
statusEl.textContent = message;

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Deep Future
22

3+
<div align="center">
4+
5+
<strong><a href="https://cloudwu.github.io/deepfuture">>> Play Online <<</a></strong>
6+
7+
</div>
8+
39
[简体中文](./README.zh-CN.md)
410

511
> Settle worlds, advance techs, and endlessly evolve your galaxy's deep future.

README.zh-CN.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# 深远未来
22

3+
<div align="center">
4+
5+
<strong><a href="https://cloudwu.github.io/deepfuture">>> 在线体验 <<</a></strong>
6+
7+
</div>
8+
39
[English](./README.md)
410

511
> 拓殖星球,发展科技,永无止境地进化你银河系的深远未来。

0 commit comments

Comments
 (0)