Note
test
| {const ender_chars='⏃⏚☊⎅⟒⎎☌⊑⟟⟊☍⌰⋔⋏⍜⌿☌⍀⌇⏁⎍⎐⍙⌖⊬⋉'.split('');const eng_to_ender=Object.fromEntries('abcdefghijklmnopqrstuvwxyz'.split('').map((c,i)=>[c,ender_chars[i]]));const ender_to_eng=Object.fromEntries(Object.entries(eng_to_ender).map((x)=>x.reverse()));const to_ender=(c)=>eng_to_ender[c]??c;const to_eng=(c)=>ender_to_eng[c]??c;const translate=(str,fn)=>str.split('').map(fn).join('');function run(){const elements=document.querySelectorAll('[id^=message-content]:not([data-ender-parsed=true])',);for(const element of elements){element.innerHTML=element.innerHTML.replace(new RegExp(`[${ender_chars.join('')} ,.!?\\-;']+`,'gi'),(match)=>{return ender_chars.some((c)=>match.includes(c))?`<span title="${translate(match,to_eng)}">${ match }</span>`:match},);element.dataset.enderParsed='true'}}setInterval(run,1000);const template=`<form id="ender-translation-form"><input id="ender-translaion" name="text" required /><button type="submit">Translate</button></form>`;const element=document.createElement('div');element.in |
| export const actions = { | |
| first: async ({ request }) => { | |
| const data = Object.fromEntries(await request.formData()); | |
| console.log('first', data); | |
| return { | |
| data, | |
| step: 2 | |
| }; | |
| }, | |
| second: async ({ request }) => { |
| <script lang="ts"> | |
| import { faGripLines } from '@fortawesome/free-solid-svg-icons'; | |
| import Fa from 'svelte-fa'; | |
| type List = $$Generic<Array<any>>; | |
| export let list: List; | |
| let hovering: number | null = null; |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <script> | |
| document.write(`<pre>${JSON.stringify({ width: window.innerWidth, height: window.innerHeight }, null, 2)}</pre>`) |
Note
test
| { | |
| "compilerOptions": { | |
| "allowJs": true, | |
| "checkJs": true, | |
| "noEmit": true, | |
| "strict": true, | |
| "target": "es2022", | |
| "module": "node16", | |
| "moduleResolution": "node16", // or bundler depending | |
| "allowSyntheticDefaultImports": true |
| /** | |
| * A simple theme for reveal.js presentations, similar | |
| * to the default theme. The accent color is darkblue. | |
| * | |
| * This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed. | |
| * reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se | |
| */ | |
| @import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap"); | |
| section.has-dark-background, section.has-dark-background h1, section.has-dark-background h2, section.has-dark-background h3, section.has-dark-background h4, section.has-dark-background h5, section.has-dark-background h6 { | |
| color: #fff; |
| function flat<T extends any[], D extends number = 1>(array: T, depth?: D): FlatArray<T, D>[] { | |
| return typeof depth == 'undefined' || depth > 0 | |
| ? array.reduce((a, x) => a.concat(Array.isArray(x) ? flat(x, (depth ?? 1) - 1) : x), []) | |
| : array | |
| } |
| #!/bin/bash | |
| set -e | |
| echo Updating | |
| sudo apt update | |
| if ! command -v jq &> /dev/null; then | |
| echo Installing jq | |
| sudo apt-get install jq |