Initial commit

This commit is contained in:
randogoth 2023-07-01 11:01:17 +03:00
commit 50f1eba33a
204 changed files with 4749 additions and 0 deletions

Binary file not shown.

View file

@ -0,0 +1,284 @@
@font-face {
font-family: 'Classic Console Neue';
src: local('Classic Console Neue'), local('ClassicConsoleNeue'),
url('clacon2.woff2') format('woff2')
}
/* CSS Reset */
html {
margin: 0;
padding: 0;
text-align: left;
text-rendering: optimizeLegibility;
}
/* HTML5 tag defaults. */
header, footer, aside, nav, article
{
display: block;
}
h1, h2, h3, h4, h5 {
font-weight: normal;
text-align: left;
font-size: 1em;
text-transform: uppercase;
}
body {
font-family: 'Classic Console Neue';
padding: 1em;
font-size: 1.4em;
line-height: 1.2em;
text-align: left;
background: #090A0E;
color: #bbb;
height: 100vh;
overflow-x: hidden;
overflow-y: auto;
perspective: 2px;
margin: auto;
max-width: 40em;
}
ul, ul li {
margin:0;
padding:0;
list-style:none
}
ul li::before {
content: '*\00a0';
}
/* Use a thin border around all images. */
img
{
border: 1px solid;
max-width: 40em;
width: 100%;
}
/* Navigation bar. */
nav
{
padding-bottom: 1ex;
margin-bottom: 4em;
}
nav::after {
clear:left;
}
nav ul
{
padding: 0;
margin-left: 0;
list-style: none;
}
nav ul li
{
display: inline;
float: left;
margin-right: .4em; /* How far between items. */
margin-top: .3em;
}
nav li::before {
content: none;
}
nav ul li a
{
display: inline;
margin: 0;
}
/*
* Use a border around tables, but don't draw lines around individual
* cells.
*/
table
{
border-style: solid;
border-collapse: collapse;
border-width: thin;
font-size: 100%;
}
th, td
{
border-style: solid;
border-width: thin;
}
a {
background-color: #bbb;
color:#090A0E;
padding: 0.2em 0.3em 0em 0.3em;
}
a.translation {
background-color: #333;
}
/* for unvisited links: blue */
a:link
{
text-decoration: none;
}
/* for visited links: purple */
a:visited
{
text-decoration: none;
}
/* when mouse is over link or the link is active*/
a:hover, a:active
{
text-decoration: none;
}
/* Very clean ruler with no shadows. */
hr
{
border: none;
}
@media screen and (min-width: 941px) {
hr::after {
content: '--------------------------------------------------------------------------------';
}
}
@media screen and (max-width: 940px) {
hr {
border-top: 2px dashed #bbb;
}
}
.hentry::after {
content: '\00a0'
}
abbr {
float: left;
display: inline;
text-decoration: none;
padding: 0;
}
.hentry .published::before {
content: '*';
}
.hentry .published::after {
content: '>\00a0';
}
.hentry .entry-summary p {
margin: 0;
margin-left: 7.5em;
}
.hentry h2 {
margin: 0;
}
header h2 a {
background: none;
color: #bbb;
text-transform: uppercase;
padding: 0;
}
.post-info abbr {
float: none;
}
.author {
font-style: normal;
padding: 0;
}
.post-info {
color: #555;
}
.author a {
padding: 0;
background: none;
color: #555;
}
@keyframes cursor-blink {
0% {
opacity: 0;
}
}
#root {
display: block;
margin-top: 2em;
}
[contenteditable="true"]:active,
[contenteditable="true"]:focus{
border:none;
outline:none;
caret-color: transparent;
}
[contenteditable="true"]:active:after,
[contenteditable="true"]:focus:after {
content: "\02588";
animation: cursor-blink 1.5s steps(2) infinite;
}
.para {
border: 1px solid;
max-width: 40em;
display: block;
background-attachment: fixed;
background-position: center;
background-size: contain;
}
iframe {
border: 1px solid;
aspect-ratio: 16 / 9;
width: 100%;
}
blockquote {
border: 1px solid;
margin: 0;
padding-left: 1em;
background: #222;
}
em, strong {
font-style: normal;
color: white;
}
.overlay {
height: 100%;
width: 100%;
position: fixed;
z-index: 1;
left: 0;
overflow-x: hidden;
pointer-events: none;
}
.vignette {
background-image: radial-gradient(ellipse at center, rgba(0,0,0,0) 50%, rgba(0,0,0,0.25) 100%);
}
.scanline {
background-image: linear-gradient(0deg, rgba(0,0,0,0) 25%, rgba(0,0,0,0.33) 25%, rgba(0,0,0,0.33) 50%, rgba(0,0,0,0) 50%, rgba(0,0,0,0) 75%, rgba(0,0,0,0.33) 75%, rgba(0,0,0,0.33) 100%);
background-size: 4px 4px;
}

View file

@ -0,0 +1,62 @@
/* Syntax highlighting. */
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #60a0b0; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
.highlight .o { color: #666666 } /* Operator */
.highlight .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #007020 } /* Comment.Preproc */
.highlight .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.highlight .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
.highlight .go { color: #808080 } /* Generic.Output */
.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #0040D0 } /* Generic.Traceback */
.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #007020 } /* Keyword.Pseudo */
.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #902000 } /* Keyword.Type */
.highlight .m { color: #40a070 } /* Literal.Number */
.highlight .s { color: #4070a0 } /* Literal.String */
.highlight .na { color: #4070a0 } /* Name.Attribute */
.highlight .nb { color: #007020 } /* Name.Builtin */
.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.highlight .no { color: #60add5 } /* Name.Constant */
.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #007020 } /* Name.Exception */
.highlight .nf { color: #06287e } /* Name.Function */
.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #bb60d5 } /* Name.Variable */
.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #40a070 } /* Literal.Number.Float */
.highlight .mh { color: #40a070 } /* Literal.Number.Hex */
.highlight .mi { color: #40a070 } /* Literal.Number.Integer */
.highlight .mo { color: #40a070 } /* Literal.Number.Oct */
.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
.highlight .sc { color: #4070a0 } /* Literal.String.Char */
.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #4070a0 } /* Literal.String.Double */
.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.highlight .sx { color: #c65d09 } /* Literal.String.Other */
.highlight .sr { color: #235388 } /* Literal.String.Regex */
.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
.highlight .ss { color: #517918 } /* Literal.String.Symbol */
.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */

View file

@ -0,0 +1,137 @@
const randomColor = Math.floor(Math.random()*16777215).toString(16);
document.querySelector('#blog-title').firstElementChild.style.backgroundColor = '#' + randomColor;
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;
paras[i].setAttribute("offset", paras[i].getBoundingClientRect().bottom - image.height * 0.5);
}
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();