Skip to content

Commit

Permalink
Deploying to gh-pages from @ 2949624 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
W-Mai committed Nov 11, 2024
0 parents commit 3d42e60
Show file tree
Hide file tree
Showing 20 changed files with 2,809 additions and 0 deletions.
245 changes: 245 additions & 0 deletions artifacts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
/* Code modified from the blender website
* https://www.blender.org/wp-content/themes/bthree/assets/js/get_os.js?x82196
*/

let options = {
windows64: "x86_64-pc-windows",
windows32: "i686-pc-windows",
windowsArm: "aarch64-pc-windows",

mac64: "x86_64-apple",
mac32: "i686-apple",
macSilicon: "aarch64-apple",

linux64: "x86_64-unknown-linux",
linux32: "i686-unknown-linux",
linuxArm: "aarch64-unknown-linux",

// ios: "ios",
// android: "linux-android",
// freebsd: "freebsd",
};

function isAppleSilicon() {
try {
var glcontext = document.createElement("canvas").getContext("webgl");
var debugrenderer = glcontext
? glcontext.getExtension("WEBGL_debug_renderer_info")
: null;
var renderername =
(debugrenderer &&
glcontext.getParameter(debugrenderer.UNMASKED_RENDERER_WEBGL)) ||
"";
if (renderername.match(/Apple M/) || renderername.match(/Apple GPU/)) {
return true;
}

return false;
} catch (e) {}
}

function getOS() {
var OS = options.windows64.default;
var userAgent = navigator.userAgent;
var platform = navigator.platform;

if (navigator.appVersion.includes("Win")) {
if (
!userAgent.includes("Windows NT 5.0") &&
!userAgent.includes("Windows NT 5.1") &&
(userAgent.indexOf("Win64") > -1 ||
platform == "Win64" ||
userAgent.indexOf("x86_64") > -1 ||
userAgent.indexOf("x86_64") > -1 ||
userAgent.indexOf("amd64") > -1 ||
userAgent.indexOf("AMD64") > -1 ||
userAgent.indexOf("WOW64") > -1)
) {
OS = options.windows64;
} else {
if (
window.external &&
window.external.getHostEnvironmentValue &&
window.external
.getHostEnvironmentValue("os-architecture")
.includes("ARM64")
) {
OS = options.windowsArm;
} else {
try {
var canvas = document.createElement("canvas");
var gl = canvas.getContext("webgl");

var debugInfo = gl.getExtension("WEBGL_debug_renderer_info");
var renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
if (renderer.includes("Qualcomm")) OS = options.windowsArm;
} catch (e) {}
}
}
}

//MacOS, MacOS X, macOS
if (navigator.appVersion.includes("Mac")) {
if (
navigator.userAgent.includes("OS X 10.5") ||
navigator.userAgent.includes("OS X 10.6")
) {
OS = options.mac32;
} else {
OS = options.mac64;

const isSilicon = isAppleSilicon();
if (isSilicon) {
OS = options.macSilicon;
}
}
}

// linux
if (platform.includes("Linux")) {
OS = options.linux64;
// FIXME: Can we find out whether linux 32-bit or ARM are used?
}

// if (
// userAgent.includes("iPad") ||
// userAgent.includes("iPhone") ||
// userAgent.includes("iPod")
// ) {
// OS = options.ios;
// }
// if (platform.toLocaleLowerCase().includes("freebsd")) {
// OS = options.freebsd;
// }

return OS;
}

let os = getOS();
window.os = os;

// Unhide and hydrate selector with events
const archSelect = document.querySelector(".arch-select");
if (archSelect) {
archSelect.classList.remove("hidden");
const selector = document.querySelector("#install-arch-select");
if (selector) {
selector.addEventListener("change", onArchChange);
}
}

// Hydrate tab buttons with events
Array.from(document.querySelectorAll(".install-tab[data-id]")).forEach((tab) => {
tab.addEventListener("click", onTabClick);
});

function onArchChange(evt) {
// Get target
const target = evt.currentTarget.value;
// Find corresponding installer lists
const newContentEl = document.querySelector(`.arch[data-arch=${target}]`);
const oldContentEl = document.querySelector(`.arch[data-arch]:not(.hidden)`);
// Hide old content element (if applicable)
if (oldContentEl) {
oldContentEl.classList.add("hidden");
}
// Show new content element
newContentEl.classList.remove("hidden");
// Show the first tab's content if nothing was selected before
if (newContentEl.querySelectorAll(".install-tab.selected").length === 0) {
const firstContentChild = newContentEl.querySelector(".install-content:first-of-type");
const firstTabChild = newContentEl.querySelector(".install-tab:first-of-type");
firstContentChild.classList.remove("hidden");
if (firstTabChild) {
firstTabChild.classList.add("selected");
}
}
// Hide "no OS detected" message
const noDetectEl = document.querySelector(".no-autodetect");
noDetectEl.classList.add("hidden");
// Hide Mac hint
document.querySelector(".mac-switch").classList.add("hidden");
}

