sites/randogoth.com/mc-pelican/static/script.js
randogoth 8505b7e9e0 Three sites, one directory each
flux.vision, tobias.raayoni-last.com and randogoth.com. They were one site until
October 2026, serving four audiences from a single dated list, which is the only
format that can hold unrelated things at once.

flux.vision is recovered from the Wayback Machine, where it had sat since being
deleted in 2021: 90 articles, closed and maintained rather than updated.
tobias.raayoni-last.com is the professional record, 97 articles back to 1999.
randogoth.com is the technical work, 41 articles across six areas, served as an
ANSI bulletin board.

History starts here deliberately. The development history, the 266-row inventory
that records why each article went where it did, the Wayback pipelines, the
pruned articles, the source archives and the full-size images are kept beside
the repo rather than in it, so a clone is the web presence and not the argument
that produced it. REFACTOR.md is gitignored for the same reason. See README.md
for where that material lives, and keep it: the sort is not reproducible from
these three directories alone.

Each site documents itself in its own README, including the traps that cost time
and look like nothing when you get them wrong.
2026-10-05 20:54:45 +03:00

173 lines
No EOL
5.5 KiB
JavaScript

function pickColors() {
const highlights = [
"#000000", // Black
"#0000AA", // Blue
"#00AA00", // Green
"#00AAAA", // Cyan
"#AA00AA", // Magenta
"#AA5500", // Brown
"#AA0000", // Red
"#555555", // Dark Gray
"#5555FF", // Bright Blue
"#55FF55", // Bright Green
"#55FFFF", // Bright Cyan
"#FF5555", // Bright Red
"#FF55FF", // Bright Magenta
"#FFFF55", // Bright Yellow
];
return {
// background: backgrounds[Math.floor(Math.random() * backgrounds.length)],
highlight: highlights[Math.floor(Math.random() * highlights.length)],
};
}
const { background } = pickColors();
document.querySelector('.home').style.backgroundColor = background;
const blogTitle = document.querySelector('#blog-title').firstElementChild;
blogTitle.style.color = "#FFFF55"; // Bright Yellow
// setInterval(() => {
// blogTitle.style.color = pickColors().highlight;
// }, 120);
let scrollHeight = Math.max(
document.body.scrollHeight, document.documentElement.scrollHeight,
document.body.offsetHeight, document.documentElement.offsetHeight,
document.body.clientHeight, document.documentElement.clientHeight
);
let paras = document.getElementsByClassName("para");
for (let i = 0; i < paras.length; i++) {
var imageSrc = paras[i].style.backgroundImage.replace(/url\((['"])?(.*?)\1\)/gi, '$2').split(',')[0];
var image = new Image();
image.src = imageSrc;
if ( screen.width > screen.height ) {
paras[i].setAttribute("offset", paras[i].getBoundingClientRect().bottom - image.height * 0.5);
} else {
paras[i].parentNode.insertBefore(image, paras[i].nextSibling);
paras[i].style.display = 'none';
}
}
window.addEventListener('scroll', () => {
let { scrollY } = window;
if ( screen.width > screen.height ) {
for (let i = 0; i < paras.length; i++) {
paras[i].style.backgroundPositionY = paras[i].getAttribute("offset") * 0.1 + -0.1 * scrollY + 'px';
}
}
});
// //components
// //console component
// class Console{
// comps=[];
// input_received=false;
// blocking_interval=null;
// text_color="#bbb";
// constructor(root){
// this.elem=document.createElement("span");
// this.elem.className="console";
// root.appendChild(this.elem);
// this.resetTextColor();
// }
// appendComponent(comp){
// this.comps.push(comp);
// this.elem.appendChild(comp.elem);
// }
// writeLine(txt){
// let text=new Text(txt,this.text_color);
// this.appendComponent(text);
// }
// async readLine(txt){
// let text=new Text(txt,this.text_color);
// this.appendComponent(text);
// let input=new Input(this.text_color);
// this.appendComponent(input);
// input.elem.focus({ preventScroll: true});
// return new Promise(resolve=>{
// this.blocking_interval=setInterval(()=>{
// if(this.input_received){
// this.input_received=false;
// clearInterval(this.blocking_interval);
// resolve(input.elem.innerText);
// }
// },500);
// })
// }
// setTextColor(color){
// this.text_color=color;
// }
// resetTextColor(){
// this.text_color="#bbb";
// }
// //helpers
// get lastComp(){return this.comps[this.comps.length-1]};
// }
// //text component
// class Text{
// constructor(txt,color){
// this.elem=document.createElement("span");
// this.elem.className="text";
// this.elem.style.color=color;
// this.elem.innerText=txt;
// }
// }
// //input component
// class Input{
// constructor(color){
// this.elem=document.createElement("span");
// this.elem.style.color=color;
// this.elem.contentEditable=true;
// this.elem.addEventListener('keydown',function(e){
// let key=e.key;
// if(key=="Enter"){
// e.preventDefault();
// cmd.input_received=true;
// cmd.lastComp.elem.contentEditable=false;
// cmd.lastComp.elem.style.borderWidth="0px";
// }
// });
// }
// }
// /************************************/
// let root=document.getElementById("root");
// let cmd=new Console(root);
// let prompt = "C:\\>"
// async function execute(){
// let command= await cmd.readLine(prompt);
// if ( command == "projects" ) window.location = "/current.html";
// else if ( command == "blog" ) window.location = "/blog";
// else if ( command == "archive" ) window.location = "/archive";
// else if ( command == "dir" ) window.location = "/archive";
// else if ( command == "home" ) window.location = "/";
// else if ( command == "connect" ) window.location = "/connect.html";
// else if ( command == "reboot" ) location.reload();
// else if ( command == "a:" ) {
// prompt = "A:\\>";
// cmd.writeLine("\n");
// cmd=new Console(root);
// execute();
// }
// else if ( command == "b:" ) {
// prompt = "B:\\>";
// cmd.writeLine("\n");
// cmd=new Console(root);
// execute();
// }
// else if ( command == "c:" ) {
// prompt = "C:\\>";
// cmd.writeLine("\n");
// cmd=new Console(root);
// execute();
// }
// else {
// cmd.writeLine("\nSyntax error\n");
// cmd=new Console(root);
// execute();
// }
// }
// execute();