Skip to content

Commit bd9098a

Browse files
committed
OpenModSim site docs
1 parent 761de0b commit bd9098a

40 files changed

Lines changed: 2497 additions & 0 deletions

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ out
5555
CMakePresets.json
5656
CMakeUserPresets.json
5757

58+
.claude
5859
.directory
5960
*.bat
6061
*.qmake.stash
@@ -63,3 +64,7 @@ CMakeUserPresets.json
6364
*.qtds
6465
*.ts text eol=lf
6566
src/res/license.txt
67+
/docs/PROJECT_SUMMARY.md
68+
/docs/README.md
69+
/docs/SITE_STRUCTURE.md
70+
/docs/DEPLOYMENT.md

docs/.nojekyll

Whitespace-only changes.

docs/404.html

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>404 - Page Not Found | OpenModSim</title>
7+
<link rel="icon" type="image/png" href="logo.png">
8+
<style>
9+
* {
10+
margin: 0;
11+
padding: 0;
12+
box-sizing: border-box;
13+
}
14+
15+
body {
16+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
17+
display: flex;
18+
justify-content: center;
19+
align-items: center;
20+
min-height: 100vh;
21+
background: #EEF4FC;
22+
color: #1E2D3D;
23+
}
24+
25+
.container {
26+
text-align: center;
27+
padding: 2rem;
28+
}
29+
30+
.logo {
31+
width: 120px;
32+
height: 120px;
33+
margin-bottom: 2rem;
34+
}
35+
36+
h1 {
37+
font-size: 6rem;
38+
font-weight: 700;
39+
color: #1877C8;
40+
margin-bottom: 1rem;
41+
}
42+
43+
h2 {
44+
font-size: 2rem;
45+
margin-bottom: 1rem;
46+
color: #1E2D3D;
47+
}
48+
49+
p {
50+
font-size: 1.25rem;
51+
color: #4A6080;
52+
margin-bottom: 2rem;
53+
}
54+
55+
.btn {
56+
display: inline-block;
57+
padding: 0.875rem 2rem;
58+
background: #1877C8;
59+
color: white;
60+
text-decoration: none;
61+
border-radius: 8px;
62+
font-weight: 600;
63+
transition: all 0.3s;
64+
}
65+
66+
.btn:hover {
67+
background: #1464A8;
68+
}
69+
</style>
70+
</head>
71+
<body>
72+
<div class="container">
73+
<img src="logo.png" alt="OpenModSim Logo" class="logo">
74+
<h1>404</h1>
75+
<h2>Page Not Found</h2>
76+
<p>The page you're looking for doesn't exist or has been moved.</p>
77+
<a href="/" class="btn">Go to Homepage</a>
78+
</div>
79+
</body>
80+
</html>