function onTabClick(evt) {
// Get target and ID
const {triple, id} = evt.currentTarget.dataset;
if (triple) {
// Find corresponding content elements
const newContentEl = document.querySelector(`.install-content[data-id="${String(id)}"][data-triple=${triple}]`);
const oldContentEl = document.querySelector(`.install-content[data-triple=${triple}][data-id]:not(.hidden)`);
// Find old tab to unselect
const oldTabEl = document.querySelector(`.install-tab[data-triple=${triple}].selected`);
// Hide old content element
if (oldContentEl && oldTabEl) {
oldContentEl.classList.add("hidden");
oldTabEl.classList.remove("selected");
}

// Unhide new content element
newContentEl.classList.remove("hidden");
// Select new tab element
evt.currentTarget.classList.add("selected");
}
}

const allPlatforms = Array.from(document.querySelectorAll(`.arch[data-arch]`));
let hit = allPlatforms.find(
(a) => {
// Show Intel Mac downloads if no M1 Mac downloads are available
if (
a.attributes["data-arch"].value.includes(options.mac64) &&
os.includes(options.macSilicon) &&
!allPlatforms.find(p => p.attributes["data-arch"].value.includes(options.macSilicon))) {
// Unhide hint
document.querySelector(".mac-switch").classList.remove("hidden");
return true;
}
return a.attributes["data-arch"].value.includes(os);
}
);

if (hit) {
hit.classList.remove("hidden");
const selectEl = document.querySelector("#install-arch-select");
selectEl.value = hit.dataset.arch;
const firstContentChild = hit.querySelector(".install-content:first-of-type");
const firstTabChild = hit.querySelector(".install-tab:first-of-type");
firstContentChild.classList.remove("hidden");
if (firstTabChild) {
firstTabChild.classList.add("selected");
}
} else {
const noDetectEl = document.querySelector(".no-autodetect");
if (noDetectEl) {
const noDetectElDetails = document.querySelector(".no-autodetect-details");
if (noDetectElDetails) {
noDetectElDetails.innerHTML = `We detected you're on ${os} but there don't seem to be installers for that. `
}
noDetectEl.classList.remove("hidden");
}
}

let copyButtons = Array.from(document.querySelectorAll("[data-copy]"));
if (copyButtons.length) {
copyButtons.forEach(function (element) {
element.addEventListener("click", () => {
navigator.clipboard.writeText(element.attributes["data-copy"].value);
});
});
}

// Toggle for pre releases
const checkbox = document.getElementById("show-prereleases");

