Skip to content

Commit adc1a2a

Browse files
authored
Hello Web-Template
1 parent 01a22d3 commit adc1a2a

17 files changed

Lines changed: 6482 additions & 3734 deletions

.github/workflows/single-file.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Create single file build
2+
3+
on:
4+
push:
5+
branches: ["*"]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: "pages"
10+
cancel-in-progress: false
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Use Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: "22" # Using latest Node 22 for 2026 compatibility
23+
24+
- name: Install dependencies
25+
working-directory: Build
26+
run: npm i
27+
28+
- name: Build
29+
working-directory: Build
30+
run: npm run build:single
31+
32+
- name: Rename for distribution
33+
working-directory: Build/dist
34+
run: mv index.html HTMLRunner.html
35+
36+
- name: Upload Build Artifact
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: HTMLRunner-Standalone
40+
path: Build/dist/HTMLRunner.html
41+
if-no-files-found: error

.github/workflows/static.yml

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,43 @@
1-
# .github/workflows/static.yml
2-
name: Deploy static content to Pages
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy browser build to GitHub Pages
33

44
on:
55
push:
66
branches: ["main"]
77
workflow_dispatch:
88

9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
910
permissions:
10-
contents: read
11-
pages: write
12-
id-token: write
11+
contents: write
1312

13+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
14+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
1415
concurrency:
1516
group: "pages"
16-
cancel-in-progress: true
17+
cancel-in-progress: false
1718

1819
jobs:
1920
deploy:
20-
environment:
21-
name: github-pages
22-
url: ${{ steps.deployment.outputs.page_url }}
2321
runs-on: ubuntu-latest
2422
steps:
25-
- name: Checkout repository
23+
- name: Checkout
2624
uses: actions/checkout@v4
2725

28-
- name: Setup Node.js
26+
- name: Use Node.js
2927
uses: actions/setup-node@v4
3028
with:
31-
node-version: '20'
29+
node-version: "20"
3230

33-
- name: Run build script
34-
run: |
35-
chmod +x Build/Buildscripts/build.sh
36-
./Build/Buildscripts/build.sh
31+
- name: Install dependencies
32+
working-directory: Build
33+
run: npm i
3734

38-
- name: Upload GitHub Pages artifact
39-
uses: actions/upload-pages-artifact@v3
40-
with:
41-
path: 'Build/dist'
35+
- name: Build
36+
working-directory: Build
37+
run: npm run build
4238

43-
- name: Deploy to GitHub Pages
44-
id: deployment
45-
uses: actions/deploy-pages@v4
39+
- name: Deploy browser build to GitHub Pages
40+
uses: peaceiris/actions-gh-pages@v4
41+
with:
42+
github_token: ${{ secrets.GITHUB_TOKEN }}
43+
publish_dir: Build/dist

Build/Buildscripts/build-all.sh

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

Build/Buildscripts/build-inline.sh

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

Build/Buildscripts/build.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>HTMLRunner</title>
7-
<link rel="shortcut icon" type="image/x-icon" href="favicon.png">
8-
<link rel="apple-touch-icon" href="favicon.png">
9-
<link rel="manifest" href="manifest.json">
107
<!-- Font Awesome CDN -->
118
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
129
<!-- CodeMirror CSS -->
@@ -17,9 +14,7 @@
1714
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.7/addon/dialog/dialog.min.css">
1815
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.7/addon/search/matchesonscrollbar.min.css">
1916
<!-- Main Styles-->
20-
<!-- prettier-ignore-start -->
21-
<link rel="stylesheet" data-inline="true" href="styles.css">
22-
<!-- prettier-ignore-end -->
17+
<link rel="stylesheet" href="./styles/styles.css">
2318
</head>
2419
<body>
2520
<div class="loading" id="loading">
@@ -66,47 +61,6 @@
6661
</div>
6762
</div>
6863
</div>
69-
<script>
70-
document.addEventListener("DOMContentLoaded", function() {
71-
// Register the service worker
72-
if ("serviceWorker" in navigator) {
73-
navigator.serviceWorker.register("service-worker.js");
74-
}
75-
76-
let deferredPrompt;
77-
const installButton = document.getElementById("install-button");
78-
79-
// Listen for the install prompt
80-
window.addEventListener("beforeinstallprompt", (e) => {
81-
e.preventDefault();
82-
deferredPrompt = e;
83-
installButton.hidden = false;
84-
});
85-
86-
// Handle install button click
87-
installButton.addEventListener("click", async () => {
88-
const isStandalone = window.matchMedia("(display-mode: standalone)").matches || window.navigator.standalone;
89-
90-
if (isStandalone) {
91-
console.log("App is already installed");
92-
return;
93-
}
94-
95-
if (deferredPrompt) {
96-
deferredPrompt.prompt();
97-
const { outcome } = await deferredPrompt.userChoice;
98-
deferredPrompt = null;
99-
console.log(outcome === "accepted" ? "User accepted install prompt" : "User dismissed install prompt");
100-
} else {
101-
if (window.matchMedia("(display-mode: browser)").matches) {
102-
window.location.assign("chrome://apps/");
103-
}
104-
}
105-
});
106-
});
107-
</script>
108-
<!-- prettier-ignore-start -->
109-
<script data-inline="true" src="main.js"></script>
110-
<!-- prettier-ignore-end -->
64+
<script type="module" src="./src/main.ts"></script>
11165
</body>
11266
</html>

0 commit comments

Comments
 (0)