Skip to content

Commit d44891a

Browse files
committed
Deploying to gh-pages from @ 23e657c 🚀
0 parents  commit d44891a

File tree

6 files changed

+483
-0
lines changed

6 files changed

+483
-0
lines changed

artifacts.js

+245
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
/* Code modified from the blender website
2+
* https://www.blender.org/wp-content/themes/bthree/assets/js/get_os.js?x82196
3+
*/
4+
5+
let options = {
6+
windows64: "x86_64-pc-windows",
7+
windows32: "i686-pc-windows",
8+
windowsArm: "aarch64-pc-windows",
9+
10+
mac64: "x86_64-apple",
11+
mac32: "i686-apple",
12+
macSilicon: "aarch64-apple",
13+
14+
linux64: "x86_64-unknown-linux",
15+
linux32: "i686-unknown-linux",
16+
linuxArm: "aarch64-unknown-linux",
17+
18+
// ios: "ios",
19+
// android: "linux-android",
20+
// freebsd: "freebsd",
21+
};
22+
23+
function isAppleSilicon() {
24+
try {
25+
var glcontext = document.createElement("canvas").getContext("webgl");
26+
var debugrenderer = glcontext
27+
? glcontext.getExtension("WEBGL_debug_renderer_info")
28+
: null;
29+
var renderername =
30+
(debugrenderer &&
31+
glcontext.getParameter(debugrenderer.UNMASKED_RENDERER_WEBGL)) ||
32+
"";
33+
if (renderername.match(/Apple M/) || renderername.match(/Apple GPU/)) {
34+
return true;
35+
}
36+
37+
return false;
38+
} catch (e) {}
39+
}
40+
41+
function getOS() {
42+
var OS = options.windows64.default;
43+
var userAgent = navigator.userAgent;
44+
var platform = navigator.platform;
45+
46+
if (navigator.appVersion.includes("Win")) {
47+
if (
48+
!userAgent.includes("Windows NT 5.0") &&
49+
!userAgent.includes("Windows NT 5.1") &&
50+
(userAgent.indexOf("Win64") > -1 ||
51+
platform == "Win64" ||
52+
userAgent.indexOf("x86_64") > -1 ||
53+
userAgent.indexOf("x86_64") > -1 ||
54+
userAgent.indexOf("amd64") > -1 ||
55+
userAgent.indexOf("AMD64") > -1 ||
56+
userAgent.indexOf("WOW64") > -1)
57+
) {
58+
OS = options.windows64;
59+
} else {
60+
if (
61+
window.external &&
62+
window.external.getHostEnvironmentValue &&
63+
window.external
64+
.getHostEnvironmentValue("os-architecture")
65+
.includes("ARM64")
66+
) {
67+
OS = options.windowsArm;
68+
} else {
69+
try {
70+
var canvas = document.createElement("canvas");
71+
var gl = canvas.getContext("webgl");
72+
73+
var debugInfo = gl.getExtension("WEBGL_debug_renderer_info");
74+
var renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
75+
if (renderer.includes("Qualcomm")) OS = options.windowsArm;
76+
} catch (e) {}
77+
}
78+
}
79+
}
80+
81+
//MacOS, MacOS X, macOS
82+
if (navigator.appVersion.includes("Mac")) {
83+
if (
84+
navigator.userAgent.includes("OS X 10.5") ||
85+
navigator.userAgent.includes("OS X 10.6")
86+
) {
87+
OS = options.mac32;
88+
} else {
89+
OS = options.mac64;
90+
91+
const isSilicon = isAppleSilicon();
92+
if (isSilicon) {
93+
OS = options.macSilicon;
94+
}
95+
}
96+
}
97+
98+
// linux
99+
if (platform.includes("Linux")) {
100+
OS = options.linux64;
101+
// FIXME: Can we find out whether linux 32-bit or ARM are used?
102+
}
103+
104+
// if (
105+
// userAgent.includes("iPad") ||
106+
// userAgent.includes("iPhone") ||
107+
// userAgent.includes("iPod")
108+
// ) {
109+
// OS = options.ios;
110+
// }
111+
// if (platform.toLocaleLowerCase().includes("freebsd")) {
112+
// OS = options.freebsd;
113+
// }
114+
115+
return OS;
116+
}
117+
118+
let os = getOS();
119+
window.os = os;
120+
121+
// Unhide and hydrate selector with events
122+
const archSelect = document.querySelector(".arch-select");
123+
if (archSelect) {
124+
archSelect.classList.remove("hidden");
125+
const selector = document.querySelector("#install-arch-select");
126+
if (selector) {
127+
selector.addEventListener("change", onArchChange);
128+
}
129+
}
130+
131+
// Hydrate tab buttons with events
132+
Array.from(document.querySelectorAll(".install-tab[data-id]")).forEach((tab) => {
133+
tab.addEventListener("click", onTabClick);
134+
});
135+
136+
function onArchChange(evt) {
137+
// Get target
138+
const target = evt.currentTarget.value;
139+
// Find corresponding installer lists
140+
const newContentEl = document.querySelector(`.arch[data-arch=${target}]`);
141+
const oldContentEl = document.querySelector(`.arch[data-arch]:not(.hidden)`);
142+
// Hide old content element (if applicable)
143+
if (oldContentEl) {
144+
oldContentEl.classList.add("hidden");
145+
}
146+
// Show new content element
147+
newContentEl.classList.remove("hidden");
148+
// Show the first tab's content if nothing was selected before
149+
if (newContentEl.querySelectorAll(".install-tab.selected").length === 0) {
150+
const firstContentChild = newContentEl.querySelector(".install-content:first-of-type");
151+
const firstTabChild = newContentEl.querySelector(".install-tab:first-of-type");
152+
firstContentChild.classList.remove("hidden");
153+
if (firstTabChild) {
154+
firstTabChild.classList.add("selected");
155+
}
156+
}
157+
// Hide "no OS detected" message
158+
const noDetectEl = document.querySelector(".no-autodetect");
159+
noDetectEl.classList.add("hidden");
160+
// Hide Mac hint
161+
document.querySelector(".mac-switch").classList.add("hidden");
162+
}
163+
164+
function onTabClick(evt) {
165+
// Get target and ID
166+
const {triple, id} = evt.currentTarget.dataset;
167+
if (triple) {
168+
// Find corresponding content elements
169+
const newContentEl = document.querySelector(`.install-content[data-id="${String(id)}"][data-triple=${triple}]`);
170+
const oldContentEl = document.querySelector(`.install-content[data-triple=${triple}][data-id]:not(.hidden)`);
171+
// Find old tab to unselect
172+
const oldTabEl = document.querySelector(`.install-tab[data-triple=${triple}].selected`);
173+
// Hide old content element
174+
if (oldContentEl && oldTabEl) {
175+
oldContentEl.classList.add("hidden");
176+
oldTabEl.classList.remove("selected");
177+
}
178+
179+
// Unhide new content element
180+
newContentEl.classList.remove("hidden");
181+
// Select new tab element
182+
evt.currentTarget.classList.add("selected");
183+
}
184+
}
185+
186+
const allPlatforms = Array.from(document.querySelectorAll(`.arch[data-arch]`));
187+
let hit = allPlatforms.find(
188+
(a) => {
189+
// Show Intel Mac downloads if no M1 Mac downloads are available
190+
if (
191+
a.attributes["data-arch"].value.includes(options.mac64) &&
192+
os.includes(options.macSilicon) &&
193+
!allPlatforms.find(p => p.attributes["data-arch"].value.includes(options.macSilicon))) {
194+
// Unhide hint
195+
document.querySelector(".mac-switch").classList.remove("hidden");
196+
return true;
197+
}
198+
return a.attributes["data-arch"].value.includes(os);
199+
}
200+
);
201+
202+
if (hit) {
203+
hit.classList.remove("hidden");
204+
const selectEl = document.querySelector("#install-arch-select");
205+
selectEl.value = hit.dataset.arch;
206+
const firstContentChild = hit.querySelector(".install-content:first-of-type");
207+
const firstTabChild = hit.querySelector(".install-tab:first-of-type");
208+
firstContentChild.classList.remove("hidden");
209+
if (firstTabChild) {
210+
firstTabChild.classList.add("selected");
211+
}
212+
} else {
213+
const noDetectEl = document.querySelector(".no-autodetect");
214+
if (noDetectEl) {
215+
const noDetectElDetails = document.querySelector(".no-autodetect-details");
216+
if (noDetectElDetails) {
217+
noDetectElDetails.innerHTML = `We detected you're on ${os} but there don't seem to be installers for that. `
218+
}
219+
noDetectEl.classList.remove("hidden");
220+
}
221+
}
222+
223+
let copyButtons = Array.from(document.querySelectorAll("[data-copy]"));
224+
if (copyButtons.length) {
225+
copyButtons.forEach(function (element) {
226+
element.addEventListener("click", () => {
227+
navigator.clipboard.writeText(element.attributes["data-copy"].value);
228+
});
229+
});
230+
}
231+
232+
// Toggle for pre releases
233+
const checkbox = document.getElementById("show-prereleases");
234+
235+
if (checkbox) {
236+
checkbox.addEventListener("click", () => {
237+
const all = document.getElementsByClassName("pre-release");
238+
239+
if (all) {
240+
for (var item of all) {
241+
item.classList.toggle("hidden");
242+
}
243+
}
244+
});
245+
}