if (checkbox) {
checkbox.addEventListener("click", () => {
const all = document.getElementsByClassName("pre-release");

if (all) {
for (var item of all) {
item.classList.toggle("hidden");
}
}
});
}
84 changes: 84 additions & 0 deletions changelog.rss
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>icu_tool Changelog</title><link>http://127.0.0.1:7979/icu/changelog</link><description>Changelog information for icu_tool</description><category domain="https://github.com/W-Mai/icu">icu_tool Changelog</category><atom:link href="http://127.0.0.1:7979/icu/changelog.rss" rel="self"/><item><title>v0.1.12-1 - 2024-11-08</title><link>http://127.0.0.1:7979/icu/changelog/v0.1.12-1</link><category domain="https://github.com/W-Mai/icu">icu_tool Changelog</category><guid>http://127.0.0.1:7979/icu/changelog/v0.1.12-1</guid><content:encoded><![CDATA[<h3>🔖 Version Tag</h3>
<ul>
<li>🚀 <strong>New Features</strong>: support custom dither params, support 1 to 30 levels. 1 is the best level.</li>
<li>🔄 <strong>Version Bump</strong>: Version was bumped to 0.1.12 to reflect the updates and improvements.</li>
</ul>
]]></content:encoded></item><item><title>v0.1.12 - 2024-11-08</title><link>http://127.0.0.1:7979/icu/changelog/v0.1.12</link><category domain="https://github.com/W-Mai/icu">icu_tool Changelog</category><guid>http://127.0.0.1:7979/icu/changelog/v0.1.12</guid><content:encoded><![CDATA[<h3>🔖 Version Tag</h3>
<ul>
<li>🚀 <strong>New Features</strong>: support custom dither params, support 1 to 30 levels. 1 is the best level.</li>
<li>🔄 <strong>Version Bump</strong>: Version was bumped to 0.1.12 to reflect the updates and improvements.</li>
</ul>
]]></content:encoded></item><item><title>v0.1.11-1 - 2024-05-01</title><link>http://127.0.0.1:7979/icu/changelog/v0.1.11-1</link><category domain="https://github.com/W-Mai/icu">icu_tool Changelog</category><guid>http://127.0.0.1:7979/icu/changelog/v0.1.11-1</guid><content:encoded><![CDATA[<h3>🔖 Version Tag</h3>
<p>劳动节快乐🎉
Happy Labor Day🎉</p>
<ul>
<li>🚀 <strong>New Features</strong>: Added support for PNG indexes 1/2/4/8.
<ul>
<li>Now you can easily convert by using the <code>-C</code> option with <code>i1/2/4/8</code> color format.</li>
</ul>
</li>
<li>🚀 <strong>New Features</strong>: Added support for Dither feature! By using <code>--dither</code> option you can make your pictures better and more natural.</li>
<li>🔄 <strong>Version Bump</strong>: Version was bumped to 0.1.11 to reflect the updates and improvements.</li>
</ul>
]]></content:encoded></item><item><title>v0.1.11 - 2024-05-01</title><link>http://127.0.0.1:7979/icu/changelog/v0.1.11</link><category domain="https://github.com/W-Mai/icu">icu_tool Changelog</category><guid>http://127.0.0.1:7979/icu/changelog/v0.1.11</guid><content:encoded><![CDATA[<h3>🔖 Version Tag</h3>
<p>劳动节快乐🎉
Happy Labor Day🎉</p>
<ul>
<li>🚀 <strong>New Features</strong>: Added support for PNG indexes 1/2/4/8.
<ul>
<li>Now you can easily convert by using the <code>-C</code> option with <code>i1/2/4/8</code> color format.</li>
</ul>
</li>
<li>🚀 <strong>New Features</strong>: Added support for Dither feature! By using <code>--dither</code> option you can make your pictures better and more natural.</li>
<li>🔄 <strong>Version Bump</strong>: Version was bumped to 0.1.11 to reflect the updates and improvements.</li>
</ul>
]]></content:encoded></item><item><title>v0.1.10 - 2024-03-12</title><link>http://127.0.0.1:7979/icu/changelog/v0.1.10</link><category domain="https://github.com/W-Mai/icu">icu_tool Changelog</category><guid>http://127.0.0.1:7979/icu/changelog/v0.1.10</guid><content:encoded><![CDATA[<h3>🔖 Version Tag</h3>
<ul>
<li>🚧 <strong>Refactoring</strong>: Refactored code to improve maintainability and readability.</li>
<li>🚧 <strong>Refactoring</strong>: Refactored error handling to improve user experience and reduce code complexity.</li>
<li>🚀 <strong>New Features</strong>: The way to display the path is more reasonable.</li>
<li>🚀 <strong>New Features</strong>: Added support for Auto-Complete feature for the command line interface. See <code>README.md</code> for more information.</li>
<li>🔄 <strong>Version Bump</strong>: Version was bumped to 0.1.10 to reflect the updates and improvements.</li>
</ul>
]]></content:encoded></item><item><title>v0.1.9 - 2024-03-06</title><link>http://127.0.0.1:7979/icu/changelog/v0.1.9</link><category domain="https://github.com/W-Mai/icu">icu_tool Changelog</category><guid>http://127.0.0.1:7979/icu/changelog/v0.1.9</guid><content:encoded><![CDATA[<h3>🔖 Version Tag</h3>
<ul>
<li>🚀 <strong>New Features</strong>: Added support for LVGL version 8 encode and decode.</li>
<li>🚀 <strong>New Features</strong>: Added support for image show for LVGL version 8.</li>
<li>🚀 <strong>New Features</strong>: Added support for more image information logging for LVGL version 8 and 9.</li>
<li>🔄 <strong>Version Bump</strong>: Version was bumped to 0.1.9 to reflect the updates and improvements.</li>
</ul>
]]></content:encoded></item><item><title>v0.1.8</title><link>http://127.0.0.1:7979/icu/changelog/v0.1.8</link><category domain="https://github.com/W-Mai/icu">icu_tool Changelog</category><guid>http://127.0.0.1:7979/icu/changelog/v0.1.8</guid><content:encoded><![CDATA[<h3>🔖 Version Tag</h3>
<ul>
<li>🌍 <strong>Oranda Updates</strong>: Configurations were updated to improve the oranda module's functionality.</li>
<li>🐛 <strong>Bug Fixes</strong>: Web page bugs were addressed to enhance user experience.</li>
<li>🌐 <strong>Webpage Additions</strong>: GitHub Pages were added for better project documentation and visibility.</li>
<li>📦 <strong>Dependency Updates</strong>: Homebrew configurations were updated to ensure compatibility with the latest dependencies.</li>
<li>🚀 <strong>New Features</strong>: A new info command was added to the main module, and an API for image info retrieval was implemented in the icu_lib.</li>
<li>🛠 <strong>CI/CD</strong>: Automated build CI was added to streamline the development process.</li>
<li>📚 <strong>Documentation</strong>: README files were updated with more examples and detailed instructions.</li>
</ul>
]]></content:encoded></item><item><title></title><link>http://127.0.0.1:7979/icu/changelog/v0.1.7</link><category domain="https://github.com/W-Mai/icu">icu_tool Changelog</category><guid>http://127.0.0.1:7979/icu/changelog/v0.1.7</guid><content:encoded><![CDATA[<h3>🔖 Version Tag</h3>
<ul>
<li>📚 <strong>Documentation</strong>: README files were updated to provide more examples and clearer instructions.</li>
<li>🔄 <strong>Dependencies</strong>: Cargo dependencies were updated to the latest versions.</li>
<li>🔄 <strong>Version Bump</strong>: Version was bumped to 0.1.7 to reflect the updates and improvements.</li>
</ul>
]]></content:encoded></item><item><title>v0.1.5</title><link>http://127.0.0.1:7979/icu/changelog/v0.1.5</link><category domain="https://github.com/W-Mai/icu">icu_tool Changelog</category><guid>http://127.0.0.1:7979/icu/changelog/v0.1.5</guid><content:encoded><![CDATA[]]></content:encoded></item><item><title>v0.1.4</title><link>http://127.0.0.1:7979/icu/changelog/v0.1.4</link><category domain="https://github.com/W-Mai/icu">icu_tool Changelog</category><guid>http://127.0.0.1:7979/icu/changelog/v0.1.4</guid><content:encoded><![CDATA[<h3>🔖 Version Tag</h3>
<ul>
<li>📚 <strong>README Updates</strong>: README files were updated with new flags and detailed information about the icu tool.</li>
<li>🔄 <strong>Version Bump</strong>: The version was incremented to 0.1.4 after adding new features and making improvements.</li>
</ul>
]]></content:encoded></item><item><title>v0.1.3</title><link>http://127.0.0.1:7979/icu/changelog/v0.1.3</link><category domain="https://github.com/W-Mai/icu">icu_tool Changelog</category><guid>http://127.0.0.1:7979/icu/changelog/v0.1.3</guid><content:encoded><![CDATA[]]></content:encoded></item><item><title>v0.1.1</title><link>http://127.0.0.1:7979/icu/changelog/v0.1.1</link><category domain="https://github.com/W-Mai/icu">icu_tool Changelog</category><guid>http://127.0.0.1:7979/icu/changelog/v0.1.1</guid><content:encoded><![CDATA[<h3>🔖 Version Tag</h3>
<ul>
<li>🚀 <strong>Initial Release</strong>: The first release of the project with basic functionality and initial documentation.</li>
<li>🖼️ <strong>Image Support</strong>: Added support for image_shower and various image formats.</li>
<li>🔧 <strong>Argument Parsing</strong>: Implemented basic argument parsing and added sub-commands for better user interaction.</li>
<li>🔄 <strong>Dependencies</strong>: Updated Cargo dependencies and prepared the project for publishing.</li>
</ul>
]]></content:encoded></item><item><title>First Release</title><link>http://127.0.0.1:7979/icu/changelog/v0.1.0</link><category domain="https://github.com/W-Mai/icu">icu_tool Changelog</category><guid>http://127.0.0.1:7979/icu/changelog/v0.1.0</guid><content:encoded><![CDATA[<h3>🔖 Version Tag</h3>
<ul>
<li>📄 <strong>README Updates</strong>: Initial README file was created with basic project information.</li>
<li>🔧 <strong>Project Setup</strong>: Set up the initial project structure and added basic functionality.</li>
<li>🔄 <strong>Version Tag</strong>: Tagged the initial release as version 0.1.0.</li>
</ul>
]]></content:encoded></item></channel></rss>
Loading

0 comments on commit 3d42e60

Please sign in to comment.