Files
Jungfraujoch/docs/landing/landing.js
T
leonarski_f f960bd7a80 Docs landing page: a real diffraction frame in the hero, and the command with a model
The generated spot-and-ring drawing is replaced by one 0.2 deg rotation frame of the in-house
lysozyme standard (EIGER2 16M, SLS X10SA): Bragg spots on their lunes, the beam stop and its arm,
the module gaps. docs/landing/hero_frame.py makes the 920 px WebP (67 KB) from the master
file - crop about the beam centre, log tone map from the frame's own background, block mean+max
downsampling - and is run by hand; the WebP is committed and copied by the landing-page step.
The dark theme shows it inverted through a CSS filter.

The hero's command line drops its explanatory sentence and gains the second form,
rugnux <diffraction image file> <CIF/PDB model file>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu
(cherry picked from commit ff26000bfe7446cb4fda739c3b72596f8a8b7047)
2026-10-26 10:53:25 +01:00

30 lines
1.6 KiB
JavaScript

// The front page: theme toggle and the download section's
// "your system" highlight. The download buttons themselves are repointed at the newest release by
// _static/jfjoch_downloads.js, shared with the Sphinx download pages.
(function () {
// ---- theme: follows the system until the toggle is used, then remembered -----------------
var root = document.documentElement;
var toggle = document.querySelector(".theme-toggle");
function isDark() {
var set = root.getAttribute("data-theme");
if (set) return set === "dark";
return window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
}
if (toggle) toggle.addEventListener("click", function () {
var next = isDark() ? "light" : "dark";
root.setAttribute("data-theme", next);
try { localStorage.setItem("jfj-theme", next); } catch (e) {}
});
// ---- "your system": highlight the platform the browser runs on ----------------------------
var ua = navigator.userAgent || "", platform = navigator.platform || "";
var os = /Windows/.test(ua) ? "windows" : /Mac/.test(platform) || /Macintosh/.test(ua) ? "macos" :
/Linux|X11/.test(platform + ua) && !/Android/.test(ua) ? "linux" : null;
if (os) {
document.querySelectorAll('.jfj-dl__card[data-platform="' + os + '"]').forEach(function (c) { c.classList.add("is-yours"); });
var note = document.querySelector("[data-os-note]");
var names = { windows: "Windows", macos: "macOS", linux: "Linux" };
if (note) note.textContent = "The " + names[os] + " builds are marked for you.";
}
})();