changelog.rss

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>ccp Changelog</title><link>http://127.0.0.1:7979/mc/changelog</link><description>Changelog information for ccp</description><category domain="https://github.com/thewh1teagle/ccp">ccp Changelog</category><atom:link href="http://127.0.0.1:7979/mc/changelog.rss" rel="self"/></channel></rss>

changelog/index.html

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<!DOCTYPE html>
2+
<html lang="en" id="oranda" class="dark axo">
3+
<head>
4+
<title>ccp</title>
5+
6+
7+
<link rel="icon" href="/mc/favicon.ico" />
8+
9+
<meta charset="utf-8" />
10+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
11+
12+
<meta name="description" content="Cross platform copy files with progress" />
13+
<meta property="og:description" content="Cross platform copy files with progress" />
14+
15+
<meta property="og:type" content="website" />
16+
<meta property="og:title" content="ccp" />
17+
18+
19+
20+
<meta http-equiv="Permissions-Policy" content="interest-cohort=()" />
21+
<link rel="stylesheet" href="/mc/oranda-v0.6.1.css" />
22+
23+
24+
</head>
25+
<body>
26+
<div class="container">
27+
<div class="page-body">
28+
29+
<div class="repo_banner">
30+
<a href="https://github.com/thewh1teagle/ccp">
31+
<div class="github-icon" aria-hidden="true"></div>
32+
Check out our GitHub!
33+
</a>
34+
</div>
35+
36+
37+
<main>
38+
<header>
39+
40+
<h1 class="title">ccp</h1>
41+
42+
<nav class="nav">
43+
<ul>
44+
<li><a href="/mc//">Home</a></li>
45+
46+
47+
48+
49+
50+
51+
52+
53+
54+
55+
<li><a href="/mc/changelog/">Changelog</a></li>
56+
57+
</ul>
58+
</nav>
59+
60+
</header>
61+
62+
63+
<div>
64+
<h1>
65+
Releases
66+
67+
<a href="/mc/changelog.rss" class="inline-icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
68+
<path d="M3.75 3a.75.75 0 00-.75.75v.5c0 .414.336.75.75.75H4c6.075 0 11 4.925 11 11v.25c0 .414.336.75.75.75h.5a.75.75 0 00.75-.75V16C17 8.82 11.18 3 4 3h-.25z" />
69+
<path d="M3 8.75A.75.75 0 013.75 8H4a8 8 0 018 8v.25a.75.75 0 01-.75.75h-.5a.75.75 0 01-.75-.75V16a6 6 0 00-6-6h-.25A.75.75 0 013 9.25v-.5zM7 15a2 2 0 11-4 0 2 2 0 014 0z" />
70+
</svg></a>
71+
72+
</h1>
73+
<div class="releases-wrapper">
74+
<nav class="releases-nav">
75+
76+
77+
78+
<p>No releases yet!</p>
79+
80+
<ul>
81+
82+
</ul>
83+
</nav>
84+
85+
<div class="releases-list">
86+
87+
</div>
88+
</div>
89+
</div>
90+
91+
</main>
92+
</div>
93+
94+
<footer>
95+
96+
<a href="https://github.com/thewh1teagle/ccp"><div class="github-icon" aria-hidden="true"></div></a>
97+
98+
<span>
99+
ccp
100+
</span>
101+
</footer>
102+
</div>
103+
104+
105+
106+
107+
108+
<script src="/mc/artifacts.js"></script>
109+
110+
</body>
111+
</html>

0 commit comments

Comments
 (0)