├── .gitignore ├── backup ├── thumb.png ├── img │ └── websites.png ├── vendor │ ├── new.css │ │ ├── 1.1.2 │ │ │ ├── .github │ │ │ │ └── FUNDING.yml │ │ │ ├── theme │ │ │ │ ├── night.css │ │ │ │ ├── boilerplate.css │ │ │ │ ├── terminal.css │ │ │ │ ├── night.html │ │ │ │ └── terminal.html │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── package.json │ │ │ ├── demo.html │ │ │ ├── README.md │ │ │ └── new.css │ │ ├── thumb.png │ │ ├── index.json │ │ └── 1.1.3 │ │ │ ├── theme │ │ │ ├── night.css │ │ │ ├── boilerplate.css │ │ │ ├── terminal.css │ │ │ ├── night.html │ │ │ └── terminal.html │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── package.json │ │ │ ├── demo.html │ │ │ ├── README.md │ │ │ └── new.css │ ├── pauls-ui-kit │ │ ├── thumb.png │ │ ├── index.json │ │ ├── buttons.js │ │ ├── blogposts.js │ │ ├── util.js │ │ ├── contact-info.js │ │ ├── links.js │ │ ├── microblog.js │ │ └── page-content.js │ └── delta-crdts │ │ └── index.json ├── index.json ├── api.js ├── components │ ├── bb-replicas.js │ └── bb-setup.js ├── index.html └── index.js ├── backup.sh ├── publish.sh ├── patch.sh ├── README.md ├── patches ├── bl.diff ├── msgpack5.diff ├── delta-crdts.diff ├── rollup-plugin-node-polyfills.diff └── delta-crdts-msgpack-codec.diff ├── snowpack.config.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | web_modules 3 | -------------------------------------------------------------------------------- /backup/thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimpick/blahbity-blog-crdt/HEAD/backup/thumb.png -------------------------------------------------------------------------------- /backup/img/websites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimpick/blahbity-blog-crdt/HEAD/backup/img/websites.png -------------------------------------------------------------------------------- /backup/vendor/new.css/1.1.2/.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: 3x 4 | -------------------------------------------------------------------------------- /backup.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | rm -rf backup 4 | cp -av ~/Hyperdrive/projects-jpmbp2/blahbity-blog-crdt-edition backup 5 | 6 | -------------------------------------------------------------------------------- /backup/vendor/new.css/thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimpick/blahbity-blog-crdt/HEAD/backup/vendor/new.css/thumb.png -------------------------------------------------------------------------------- /backup/vendor/pauls-ui-kit/thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimpick/blahbity-blog-crdt/HEAD/backup/vendor/pauls-ui-kit/thumb.png -------------------------------------------------------------------------------- /backup/vendor/delta-crdts/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "delta-crdts", 3 | "description": "Build of peer-base/js-delta-crdts for Beaker" 4 | } -------------------------------------------------------------------------------- /publish.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | DEST=~/Hyperdrive/projects-jpimac/delta-crdts 4 | rm -rf $DEST/web_modules 5 | cp -av web_modules $DEST 6 | -------------------------------------------------------------------------------- /patch.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | cd node_modules 4 | 5 | for patch in ../patches/*.diff; do 6 | echo $patch 7 | cat $patch | patch -p1 8 | done 9 | -------------------------------------------------------------------------------- /backup/vendor/new.css/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "new.css", 3 | "description": "A classless CSS framework to write modern websites using only HTML." 4 | } -------------------------------------------------------------------------------- /backup/vendor/pauls-ui-kit/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Paul's UI Kit", 3 | "description": "Web components for personal websites", 4 | "frontend": "" 5 | } -------------------------------------------------------------------------------- /backup/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Blahbity-blog", 3 | "description": "Microblog feed", 4 | "forkOf": "hyper://0e0d1685c3575cf1df94191e14b4ecf068c43bcefee787ffbbed3d1f4666cab4/" 5 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Beaker delta-crdts 2 | 3 | This primary replica is on jpimac 4 | 5 | ``` 6 | rm -rf node_modules 7 | yarn 8 | npm run patch 9 | npm run publish 10 | 11 | ``` 12 | 13 | # License 14 | 15 | MIT 16 | -------------------------------------------------------------------------------- /backup/vendor/new.css/1.1.2/theme/night.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --nc-tx-1: #ffffff; 3 | --nc-tx-2: #eeeeee; 4 | --nc-bg-1: #000000; 5 | --nc-bg-2: #111111; 6 | --nc-bg-3: #222222; 7 | --nc-lk-1: #3291FF; 8 | --nc-lk-2: #0070F3; 9 | --nc-lk-tx: #FFFFFF; 10 | --nc-ac-1: #7928CA; 11 | --nc-ac-tx: #FFFFFF; 12 | } -------------------------------------------------------------------------------- /backup/vendor/new.css/1.1.3/theme/night.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --nc-tx-1: #ffffff; 3 | --nc-tx-2: #eeeeee; 4 | --nc-bg-1: #000000; 5 | --nc-bg-2: #111111; 6 | --nc-bg-3: #222222; 7 | --nc-lk-1: #3291FF; 8 | --nc-lk-2: #0070F3; 9 | --nc-lk-tx: #FFFFFF; 10 | --nc-ac-1: #7928CA; 11 | --nc-ac-tx: #FFFFFF; 12 | } -------------------------------------------------------------------------------- /backup/vendor/pauls-ui-kit/buttons.js: -------------------------------------------------------------------------------- 1 | customElements.define('pfrazee-add-contact-button', class extends HTMLButtonElement { 2 | connectedCallback () { 3 | this.textContent = 'Add to Address Book' 4 | this.addEventListener('click', e => { 5 | beaker.contacts.requestAddContact(location.hostname) 6 | }) 7 | } 8 | }, {extends: 'button'}) -------------------------------------------------------------------------------- /backup/vendor/new.css/1.1.2/theme/boilerplate.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --nc-font-sans: sans-serif; 3 | --nc-font-mono: monospace; 4 | --nc-tx-1: #000000; 5 | --nc-tx-2: #1A1A1A; 6 | --nc-bg-1: #FFFFFF; 7 | --nc-bg-2: #F6F8FA; 8 | --nc-bg-3: #E5E7EB; 9 | --nc-lk-1: #0070F3; 10 | --nc-lk-2: #0366D6; 11 | --nc-lk-tx: #FFFFFF; 12 | --nc-ac-1: #79FFE1; 13 | --nc-ac-tx: #000000; 14 | } -------------------------------------------------------------------------------- /backup/vendor/new.css/1.1.3/theme/boilerplate.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --nc-font-sans: sans-serif; 3 | --nc-font-mono: monospace; 4 | --nc-tx-1: #000000; 5 | --nc-tx-2: #1A1A1A; 6 | --nc-bg-1: #FFFFFF; 7 | --nc-bg-2: #F6F8FA; 8 | --nc-bg-3: #E5E7EB; 9 | --nc-lk-1: #0070F3; 10 | --nc-lk-2: #0366D6; 11 | --nc-lk-tx: #FFFFFF; 12 | --nc-ac-1: #79FFE1; 13 | --nc-ac-tx: #000000; 14 | } -------------------------------------------------------------------------------- /patches/bl.diff: -------------------------------------------------------------------------------- 1 | --- node_modules/bl/bl.js 2019-02-04 19:39:45.000000000 -0800 2 | +++ node_modules.save/bl/bl.js 2020-05-25 14:28:49.000000000 -0700 3 | @@ -1,5 +1,5 @@ 4 | 'use strict' 5 | -var DuplexStream = require('readable-stream').Duplex 6 | +var DuplexStream = require('_stream_duplex') 7 | , util = require('util') 8 | , Buffer = require('safe-buffer').Buffer 9 | 10 | -------------------------------------------------------------------------------- /patches/msgpack5.diff: -------------------------------------------------------------------------------- 1 | --- node_modules/msgpack5/lib/streams.js 2018-11-30 04:56:18.000000000 -0800 2 | +++ node_modules.save/msgpack5/lib/streams.js 2020-05-25 14:28:13.000000000 -0700 3 | @@ -1,6 +1,7 @@ 4 | 'use strict' 5 | 6 | -var Transform = require('readable-stream').Transform 7 | +// var Transform = require('readable-stream').Transform 8 | +var Transform = require('_stream_transform') 9 | var inherits = require('inherits') 10 | var bl = require('bl') 11 | 12 | -------------------------------------------------------------------------------- /backup/vendor/new.css/1.1.2/theme/terminal.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.xz.style/serve/fira-code.css"); 2 | 3 | :root { 4 | --nc-font-sans: 'Fira Code', monospace; 5 | --nc-font-mono: 'Fira Code', monospace; 6 | --nc-tx-1: #FFFFFF; 7 | --nc-tx-2: #EEEEEE; 8 | --nc-bg-1: #000000; 9 | --nc-bg-2: #002700; 10 | --nc-bg-3: #005800; 11 | --nc-lk-1: #00FF00; 12 | --nc-lk-2: #00c200; 13 | --nc-lk-tx: #000000; 14 | --nc-ac-1: #00FF00; 15 | --nc-ac-tx: #000000; 16 | } -------------------------------------------------------------------------------- /backup/vendor/new.css/1.1.3/theme/terminal.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.xz.style/serve/fira-code.css"); 2 | 3 | :root { 4 | --nc-font-sans: 'Fira Code', monospace; 5 | --nc-font-mono: 'Fira Code', monospace; 6 | --nc-tx-1: #FFFFFF; 7 | --nc-tx-2: #EEEEEE; 8 | --nc-bg-1: #000000; 9 | --nc-bg-2: #002700; 10 | --nc-bg-3: #005800; 11 | --nc-lk-1: #00FF00; 12 | --nc-lk-2: #00c200; 13 | --nc-lk-tx: #000000; 14 | --nc-ac-1: #00FF00; 15 | --nc-ac-tx: #000000; 16 | } -------------------------------------------------------------------------------- /snowpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | webDependencies: [ 3 | "delta-crdts-msgpack-codec", 4 | "delta-crdts", 5 | "text-diff", 6 | "buffer-es6" 7 | ], 8 | rollup: { 9 | plugins: [ 10 | require('@rollup/plugin-replace')({ 11 | values: { 12 | 'readable-stream/transform': '_stream_transform', 13 | 'readable-stream/duplex': '_stream_duplex' 14 | } 15 | }), 16 | require('rollup-plugin-node-polyfills')() 17 | ] 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /patches/delta-crdts.diff: -------------------------------------------------------------------------------- 1 | diff -urN node_modules/delta-crdts.save/src/index.js node_modules/delta-crdts/src/index.js 2 | --- node_modules/delta-crdts.save/src/index.js 2020-05-29 23:10:24.000000000 -0700 3 | +++ node_modules/delta-crdts/src/index.js 2020-05-29 23:09:30.000000000 -0700 4 | @@ -21,7 +21,7 @@ 5 | rwlwwset: require('./rwlwwset'), 6 | lwwreg: require('./lwwreg'), 7 | rga: require('./rga'), 8 | - ormap: require('./ormap') 9 | + // ormap: require('./ormap') 10 | } 11 | 12 | module.exports.type = (typeName) => { 13 | -------------------------------------------------------------------------------- /patches/rollup-plugin-node-polyfills.diff: -------------------------------------------------------------------------------- 1 | diff -urN node_modules/rollup-plugin-node-polyfills.save/polyfills/buffer-es6.js node_modules/rollup-plugin-node-polyfills/polyfills/buffer-es6.js 2 | --- node_modules/rollup-plugin-node-polyfills.save/polyfills/buffer-es6.js 2020-05-24 17:52:00.000000000 -0700 3 | +++ node_modules/rollup-plugin-node-polyfills/polyfills/buffer-es6.js 2020-05-31 19:51:03.000000000 -0700 4 | @@ -567,9 +567,11 @@ 5 | var pos = 0; 6 | for (i = 0; i < list.length; ++i) { 7 | var buf = list[i]; 8 | + /* 9 | if (!internalIsBuffer(buf)) { 10 | throw new TypeError('"list" argument must be an Array of Buffers') 11 | } 12 | + */ 13 | buf.copy(buffer, pos); 14 | pos += buf.length; 15 | } 16 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "beaker-delta-crdts", 3 | "version": "0.0.1", 4 | "description": "Beaker + Delta CRDTs?", 5 | "main": "index.js", 6 | "scripts": { 7 | "patch": "./patch.sh", 8 | "publish": "rm -rf web_modules && snowpack && ./publish.sh" 9 | }, 10 | "dependencies": { 11 | "buffer-es6": "^4.9.3", 12 | "delta-crdts": "^0.10.3", 13 | "delta-crdts-msgpack-codec": "^0.2.0", 14 | "rollup-plugin-re": "^1.0.7", 15 | "text-diff": "^1.0.1" 16 | }, 17 | "keywords": [], 18 | "author": "Jim Pick (@jimpick)", 19 | "license": "MIT/Apache-2 (Permissive License Stack)", 20 | "devDependencies": { 21 | "@rollup/plugin-replace": "^2.3.2", 22 | "rollup-plugin-node-polyfills": "^0.2.1", 23 | "snowpack": "^1.7.1" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /backup/vendor/new.css/1.1.2/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Thanks for helping build new.css! When contributing, here are the general guidelines to follow. 2 | 3 | - Update the primary file `new.css` first. I like to comment inline how/why any changes are made, so please try to add a comment about what the change does and why it's helpful. 4 | - To make `lite.css`, remove the font-face `@import` in the beginning. 5 | 6 | And you're ready to submit! I'll publish a new version to npm when a numerical release seems needed, such as `1.0.2`. 7 | 8 | jsDelivr generates minified versions such as `new.min.css` automatically. 9 | 10 | Basic guide for release numbers- 11 | 12 | **X.Y.Z** 13 | - X updates when an older version introduces components that conflict with older ones, or something else is changed that will break compatibility with older elements/themes 14 | - Y updates when new features or styles are added 15 | - Z updates when there's a bug fix or very minor update, such as a typo -------------------------------------------------------------------------------- /backup/vendor/new.css/1.1.3/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Thanks for helping build new.css! When contributing, here are the general guidelines to follow. 2 | 3 | - Update the primary file `new.css` first. I like to comment inline how/why any changes are made, so please try to add a comment about what the change does and why it's helpful. 4 | - To make `lite.css`, remove the font-face `@import` in the beginning. 5 | 6 | And you're ready to submit! I'll publish a new version to npm when a numerical release seems needed, such as `1.0.2`. 7 | 8 | jsDelivr generates minified versions such as `new.min.css` automatically. 9 | 10 | Basic guide for release numbers- 11 | 12 | **X.Y.Z** 13 | - X updates when an older version introduces components that conflict with older ones, or something else is changed that will break compatibility with older elements/themes 14 | - Y updates when new features or styles are added 15 | - Z updates when there's a bug fix or very minor update, such as a typo -------------------------------------------------------------------------------- /backup/vendor/pauls-ui-kit/blogposts.js: -------------------------------------------------------------------------------- 1 | import { h } from './util.js' 2 | 3 | const dateFmt = new Intl.DateTimeFormat('default') 4 | 5 | class PfrazeeBlogposts extends HTMLElement { 6 | async connectedCallback () { 7 | var path = this.getAttribute('path') || '/blog' 8 | path = path.endsWith('/') ? (path + '*.md') : (path + '/*.md') 9 | 10 | try { 11 | var posts = await beaker.hyperdrive.query({path, sort: 'ctime', reverse: true}) 12 | } catch (e) { 13 | console.debug(`Failed to query ${path}`) 14 | return 15 | } 16 | 17 | this.render(posts) 18 | } 19 | 20 | render (posts) { 21 | var ul = h('ul') 22 | for (let post of posts) { 23 | let title = post.stat.metadata.title || post.path.split('/').pop() 24 | ul.append(h('li', 25 | h('a', {href: post.url, title}, title), 26 | this.hasAttribute('include-dates') ? h('small', ` ${dateFmt.format(post.stat.ctime)}`) : '' 27 | )) 28 | } 29 | this.append(ul) 30 | } 31 | } 32 | customElements.define('pfrazee-blogposts', PfrazeeBlogposts) 33 | -------------------------------------------------------------------------------- /backup/vendor/new.css/1.1.2/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Example (https://github.com/3x) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /backup/vendor/new.css/1.1.3/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Example (https://github.com/3x) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /backup/vendor/pauls-ui-kit/util.js: -------------------------------------------------------------------------------- 1 | 2 | export function h (tag, attrs, ...children) { 3 | var el = document.createElement(tag) 4 | if (isPlainObject(attrs)) { 5 | for (let k in attrs) { 6 | if (typeof attrs[k] === 'function') el.addEventListener(k, attrs[k]) 7 | else el.setAttribute(k, attrs[k]) 8 | } 9 | } else if (attrs) { 10 | children = [attrs].concat(children) 11 | } 12 | for (let child of children) el.append(child) 13 | return el 14 | } 15 | 16 | export function executeJs (container) { 17 | const scripts = container.getElementsByTagName('script') 18 | const scriptsInitialLength = scripts.length 19 | for (let i = 0; i < scriptsInitialLength; i++) { 20 | const script = scripts[i] 21 | const scriptCopy = document.createElement('script') 22 | scriptCopy.type = script.type ? script.type : 'text/javascript' 23 | if (script.innerHTML) { 24 | scriptCopy.innerHTML = script.innerHTML 25 | } else if (script.src) { 26 | scriptCopy.src = script.src 27 | } 28 | scriptCopy.async = false 29 | script.parentNode.replaceChild(scriptCopy, script) 30 | } 31 | } 32 | 33 | function isPlainObject (v) { 34 | return v && typeof v === 'object' && Object.prototype === v.__proto__ 35 | } -------------------------------------------------------------------------------- /backup/vendor/pauls-ui-kit/contact-info.js: -------------------------------------------------------------------------------- 1 | import { h } from './util.js' 2 | 3 | const PATH = '/profile.json' 4 | 5 | customElements.define('pfrazee-contact-info', class extends HTMLElement { 6 | async connectedCallback () { 7 | try { var file = await beaker.hyperdrive.readFile(PATH) } 8 | catch (e) { 9 | console.debug(`No ${PATH} found`) 10 | return 11 | } 12 | try { var json = JSON.parse(file) } catch (e) { 13 | console.error(`Failed to parse ${PATH}`) 14 | console.error(e) 15 | return 16 | } 17 | 18 | if (json.addresses && Array.isArray(json.addresses)) { 19 | let tableEl = h('table') 20 | for (let address of json.addresses) { 21 | if (address.type === 'email') { 22 | tableEl.append(h('tr', 23 | h('td', 'Email'), 24 | h('td', h('a', {href: `mailto:${address.address}`}, address.address)) 25 | )) 26 | } else if (address.type === 'profile') { 27 | tableEl.append(h('tr', 28 | h('td', address.service), 29 | h('td', h('a', {href: address.address}, strippedUrl(address.address))) 30 | )) 31 | } 32 | } 33 | this.append(tableEl) 34 | } 35 | } 36 | }) 37 | 38 | function strippedUrl (v) { 39 | try { 40 | let url = new URL(v) 41 | return url.hostname + url.pathname 42 | } catch (e) { 43 | return v 44 | } 45 | } -------------------------------------------------------------------------------- /backup/vendor/new.css/1.1.3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "@exampledev/new.css", 3 | "_id": "@exampledev/new.css@1.1.3", 4 | "_inBundle": false, 5 | "_integrity": "sha512-qhbGfqBRwUlM6MCSaJdUfjq86opNCMvM+6kVvs6S0kYhy0V8dKbe4rDMIklEJGuMc5QH5OuPjdCReu9I0tim2w==", 6 | "_location": "/@exampledev/new.css", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "tag", 10 | "registry": true, 11 | "raw": "@exampledev/new.css", 12 | "name": "@exampledev/new.css", 13 | "escapedName": "@exampledev%2fnew.css", 14 | "scope": "@exampledev", 15 | "rawSpec": "", 16 | "saveSpec": null, 17 | "fetchSpec": "latest" 18 | }, 19 | "_requiredBy": [ 20 | "#USER", 21 | "/" 22 | ], 23 | "_resolved": "https://registry.npmjs.org/@exampledev/new.css/-/new.css-1.1.3.tgz", 24 | "_shasum": "fcc1f15629db8cd105ad2e8c649095ca10623007", 25 | "_spec": "@exampledev/new.css", 26 | "_where": "/Volumes/Untitled/tmp/new.css", 27 | "author": { 28 | "name": "Example" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/xz/new.css/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "deprecated": false, 35 | "description": "A classless CSS framework to write modern websites using only HTML.", 36 | "homepage": "https://newcss.net", 37 | "license": "MIT", 38 | "main": "new.css", 39 | "name": "@exampledev/new.css", 40 | "repository": { 41 | "type": "git", 42 | "url": "git+https://github.com/xz/new.css.git" 43 | }, 44 | "version": "1.1.3" 45 | } 46 | -------------------------------------------------------------------------------- /backup/vendor/new.css/1.1.2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "@exampledev/new.css@1.1.2", 3 | "_id": "@exampledev/new.css@1.1.2", 4 | "_inBundle": false, 5 | "_integrity": "sha512-C+/9qjeHC/ZTI8EQ6U65aCAqz1+ZLdOWFDCGyN6CptHnHQHRRFu79OZYKTXcyl3Ru1Fu8DE7nS22Uz/cVUvbqQ==", 6 | "_location": "/@exampledev/new.css", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "version", 10 | "registry": true, 11 | "raw": "@exampledev/new.css@1.1.2", 12 | "name": "@exampledev/new.css", 13 | "escapedName": "@exampledev%2fnew.css", 14 | "scope": "@exampledev", 15 | "rawSpec": "1.1.2", 16 | "saveSpec": null, 17 | "fetchSpec": "1.1.2" 18 | }, 19 | "_requiredBy": [ 20 | "#USER", 21 | "/" 22 | ], 23 | "_resolved": "https://registry.npmjs.org/@exampledev/new.css/-/new.css-1.1.2.tgz", 24 | "_shasum": "ca32d0f6141bb85dd3ec762e952966e546eb03e9", 25 | "_spec": "@exampledev/new.css@1.1.2", 26 | "_where": "/Volumes/Untitled/tmp/new.css", 27 | "author": { 28 | "name": "Example" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/xz/new.css/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "deprecated": false, 35 | "description": "A classless CSS framework to write modern websites using only HTML.", 36 | "homepage": "https://newcss.net", 37 | "license": "MIT", 38 | "main": "new.css", 39 | "name": "@exampledev/new.css", 40 | "repository": { 41 | "type": "git", 42 | "url": "git+https://github.com/xz/new.css.git" 43 | }, 44 | "version": "1.1.2" 45 | } 46 | -------------------------------------------------------------------------------- /patches/delta-crdts-msgpack-codec.diff: -------------------------------------------------------------------------------- 1 | diff -urN node_modules.save/delta-crdts-msgpack-codec/package.json node_modules/delta-crdts-msgpack-codec/package.json 2 | --- node_modules.save/delta-crdts-msgpack-codec/package.json 2018-11-30 04:56:17.000000000 -0800 3 | +++ node_modules/delta-crdts-msgpack-codec/package.json 2020-05-29 23:12:15.000000000 -0700 4 | @@ -3,6 +3,7 @@ 5 | "version": "0.2.0", 6 | "description": "Msgpack codec for delta-crdts", 7 | "main": "src/index.js", 8 | + "module": "src/index.js", 9 | "scripts": { 10 | "test": "mocha", 11 | "lint": "standard" 12 | diff -urN node_modules.save/delta-crdts-msgpack-codec/src/index.js node_modules/delta-crdts-msgpack-codec/src/index.js 13 | --- node_modules.save/delta-crdts-msgpack-codec/src/index.js 2018-11-30 04:56:17.000000000 -0800 14 | +++ node_modules/delta-crdts-msgpack-codec/src/index.js 2020-05-29 23:17:45.000000000 -0700 15 | @@ -1,6 +1,9 @@ 16 | 'use strict' 17 | 18 | -const msgpack = require('msgpack5')() 19 | +import msgpack5 from 'msgpack5' 20 | + 21 | +const msgpack = msgpack5() 22 | + 23 | msgpack.register(0x40, Map, encodeMap, decodeMap) 24 | msgpack.register(0x41, Set, encodeSet, decodeSet) 25 | 26 | @@ -26,10 +29,16 @@ 27 | return new Set(msgpack.decode(buf)) 28 | } 29 | 30 | -exports.encode = function encode (value) { 31 | +export function encode (value) { 32 | return msgpack.encode(value) 33 | } 34 | 35 | -exports.decode = function encode (value) { 36 | +export function decode (value) { 37 | return msgpack.decode(value) 38 | } 39 | + 40 | +export default { 41 | + encode, 42 | + decode 43 | +} 44 | + 45 | -------------------------------------------------------------------------------- /backup/vendor/pauls-ui-kit/links.js: -------------------------------------------------------------------------------- 1 | import { h } from './util.js' 2 | 3 | class PfrazeeLinks extends HTMLElement { 4 | async connectedCallback () { 5 | var path = this.getAttribute('path') 6 | path = path.endsWith('/') ? (path + '*.goto') : (path + '/*.goto') 7 | 8 | try { 9 | var gotos = await beaker.hyperdrive.query({path, sort: 'name'}) 10 | } catch (e) { 11 | console.debug(`Failed to query ${path}`) 12 | return 13 | } 14 | 15 | this.render(gotos) 16 | } 17 | 18 | render (gotos) { 19 | var ul = h('ul') 20 | for (let goto of gotos) { 21 | let title = goto.stat.metadata.title || goto.path.split('/').pop() 22 | ul.append(h('li', 23 | h('a', {href: goto.stat.metadata.href, title}, title), 24 | this.hasAttribute('include-description') ? ` ${goto.stat.metadata.description || ''}` : '' 25 | )) 26 | } 27 | this.append(ul) 28 | } 29 | } 30 | customElements.define('pfrazee-links', PfrazeeLinks) 31 | 32 | customElements.define('pfrazee-links-table', class extends PfrazeeLinks { 33 | render (gotos) { 34 | var table = h('table') 35 | for (let goto of gotos) { 36 | let title = goto.stat.metadata.title || goto.path.split('/').pop() 37 | table.append(h('tr', 38 | h('td', goto.stat.metadata.description || ''), 39 | h('td', h('a', {href: goto.stat.metadata.href, title}, title)) 40 | )) 41 | } 42 | this.append(table) 43 | } 44 | }) 45 | 46 | customElements.define('pfrazee-links-detailed', class extends PfrazeeLinks { 47 | render (gotos) { 48 | for (let goto of gotos) { 49 | let title = goto.stat.metadata.title || goto.path.split('/').pop() 50 | this.append(h('div', {class: 'item'}, 51 | h('p', {class: 'title'}, h('a', {href: goto.stat.metadata.href, title}, title)), 52 | h('p', {class: 'description'}, goto.stat.metadata.description || '') 53 | )) 54 | } 55 | } 56 | }) -------------------------------------------------------------------------------- /backup/vendor/pauls-ui-kit/microblog.js: -------------------------------------------------------------------------------- 1 | import { h } from './util.js' 2 | 3 | const IFRAME_CSP = `default-src 'self' 'unsafe-inline';` 4 | const IFRAME_SANDBOX = `allow-forms allow-scripts allow-popups allow-popups-to-escape-sandbox` 5 | 6 | const PATH = '/microblog/' 7 | 8 | customElements.define('pfrazee-microblog', class extends HTMLElement { 9 | async connectedCallback () { 10 | try { 11 | var files = await beaker.hyperdrive.query({ 12 | path: PATH + '*', 13 | sort: 'ctime', 14 | reverse: true, 15 | limit: this.hasAttribute('limit') ? Number(this.getAttribute('limit')) : 100 16 | }) 17 | } catch (e) { 18 | console.debug(`Unable to query ${PATH}`) 19 | return 20 | } 21 | 22 | for (let file of files) { 23 | let filename = file.path.split('/').pop() 24 | let day = niceDate(file.stat.ctime) 25 | this.append(h('div', {class: 'meta'}, 26 | h('a', {href: file.path, title: filename}, filename), 27 | ' ', 28 | day 29 | )) 30 | 31 | let content 32 | try { 33 | if (/\.(png|jpe?g|gif|svg)$/i.test(file.path)) { 34 | content = h('p', h('img', {src: file.path})) 35 | } else if (/\.(mp4|webm|mov)/i.test(file.path)) { 36 | content = h('p', h('video', {controls: true}, h('source', {src: file.path}))) 37 | } else if (/\.(mp3|ogg)/i.test(file.path)) { 38 | content = h('p', h('audio', {controls: true}, h('source', {src: file.path}))) 39 | } else if (/\.goto?$/i.test(file.path)) { 40 | let title = file.stat.metadata.title || filename 41 | content = h('p', h('a', {href: file.stat.metadata.href, title}, title)) 42 | } else if (/\.html?$/i.test(file.path)) { 43 | content = h('iframe', { 44 | class: 'content', 45 | csp: IFRAME_CSP, 46 | sandbox: IFRAME_SANDBOX, 47 | src: file.url, 48 | width: '100%' 49 | }) 50 | } else { 51 | let txt = await beaker.hyperdrive.readFile(file.url) 52 | if (/\.md$/i.test(file.path)) { 53 | content = h('div', {class: 'content'}) 54 | content.innerHTML = beaker.markdown.toHTML(txt) 55 | } else { 56 | content = h('div', {class: 'content'}, h('pre', txt)) 57 | } 58 | } 59 | } catch (e) { 60 | console.error('Failed to read', file.path) 61 | console.error(e) 62 | continue 63 | } 64 | 65 | this.append(h('div', {class: 'content'}, content)) 66 | } 67 | } 68 | }) 69 | 70 | var today = (new Date()).toLocaleDateString() 71 | var yesterday = (new Date(Date.now() - 8.64e7)).toLocaleDateString() 72 | function niceDate (ts) { 73 | var date = (new Date(ts)).toLocaleDateString() 74 | if (date === today) return 'Today' 75 | if (date === yesterday) return 'Yesterday' 76 | return date 77 | } -------------------------------------------------------------------------------- /backup/api.js: -------------------------------------------------------------------------------- 1 | var profile = undefined 2 | try { profile = JSON.parse(localStorage.profile) } 3 | catch (e) { console.debug(e) } 4 | 5 | export async function loadFeedFromCache (progressCb = () => {}) { 6 | try { 7 | if (localStorage.cachedFeed) { 8 | console.debug('Using cached feed') 9 | return JSON.parse(localStorage.cachedFeed) 10 | } 11 | } catch (e) { 12 | console.log('Failed to load cached feed, running query', e) 13 | } 14 | return loadFeed(progressCb) 15 | } 16 | 17 | export async function loadFeed (progressCb = () => {}) { 18 | var contacts = await getContacts() 19 | if (contacts.length === 0) return [] 20 | 21 | var numLoaded = 0 22 | var numToLoad = contacts.length 23 | progressCb({label: 'Querying...', progress: 0}) 24 | 25 | var feedsFiles = await Promise.all(contacts.map(async contact => { 26 | let files = await beaker.hyperdrive.query({ 27 | path: '/microblog/*', 28 | drive: contact.url, 29 | sort: 'ctime', 30 | reverse: true, 31 | limit: 200, 32 | timeout: 15e3 33 | }).catch(e => ([])) 34 | progressCb({label: 'Querying...', progress: (++numLoaded) / numToLoad}) 35 | return files 36 | })) 37 | 38 | var files = feedsFiles.flat() 39 | files.sort((a, b) => b.stat.ctime - a.stat.ctime) 40 | return files.slice(0, 200).map(file => ({ 41 | author: contacts.find(c => c.url === file.drive), 42 | url: file.url, 43 | filename: file.url.split('/').filter(Boolean).pop(), 44 | ctime: file.stat.ctime, 45 | metadata: file.stat.metadata, 46 | content: undefined 47 | })) 48 | } 49 | 50 | export async function loadPost (post) { 51 | try { 52 | if (/\.(png|jpe?g|gif|svg)$/i.test(post.url)) { 53 | post.content = {img: post.url} 54 | } else if (/\.(mp4|webm|mov)/i.test(post.url)) { 55 | post.content = {video: post.url} 56 | } else if (/\.(mp3|ogg)/i.test(post.url)) { 57 | post.content = {audio: post.url} 58 | } else if (/\.goto$/i.test(post.url)) { 59 | if (!post.metadata) { 60 | const stat = await beaker.hyperdrive.stat(post.url) 61 | post.metadata = stat.metadata 62 | } 63 | post.content = { 64 | link: { 65 | href: post.metadata?.href, 66 | title: post.metadata?.title 67 | } 68 | } 69 | } else { 70 | let txt = await beaker.hyperdrive.readFile(post.url) 71 | if (/\.html?$/i.test(post.url)) { 72 | post.content = {iframe: post.url} 73 | } else if (/\.md$/i.test(post.url)) { 74 | post.content = {html: beaker.markdown.toHTML(txt)} 75 | } else { 76 | post.content = {txt} 77 | } 78 | } 79 | } catch (e) { 80 | console.error('Failed to read', post.url) 81 | console.error(e) 82 | } 83 | } 84 | 85 | async function getContacts () { 86 | var contacts = await beaker.contacts.list() 87 | if (profile && !contacts.find(c => c.url === profile.url)) { 88 | contacts.push(profile) 89 | } 90 | return contacts 91 | } 92 | -------------------------------------------------------------------------------- /backup/components/bb-replicas.js: -------------------------------------------------------------------------------- 1 | import { h } from '../vendor/pauls-ui-kit/util.js' 2 | 3 | var profile 4 | try { 5 | profile = JSON.parse(localStorage.profile) 6 | } catch (e) { 7 | console.debug(e) 8 | } 9 | 10 | export default class extends HTMLElement { 11 | constructor () { 12 | super() 13 | } 14 | 15 | async connectedCallback () { 16 | if (!profile) return 17 | this.profileDrive = await beaker.hyperdrive.drive(profile) 18 | this.replicas = [] 19 | this.replicaNicknames = {} 20 | this.replicaElements = [] 21 | let loadReplicas = false 22 | try { 23 | const stat = await this.profileDrive.stat('replicas.json') 24 | loadReplicas = true 25 | } catch (e) { 26 | console.log('Stat replicas.json error', e) 27 | // Ignore if file doesn't exist yet 28 | } 29 | if (loadReplicas) { 30 | this.replicas = await this.profileDrive.readFile('replicas.json', 'json') 31 | for (const replicaUrl of this.replicas) { 32 | // FIXME: Error in UI if this doesn't work 33 | const replicaDrive = await beaker.hyperdrive.drive(replicaUrl) 34 | const { nickname } = await replicaDrive.readFile( 35 | 'remote-replica.json', 36 | 'json' 37 | ) 38 | this.replicaNicknames[replicaUrl] = nickname 39 | this.replicaElements.push(h('div', nickname)) 40 | } 41 | } 42 | this.append( 43 | h( 44 | 'div', 45 | { style: 'display: flex', class: 'replicas' }, 46 | 'Replicas:', 47 | h.apply(null, ['div', ...this.replicaElements]), 48 | h('button', { click: this.onClickAddReplica.bind(this) }, '+') 49 | ) 50 | ) 51 | } 52 | 53 | async onClickAddReplica (evt) { 54 | evt.preventDefault() 55 | this.renderAddReplicaForm() 56 | } 57 | 58 | renderAddReplicaForm () { 59 | this.append( 60 | h( 61 | 'p', 62 | 'URL of replica from other machine', 63 | h( 64 | 'form', 65 | { submit: this.onSubmitReplicaUrl.bind(this) }, 66 | h( 67 | 'p', 68 | h('input', { 69 | id: 'replicaUrl', 70 | type: 'text', 71 | placeholder: 'hyper://...', 72 | style: 'width: 100%', 73 | input: this.onInputReplicaUrl.bind(this) 74 | }), 75 | h('button', { type: 'submit', disabled: true }, 'Submit') 76 | ) 77 | ) 78 | ) 79 | ) 80 | } 81 | 82 | onInputReplicaUrl (e) { 83 | this.querySelector( 84 | 'button[type="submit"]' 85 | ).disabled = !e.target.value.match(/^hyper:\/\/[0-9a-fA-F]{64}\/?$/) 86 | } 87 | 88 | async onSubmitReplicaUrl (e) { 89 | e.preventDefault() 90 | const replicaUrl = this.querySelector('#replicaUrl').value 91 | console.log('Submit', replicaUrl) 92 | try { 93 | const replicaDrive = await beaker.hyperdrive.drive(replicaUrl) 94 | console.log('Jim replicaDrive', replicaDrive) 95 | const remoteReplica = await replicaDrive.readFile( 96 | 'remote-replica.json', 97 | 'json' 98 | ) 99 | console.log('Jim remote-replica.json', remoteReplica) 100 | if (remoteReplica.primaryProfile !== profile.url) { 101 | console.error( 102 | 'Remote replica is following different profile', 103 | remoteReplica.primaryProfile, 104 | '!==', 105 | profile.url 106 | ) 107 | throw new Error('Wrong profile') 108 | // FIXME - show error in UI 109 | } 110 | this.replicas.push(replicaUrl) 111 | console.log('New replicas', this.replicas) 112 | await this.profileDrive.writeFile( 113 | 'replicas.json', 114 | JSON.stringify(this.replicas) 115 | ) 116 | location.reload() 117 | } catch (e) { 118 | // FIXME - show error in UI 119 | console.error('Error loading replica drive', replicaUrl) 120 | throw e 121 | } 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /backup/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |Microblogging feed app (CRDT edition)
169 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
18 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
20 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
22 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
24 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
26 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
28 | 29 |
34 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Aut harum
35 | molestias labore amet
36 | possimus exercitationem aperiam earum, doloribus nobis ducimus maiores quia voluptates quis omnis
37 | molestiae quisquam. Voluptatibus, officiis laudantium?
38 |
41 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Hic culpa, nobis doloremque veniam non,
42 | nihil
43 | cupiditate odit repellat est ALT + F4 expedita facilis. Fuga aspernatur, alias debitis eveniet totam
44 | minima vel.
45 |
71 | If you think privacy is unimportant for you because you have nothing to hide, you might as well say free speech 72 | is unimportant for you because you have nothing useful to say.74 | 75 |
– Edward Snowden 73 |
76 | <!DOCTYPE html> 77 | <html> 78 | <head> 79 | <title>Hello World</title> 80 | </head> 81 | <body> 82 | <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> 83 | </body> 84 | </html>85 | 86 |
| Name | 95 |Instrument | 96 |
|---|---|
| Name | 101 |Instrument | 102 |
| Yui Hirasawa | 107 |Lead Guitar | 108 |
| Mio Akiyama | 111 |Bass | 112 |
| Ritsu Tainaka | 115 |Drums | 116 |
| Tsumugi Kotobuki | 119 |Keyboard | 120 |
| Azusa Nakano | 123 |Rhythm Guitar | 124 |
203 |
204 |
205 |
206 |
207 |
--------------------------------------------------------------------------------
/backup/vendor/new.css/1.1.2/theme/terminal.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
18 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
20 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
22 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
24 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
26 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
28 | 29 |
34 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Aut harum
35 | molestias labore amet
36 | possimus exercitationem aperiam earum, doloribus nobis ducimus maiores quia voluptates quis omnis
37 | molestiae quisquam. Voluptatibus, officiis laudantium?
38 |
41 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Hic culpa, nobis doloremque veniam non,
42 | nihil
43 | cupiditate odit repellat est ALT + F4 expedita facilis. Fuga aspernatur, alias debitis eveniet totam
44 | minima vel.
45 |
71 | If you think privacy is unimportant for you because you have nothing to hide, you might as well say free speech 72 | is unimportant for you because you have nothing useful to say.74 | 75 |
– Edward Snowden 73 |
76 | <!DOCTYPE html> 77 | <html> 78 | <head> 79 | <title>Hello World</title> 80 | </head> 81 | <body> 82 | <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> 83 | </body> 84 | </html>85 | 86 |
| Name | 95 |Instrument | 96 |
|---|---|
| Name | 101 |Instrument | 102 |
| Yui Hirasawa | 107 |Lead Guitar | 108 |
| Mio Akiyama | 111 |Bass | 112 |
| Ritsu Tainaka | 115 |Drums | 116 |
| Tsumugi Kotobuki | 119 |Keyboard | 120 |
| Azusa Nakano | 123 |Rhythm Guitar | 124 |
203 |
204 |
205 |
206 |
207 |
--------------------------------------------------------------------------------
/backup/vendor/new.css/1.1.3/theme/night.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
19 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
21 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
23 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
25 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
27 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
29 | 30 |
35 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Aut harum
36 | molestias labore amet
37 | possimus exercitationem aperiam earum, doloribus nobis ducimus maiores quia voluptates quis omnis
38 | molestiae quisquam. Voluptatibus, officiis laudantium?
39 |
42 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Hic culpa, nobis doloremque veniam non,
43 | nihil
44 | cupiditate odit repellat est ALT + F4 expedita facilis. Fuga aspernatur, alias debitis eveniet totam
45 | minima vel.
46 |
72 | If you think privacy is unimportant for you because you have nothing to hide, you might as well say free speech 73 | is unimportant for you because you have nothing useful to say.75 | 76 |
– Edward Snowden 74 |
77 | <!DOCTYPE html> 78 | <html> 79 | <head> 80 | <title>Hello World</title> 81 | </head> 82 | <body> 83 | <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> 84 | </body> 85 | </html>86 | 87 |
| Name | 96 |Instrument | 97 |
|---|---|
| Name | 102 |Instrument | 103 |
| Yui Hirasawa | 108 |Lead Guitar | 109 |
| Mio Akiyama | 112 |Bass | 113 |
| Ritsu Tainaka | 116 |Drums | 117 |
| Tsumugi Kotobuki | 120 |Keyboard | 121 |
| Azusa Nakano | 124 |Rhythm Guitar | 125 |
204 |
205 |
206 |
207 |
208 |
--------------------------------------------------------------------------------
/backup/vendor/new.css/1.1.3/theme/terminal.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
19 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
21 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
23 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
25 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
27 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
29 | 30 |
35 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Aut harum
36 | molestias labore amet
37 | possimus exercitationem aperiam earum, doloribus nobis ducimus maiores quia voluptates quis omnis
38 | molestiae quisquam. Voluptatibus, officiis laudantium?
39 |
42 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Hic culpa, nobis doloremque veniam non,
43 | nihil
44 | cupiditate odit repellat est ALT + F4 expedita facilis. Fuga aspernatur, alias debitis eveniet totam
45 | minima vel.
46 |
72 | If you think privacy is unimportant for you because you have nothing to hide, you might as well say free speech 73 | is unimportant for you because you have nothing useful to say.75 | 76 |
– Edward Snowden 74 |
77 | <!DOCTYPE html> 78 | <html> 79 | <head> 80 | <title>Hello World</title> 81 | </head> 82 | <body> 83 | <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> 84 | </body> 85 | </html>86 | 87 |
| Name | 96 |Instrument | 97 |
|---|---|
| Name | 102 |Instrument | 103 |
| Yui Hirasawa | 108 |Lead Guitar | 109 |
| Mio Akiyama | 112 |Bass | 113 |
| Ritsu Tainaka | 116 |Drums | 117 |
| Tsumugi Kotobuki | 120 |Keyboard | 121 |
| Azusa Nakano | 124 |Rhythm Guitar | 125 |
204 |
205 |
206 |
207 |
208 |
--------------------------------------------------------------------------------
/backup/components/bb-setup.js:
--------------------------------------------------------------------------------
1 | import { h } from '../vendor/pauls-ui-kit/util.js'
2 |
3 | export default class extends HTMLElement {
4 | constructor () {
5 | super()
6 | }
7 |
8 | async connectedCallback () {
9 | try {
10 | this.remoteInfo = JSON.parse(localStorage.remoteInfo)
11 | if (this.remoteInfo.state === 'created') {
12 | this.replicaDrive = await beaker.hyperdrive.drive(
13 | this.remoteInfo.replicaDriveUrl
14 | )
15 | this.primaryProfileUrl = this.remoteInfo.primaryProfileUrl
16 | this.renderConnectToPrimaryForm()
17 | return
18 | }
19 | } catch (e) {
20 | console.debug('bb-setup load remoteInfo', e)
21 | }
22 |
23 | this.append(
24 | h(
25 | 'div',
26 | h(
27 | 'button',
28 | { click: this.onClickChangeProfile.bind(this) },
29 | 'Select a profile on this machine to post with'
30 | )
31 | )
32 | )
33 | this.append(
34 | h(
35 | 'div',
36 | h(
37 | 'button',
38 | { click: this.onClickSetupRemote.bind(this) },
39 | 'Set up as a "remote" for a profile on another machine'
40 | )
41 | )
42 | )
43 | }
44 |
45 | async onClickChangeProfile (e) {
46 | e.preventDefault()
47 | const profile = await beaker.contacts.requestProfile()
48 | localStorage.profile = JSON.stringify(profile)
49 | localStorage.removeItem('remoteInfo')
50 | location.reload()
51 | }
52 |
53 | async onClickSetupRemote (e) {
54 | e.preventDefault()
55 | localStorage.removeItem('profile')
56 | localStorage.removeItem('remoteInfo')
57 | console.log('Setup remote')
58 | this.renderPrimaryProfileUrlForm()
59 | }
60 |
61 | renderPrimaryProfileUrlForm () {
62 | for (const child of [...this.childNodes]) child.remove()
63 | this.append(
64 | h(
65 | 'p',
66 | 'Paste hyper://... URL of profile from other machine',
67 | h(
68 | 'form',
69 | { submit: this.onSubmitPrimaryProfileUrl.bind(this) },
70 | h(
71 | 'p',
72 | h('input', {
73 | id: 'primaryProfileUrl',
74 | type: 'text',
75 | placeholder: 'hyper://...',
76 | style: 'width: 100%',
77 | input: this.onInputPrimaryProfileUrl.bind(this)
78 | }),
79 | h('button', { type: 'submit', disabled: true }, 'Submit')
80 | )
81 | )
82 | )
83 | )
84 | }
85 |
86 | onInputPrimaryProfileUrl (e) {
87 | this.querySelector('button').disabled = !e.target.value.match(
88 | /^hyper:\/\/[0-9a-fA-F]{64}\/?$/
89 | )
90 | }
91 |
92 | async onSubmitPrimaryProfileUrl (e) {
93 | e.preventDefault()
94 | this.primaryProfileUrl = this.querySelector('#primaryProfileUrl').value
95 | console.log('Submit', this.primaryProfileUrl)
96 | try {
97 | this.primaryProfileDrive = await beaker.hyperdrive.drive(
98 | this.primaryProfileUrl
99 | )
100 | this.primaryProfileInfo = await this.primaryProfileDrive.getInfo()
101 | } catch (e) {
102 | // FIXME - show error in UI
103 | console.error(
104 | 'Error loading primary profile drive',
105 | this.primaryProfileUrl
106 | )
107 | throw e
108 | }
109 | this.renderNicknameForm()
110 | }
111 |
112 | renderNicknameForm () {
113 | for (const child of [...this.childNodes]) child.remove()
114 | this.append(
115 | h(
116 | 'p',
117 | `Primary profile (on another machine):`,
118 | h(
119 | 'p',
120 | h('a', { href: this.primaryProfileUrl }, this.primaryProfileUrl)
121 | ),
122 | h('div', `Title: ${this.primaryProfileInfo.title}`),
123 | h('div', `Description: ${this.primaryProfileInfo.description}`),
124 | h('img', {
125 | src: `${this.primaryProfileUrl}/thumb.png`
126 | })
127 | ),
128 | h(
129 | 'p',
130 | 'A hyperdrive will be created to host a replica related to the ' +
131 | 'profile on this machine. Please set a nickname for the replica ' +
132 | `(eg. 'desktop', 'laptop'):`
133 | ),
134 | h(
135 | 'form',
136 | { submit: this.onSubmitNickname.bind(this) },
137 | h(
138 | 'p',
139 | h('input', {
140 | id: 'nickname',
141 | type: 'text',
142 | placeholder: 'desktop',
143 | style: 'width: 100%'
144 | }),
145 | h('button', { type: 'submit' }, 'Create archive to contain replica')
146 | )
147 | )
148 | )
149 | }
150 |
151 | async onSubmitNickname (e) {
152 | e.preventDefault()
153 | this.nickname = this.querySelector('#nickname').value
154 | console.log('SubmitNickname', this.nickname)
155 | this.replicaDrive = await beaker.hyperdrive.createDrive({
156 | title: `remote-${this.nickname}`,
157 | description: 'Remote replica for profile'
158 | })
159 | await this.replicaDrive.writeFile(
160 | '/remote-replica.json',
161 | JSON.stringify({
162 | nickname: this.nickname,
163 | primaryProfile: this.primaryProfileUrl
164 | })
165 | )
166 | this.remoteInfo = {
167 | primaryProfileUrl: this.primaryProfileUrl,
168 | replicaDriveUrl: this.replicaDrive.url,
169 | state: 'created'
170 | }
171 | localStorage.setItem('remoteInfo', JSON.stringify(this.remoteInfo))
172 | console.log('Jim', this.replicaDrive)
173 | this.renderConnectToPrimaryForm()
174 | }
175 |
176 | renderConnectToPrimaryForm () {
177 | for (const child of [...this.childNodes]) child.remove()
178 | this.append(
179 | h(
180 | 'p',
181 | 'A hyperdrive was created to host a replica on this machine:',
182 | h('p', this.replicaDrive.url),
183 | h('p', h('a', { href: this.replicaDrive.url }, 'Link'))
184 | ),
185 | h(
186 | 'p',
187 | 'Now, go to your other machine that hosts your ',
188 | h('a', { href: this.primaryProfileUrl }, this.primaryProfileUrl),
189 | ' and add the URL for this replica.'
190 | ),
191 | h(
192 | 'button',
193 | { click: this.onCheckButtonClick.bind(this) },
194 | 'Check Primary'
195 | )
196 | )
197 | }
198 |
199 | async onCheckButtonClick (e) {
200 | e.preventDefault()
201 | console.log('Check')
202 | // FIXME: Error checking
203 | const primaryDrive = await beaker.hyperdrive.drive(this.primaryProfileUrl)
204 | const replicas = await primaryDrive.readFile('replicas.json', 'json')
205 | console.log('Replicas', replicas, this.replicaDrive.url)
206 | console.log('this.replicaDrive.url', replicas, this.replicaDrive.url)
207 | if (replicas.includes(this.replicaDrive.url)) {
208 | console.log('Found')
209 | this.remoteInfo = {
210 | primaryProfileUrl: this.primaryProfileUrl,
211 | replicaDriveUrl: this.replicaDrive.url,
212 | state: 'connected'
213 | }
214 | localStorage.setItem('remoteInfo', JSON.stringify(this.remoteInfo))
215 | const { url, title, description } = await primaryDrive.getInfo()
216 | const profile = {
217 | url,
218 | title,
219 | description
220 | }
221 | localStorage.setItem('profile', JSON.stringify(profile))
222 | location.reload()
223 | }
224 | }
225 | }
226 |
--------------------------------------------------------------------------------
/backup/vendor/new.css/1.1.2/demo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
23 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
25 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
27 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
29 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
31 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
33 | 34 |
39 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Aut harum
40 | molestias labore amet
41 | possimus exercitationem aperiam earum, doloribus nobis ducimus maiores quia voluptates quis omnis
42 | molestiae quisquam. Voluptatibus, officiis laudantium?
43 |
46 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Hic culpa, nobis doloremque veniam non,
47 | nihil
48 | cupiditate odit repellat est ALT + F4 expedita facilis. Fuga aspernatur, alias debitis eveniet totam
49 | minima vel.
50 |
76 | If you think privacy is unimportant for you because you have nothing to hide, you might as well say free speech 77 | is unimportant for you because you have nothing useful to say.79 | 80 |
– Edward Snowden 78 |
81 | <!DOCTYPE html> 82 | <html> 83 | <head> 84 | <title>Hello World</title> 85 | </head> 86 | <body> 87 | <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> 88 | </body> 89 | </html>90 | 91 |
| Name | 100 |Instrument | 101 |
|---|---|
| Name | 106 |Instrument | 107 |
| Yui Hirasawa | 112 |Lead Guitar | 113 |
| Mio Akiyama | 116 |Bass | 117 |
| Ritsu Tainaka | 120 |Drums | 121 |
| Tsumugi Kotobuki | 124 |Keyboard | 125 |
| Azusa Nakano | 128 |Rhythm Guitar | 129 |
208 |
209 |
210 |
211 |
212 |
213 |
--------------------------------------------------------------------------------
/backup/vendor/new.css/1.1.3/demo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
23 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
25 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
27 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
29 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
31 |This is paragraph text. Lorem ipsum dolor sit amet consectetur adipisicing elit.
33 | 34 |
39 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Aut harum
40 | molestias labore amet
41 | possimus exercitationem aperiam earum, doloribus nobis ducimus maiores quia voluptates quis omnis
42 | molestiae quisquam. Voluptatibus, officiis laudantium?
43 |
46 | Lorem ipsum dolor sit amet consectetur adipisicing elit. Hic culpa, nobis doloremque veniam non,
47 | nihil
48 | cupiditate odit repellat est ALT + F4 expedita facilis. Fuga aspernatur, alias debitis eveniet totam
49 | minima vel.
50 |
76 | If you think privacy is unimportant for you because you have nothing to hide, you might as well say free speech 77 | is unimportant for you because you have nothing useful to say.79 | 80 |
– Edward Snowden 78 |
81 | <!DOCTYPE html> 82 | <html> 83 | <head> 84 | <title>Hello World</title> 85 | </head> 86 | <body> 87 | <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> 88 | </body> 89 | </html>90 | 91 |
| Name | 100 |Instrument | 101 |
|---|---|
| Name | 106 |Instrument | 107 |
| Yui Hirasawa | 112 |Lead Guitar | 113 |
| Mio Akiyama | 116 |Bass | 117 |
| Ritsu Tainaka | 120 |Drums | 121 |
| Tsumugi Kotobuki | 124 |Keyboard | 125 |
| Azusa Nakano | 128 |Rhythm Guitar | 129 |
208 |
209 |
210 |
211 |
212 |
213 |
--------------------------------------------------------------------------------
/backup/vendor/pauls-ui-kit/page-content.js:
--------------------------------------------------------------------------------
1 | import { h, executeJs } from './util.js'
2 |
3 | var self = beaker.hyperdrive
4 | async function stat(p) {
5 | return self.stat(p).catch(e => undefined)
6 | }
7 |
8 | const regexImages = /\.(png|jpe?g|gif|svg|webp)$/i
9 | const regexCode = /\.(js|py)$/i
10 | const regexMD = /\.(md)$/i
11 | const regexPDF = /\.(pdf)$/i
12 | const regexGoto = /\.(goto)$/i
13 |
14 | customElements.define('pfrazee-page-content', class extends HTMLElement {
15 | constructor() {
16 | super()
17 | this.render()
18 | }
19 |
20 | async renderFile(file, url, list) {
21 | const fs = await stat(url + file)
22 |
23 | const href = './' + file
24 | let icon = '📄'
25 |
26 | if (fs) {
27 | // console.debug(fs)
28 |
29 | if (fs.isDirectory()) {
30 | icon = '📁'
31 | } else {
32 | if (regexMD.test(file)) {
33 | icon = '📝'
34 | }
35 | if (regexPDF.test(file)) {
36 | icon = '📔'
37 | }
38 | if (regexImages.test(file)) {
39 | icon = '🖼️'
40 | }
41 | if (regexCode.test(file)) {
42 | icon = '📜'
43 | }
44 | if (regexGoto.test(file)) {
45 | icon = '🌐'
46 | }
47 | }
48 |
49 | const label = h('span', h('span', { class: 'icon' }, icon), h('span', { class: 'file' }, file))
50 |
51 | const fileSize = `${(fs.size / 1024).toFixed(3)} KB`
52 | let title = `${file} (${fileSize})`
53 |
54 | if (fs.metadata && fs.metadata.href) {
55 | title = fs.metadata.href
56 | }
57 |
58 | if (fs.metadata && fs.metadata.title) {
59 | title = fs.metadata.title
60 | }
61 |
62 | list.append(h('li', h('a', {
63 | href,
64 | title,
65 | },
66 | label
67 | )))
68 | }
69 | return list
70 | }
71 |
72 | /**
73 | * The body classList mutations will be replaced with customEvents
74 | */
75 | isLoading(state) {
76 | (state)
77 | ? document.body.classList.add('loading')
78 | : document.body.classList.remove('loading')
79 | }
80 |
81 | /**
82 | * Inspired By Kaezarrex
83 | * ' + content + '' 204 | this.isLoading(0) 205 | // Trying to still open binaries and PDF 206 | } else if (/\.(pdf|doc|zip|docx|rar)/i.test(pathname)) { 207 | document.body.classList.add('binary') 208 | const filename = pathname.split('/').slice(-1)[0] 209 | // The `download` attribute will trigger the file download 210 | const link = h('a', { href: pathname, download: filename, title: `Download ${filename}` }, pathname) 211 | this.append(h('section', h('article', link))) 212 | this.isLoading(0) 213 | } else if (/\.(goto)$/i.test(pathname)) { 214 | // console.debug(st) 215 | if (st.metadata) { 216 | this.append(h('article', h('a', { href: st.metadata.href }, st.metadata.title))) 217 | } else { 218 | this.append(h('article', pathname)) 219 | } 220 | this.isLoading(0) 221 | // Render md or html 222 | } else { 223 | let content = await self.readFile(pathname) 224 | // render content 225 | if (/\.(md|html)$/i.test(pathname)) { 226 | if (pathname.endsWith('.md')) { 227 | document.body.classList.remove('home') 228 | document.body.classList.add('md') 229 | content = '
`.
71 | - For code blocks, use ``.
72 | - For keyboard input, use ``,
73 | - There's no reason to nest code tags inside each other, however, `` and `` will reset themselves to match if you nest them.
74 | - `header`
75 | - **Only use a `` at the top of your ``!**
76 | - Creates a large and slightly darker header.
77 |
78 | Here are the improvements new.css adds to your browser's basic HTML.
79 |
80 |
81 | Full Changes
82 |
83 | - **Global**
84 | - Slightly increase all text sizes
85 | - Use a less harsh color scheme
86 | - Use the Inter font, and if not possible, the system font
87 | - Redefine all margins to more sensible defaults
88 | - `body`
89 | - Set a reasonable max width
90 | - Centered the body element, keeping left-alignment
91 | - `abbr`
92 | - Question mark cursor on hover
93 | - `blockquote`
94 | - Improved margins
95 | - Added background color
96 | - `button`
97 | - Appears uniformly across browsers
98 | - Looks like a real button
99 | - `code`
100 | - Added background color
101 | - Added outline stroke
102 | - `details`
103 | - Looks more button-like with background color and link cursor on hover
104 | - `h1`–`h6`
105 | - Uniform margins and padding
106 | - Tweaked font size
107 | - `h1-h3`
108 | - Added thin bottom border line
109 | - `hr`
110 | - Changed to single 1px line
111 | - `kbd`
112 | - Looks like a real keyboard key
113 | - `mark`
114 | - Added padding
115 | - Color follows theme
116 | - `nav`
117 | - Added between-element margins
118 | - `samp`
119 | - Ambiguous element, merged with `code`
120 | - `table`
121 | - Basic styling to make cells more discernable
122 | - Border stroke across all cells
123 | - Alternating row background color
124 |
125 |
126 | ## Themes
127 | new.css uses an 10-color palette and can be easily customized. These are declared as a CSS variable in the `:root` attribute.
128 |
129 | ### Customizing
130 |
131 | By loading a secondary style sheet after new.css in your HTML, you can override these variables. Here's the default theme:
132 |
133 |
134 | Default theme
135 |
136 | ```css
137 | @import url('https://fonts.xz.style/serve/inter.css');
138 |
139 | :root {
140 | --nc-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
141 | --nc-font-mono: 'Courier New', Courier, 'Ubuntu Mono', 'Liberation Mono', monospace;
142 | --nc-tx-1: #000000;
143 | --nc-tx-2: #1A1A1A;
144 | --nc-bg-1: #FFFFFF;
145 | --nc-bg-2: #F6F8FA;
146 | --nc-bg-3: #E5E7EB;
147 | --nc-lk-1: #0070F3;
148 | --nc-lk-2: #0366D6;
149 | --nc-lk-tx: #FFFFFF;
150 | --nc-ac-1: #79FFE1;
151 | --nc-ac-tx: #0C4047;
152 | }
153 | ```
154 |
155 |
156 | ### Legend
157 |
158 | - `--nc-font-sans`: Font for all text besides code or preformatted
159 | - `--nc-font-mono`: Font for ``, ``, ``, ``
160 | - `--nc-tx-1`: Heading text color
161 | - `--nc-tx-2`: Body text color
162 | - `--nc-bg-1`: Base background color
163 | - `--nc-bg-2`: Slightly darker background color
164 | - `--nc-bg-3`: Even slightly darker background color
165 | - `--nc-lk-1`: Action color for links and buttons
166 | - `--nc-lk-2`: Link and buttons on mouse hover and active
167 | - `--nc-ac-1`: Accent color for `` and text selection background
168 |
169 | ### Usage
170 | 1. Create a stylesheet including some or all of the above variables in the `:root`. An example theme file is available here: [boilerplate.css](https://newcss.net/theme/boilerplate.css)
171 | 2. If you'd like to import custom fonts, put the `@import` tag before the `:root` element. Many open-source fonts are available on [xz/fonts](https://github.com/xz/fonts).
172 | 3. Reference your new stylesheet **after** new.css in your ``. Here's an example ``:
173 | ```html
174 |
175 |
176 |
177 | Document
178 | ">
179 |
180 |
181 | ```
182 |
183 | ## Pre-Made Themes
184 | Here are two extra themes with CDN links. Feel free to use or edit them!
185 |
186 | ### Night
187 | ```html
188 |
189 | ```
190 |
191 | Preview at [newcss.net/theme/night/](https://newcss.net/theme/night/)
192 |
193 |
194 |
195 | ### Terminal
196 | ```html
197 |
198 | ```
199 |
200 | Preview at [newcss.net/theme/terminal/](https://newcss.net/theme/terminal/)
201 |
202 |
203 |
204 | ## Sponsors
205 | - Domaincord (also a domain name discussion group here!)
206 | - Vercel
207 |
208 | ## Special Thanks
209 | - [sakura by oxal](https://github.com/oxalorg/sakura) for introducing me to classless CSS
210 | - [mydarkstar](https://mydarkstar.net/) for priceless advice
211 | - [Vercel](https://vercel.com/?utm_source=xz&utm_campaign=new.css) for sponsoring [xz](https://xz.style) and for their amazing color palettes
212 |
213 |
214 |
215 |
216 |
217 |
218 |
--------------------------------------------------------------------------------
/backup/vendor/new.css/1.1.2/README.md:
--------------------------------------------------------------------------------
1 | # new.css
2 |
3 | **[newcss.net](https://newcss.net) / [xz Discord](https://discord.gg/hhuuC4w)** / **[Twitter](https://twitter.com/example_dev)**
4 |
5 | A classless CSS framework to write modern websites using only HTML. It weighs **~4.5kb**.
6 |
7 | Take a look at the demo on [newcss.net](https://newcss.net/), or the quick-start guide on [newcss.net/usage](https://newcss.net/usage/). It's on npm as `@exampledev/new.css`.
8 |
9 | [Vercel](https://vercel.com?utm_source=xz&utm_campaign=new.css)'s impossibly fast CDN delivers new.css and the font [Inter](https://rsms.me/inter) using [xz/fonts](https://github.com/xz/fonts), so there's virtually no bloat added to your pages.
10 |
11 | And of course, there's a dark mode. It automatically applies a light/dark theme based on your browser's preference.
12 |
13 | It supports custom color themes and fonts using CSS variables. For example, check out the terminal theme: [newcss.net/theme/terminal/](https://newcss.net/theme/terminal/)
14 |
15 | new.css is a project from [xz](https://xz.style).
16 |
17 | ## Table of Contents
18 | - [Usage](#usage)
19 | - [Use Cases](#use-cases)
20 | - [Details](#details)
21 | - [Themes](#themes)
22 | - [Customizing](#customizing)
23 | - [Legend](#legend)
24 | - [Usage](#usage)
25 | - [Pre-made Themes](#pre-made-themes)
26 | - [Night](#night)
27 | - [Terminal](#terminal)
28 | - [Special Thanks](#special-thanks)
29 |
30 |
31 | ## Usage
32 |
33 | Here's your configuration:
34 |
35 | ### HTML
36 |
37 | Add this code to the end of your ``:
38 | ```html
39 |
40 |
41 | ```
42 |
43 |
44 |
45 | > 💡 new.css is best with the font [Inter](https://rsms.me/inter), which the line above imports as well. Use this line instead if you prefer no added fonts:
46 |
47 | ```html
48 |
49 | ```
50 |
51 | ### npm
52 |
53 | Or, if you prefer npm:
54 |
55 | 1. `npm -i @exampledev/new.css`
56 |
57 | ## Use Cases
58 | - A dead-simple blog
59 | - Collecting your most used links
60 | - Making a simple "about me" site
61 | - Rendering markdown-generated HTML
62 |
63 | ## Details
64 | ### Element Guide
65 | How to use some of new.css' semantic HTML features.
66 |
67 | - `button`
68 | - Wrap a button in an `` tag to make it a link.
69 | - Code
70 | - For inline code, use ``.
71 | - For code blocks, use ``.
72 | - For keyboard input, use ``,
73 | - There's no reason to nest code tags inside each other, however, `` and `` will reset themselves to match if you nest them.
74 | - `header`
75 | - **Only use a `` at the top of your ``!**
76 | - Creates a large and slightly darker header.
77 |
78 | Here are the improvements new.css adds to your browser's basic HTML.
79 |
80 |
81 | Full Changes
82 |
83 | - **Global**
84 | - Slightly increase all text sizes
85 | - Use a less harsh color scheme
86 | - Use the Inter font, and if not possible, the system font
87 | - Redefine all margins to more sensible defaults
88 | - `body`
89 | - Set a reasonable max width
90 | - Centered the body element, keeping left-alignment
91 | - `abbr`
92 | - Question mark cursor on hover
93 | - `blockquote`
94 | - Improved margins
95 | - Added background color
96 | - `button`
97 | - Appears uniformly across browsers
98 | - Looks like a real button
99 | - `code`
100 | - Added background color
101 | - Added outline stroke
102 | - `details`
103 | - Looks more button-like with background color and link cursor on hover
104 | - `h1`–`h6`
105 | - Uniform margins and padding
106 | - Tweaked font size
107 | - `h1-h3`
108 | - Added thin bottom border line
109 | - `hr`
110 | - Changed to single 1px line
111 | - `kbd`
112 | - Looks like a real keyboard key
113 | - `mark`
114 | - Added padding
115 | - Color follows theme
116 | - `nav`
117 | - Added between-element margins
118 | - `samp`
119 | - Ambiguous element, merged with `code`
120 | - `table`
121 | - Basic styling to make cells more discernable
122 | - Border stroke across all cells
123 | - Alternating row background color
124 |
125 |
126 | ## Themes
127 | new.css uses an 10-color palette and can be easily customized. These are declared as a CSS variable in the `:root` attribute.
128 |
129 | ### Customizing
130 |
131 | By loading a secondary style sheet after new.css in your HTML, you can override these variables. Here's the default theme:
132 |
133 |
134 | Default theme
135 |
136 | ```css
137 | @import url('https://fonts.xz.style/serve/inter.css');
138 |
139 | :root {
140 | --nc-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
141 | --nc-font-mono: 'Courier New', Courier, 'Ubuntu Mono', 'Liberation Mono', monospace;
142 | --nc-tx-1: #000000;
143 | --nc-tx-2: #1A1A1A;
144 | --nc-bg-1: #FFFFFF;
145 | --nc-bg-2: #F6F8FA;
146 | --nc-bg-3: #E5E7EB;
147 | --nc-lk-1: #0070F3;
148 | --nc-lk-2: #0366D6;
149 | --nc-lk-tx: #FFFFFF;
150 | --nc-ac-1: #79FFE1;
151 | --nc-ac-tx: #0C4047;
152 | }
153 | ```
154 |
155 |
156 | ### Legend
157 |
158 | - `--nc-font-sans`: Font for all text besides code or preformatted
159 | - `--nc-font-mono`: Font for ``, ``, ``, ``
160 | - `--nc-tx-1`: Heading text color
161 | - `--nc-tx-2`: Body text color
162 | - `--nc-bg-1`: Base background color
163 | - `--nc-bg-2`: Slightly darker background color
164 | - `--nc-bg-3`: Even slightly darker background color
165 | - `--nc-lk-1`: Action color for links and buttons
166 | - `--nc-lk-2`: Link and buttons on mouse hover and active
167 | - `--nc-ac-1`: Accent color for `` and text selection background
168 |
169 | ### Usage
170 | 1. Create a stylesheet including some or all of the above variables in the `:root`. An example theme file is available here: [boilerplate.css](https://newcss.net/theme/boilerplate.css)
171 | 2. If you'd like to import custom fonts, put the `@import` tag before the `:root` element. Many open-source fonts are available on [xz/fonts](https://github.com/xz/fonts).
172 | 3. Reference your new stylesheet **after** new.css in your ``. Here's an example ``:
173 | ```html
174 |
175 |
176 |
177 | Document
178 | ">
179 |
180 |
181 | ```
182 |
183 | ## Pre-Made Themes
184 | Here are two extra themes with CDN links. Feel free to use or edit them!
185 |
186 | ### Night
187 | ```html
188 |
189 | ```
190 |
191 | Preview at [newcss.net/theme/night/](https://newcss.net/theme/night/)
192 |
193 |
194 |
195 | ### Terminal
196 | ```html
197 |
198 | ```
199 |
200 | Preview at [newcss.net/theme/terminal/](https://newcss.net/theme/terminal/)
201 |
202 |
203 |
204 | ## Sponsors
205 | - Domaincord (also a domain name discussion group here!)
206 | - Vercel
207 |
208 | ## Special Thanks
209 | - [sakura by oxal](https://github.com/oxalorg/sakura) for introducing me to classless CSS
210 | - [mydarkstar](https://mydarkstar.net/) for priceless advice
211 | - [Vercel](https://vercel.com/?utm_source=xz&utm_campaign=new.css) for sponsoring [xz](https://xz.style) and for their amazing color palettes
212 |
213 |
214 |
215 |
216 |
217 |
218 |
--------------------------------------------------------------------------------
/backup/vendor/new.css/1.1.2/new.css:
--------------------------------------------------------------------------------
1 | :root {
2 | --nc-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
3 | --nc-font-mono: Consolas, monaco, 'Ubuntu Mono', 'Liberation Mono', 'Courier New', Courier, monospace;
4 | --nc-tx-1: #000000;
5 | --nc-tx-2: #1A1A1A;
6 | --nc-bg-1: #FFFFFF;
7 | --nc-bg-2: #F6F8FA;
8 | --nc-bg-3: #E5E7EB;
9 | --nc-lk-1: #0070F3;
10 | --nc-lk-2: #0366D6;
11 | --nc-lk-tx: #FFFFFF;
12 | --nc-ac-1: #79FFE1;
13 | --nc-ac-tx: #0C4047;
14 | }
15 |
16 | @media (prefers-color-scheme: dark) {
17 | :root {
18 | --nc-tx-1: #ffffff;
19 | --nc-tx-2: #eeeeee;
20 | --nc-bg-1: #000000;
21 | --nc-bg-2: #111111;
22 | --nc-bg-3: #222222;
23 | --nc-lk-1: #3291FF;
24 | --nc-lk-2: #0070F3;
25 | --nc-lk-tx: #FFFFFF;
26 | --nc-ac-1: #7928CA;
27 | --nc-ac-tx: #FFFFFF;
28 | }
29 | }
30 |
31 | * {
32 | /* Reset margins and padding */
33 | margin: 0;
34 | padding: 0;
35 | }
36 |
37 | address,
38 | area,
39 | article,
40 | aside,
41 | audio,
42 | blockquote,
43 | datalist,
44 | details,
45 | dl,
46 | fieldset,
47 | figure,
48 | form,
49 | input,
50 | iframe,
51 | img,
52 | meter,
53 | nav,
54 | ol,
55 | optgroup,
56 | option,
57 | output,
58 | p,
59 | pre,
60 | progress,
61 | ruby,
62 | section,
63 | table,
64 | textarea,
65 | ul,
66 | video {
67 | /* Margins for most elements */
68 | margin-bottom: 1rem;
69 | }
70 |
71 | html,input,select,button {
72 | /* Set body font family and some finicky elements */
73 | font-family: var(--nc-font-sans);
74 | }
75 |
76 | body {
77 | /* Center body in page */
78 | margin: 0 auto;
79 | max-width: 750px;
80 | padding: 2rem;
81 | border-radius: 6px;
82 | overflow-x: hidden;
83 | word-break: break-word;
84 | overflow-wrap: break-word;
85 | background: var(--nc-bg-1);
86 |
87 | /* Main body text */
88 | color: var(--nc-tx-2);
89 | font-size: 1.03rem;
90 | line-height: 1.5;
91 | }
92 |
93 | ::selection {
94 | /* Set background color for selected text */
95 | background: var(--nc-ac-1);
96 | color: var(--nc-ac-tx);
97 | }
98 |
99 | h1,h2,h3,h4,h5,h6 {
100 | line-height: 1;
101 | color: var(--nc-tx-1);
102 | padding-top: .875rem;
103 | }
104 |
105 | h1,
106 | h2,
107 | h3 {
108 | color: var(--nc-tx-1);
109 | padding-bottom: 2px;
110 | margin-bottom: 8px;
111 | border-bottom: 1px solid var(--nc-bg-2);
112 | }
113 |
114 | h4,
115 | h5,
116 | h6 {
117 | margin-bottom: .3rem;
118 | }
119 |
120 | h1 {
121 | font-size: 2.25rem;
122 | }
123 |
124 | h2 {
125 | font-size: 1.85rem;
126 | }
127 |
128 | h3 {
129 | font-size: 1.55rem;
130 | }
131 |
132 | h4 {
133 | font-size: 1.25rem;
134 | }
135 |
136 | h5 {
137 | font-size: 1rem;
138 | }
139 |
140 | h6 {
141 | font-size: .875rem;
142 | }
143 |
144 | a {
145 | color: var(--nc-lk-1);
146 | }
147 |
148 | a:hover {
149 | color: var(--nc-lk-2);
150 | }
151 |
152 | abbr:hover {
153 | /* Set the '?' cursor while hovering an abbreviation */
154 | cursor: help;
155 | }
156 |
157 | blockquote {
158 | padding: 1.5rem;
159 | background: var(--nc-bg-2);
160 | border-left: 5px solid var(--nc-bg-3);
161 | }
162 |
163 | abbr {
164 | cursor: help;
165 | }
166 |
167 | blockquote *:last-child {
168 | padding-bottom: 0;
169 | margin-bottom: 0;
170 | }
171 |
172 | header {
173 | background: var(--nc-bg-2);
174 | border-bottom: 1px solid var(--nc-bg-3);
175 | padding: 2rem 1.5rem;
176 |
177 | /* This sets the right and left margins to cancel out the body's margins. It's width is still the same, but the background stretches across the page's width. */
178 |
179 | margin: -2rem calc(0px - (50vw - 50%)) 2rem;
180 |
181 | /* Shorthand for:
182 |
183 | margin-top: -2rem;
184 | margin-bottom: 2rem;
185 |
186 | margin-left: calc(0px - (50vw - 50%));
187 | margin-right: calc(0px - (50vw - 50%)); */
188 |
189 | padding-left: calc(50vw - 50%);
190 | padding-right: calc(50vw - 50%);
191 | }
192 |
193 | header h1,
194 | header h2,
195 | header h3 {
196 | padding-bottom: 0;
197 | border-bottom: 0;
198 | }
199 |
200 | header > *:first-child {
201 | margin-top: 0;
202 | padding-top: 0;
203 | }
204 |
205 | header > *:last-child {
206 | margin-bottom: 0;
207 | }
208 |
209 | a button,
210 | button,
211 | input[type="submit"],
212 | input[type="reset"],
213 | input[type="button"] {
214 | font-size: 1rem;
215 | display: inline-block;
216 | padding: 6px 12px;
217 | text-align: center;
218 | text-decoration: none;
219 | white-space: nowrap;
220 | background: var(--nc-lk-1);
221 | color: var(--nc-lk-tx);
222 | border: 0;
223 | border-radius: 4px;
224 | box-sizing: border-box;
225 | cursor: pointer;
226 | color: var(--nc-lk-tx);
227 | }
228 |
229 | a button[disabled],
230 | button[disabled],
231 | input[type="submit"][disabled],
232 | input[type="reset"][disabled],
233 | input[type="button"][disabled] {
234 | cursor: default;
235 | opacity: .5;
236 |
237 | /* Set the [X] cursor while hovering a disabled link */
238 | cursor: not-allowed;
239 | }
240 |
241 | .button:focus,
242 | .button:hover,
243 | button:focus,
244 | button:hover,
245 | input[type="submit"]:focus,
246 | input[type="submit"]:hover,
247 | input[type="reset"]:focus,
248 | input[type="reset"]:hover,
249 | input[type="button"]:focus,
250 | input[type="button"]:hover {
251 | background: var(--nc-lk-2);
252 | }
253 |
254 | code,
255 | pre,
256 | kbd,
257 | samp {
258 | /* Set the font family for monospaced elements */
259 | font-family: var(--nc-font-mono);
260 | }
261 |
262 | code,
263 | samp,
264 | kbd,
265 | pre {
266 | /* The main preformatted style. This is changed slightly across different cases. */
267 | background: var(--nc-bg-2);
268 | border: 1px solid var(--nc-bg-3);
269 | border-radius: 4px;
270 | padding: 3px 6px;
271 | font-size: 0.9rem;
272 | }
273 |
274 | kbd {
275 | /* Makes the kbd element look like a keyboard key */
276 | border-bottom: 3px solid var(--nc-bg-3);
277 | }
278 |
279 | pre {
280 | padding: 1rem 1.4rem;
281 | max-width: 100%;
282 | overflow: auto;
283 | }
284 |
285 | pre code {
286 | /* When is in a , reset it's formatting to blend in */
287 | background: inherit;
288 | font-size: inherit;
289 | color: inherit;
290 | border: 0;
291 | padding: 0;
292 | margin: 0;
293 | }
294 |
295 | code pre {
296 | /* When is in a , reset it's formatting to blend in */
297 | display: inline;
298 | background: inherit;
299 | font-size: inherit;
300 | color: inherit;
301 | border: 0;
302 | padding: 0;
303 | margin: 0;
304 | }
305 |
306 | details {
307 | /* Make the look more "clickable" */
308 | padding: .6rem 1rem;
309 | background: var(--nc-bg-2);
310 | border: 1px solid var(--nc-bg-3);
311 | border-radius: 4px;
312 | }
313 |
314 | summary {
315 | /* Makes the look more like a "clickable" link with the pointer cursor */
316 | cursor: pointer;
317 | font-weight: bold;
318 | }
319 |
320 | details[open] {
321 | /* Adjust the padding while open */
322 | padding-bottom: .75rem;
323 | }
324 |
325 | details[open] summary {
326 | /* Adjust the padding while open */
327 | margin-bottom: 6px;
328 | }
329 |
330 | details[open]>*:last-child {
331 | /* Resets the bottom margin of the last element in the while is opened. This prevents double margins/paddings. */
332 | margin-bottom: 0;
333 | }
334 |
335 | dt {
336 | font-weight: bold;
337 | }
338 |
339 | dd::before {
340 | /* Add an arrow to data table definitions */
341 | content: '→ ';
342 | }
343 |
344 | hr {
345 | /* Reset the border of the
separator, then set a better line */
346 | border: 0;
347 | border-bottom: 1px solid var(--nc-bg-3);
348 | margin: 1rem auto;
349 | }
350 |
351 | fieldset {
352 | margin-top: 1rem;
353 | padding: 2rem;
354 | border: 1px solid var(--nc-bg-3);
355 | border-radius: 4px;
356 | }
357 |
358 | legend {
359 | padding: auto .5rem;
360 | }
361 |
362 | table {
363 | /* border-collapse sets the table's elements to share borders, rather than floating as separate "boxes". */
364 | border-collapse: collapse;
365 | width: 100%
366 | }
367 |
368 | td,
369 | th {
370 | border: 1px solid var(--nc-bg-3);
371 | text-align: left;
372 | padding: .5rem;
373 | }
374 |
375 | th {
376 | background: var(--nc-bg-2);
377 | }
378 |
379 | tr:nth-child(even) {
380 | /* Set every other cell slightly darker. Improves readability. */
381 | background: var(--nc-bg-2);
382 | }
383 |
384 | table caption {
385 | font-weight: bold;
386 | margin-bottom: .5rem;
387 | }
388 |
389 | textarea {
390 | /* Don't let the