Skip to content

Commit 5e90ea0

Browse files
committed
Move hosting to GitHub Pages
1 parent 2b08939 commit 5e90ea0

11 files changed

Lines changed: 601 additions & 346 deletions

.editorconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
root = true
2+
13
[*]
24
charset = utf-8
35
insert_final_newline = true
46
end_of_line = lf
5-
indent_style = space
7+
indent_style = tab
68
indent_size = 4
79
max_line_length = 120

.firebaserc

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/deploy.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: pages
14+
cancel-in-progress: true
15+
16+
jobs:
17+
deploy:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v6
22+
23+
- name: Set up Node
24+
uses: actions/setup-node@v6
25+
with:
26+
node-version: 22
27+
cache: npm
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Build
33+
run: npm run build
34+
35+
- name: Setup Pages
36+
uses: actions/configure-pages@v5
37+
38+
- name: Upload artifact
39+
uses: actions/upload-pages-artifact@v4
40+
with:
41+
path: "./dist"
42+
43+
- name: Deploy to GitHub Pages
44+
id: deployment
45+
uses: actions/deploy-pages@v4

.github/workflows/firebase-hosting-merge.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/firebase-hosting-pull-request.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

firebase.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

index.css

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
@font-face {
2-
font-family: "Saira";
3-
src: url("saira.ttf");
2+
font-family: "Saira";
3+
src: url("saira.ttf");
44
}
55

66
* {
7-
margin: 0;
8-
padding: 0;
7+
margin: 0;
8+
padding: 0;
99
}
1010

1111
body {
12-
width: 100vw;
13-
height: 100vh;
14-
display: flex;
15-
align-items: center;
16-
justify-content: center;
17-
background: #141b24;
18-
color: white;
19-
overflow: hidden;
12+
width: 100vw;
13+
height: 100vh;
14+
display: flex;
15+
align-items: center;
16+
justify-content: center;
17+
background: #141b24;
18+
color: white;
19+
overflow: hidden;
2020
}
2121

2222
svg {
23-
width: 100%;
24-
padding: 1rem;
25-
max-width: 50rem;
23+
width: 100%;
24+
padding: 1rem;
25+
max-width: 50rem;
2626
}
2727

2828
google-cast-launcher {
29-
position: fixed;
30-
top: 2rem;
31-
right: 2rem;
32-
width: 2rem;
33-
height: 2rem;
34-
cursor: pointer;
29+
position: fixed;
30+
top: 2rem;
31+
right: 2rem;
32+
width: 2rem;
33+
height: 2rem;
34+
cursor: pointer;
3535
}

index.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<meta name="theme-color" content="#141b24" />
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<meta name="theme-color" content="#141b24" />
77

8-
<title>Clock</title>
8+
<title>Clock</title>
99

10-
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
11-
<link href="/index.css" rel="stylesheet" />
12-
</head>
13-
<body>
14-
<svg>
15-
<text fill="white" font-family="Saira" font-variant="tabular-nums"></text>
16-
</svg>
17-
<script type="module" src="/index.js"></script>
18-
</body>
10+
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
11+
<link href="/index.css" rel="stylesheet" />
12+
</head>
13+
<body>
14+
<svg>
15+
<text fill="white" font-family="Saira" font-variant="tabular-nums"></text>
16+
</svg>
17+
<script type="module" src="/index.js"></script>
18+
</body>
1919
</html>

index.js

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
11
function loadScript(src) {
2-
return new Promise((resolve, reject) => {
3-
try {
4-
const tag = document.createElement("script");
5-
tag.async = true;
6-
tag.src = src;
7-
tag.addEventListener("load", () => resolve());
8-
tag.addEventListener("error", () => reject());
9-
document.head.appendChild(tag);
10-
} catch (error) {
11-
reject(error);
12-
}
13-
});
2+
return new Promise((resolve, reject) => {
3+
try {
4+
const tag = document.createElement("script");
5+
tag.async = true;
6+
tag.src = src;
7+
tag.addEventListener("load", () => resolve());
8+
tag.addEventListener("error", () => reject());
9+
document.head.appendChild(tag);
10+
} catch (error) {
11+
reject(error);
12+
}
13+
});
1414
}
1515

1616
function initClock() {
17-
const svg = document.querySelector("svg");
18-
const text = document.querySelector("text");
19-
const formatter = new Intl.DateTimeFormat("en-US", {
20-
timeStyle: "medium",
21-
hourCycle: "h23",
22-
});
17+
const svg = document.querySelector("svg");
18+
const text = document.querySelector("text");
19+
const formatter = new Intl.DateTimeFormat("en-US", {
20+
timeStyle: "medium",
21+
hourCycle: "h23",
22+
});
2323

24-
function updateTime() {
25-
text.textContent = formatter.format(new Date());
26-
svg.setAttribute("viewBox", `0 -12 ${Math.ceil(text.getBBox().width)} 13`);
27-
requestAnimationFrame(updateTime);
28-
}
29-
updateTime();
24+
function updateTime() {
25+
text.textContent = formatter.format(new Date());
26+
svg.setAttribute("viewBox", `0 -12 ${Math.ceil(text.getBBox().width)} 13`);
27+
requestAnimationFrame(updateTime);
28+
}
29+
updateTime();
3030
}
3131

3232
async function initReceiver() {
33-
await loadScript("//www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js");
34-
const options = new cast.framework.CastReceiverOptions();
35-
options.disableIdleTimeout = true;
36-
cast.framework.CastReceiverContext.getInstance().start(options);
33+
await loadScript("//www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js");
34+
const options = new cast.framework.CastReceiverOptions();
35+
options.disableIdleTimeout = true;
36+
cast.framework.CastReceiverContext.getInstance().start(options);
3737
}
3838

3939
async function initSender() {
40-
window["__onGCastApiAvailable"] = (isAvailable) => {
41-
if (isAvailable) {
42-
cast.framework.CastContext.getInstance().setOptions({
43-
receiverApplicationId: "F65B2EC2",
44-
autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,
45-
});
46-
document.body.appendChild(document.createElement("google-cast-launcher"));
47-
}
48-
};
49-
await loadScript("//www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");
40+
window["__onGCastApiAvailable"] = (isAvailable) => {
41+
if (isAvailable) {
42+
cast.framework.CastContext.getInstance().setOptions({
43+
receiverApplicationId: "F65B2EC2",
44+
autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED,
45+
});
46+
document.body.appendChild(document.createElement("google-cast-launcher"));
47+
}
48+
};
49+
await loadScript("//www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1");
5050
}
5151

5252
initClock();
5353
if (navigator.userAgent.includes("CrKey")) {
54-
initReceiver();
54+
initReceiver();
5555
} else {
56-
initSender();
56+
initSender();
5757
}

0 commit comments

Comments
 (0)