Compare commits

..

3 Commits

Author SHA1 Message Date
bearfm 3098ec5442
aa 2024-03-24 14:33:07 -07:00
bearfm fb417029e0
Merge branch 'main' of github.com:bearfm/site
grup
2024-03-24 14:31:13 -07:00
bearfm dd714b0d11
cruh 2024-03-24 14:31:02 -07:00
19 changed files with 156 additions and 13 deletions

2
dist/404.html vendored
View File

@ -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">

2
dist/418.html vendored
View File

@ -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">

View File

@ -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">

View File

@ -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">

View File

@ -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">

54
dist/calc/elastic.html vendored Normal file
View File

@ -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>

2
dist/coolLinks.html vendored
View File

@ -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">

1
dist/elastic.js vendored Normal file
View File

@ -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)})();

2
dist/git/index.html vendored
View File

@ -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">

4
dist/index.html vendored
View File

@ -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, Im Bear. I dont 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>

1
dist/sitemap.xml vendored
View File

@ -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>

2
dist/snoop.html vendored
View File

@ -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
js/Cache.ts Normal file
View File

@ -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);
});
}
}

18
js/calc/App.ts Normal file
View File

@ -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();
}
}

8
js/calc/elastic.ts Normal file
View File

@ -0,0 +1,8 @@
import { App } from "./App";
function __run() {
const app = new App(document.getRootNode());
app.run();
}
document.addEventListener("DOMContentLoaded", __run);

26
src/calc/elastic.md Normal file
View File

@ -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>
-->

View File

@ -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/)

View File

@ -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">

View File

@ -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: {