docs/download.js

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
// Tab switching
2+
function initTabs() {
3+
const tabButtons = document.querySelectorAll('.tab-btn');
4+
const tabPanels = document.querySelectorAll('.tab-panel');
5+
6+
tabButtons.forEach(function(btn) {
7+
btn.addEventListener('click', function() {
8+
var tabId = this.getAttribute('data-tab');
9+
10+
tabButtons.forEach(function(b) { b.classList.remove('active'); });
11+
tabPanels.forEach(function(p) { p.classList.remove('active'); });
12+
13+
this.classList.add('active');
14+
document.getElementById('tab-' + tabId).classList.add('active');
15+
});
16+
});
17+
}
18+
19+
// Fetch latest release information from GitHub
20+
async function fetchLatestRelease() {
21+
const GITHUB_API = 'https://api.github.com/repos/sanny32/OpenModSim/releases/latest';
22+
23+
try {
24+
console.log('Fetching latest release from GitHub...');
25+
const response = await fetch(GITHUB_API);
26+
if (!response.ok) {
27+
throw new Error(`HTTP error! status: ${response.status}`);
28+
}
29+
30+
const release = await response.json();
31+
updateDownloadLinks(release);
32+
} catch (error) {
33+
console.error('Error fetching release:', error);
34+
console.warn('Download links will point to releases page instead of direct downloads');
35+
}
36+
}
37+
38+
function updateDownloadLinks(release) {
39+
const assets = release.assets;
40+
41+
// Find specific file patterns
42+
const files = {
43+
winx64Qt6: assets.find(a => a.name.match(/qt6-omodsim-.*_x64\.exe$/i)),
44+
winx64Qt5: assets.find(a => a.name.match(/qt5-omodsim-.*_x64\.exe$/i)),
45+
winx86: assets.find(a => a.name.match(/qt5-omodsim-.*_x86\.exe$/i)),
46+
debQt6: assets.find(a => a.name.match(/qt6-omodsim_.*_amd64\.deb$/i)),
47+
debQt5: assets.find(a => a.name.match(/qt5-omodsim_.*_amd64\.deb$/i)),
48+
rpmQt6: assets.find(a => a.name.match(/qt6-omodsim-.*\.x86_64\.rpm$/i)),
49+
rpmPubkey: assets.find(a => a.name.match(/qt6-omodsim\.rpm\.pubkey$/i)),
50+
flatpak: assets.find(a => a.name.match(/io\.github\.sanny32\.omodsim.*\.flatpak$/i))
51+
};
52+
53+
// Helper function to update link
54+
function updateLink(id, file, name) {
55+
const link = document.getElementById(id);
56+
if (link && file) {
57+
link.href = file.browser_download_url;
58+
} else if (link && !file) {
59+
console.warn(`✗ File not found for ${name}`);
60+
}
61+
}
62+
63+
// Update all download links
64+
updateLink('win-x64-qt6-link', files.winx64Qt6, 'Windows x64 Qt6');
65+
updateLink('win-x64-qt5-link', files.winx64Qt5, 'Windows x64 Qt5');
66+
updateLink('win-x86-qt5-link', files.winx86, 'Windows x86 Qt5');
67+
updateLink('deb-qt6-link', files.debQt6, 'DEB Qt6');
68+
updateLink('deb-qt5-link', files.debQt5, 'DEB Qt5');
69+
updateLink('rpm-qt6-link', files.rpmQt6, 'RPM Qt6');
70+
updateLink('rpm-pubkey-link', files.rpmPubkey, 'RPM Public Key');
71+
updateLink('flatpak-link', files.flatpak, 'Flatpak');
72+
73+
// Update all install commands with actual file names
74+
updateInstallCommands(files);
75+
76+
// Update version display if available
77+
if (release.tag_name) {
78+
updateVersionDisplay(release.tag_name);
79+
}
80+
}
81+
82+
function updateVersionDisplay(version) {
83+
// Update the download subtitle to include version
84+
const subtitle = document.querySelector('.download-subtitle');
85+
if (subtitle) {
86+
subtitle.textContent = `Get the latest version (${version}) for your platform`;
87+
}
88+
}
89+
90+
function updateInstallCommands(files) {
91+
if (files.debQt5) {
92+
const debName = files.debQt5.name;
93+
document.querySelectorAll('.qt5-deb-package-name').forEach(el => {
94+
el.textContent = debName;
95+
});
96+
}
97+
98+
if (files.debQt6) {
99+
const debName = files.debQt6.name;
100+
document.querySelectorAll('.qt6-deb-package-name').forEach(el => {
101+
el.textContent = debName;
102+
});
103+
}
104+
105+
if (files.rpmQt6) {
106+
const rpmName = files.rpmQt6.name;
107+
document.querySelectorAll('.qt6-rpm-package-name').forEach(el => {
108+
el.textContent = rpmName;
109+
});
110+
}
111+
}
112+
113+
function initCopyButtons() {
114+
document.querySelectorAll('.install-instructions .code-block .copy-btn').forEach(btn => {
115+
btn.addEventListener('click', () => {
116+
const codeEl = btn.closest('.code-block').querySelector('code');
117+
if (!codeEl) return;
118+
119+
navigator.clipboard.writeText(codeEl.innerText.trim()).then(() => {
120+
btn.classList.add('copied');
121+
btn.innerHTML = `<svg viewBox="0 0 16 16" fill="currentColor"><path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"/></svg>`;
122+
123+
setTimeout(() => {
124+
btn.classList.remove('copied');
125+
btn.innerHTML = `
126+
<svg viewBox="0 0 16 16" fill="currentColor">
127+
<path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"/>
128+
<path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"/>
129+
</svg>
130+
`;
131+
}, 1500);
132+
});
133+
});
134+
});
135+
}
136+
137+
138+
// Initialize when page loads
139+
document.addEventListener('DOMContentLoaded', function() {
140+
initTabs();
141+
fetchLatestRelease();
142+
initCopyButtons();
143+
});

docs/favicon-16x16.png

144 Bytes
Loading

docs/favicon-32x32.png

217 Bytes
Loading

docs/hero-bg.svg

Lines changed: 40 additions & 0 deletions
Loading

docs/icons/coils.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/icons/computer.svg

Lines changed: 15 additions & 0 deletions
Loading

docs/icons/document.svg

Lines changed: 9 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)