mirror of https://github.com/bearfm/site.git
cruh
This commit is contained in:
parent
b4e4c31868
commit
dd714b0d11
|
@ -22,7 +22,7 @@
|
|||
<header>
|
||||
<nav>
|
||||
<a href="/"><i class="material-icons">home</i> Home</a>
|
||||
<a href="/blog"><i class="material-icons">book</i>Blog</a>
|
||||
<a href="/blog/"><i class="material-icons">book</i>Blog</a>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="header-container">
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<header>
|
||||
<nav>
|
||||
<a href="/"><i class="material-icons">home</i> Home</a>
|
||||
<a href="/blog"><i class="material-icons">book</i>Blog</a>
|
||||
<a href="/blog/"><i class="material-icons">book</i>Blog</a>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="header-container">
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<header>
|
||||
<nav>
|
||||
<a href="/"><i class="material-icons">home</i> Home</a>
|
||||
<a href="/blog"><i class="material-icons">book</i>Blog</a>
|
||||
<a href="/blog/"><i class="material-icons">book</i>Blog</a>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="header-container">
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<header>
|
||||
<nav>
|
||||
<a href="/"><i class="material-icons">home</i> Home</a>
|
||||
<a href="/blog"><i class="material-icons">book</i>Blog</a>
|
||||
<a href="/blog/"><i class="material-icons">book</i>Blog</a>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="header-container">
|
||||
|
|
|
@ -23,7 +23,7 @@ bear.oops.wtf</title>
|
|||
<header>
|
||||
<nav>
|
||||
<a href="/"><i class="material-icons">home</i> Home</a>
|
||||
<a href="/blog"><i class="material-icons">book</i>Blog</a>
|
||||
<a href="/blog/"><i class="material-icons">book</i>Blog</a>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="header-container">
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta name="google-site-verification" content="bjvkxJW39IrGsgIIZidzUziC9B0c5Ej0ncQX2Btyv60" />
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<!-- <link rel="stylesheet" href="/css/style.css"> -->
|
||||
<script src="/css.js" type=""></script>
|
||||
<script src="/main.js" type=""></script>
|
||||
<title>Blog Index</title>
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
||||
<link rel="manifest" href="/site.webmanifest">
|
||||
|
||||
</head>
|
||||
|
||||
<!-- https://bear.oops.wtf/git/bearfm/site -->
|
||||
<!-- GPL-3.0-only or GPL-3.0-or-later -->
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<nav>
|
||||
<a href="/"><i class="material-icons">home</i> Home</a>
|
||||
<a href="/blog/"><i class="material-icons">book</i>Blog</a>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="header-container">
|
||||
<h1 class="title">BEAR.OOPS.WTF</h1>
|
||||
</div>
|
||||
<article class="article" id="article-body">
|
||||
<p class="meta">Page created: March 15, 2024</p>
|
||||
<p class="meta">Page last modified: March 15, 2024</p>
|
||||
<!--
|
||||
# Cool calculator
|
||||
Starting Height (m)
|
||||
<input type="text" id="start-height"></input>
|
||||
|
||||
Mass of Jumper (kg)
|
||||
<input type="text" id="jumper-mass"></input>
|
||||
|
||||
Length of Unstretched Elastic Cord (m)
|
||||
<input type="text" id="unstretched-length"></input>
|
||||
|
||||
Spring Constant (Newtons per meter)
|
||||
<input type="text" id="spring-constant"></input>
|
||||
|
||||
Height of Jumper (m)
|
||||
<input type="text" id="jumper-height"></input>
|
||||
|
||||
-->
|
||||
</article>
|
||||
</body>
|
||||
</html>
|
|
@ -22,7 +22,7 @@
|
|||
<header>
|
||||
<nav>
|
||||
<a href="/"><i class="material-icons">home</i> Home</a>
|
||||
<a href="/blog"><i class="material-icons">book</i>Blog</a>
|
||||
<a href="/blog/"><i class="material-icons">book</i>Blog</a>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="header-container">
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
(()=>{"use strict";var t={672:(t,n,e)=>{e.d(n,{q:()=>a});var r=function(t,n,e,r){return new(e||(e=Promise))((function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(u,c)}a((r=r.apply(t,n||[])).next())}))},o=function(t,n){var e,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(a){return function(c){if(e)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(u=0)),u;)try{if(e=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){u=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){u.label=c[1];break}if(6===c[0]&&u.label<o[1]){u.label=o[1],o=c;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(c);break}o[2]&&u.ops.pop(),u.trys.pop();continue}c=n.call(t,u)}catch(t){c=[6,t],r=0}finally{e=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}},i=function(){function t(){this.doneTypingInterval=1e3,this.cacheInputFields()}return t.prototype.cacheInputFields=function(){return r(this,void 0,void 0,(function(){var t,n=this;return o(this,(function(e){return t=document.querySelectorAll("input"),console.debug(t),t.forEach((function(t){t.addEventListener("input",(function(){clearTimeout(n.typingTimer),n.typingTimer=setTimeout((function(){console.debug("".concat(t.id,": ").concat(t.value)),localStorage.setItem(t.id,t.value)}),n.doneTypingInterval)}));var e=localStorage.getItem(t.id);null!==e&&(t.value=e)})),[2]}))}))},t.prototype.clearCache=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return document.querySelectorAll("input").forEach((function(t){localStorage.removeItem(t.id)})),[2]}))}))},t}(),u=function(t,n,e,r){return new(e||(e=Promise))((function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(u,c)}a((r=r.apply(t,n||[])).next())}))},c=function(t,n){var e,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(a){return function(c){if(e)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(u=0)),u;)try{if(e=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){u=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){u.label=c[1];break}if(6===c[0]&&u.label<o[1]){u.label=o[1],o=c;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(c);break}o[2]&&u.ops.pop(),u.trys.pop();continue}c=n.call(t,u)}catch(t){c=[6,t],r=0}finally{e=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}},a=function(){function t(t){this.state=t}return t.prototype.cache=function(){return u(this,void 0,void 0,(function(){return c(this,(function(t){return[2,new i]}))}))},t.prototype.run=function(){return u(this,void 0,void 0,(function(){var t;return c(this,(function(n){switch(n.label){case 0:return t=this,[4,this.cache()];case 1:return t.inputFieldCache=n.sent(),[2]}}))}))},t}()},108:(t,n,e)=>{var r=e(672);document.addEventListener("DOMContentLoaded",(function(){new r.q(document.getRootNode()).run()}))}},n={};function e(r){var o=n[r];if(void 0!==o)return o.exports;var i=n[r]={exports:{}};return t[r](i,i.exports,e),i.exports}e.d=(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),e(108),e(672)})();
|
|
@ -22,7 +22,7 @@
|
|||
<header>
|
||||
<nav>
|
||||
<a href="/"><i class="material-icons">home</i> Home</a>
|
||||
<a href="/blog"><i class="material-icons">book</i>Blog</a>
|
||||
<a href="/blog/"><i class="material-icons">book</i>Blog</a>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="header-container">
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<header>
|
||||
<nav>
|
||||
<a href="/"><i class="material-icons">home</i> Home</a>
|
||||
<a href="/blog"><i class="material-icons">book</i>Blog</a>
|
||||
<a href="/blog/"><i class="material-icons">book</i>Blog</a>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="header-container">
|
||||
|
@ -34,7 +34,7 @@
|
|||
<p>Hello, I’m Bear. I don’t have much to put here. I play some
|
||||
games (Tetris recently),</p>
|
||||
<p><a href="/coolLinks.html">Cool Links</a> <a
|
||||
href="/git">Git</a> <a href="/blog">Blog Posts</a></p>
|
||||
href="/git/">Git</a> <a href="/blog/">Blog Posts</a></p>
|
||||
</article>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -8,4 +8,5 @@
|
|||
<url><loc>https://bear.oops.wtf/git/index.html</loc></url>
|
||||
<url><loc>https://bear.oops.wtf/index.html</loc></url>
|
||||
<url><loc>https://bear.oops.wtf/snoop.html</loc></url>
|
||||
<url><loc>https://bear.oops.wtf/calc/elastic.html</loc></url>
|
||||
</urlset>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<header>
|
||||
<nav>
|
||||
<a href="/"><i class="material-icons">home</i> Home</a>
|
||||
<a href="/blog"><i class="material-icons">book</i>Blog</a>
|
||||
<a href="/blog/"><i class="material-icons">book</i>Blog</a>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="header-container">
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
export class InputFieldCache {
|
||||
private typingTimer: ReturnType<typeof setTimeout>;
|
||||
private doneTypingInterval: number = 1000;
|
||||
|
||||
constructor() {
|
||||
this.cacheInputFields();
|
||||
}
|
||||
|
||||
private async cacheInputFields() {
|
||||
const inputFields = document.querySelectorAll('input');
|
||||
console.debug(inputFields);
|
||||
inputFields.forEach((input: HTMLInputElement) => {
|
||||
input.addEventListener('input', () => {
|
||||
clearTimeout(this.typingTimer);
|
||||
this.typingTimer = setTimeout(() => {
|
||||
console.debug(`${input.id}: ${input.value}`);
|
||||
localStorage.setItem(input.id, input.value);
|
||||
}, this.doneTypingInterval);
|
||||
});
|
||||
|
||||
const cachedValue = localStorage.getItem(input.id);
|
||||
if (cachedValue !== null) {
|
||||
input.value = cachedValue;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async clearCache() {
|
||||
const inputFields = document.querySelectorAll('input');
|
||||
inputFields.forEach((input: HTMLInputElement) => {
|
||||
localStorage.removeItem(input.id);
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
import { InputFieldCache } from "../Cache";
|
||||
|
||||
export class App {
|
||||
private state: Node;
|
||||
private inputFieldCache: InputFieldCache;
|
||||
|
||||
constructor(state: Node) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
async cache(): Promise<InputFieldCache> {
|
||||
return new InputFieldCache();
|
||||
}
|
||||
|
||||
async run() {
|
||||
this.inputFieldCache = await this.cache();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
import { App } from "./App";
|
||||
|
||||
function __run() {
|
||||
const app = new App(document.getRootNode());
|
||||
app.run();
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", __run);
|
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
title: Blog Index
|
||||
author: BearFM
|
||||
date: March 15, 2024
|
||||
modified: March 15, 2024
|
||||
#header: <script src="/elastic.js"></script>
|
||||
header:
|
||||
---
|
||||
<!--
|
||||
# Cool calculator
|
||||
Starting Height (m)
|
||||
<input type="text" id="start-height"></input>
|
||||
|
||||
Mass of Jumper (kg)
|
||||
<input type="text" id="jumper-mass"></input>
|
||||
|
||||
Length of Unstretched Elastic Cord (m)
|
||||
<input type="text" id="unstretched-length"></input>
|
||||
|
||||
Spring Constant (Newtons per meter)
|
||||
<input type="text" id="spring-constant"></input>
|
||||
|
||||
Height of Jumper (m)
|
||||
<input type="text" id="jumper-height"></input>
|
||||
|
||||
-->
|
|
@ -10,5 +10,5 @@ Hello, I'm Bear. I don't have much to put here.
|
|||
I play some games (Tetris recently),
|
||||
|
||||
[Cool Links](/coolLinks.html)
|
||||
[Git](/git)
|
||||
[Blog Posts](/blog)
|
||||
[Git](/git/)
|
||||
[Blog Posts](/blog/)
|
|
@ -22,7 +22,7 @@
|
|||
<header>
|
||||
<nav>
|
||||
<a href="/"><i class="material-icons">home</i> Home</a>
|
||||
<a href="/blog"><i class="material-icons">book</i>Blog</a>
|
||||
<a href="/blog/"><i class="material-icons">book</i>Blog</a>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="header-container">
|
||||
|
|
|
@ -15,6 +15,7 @@ const config = {
|
|||
blogIndex: glob.sync("./js/blogIndex/**/*.ts").map(file => path.resolve(file)),
|
||||
css: glob.sync("./js/css/**/*.ts").map(file => path.resolve(file)).concat(["./src/scss/style.scss"]),
|
||||
main: glob.sync("./js/main/**/*.ts").map(file => path.resolve(file)),
|
||||
elastic: glob.sync("./js/calc/**/*.ts").map(file => path.resolve(file)),
|
||||
|
||||
},
|
||||
output: {
|
||||
|
|
Loading…
Reference in New Issue