Compare commits

..

No commits in common. "1a16556ec3eb2a5780823a8518d4dd2d6013a8b0" and "be964a8c490e2f00dda5ff26b82765fc498a7870" have entirely different histories.

42 changed files with 260 additions and 1573 deletions

View file

@ -1,36 +1,8 @@
import { defineConfig } from 'astro/config'; import { defineConfig } from 'astro/config';
import compress from "astro-compress"; import compress from "astro-compress";
import remarkPostMeta from './remark-post-meta.mjs';
import remarkUnwrapImages from 'remark-unwrap-images';
import { rehypeHeadingIds } from '@astrojs/markdown-remark';
import rehypeSlug from 'rehype-slug';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeFigure from 'rehype-figure';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
integrations: [compress()], integrations: [compress()]
build: {
format: "directory"
},
markdown: {
syntaxHighlight: "shiki",
remarkPlugins: [
remarkPostMeta,
remarkUnwrapImages,
],
rehypePlugins: [
rehypeSlug,
rehypeHeadingIds,
[
rehypeAutolinkHeadings,
{ behavior: "append" },
],
[
rehypeFigure,
{ className: "rehype-figure" },
],
],
},
}); });

View file

@ -1,9 +0,0 @@
/*
* If you are looking for the `dc09.js` script
* that was used to minify sources of
* my old website, see
* https://git.dc09.ru/DarkCat09/dc09.ru-old/src/branch/main/dc09.js
*
* Recently the website was rewritten in Astro,
* so I don't use that script anymore
*/

399
package-lock.json generated
View file

@ -9,13 +9,7 @@
"dependencies": { "dependencies": {
"astro": "^2.3.0", "astro": "^2.3.0",
"astro-compress": "^1.1.42", "astro-compress": "^1.1.42",
"less": "^4.1.3", "less": "^4.1.3"
"mdast-util-to-string": "^3.2.0",
"reading-time": "^1.5.0",
"rehype-autolink-headings": "^6.1.1",
"rehype-figure": "^1.0.1",
"rehype-slug": "^5.1.0",
"remark-unwrap-images": "^3.0.1"
} }
}, },
"node_modules/@ampproject/remapping": { "node_modules/@ampproject/remapping": {
@ -2513,40 +2507,6 @@
"url": "https://opencollective.com/unified" "url": "https://opencollective.com/unified"
} }
}, },
"node_modules/hast-util-has-property": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/hast-util-has-property/-/hast-util-has-property-2.0.1.tgz",
"integrity": "sha512-X2+RwZIMTMKpXUzlotatPzWj8bspCymtXH3cfG3iQKV+wPF53Vgaqxi/eLqGck0wKq1kS9nvoB1wchbCPEL8sg==",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/hast-util-heading-rank": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/hast-util-heading-rank/-/hast-util-heading-rank-2.1.1.tgz",
"integrity": "sha512-iAuRp+ESgJoRFJbSyaqsfvJDY6zzmFoEnL1gtz1+U8gKtGGj1p0CVlysuUAUjq95qlZESHINLThwJzNGmgGZxA==",
"dependencies": {
"@types/hast": "^2.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/hast-util-is-element": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-2.1.3.tgz",
"integrity": "sha512-O1bKah6mhgEq2WtVMk+Ta5K7pPMqsBBlmzysLdcwKVrqzZQ0CHqUPiIVspNhAG1rvxpvJjtGee17XfauZYKqVA==",
"dependencies": {
"@types/hast": "^2.0.0",
"@types/unist": "^2.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/hast-util-parse-selector": { "node_modules/hast-util-parse-selector": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-3.1.1.tgz", "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-3.1.1.tgz",
@ -2620,18 +2580,6 @@
"url": "https://opencollective.com/unified" "url": "https://opencollective.com/unified"
} }
}, },
"node_modules/hast-util-to-string": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/hast-util-to-string/-/hast-util-to-string-2.0.0.tgz",
"integrity": "sha512-02AQ3vLhuH3FisaMM+i/9sm4OXGSq1UhOOCpTLLQtHdL3tZt7qil69r8M8iDkZYyC0HCFylcYoP+8IO7ddta1A==",
"dependencies": {
"@types/hast": "^2.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/hast-util-whitespace": { "node_modules/hast-util-whitespace": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz", "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz",
@ -4641,11 +4589,6 @@
"node": ">=8.10.0" "node": ">=8.10.0"
} }
}, },
"node_modules/reading-time": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/reading-time/-/reading-time-1.5.0.tgz",
"integrity": "sha512-onYyVhBNr4CmAxFsKS7bz+uTLRakypIe4R+5A824vBSkQy/hB3fZepoVEf8OVAxzLvK+H/jm9TzpI3ETSm64Kg=="
},
"node_modules/rehype": { "node_modules/rehype": {
"version": "12.0.1", "version": "12.0.1",
"resolved": "https://registry.npmjs.org/rehype/-/rehype-12.0.1.tgz", "resolved": "https://registry.npmjs.org/rehype/-/rehype-12.0.1.tgz",
@ -4661,124 +4604,6 @@
"url": "https://opencollective.com/unified" "url": "https://opencollective.com/unified"
} }
}, },
"node_modules/rehype-autolink-headings": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/rehype-autolink-headings/-/rehype-autolink-headings-6.1.1.tgz",
"integrity": "sha512-NMYzZIsHM3sA14nC5rAFuUPIOfg+DFmf9EY1YMhaNlB7+3kK/ZlE6kqPfuxr1tsJ1XWkTrMtMoyHosU70d35mA==",
"dependencies": {
"@types/hast": "^2.0.0",
"extend": "^3.0.0",
"hast-util-has-property": "^2.0.0",
"hast-util-heading-rank": "^2.0.0",
"hast-util-is-element": "^2.0.0",
"unified": "^10.0.0",
"unist-util-visit": "^4.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/rehype-figure": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/rehype-figure/-/rehype-figure-1.0.1.tgz",
"integrity": "sha512-g7DJuK8R8xHIaPI3QJ6/OoWiKepn92RF2CV3z4dO7lRO6ZHo48Tu9X3KgnZUKK035srFHqWQx93AybBy12XqmQ==",
"dependencies": {
"hastscript": "^6.0.0",
"unist-util-visit": "^2.0.3"
}
},
"node_modules/rehype-figure/node_modules/comma-separated-tokens": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz",
"integrity": "sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/rehype-figure/node_modules/hast-util-parse-selector": {
"version": "2.2.5",
"resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz",
"integrity": "sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ==",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/rehype-figure/node_modules/hastscript": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/hastscript/-/hastscript-6.0.0.tgz",
"integrity": "sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w==",
"dependencies": {
"@types/hast": "^2.0.0",
"comma-separated-tokens": "^1.0.0",
"hast-util-parse-selector": "^2.0.0",
"property-information": "^5.0.0",
"space-separated-tokens": "^1.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/rehype-figure/node_modules/property-information": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/property-information/-/property-information-5.6.0.tgz",
"integrity": "sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA==",
"dependencies": {
"xtend": "^4.0.0"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/rehype-figure/node_modules/space-separated-tokens": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz",
"integrity": "sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA==",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/rehype-figure/node_modules/unist-util-is": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz",
"integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/rehype-figure/node_modules/unist-util-visit": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz",
"integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==",
"dependencies": {
"@types/unist": "^2.0.0",
"unist-util-is": "^4.0.0",
"unist-util-visit-parents": "^3.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/rehype-figure/node_modules/unist-util-visit-parents": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz",
"integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==",
"dependencies": {
"@types/unist": "^2.0.0",
"unist-util-is": "^4.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/rehype-parse": { "node_modules/rehype-parse": {
"version": "8.0.4", "version": "8.0.4",
"resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-8.0.4.tgz", "resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-8.0.4.tgz",
@ -4808,24 +4633,6 @@
"url": "https://opencollective.com/unified" "url": "https://opencollective.com/unified"
} }
}, },
"node_modules/rehype-slug": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/rehype-slug/-/rehype-slug-5.1.0.tgz",
"integrity": "sha512-Gf91dJoXneiorNEnn+Phx97CO7oRMrpi+6r155tTxzGuLtm+QrI4cTwCa9e1rtePdL4i9tSO58PeSS6HWfgsiw==",
"dependencies": {
"@types/hast": "^2.0.0",
"github-slugger": "^2.0.0",
"hast-util-has-property": "^2.0.0",
"hast-util-heading-rank": "^2.0.0",
"hast-util-to-string": "^2.0.0",
"unified": "^10.0.0",
"unist-util-visit": "^4.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/rehype-stringify": { "node_modules/rehype-stringify": {
"version": "9.0.3", "version": "9.0.3",
"resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-9.0.3.tgz", "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-9.0.3.tgz",
@ -4905,21 +4712,6 @@
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
} }
}, },
"node_modules/remark-unwrap-images": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/remark-unwrap-images/-/remark-unwrap-images-3.0.1.tgz",
"integrity": "sha512-5VUY0n+J9lPTPfkct5S3/SbutryBjp8J/4mbgtlkDrOk3h8jde0hyqdYUJOoJKherZezS08tjd6i4+nnQ+wl5w==",
"dependencies": {
"@types/mdast": "^3.0.0",
"hast-util-whitespace": "^2.0.0",
"unified": "^10.0.0",
"unist-util-visit": "^4.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/resolve": { "node_modules/resolve": {
"version": "1.22.2", "version": "1.22.2",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz",
@ -5042,9 +4834,9 @@
} }
}, },
"node_modules/rollup": { "node_modules/rollup": {
"version": "3.25.1", "version": "3.20.6",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.25.1.tgz", "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.20.6.tgz",
"integrity": "sha512-tywOR+rwIt5m2ZAWSe5AIJcTat8vGlnPFAv15ycCrw33t6iFsXZ6mzHVFh2psSjxQPmI+xgzMZZizUAukBI4aQ==", "integrity": "sha512-2yEB3nQXp/tBQDN0hJScJQheXdvU2wFhh6ld7K/aiZ1vYcak6N/BKjY1QrU6BvO2JWYS8bEs14FRaxXosxy2zw==",
"bin": { "bin": {
"rollup": "dist/bin/rollup" "rollup": "dist/bin/rollup"
}, },
@ -5970,13 +5762,13 @@
} }
}, },
"node_modules/vite": { "node_modules/vite": {
"version": "4.3.9", "version": "4.3.0",
"resolved": "https://registry.npmjs.org/vite/-/vite-4.3.9.tgz", "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.0.tgz",
"integrity": "sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==", "integrity": "sha512-JTGFgDh3dVxeGBpuQX04Up+JZmuG6wu9414Ei36vQzaEruY/M4K0AgwtuB2b4HaBgB7R8l+LHxjB0jcgz4d2qQ==",
"dependencies": { "dependencies": {
"esbuild": "^0.17.5", "esbuild": "^0.17.5",
"postcss": "^8.4.23", "postcss": "^8.4.21",
"rollup": "^3.21.0" "rollup": "^3.20.2"
}, },
"bin": { "bin": {
"vite": "bin/vite.js" "vite": "bin/vite.js"
@ -6201,14 +5993,6 @@
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
}, },
"node_modules/xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
"engines": {
"node": ">=0.4"
}
},
"node_modules/yallist": { "node_modules/yallist": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
@ -8008,28 +7792,6 @@
"web-namespaces": "^2.0.0" "web-namespaces": "^2.0.0"
} }
}, },
"hast-util-has-property": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/hast-util-has-property/-/hast-util-has-property-2.0.1.tgz",
"integrity": "sha512-X2+RwZIMTMKpXUzlotatPzWj8bspCymtXH3cfG3iQKV+wPF53Vgaqxi/eLqGck0wKq1kS9nvoB1wchbCPEL8sg=="
},
"hast-util-heading-rank": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/hast-util-heading-rank/-/hast-util-heading-rank-2.1.1.tgz",
"integrity": "sha512-iAuRp+ESgJoRFJbSyaqsfvJDY6zzmFoEnL1gtz1+U8gKtGGj1p0CVlysuUAUjq95qlZESHINLThwJzNGmgGZxA==",
"requires": {
"@types/hast": "^2.0.0"
}
},
"hast-util-is-element": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-2.1.3.tgz",
"integrity": "sha512-O1bKah6mhgEq2WtVMk+Ta5K7pPMqsBBlmzysLdcwKVrqzZQ0CHqUPiIVspNhAG1rvxpvJjtGee17XfauZYKqVA==",
"requires": {
"@types/hast": "^2.0.0",
"@types/unist": "^2.0.0"
}
},
"hast-util-parse-selector": { "hast-util-parse-selector": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-3.1.1.tgz", "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-3.1.1.tgz",
@ -8087,14 +7849,6 @@
"zwitch": "^2.0.0" "zwitch": "^2.0.0"
} }
}, },
"hast-util-to-string": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/hast-util-to-string/-/hast-util-to-string-2.0.0.tgz",
"integrity": "sha512-02AQ3vLhuH3FisaMM+i/9sm4OXGSq1UhOOCpTLLQtHdL3tZt7qil69r8M8iDkZYyC0HCFylcYoP+8IO7ddta1A==",
"requires": {
"@types/hast": "^2.0.0"
}
},
"hast-util-whitespace": { "hast-util-whitespace": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz", "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-2.0.1.tgz",
@ -9388,11 +9142,6 @@
"picomatch": "^2.2.1" "picomatch": "^2.2.1"
} }
}, },
"reading-time": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/reading-time/-/reading-time-1.5.0.tgz",
"integrity": "sha512-onYyVhBNr4CmAxFsKS7bz+uTLRakypIe4R+5A824vBSkQy/hB3fZepoVEf8OVAxzLvK+H/jm9TzpI3ETSm64Kg=="
},
"rehype": { "rehype": {
"version": "12.0.1", "version": "12.0.1",
"resolved": "https://registry.npmjs.org/rehype/-/rehype-12.0.1.tgz", "resolved": "https://registry.npmjs.org/rehype/-/rehype-12.0.1.tgz",
@ -9404,90 +9153,6 @@
"unified": "^10.0.0" "unified": "^10.0.0"
} }
}, },
"rehype-autolink-headings": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/rehype-autolink-headings/-/rehype-autolink-headings-6.1.1.tgz",
"integrity": "sha512-NMYzZIsHM3sA14nC5rAFuUPIOfg+DFmf9EY1YMhaNlB7+3kK/ZlE6kqPfuxr1tsJ1XWkTrMtMoyHosU70d35mA==",
"requires": {
"@types/hast": "^2.0.0",
"extend": "^3.0.0",
"hast-util-has-property": "^2.0.0",
"hast-util-heading-rank": "^2.0.0",
"hast-util-is-element": "^2.0.0",
"unified": "^10.0.0",
"unist-util-visit": "^4.0.0"
}
},
"rehype-figure": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/rehype-figure/-/rehype-figure-1.0.1.tgz",
"integrity": "sha512-g7DJuK8R8xHIaPI3QJ6/OoWiKepn92RF2CV3z4dO7lRO6ZHo48Tu9X3KgnZUKK035srFHqWQx93AybBy12XqmQ==",
"requires": {
"hastscript": "^6.0.0",
"unist-util-visit": "^2.0.3"
},
"dependencies": {
"comma-separated-tokens": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz",
"integrity": "sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw=="
},
"hast-util-parse-selector": {
"version": "2.2.5",
"resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.5.tgz",
"integrity": "sha512-7j6mrk/qqkSehsM92wQjdIgWM2/BW61u/53G6xmC8i1OmEdKLHbk419QKQUjz6LglWsfqoiHmyMRkP1BGjecNQ=="
},
"hastscript": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/hastscript/-/hastscript-6.0.0.tgz",
"integrity": "sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w==",
"requires": {
"@types/hast": "^2.0.0",
"comma-separated-tokens": "^1.0.0",
"hast-util-parse-selector": "^2.0.0",
"property-information": "^5.0.0",
"space-separated-tokens": "^1.0.0"
}
},
"property-information": {
"version": "5.6.0",
"resolved": "https://registry.npmjs.org/property-information/-/property-information-5.6.0.tgz",
"integrity": "sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA==",
"requires": {
"xtend": "^4.0.0"
}
},
"space-separated-tokens": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz",
"integrity": "sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA=="
},
"unist-util-is": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz",
"integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg=="
},
"unist-util-visit": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz",
"integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==",
"requires": {
"@types/unist": "^2.0.0",
"unist-util-is": "^4.0.0",
"unist-util-visit-parents": "^3.0.0"
}
},
"unist-util-visit-parents": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz",
"integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==",
"requires": {
"@types/unist": "^2.0.0",
"unist-util-is": "^4.0.0"
}
}
}
},
"rehype-parse": { "rehype-parse": {
"version": "8.0.4", "version": "8.0.4",
"resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-8.0.4.tgz", "resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-8.0.4.tgz",
@ -9509,20 +9174,6 @@
"unified": "^10.0.0" "unified": "^10.0.0"
} }
}, },
"rehype-slug": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/rehype-slug/-/rehype-slug-5.1.0.tgz",
"integrity": "sha512-Gf91dJoXneiorNEnn+Phx97CO7oRMrpi+6r155tTxzGuLtm+QrI4cTwCa9e1rtePdL4i9tSO58PeSS6HWfgsiw==",
"requires": {
"@types/hast": "^2.0.0",
"github-slugger": "^2.0.0",
"hast-util-has-property": "^2.0.0",
"hast-util-heading-rank": "^2.0.0",
"hast-util-to-string": "^2.0.0",
"unified": "^10.0.0",
"unist-util-visit": "^4.0.0"
}
},
"rehype-stringify": { "rehype-stringify": {
"version": "9.0.3", "version": "9.0.3",
"resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-9.0.3.tgz", "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-9.0.3.tgz",
@ -9580,17 +9231,6 @@
"unist-util-visit": "^4.1.0" "unist-util-visit": "^4.1.0"
} }
}, },
"remark-unwrap-images": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/remark-unwrap-images/-/remark-unwrap-images-3.0.1.tgz",
"integrity": "sha512-5VUY0n+J9lPTPfkct5S3/SbutryBjp8J/4mbgtlkDrOk3h8jde0hyqdYUJOoJKherZezS08tjd6i4+nnQ+wl5w==",
"requires": {
"@types/mdast": "^3.0.0",
"hast-util-whitespace": "^2.0.0",
"unified": "^10.0.0",
"unist-util-visit": "^4.0.0"
}
},
"resolve": { "resolve": {
"version": "1.22.2", "version": "1.22.2",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz",
@ -9674,9 +9314,9 @@
"integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw=="
}, },
"rollup": { "rollup": {
"version": "3.25.1", "version": "3.20.6",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.25.1.tgz", "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.20.6.tgz",
"integrity": "sha512-tywOR+rwIt5m2ZAWSe5AIJcTat8vGlnPFAv15ycCrw33t6iFsXZ6mzHVFh2psSjxQPmI+xgzMZZizUAukBI4aQ==", "integrity": "sha512-2yEB3nQXp/tBQDN0hJScJQheXdvU2wFhh6ld7K/aiZ1vYcak6N/BKjY1QrU6BvO2JWYS8bEs14FRaxXosxy2zw==",
"requires": { "requires": {
"fsevents": "~2.3.2" "fsevents": "~2.3.2"
} }
@ -10295,14 +9935,14 @@
} }
}, },
"vite": { "vite": {
"version": "4.3.9", "version": "4.3.0",
"resolved": "https://registry.npmjs.org/vite/-/vite-4.3.9.tgz", "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.0.tgz",
"integrity": "sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==", "integrity": "sha512-JTGFgDh3dVxeGBpuQX04Up+JZmuG6wu9414Ei36vQzaEruY/M4K0AgwtuB2b4HaBgB7R8l+LHxjB0jcgz4d2qQ==",
"requires": { "requires": {
"esbuild": "^0.17.5", "esbuild": "^0.17.5",
"fsevents": "~2.3.2", "fsevents": "~2.3.2",
"postcss": "^8.4.23", "postcss": "^8.4.21",
"rollup": "^3.21.0" "rollup": "^3.20.2"
} }
}, },
"vitefu": { "vitefu": {
@ -10445,11 +10085,6 @@
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
}, },
"xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
},
"yallist": { "yallist": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",

View file

@ -12,12 +12,6 @@
"dependencies": { "dependencies": {
"astro": "^2.3.0", "astro": "^2.3.0",
"astro-compress": "^1.1.42", "astro-compress": "^1.1.42",
"less": "^4.1.3", "less": "^4.1.3"
"mdast-util-to-string": "^3.2.0",
"reading-time": "^1.5.0",
"rehype-autolink-headings": "^6.1.1",
"rehype-figure": "^1.0.1",
"rehype-slug": "^5.1.0",
"remark-unwrap-images": "^3.0.1"
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 KiB

11
public/less.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
../src/styles/theme.less

View file

@ -1,5 +0,0 @@
@import url(/theme.less);
@accent: #6570d6;
@bdrs: 2rem;
@purebg: false;
body { .theme-mixin(@accent, @bdrs, @purebg) !important; }

View file

@ -1,16 +0,0 @@
import getReadingTime from 'reading-time';
import { toString as mdToString } from 'mdast-util-to-string';
const ELLIPSIS = '\u2026';
export default function() {
return function (tree, { data }) {
const textOnPage = mdToString(tree);
const readingTime = getReadingTime(textOnPage);
data.astro.frontmatter.readingTime = readingTime.text;
const description = textOnPage.slice(0, 100) + ELLIPSIS;
data.astro.frontmatter.description = description;
};
}

View file

@ -1,67 +0,0 @@
---
import TextBox from "./TextBox.astro";
import Icon from "./Icon.astro";
export interface Props {
method: "get" | "post";
}
const { method } = Astro.props;
---
<form method={method} action="https://searx.dc09.ru/search">
<span slot="label" id="method-and-submit">
<span>
Method:
{method == "get" ? <b>GET</b> : <a href="/blog/search">GET</a>}
{method == "post" ? <b>POST</b> : <a href="/blog/search_post">POST</a>}
</span>
<span>
<label id="search-btn">
<span>
Search
</span>
<input type="submit" value="Search">
</label>
</span>
</span>
<TextBox id="q" label="Query" size={27} value="<write here> site:https://dc09.ru/blog" />
<input type="hidden" name="engines" value="google,yahoo">
</form>
<style lang="less">
#method-and-submit {
width: 100%;
display: inline-flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
#search-btn {
input[type=submit] {
display: none;
}
span {
cursor: pointer;
display: inline-flex;
justify-content: center;
align-items: center;
padding: 0 0.625rem;
font-size: 1.1rem;
background-color: var(--bg);
border: 0.125rem dashed var(--bg-sec);
border-radius: var(--bdrs);
transition: background-color 0.2s ease 0s;
&:hover {
background-color: var(--bg-sec);
}
}
}
</style>

View file

@ -1,46 +0,0 @@
---
export interface Props {
name: string;
hex: string;
}
const { name, hex } = Astro.props;
---
<a href="javascript:void(0)" class="color-button" data-hex={hex}>
<span>{name}</span>
</a>
<style lang="less" define:vars={{ hex }}>
.color-button {
padding: 0.15rem 0.3rem;
display: inline-flex;
flex-direction: column;
justify-content: center;
align-items: center;
border-radius: var(--bdrs);
background: var(--hex);
color: #fff;
transition: filter 0.2s ease 0s;
&:hover {
color: #fff;
filter: brightness(80%);
}
}
</style>
<script>
const accentInput = document.getElementById('accent') as HTMLInputElement
const btns = document.querySelectorAll('.color-button')
for (let btn of btns) {
btn.addEventListener('click', ev => {
const elem = ev.currentTarget as HTMLAnchorElement
accentInput.value = elem.dataset.hex
accentInput.dispatchEvent(new Event('input'))
})
}
</script>

View file

@ -10,26 +10,26 @@ const { code } = Astro.props;
<span class="icon">{code}</span> <span class="icon">{code}</span>
<style lang="less" is:global> <style lang="less">
@font-face { @font-face {
font-family: 'Line Awesome Regular'; font-family: 'Line Awesome Regular';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: 400;
font-display: swap; font-display: auto;
src: url("/fonts/la-regular-400.eot?#iefix") format("embedded-opentype"), url("/fonts/la-regular-400.woff2") format("woff2"), url("/fonts/la-regular-400.woff") format("woff"), url("/fonts/la-regular-400.ttf") format("truetype"); src: url("/fonts/la-regular-400.eot?#iefix") format("embedded-opentype"), url("/fonts/la-regular-400.woff2") format("woff2"), url("/fonts/la-regular-400.woff") format("woff"), url("/fonts/la-regular-400.ttf") format("truetype");
} }
@font-face { @font-face {
font-family: 'Line Awesome Solid'; font-family: 'Line Awesome Solid';
font-style: normal; font-style: normal;
font-weight: 900; font-weight: 900;
font-display: swap; font-display: auto;
src: url("/fonts/la-solid-900.eot?#iefix") format("embedded-opentype"), url("/fonts/la-solid-900.woff2") format("woff2"), url("/fonts/la-solid-900.woff") format("woff"), url("/fonts/la-solid-900.ttf") format("truetype"); src: url("/fonts/la-solid-900.eot?#iefix") format("embedded-opentype"), url("/fonts/la-solid-900.woff2") format("woff2"), url("/fonts/la-solid-900.woff") format("woff"), url("/fonts/la-solid-900.ttf") format("truetype");
} }
@font-face { @font-face {
font-family: 'Line Awesome Brands'; font-family: 'Line Awesome Brands';
font-style: normal; font-style: normal;
font-weight: 400; font-weight: normal;
font-display: swap; font-display: auto;
src: url("/fonts/la-brands-400.eot?#iefix") format("embedded-opentype"), url("/fonts/la-brands-400.woff2") format("woff2"), url("/fonts/la-brands-400.woff") format("woff"), url("/fonts/la-brands-400.ttf") format("truetype"); src: url("/fonts/la-brands-400.eot?#iefix") format("embedded-opentype"), url("/fonts/la-brands-400.woff2") format("woff2"), url("/fonts/la-brands-400.woff") format("woff"), url("/fonts/la-brands-400.ttf") format("truetype");
} }

View file

@ -1,33 +0,0 @@
---
import Icon from './Icon.astro';
export interface Props {
icon: string;
}
const { icon } = Astro.props;
---
<li>
<span class="icon-wrapper">
<Icon code={icon} />
</span>
<span class="content">
<slot />
</span>
</li>
<style lang="less">
li {
display: flex;
flex-direction: row;
align-items: center;
}
.icon-wrapper {
margin-right: 0.375rem;
width: 1.6rem;
font-size: 1.5rem;
text-align: center;
}
</style>

66
src/components/Menu.astro Normal file
View file

@ -0,0 +1,66 @@
---
import Icon from "./Icon.astro";
import ThemeModal from "./ThemeModal.astro";
---
<ThemeModal />
<nav>
<ul>
<li>
<a href="#">
<Icon code="&#xf015;" />
Homepage
</a>
</li>
<li>
<a href="#skills">
Skills
</a>
</li>
<li>
<a href="#projects">
Projects
</a>
</li>
</ul>
<ul>
<li>
<a href="#theme">
Theme
</a>
</li>
<li>
<a href="#dc09ru">
Services
</a>
</li>
<li>
<a href="https://blog.dc09.ru">
Blog
</a>
</li>
</ul>
</nav>
<style lang="less">
nav {
margin: 0.4rem;
display: flex;
flex-direction: row;
justify-content: space-between;
}
ul {
margin: 0;
padding: 0;
list-style: none;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
li {
padding: 0 0.6rem;
font-size: 1.1rem;
}
</style>

View file

@ -1,48 +0,0 @@
---
import Icon from './Icon.astro';
export interface Props {
name: string;
link: string;
icon: string;
}
const { name, link, icon } = Astro.props;
---
<li>
<a href={link}>
<span class="icon-wrapper">
<Icon code={icon} />
</span>
{name}
</a>
</li>
<style lang="less">
li {
// 0.6rem = horizontal padding
padding: 0 0.6rem;
font-size: 1.15rem;
&:first-child {
padding-left: 0;
}
&:last-child {
padding-right: 0;
}
}
a {
display: flex;
flex-direction: row;
align-items: center;
}
.icon-wrapper {
margin-right: 0.25rem;
font-size: 1.5rem;
color: var(--fg-sec);
}
</style>

View file

@ -43,18 +43,14 @@ const { app, url, name, icon, copyName = false } = Astro.props;
</script> </script>
<style lang="less"> <style lang="less">
@import "/src/styles/profile_calc.less";
.profile { .profile {
// vertical horizontal padding: 0.4rem 0.6rem;
padding: 0.4rem @profile-horiz-padding;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
width: @profile-width; border-radius: 2rem;
border-radius: var(--bdrs);
&:hover { &:hover {
background: var(--accent-bg); background: var(--accent-bg);
@ -62,6 +58,8 @@ const { app, url, name, icon, copyName = false } = Astro.props;
} }
a.profile-main { a.profile-main {
@icon-size: 2.3rem;
flex-grow: 1; flex-grow: 1;
display: flex; display: flex;
@ -72,12 +70,13 @@ const { app, url, name, icon, copyName = false } = Astro.props;
text-decoration: none; text-decoration: none;
.icon-wrapper { .icon-wrapper {
font-size: @profile-icon-app; font-size: @icon-size;
margin-right: @profile-icon-margin; margin-right: 0.4rem;
} }
} }
a.copy { a.copy {
@icon-size: 1.8rem;
position: relative; position: relative;
font-size: 1.1rem; font-size: 1.1rem;
@ -87,8 +86,8 @@ const { app, url, name, icon, copyName = false } = Astro.props;
align-items: center; align-items: center;
.icon-wrapper { .icon-wrapper {
font-size: @profile-icon-copy; font-size: @icon-size;
margin-left: @profile-icon-margin; margin-left: 0.4rem;
} }
} }
@ -96,9 +95,6 @@ const { app, url, name, icon, copyName = false } = Astro.props;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: @profile-text-width;
overflow: hidden;
.app { .app {
font-weight: 600; font-weight: 600;
} }

View file

@ -1,82 +0,0 @@
---
import Input from "../layouts/Input.astro";
export interface Props {
id: string;
label: string;
min: number;
max: number;
value: number;
}
const { id, label, min, max, value } = Astro.props;
---
<Input label="" column>
<span slot="label">
{label}:
<span class="range-value">2</span>
rem
</span>
<span slot="after">
<input type="range" name={id} id={id} min={min} max={max} value={value}>
</span>
</Input>
<style lang="less">
input {
-webkit-appearance: none;
appearance: none;
border: none;
outline: 0;
background: var(--bg);
&:focus {
outline: 0;
}
@track-height: 0.4rem;
@thumb-size: 1.05rem;
@thumb-shadow-blur: @thumb-size * 0.5;
// line
&::-webkit-slider-runnable-track,
&::-moz-range-track {
height: @track-height;
background: var(--bg-sec);
border-radius: @track-height * 0.5;
}
// circle
&::-webkit-slider-thumb,
&::-moz-range-thumb {
-webkit-appearance: none;
appearance: none;
width: @thumb-size;
height: @thumb-size;
border-radius: @thumb-size;
border: none;
//background: var(--bg);
background: #fff;
// x-offset y-offset blur color
box-shadow: 0 0 @thumb-shadow-blur var(--fg);
}
}
</style>
<script>
const ranges = document.querySelectorAll('input[type="range"]')
const handler = (ev: Event) => {
const input = ev.currentTarget as HTMLInputElement
const container = input.parentElement.parentElement
const valueSpan = container.querySelector('.range-value') as HTMLSpanElement
valueSpan.innerText = input.value
}
for (let elem of ranges) {
elem.addEventListener('input', handler)
elem.addEventListener('updatedByJavascript', handler)
elem.dispatchEvent(new Event('updatedByJavascript'))
}
</script>

View file

@ -26,14 +26,9 @@ const { id, label, checked = false } = Astro.props;
@switch-width: 2.5rem; @switch-width: 2.5rem;
@switch-height: @switch-width * 0.5; @switch-height: @switch-width * 0.5;
@switch-padding: @switch-width * 0.08;
@switch-bdrs: @switch-width * 0.4; @switch-bdrs: @switch-width * 0.4;
@circle-size: @switch-width * 0.4; @circle-size: @switch-width * 0.4;
@circle-margin: @switch-width * 0.05; @circle-margin: @switch-width * 0.04;
.input-wrapper {
padding-top: @switch-padding;
}
.switch { .switch {
display: inline-flex; display: inline-flex;

View file

@ -1,48 +1,22 @@
--- ---
import Input from '../layouts/Input.astro';
export interface Props { export interface Props {
id: string; id: string;
label: string; label: string;
value?: string;
placeholder?: string; placeholder?: string;
regex?: string; regex?: string | null;
size?: number;
} }
const { id, label, value = "", placeholder = "", regex = ".*", size = 15 } = Astro.props; const { id, label, placeholder = "", regex = null } = Astro.props;
--- ---
<Input label={label}> <label>
<span slot="after"> <span class="label">{label}</span>
<input type="text" name={id} id={id} value={value} placeholder={placeholder} pattern={regex} size={size}> <input type="text" name={id} id={id} placeholder={placeholder} pattern={regex}>
</span> </label>
</Input>
<style lang="less"> <style lang="less">
input { input {
margin-left: 0.5rem;
padding: 0.2rem;
background: var(--sec-bg); background: var(--sec-bg);
color: var(--fg); color: var(--fg);
font-size: 0.9rem;
outline: 0;
border: none;
border-bottom: 0.125rem solid var(--bg-sec);
transition: border-bottom-color 0.2s ease 0s;
&:focus {
border-bottom-color: var(--accent);
}
&:hover {
border-bottom-color: var(--accent-hl);
}
&::placeholder {
color: var(--fg-sec);
}
} }
</style> </style>

View file

@ -1,42 +1,21 @@
--- ---
import Input from "../layouts/Input.astro";
import Modal from "../layouts/Modal.astro"; import Modal from "../layouts/Modal.astro";
import ColorBtn from "./ColorBtn.astro";
import Slider from "./Slider.astro";
import Switch from "./Switch.astro"; import Switch from "./Switch.astro";
import TextBox from "./TextBox.astro"; import TextBox from "./TextBox.astro";
--- ---
<Modal id="theme"> <Modal id="theme">
<noscript class="hint"> <noscript>
These options will <b>not</b> work without JavaScript These options will <b>not</b> work without JavaScript
</noscript> </noscript>
<fieldset class="first"> <Switch id="dark" label="Dark theme" checked />
<Switch id="dark" label="Dark theme" checked /> <Switch id="custom-theme" label="Set custom colors" />
<Switch id="custom-theme" label="Advanced (&beta;eta)" />
</fieldset>
<section id="custom-colors"> <section id="custom-colors">
<label class="hint"> <TextBox id="accent" label="Accent color" placeholder="HEX (#fff)" regex="#?(?:[A-Fa-f0-9]{3}|[A-Fa-f0-9]{6})" />
You may need to reload the page <label>
after enabling/disabling "Advanced" <span class="label">Accent color</span>
<input type="color" name="accent" id="accent">
</label> </label>
<fieldset>
<Switch id="purebg" label="Pure background" />
</fieldset>
<fieldset>
<TextBox id="accent" label="Accent color" placeholder="HEX (#fff)" regex="#?(?:[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})" size={7} />
<Input label="">
<span class="color-btns" slot="after">
<ColorBtn name="red" hex="#ba505a" />
<ColorBtn name="yellow" hex="#b9aa50" />
<ColorBtn name="green" hex="#5bab65" />
<ColorBtn name="blue" hex="#6570d6" />
</span>
</Input>
</fieldset>
<fieldset>
<Slider id="bdrs" label="Border radius" min={0} max={4} value={2} />
</fieldset>
</section> </section>
</Modal> </Modal>
@ -49,189 +28,137 @@ import TextBox from "./TextBox.astro";
flex-direction: column; flex-direction: column;
} }
} }
.color-btns {
margin-top: 0.2rem;
}
.hint {
width: 18rem;
font-size: 0.9rem;
color: var(--fg-sec);
}
</style> </style>
<script> <script>
var lessLoaded = false const colorsSection = document.getElementById('custom-colors')
class ThemingOption { class ThemingOption {
input: HTMLInputElement | undefined private cookieKey: string
onchange: private cookieSwitch: Array<string | RegExp>
(opt: ThemingOption, upd: boolean) => any = private callback: (input: HTMLInputElement, state: boolean) => any
(_opt, _upd) => {} private getval: (input: HTMLInputElement) => any
private media: string | null
private _input: HTMLInputElement | null
get input() { return this._input }
constructor ( constructor (
inputId: string, cookieKey: string,
onchange: (opt: ThemingOption, upd: boolean) => any cookieSwitch: Array<string | RegExp> | null,
callback: (input: HTMLInputElement, state: boolean) => any,
getval: (input: HTMLInputElement) => any,
input: HTMLInputElement | null = null,
media: string | null = null,
) { ) {
this.input = document.getElementById(inputId) as HTMLInputElement this.cookieKey = cookieKey
this.onchange = onchange this.cookieSwitch = cookieSwitch
this.callback = callback
this.onchange(this, false) this.getval = getval
if (!this.input) return this._input = input
this.input.addEventListener( this.media = media
'input',
() => this.onchange(this, true),
)
} }
}
/** Converts string to boolean, mainly for localStorage. /*
* Returned `null` means that the key was unset. function themeCheck() {
*/ if (
const toBool = (val: string | null) => { document.cookie.includes('dc09_dark=1') || (
switch (val) { matchMedia('(prefers-color-scheme: dark)') &&
case undefined: !document.cookie.includes('dc09_dark=0')
case null: )
case '': ) {
return null document.body.dataset.dark = '1'
case 'false': switchDark.checked = true
case '0': }
return false else {
default: document.body.dataset.dark = '0'
return true switchDark.checked = false
} }
}
const colorRegex = /#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/
/** Parses color-like string and
* returns the color in the general format.
* Returned `undefined` means that it's not a color.
* If `val` is `null`, returns `null`.
*/
const toColor = (val: string | null) => {
if (!val) return null
return (val.match(colorRegex) || [])[1]
}
new ThemingOption(
'dark',
(opt, upd) => {
if (upd) {
const state = opt.input.checked
localStorage.setItem('dc09_dark', state ? '1' : '0')
return opt.onchange(opt, false)
} }
const stored = toBool(localStorage.getItem('dc09_dark')) Here is the rewritten themeCheck:
const media = matchMedia('(prefers-color-scheme: dark)') */
check() {
const state = ( const match = this.cookieSwitch.map(
stored || ( value => document.cookie.match(
stored === null && `${this.cookieKey}=${value}`
media.matches
) )
) )
opt.input.checked = state
document.body.dataset.dark = state ? '1' : '0'
}
)
const purebgOpt = new ThemingOption( if (
'purebg', // pure background match[1] || (
(opt, upd) => { this.media && !match[0] &&
if (upd) { matchMedia(this.media).matches
const state = opt.input.checked )
localStorage.setItem('dc09_purebg', state ? '1' : '0') ) {
reloadTheme() if (this.callback)
return opt.onchange(opt, false) this.callback(this._input, true)
}
opt.input.checked = toBool(localStorage.getItem('dc09_purebg'))
}
)
const accentOpt = new ThemingOption(
'accent',
(opt, upd) => {
if (upd) {
if (!opt.input.validity.valid) return
const color = toColor(opt.input.value)
if (!color) return
localStorage.setItem('dc09_accent', color)
reloadTheme()
return return
} }
const color = localStorage.getItem('dc09_accent') || '6570d6' if (this.callback)
opt.input.value = color this.callback(this._input, false)
} }
)
const bdrsOpt = new ThemingOption( update() {
'bdrs', // border-radius, as in Emmet const value = this.getval(this._input)
(opt, upd) => { const localhost = window.location.hostname == 'localhost'
if (upd) { const domain = localhost ? 'localhost' : 'dc09.ru'
const value = opt.input.value const cookie = `${this.cookieKey}=${value};domain=${domain};samesite=lax`
localStorage.setItem('dc09_bdrs', value) document.cookie = cookie
reloadTheme() this.check()
return
}
let value = Number(localStorage.getItem('dc09_bdrs'))
value = isNaN(value) ? 2 : value
opt.input.value = String(value)
opt.input.dispatchEvent(new Event('updatedByJavascript'))
} }
)
const colorsSection = document.getElementById('custom-colors')
new ThemingOption(
'custom-theme',
(opt, upd) => {
if (upd) {
const state = opt.input.checked
localStorage.setItem('dc09_custom', state ? '1' : '0')
return opt.onchange(opt, false)
}
const state = toBool(localStorage.getItem('dc09_custom'))
opt.input.checked = state
colorsSection.dataset.show = state ? '1' : '0'
if (state)
reloadLess()
}
)
function reloadLess() {
if (!lessLoaded) {
// Load `theme_dyn.less`
const lessStyles = document.createElement('link')
lessStyles.rel = 'stylesheet/less'
lessStyles.type = 'text/css'
lessStyles.href = '/theme_dyn.less'
document.head.append(lessStyles)
// Create LessCSS script element
const lessScript = document.createElement('script')
lessScript.src = '/less.min.js'
// Modify variables when less is loaded
lessScript.addEventListener('load', reloadTheme)
// Load LessCSS script
document.head.append(lessScript)
}
else
reloadTheme()
} }
function reloadTheme() { const opts = {
const accent = '#' + toColor(accentOpt.input.value) dark: new ThemingOption(
const bdrs = Number(bdrsOpt.input.value) 'dc09_dark', ['0', '1'],
const purebg = purebgOpt.input.checked (input: HTMLInputElement, state: boolean) => {
eval('less').modifyVars({ input.checked = state
accent: accent, document.body.dataset.dark = state ? '1' : '0'
bdrs: `${bdrs}rem`, },
purebg: purebg, (input: HTMLInputElement) => input.checked ? 1 : 0,
}) document.getElementById('dark') as HTMLInputElement,
'(prefers-color-scheme: dark)',
),
custom: new ThemingOption(
'dc09_custom', ['0', '1'],
(input: HTMLInputElement, state: boolean) => {
input.checked = state
colorsSection.dataset.show = state ? '1' : '0'
if (state)
loadCustomTheme()
},
(input: HTMLInputElement) => input.checked ? 1 : 0,
document.getElementById('custom-theme') as HTMLInputElement,
)
}
for (let optObj of Object.values(opts)) {
((opt) => {
opt.check()
opt.input.addEventListener('input', () => opt.update())
})(optObj)
}
function loadCustomTheme() {
// Load `theme.less`
const lessStyles = document.createElement('link')
lessStyles.rel = 'stylesheet/less'
lessStyles.type = 'text/css'
lessStyles.href = '/src/styles/theme.less'
document.head.append(lessStyles)
// Load LessCSS script element
const lessScript = document.createElement('script')
lessScript.src = 'https://cdn.jsdelivr.net/npm/less'
// Replace variables
lessScript.onload = () => {
eval('less').modifyVars({
'accent': '#50aa70',
})
}
// Load LessCSS
document.head.append(lessScript)
} }
</script> </script>

View file

@ -1,27 +0,0 @@
# H1
## H2
### H3
#### H4
##### H5
###### H6
```
123
```
_Hello_
**world**
|Col1|Col2|Col3|
|:--:|:---|---:|
|Some|cool|data|
|12345678|11|00|
```js
console.log(Object.keys({a:'a',b:'b'}))
```
> Quotation
![Forest](https://dc09.ru/forest.jpg)
123

View file

@ -1,15 +0,0 @@
The standard Lorem Ipsum passage, used since the 1500s
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"
1914 translation by H. Rackham
"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?"
Section 1.10.33 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC
"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat."
1914 translation by H. Rackham
"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish. In a free hour, when our power of choice is untrammelled and when nothing prevents our being able to do what we like best, every pleasure is to be welcomed and every pain avoided. But in certain circumstances and owing to the claims of duty or the obligations of business it will frequently occur that pleasures have to be repudiated and annoyances accepted. The wise man therefore always holds in these matters to this principle of selection: he rejects pleasures to secure other greater pleasures, or else he endures pains to avoid worse pains."

1
src/env.d.ts vendored
View file

@ -1,2 +1 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" /> /// <reference types="astro/client" />

View file

@ -1,25 +0,0 @@
---
import Layout from "./Layout.astro";
import Menu from "./Menu.astro";
import MenuItem from "../components/MenuItem.astro";
export interface Props {
title: string;
description: string;
}
const { title, description } = Astro.props;
---
<Layout title={"Blog | " + title} description={description}>
<slot name="metadata" slot="metadata" />
<Menu>
<MenuItem name="All articles" icon="&#xf015;" link="/blog" />
<MenuItem name="Shorts" icon="&#xf0e7;" link="/blog/shorts" />
<MenuItem name="Random post" icon="&#xf522;" link="/blog/random" />
<MenuItem name="Search" icon="&#xf002;" link="/blog/search" />
</Menu>
<main>
<slot />
</main>
</Layout>

View file

@ -1,47 +1,26 @@
--- ---
export interface Props { export interface Props {
label: string; label: string;
column?: boolean;
} }
const { label, column = false } = Astro.props; const { label } = Astro.props;
const flexDirection = column ? "column" : "row";
const flexAlign = column ? "start" : "center";
const cursor = column ? "normal" : "pointer";
--- ---
<label> <label>
<slot name="before" /> <slot name="before" />
<slot name="label"> <span class="label">{label}</span>
<span class="label">
{label}
</span>
</slot>
<slot name="after" /> <slot name="after" />
</label> </label>
<style lang="less" define:vars={{ flexDirection, flexAlign, cursor }}> <style lang="less">
label { label {
display: flex; display: flex;
flex-direction: var(--flexDirection); flex-direction: row;
align-items: var(--flexAlign); align-items: center;
cursor: var(--cursor); cursor: pointer;
margin-top: 0.5rem; &:not(:first-of-type) {
} margin-top: 0.25rem;
:global(fieldset) {
margin: 0;
padding: 0;
border: none;
&.first > label:first-of-type {
margin-top: 0;
}
& > label:not(:first-of-type) {
margin-top: 0;
} }
} }
</style> </style>

View file

@ -1,10 +1,11 @@
--- ---
import Menu from '../components/Menu.astro';
export interface Props { export interface Props {
title: string; title: string;
description: string;
} }
const { title, description } = Astro.props; const { title } = Astro.props;
--- ---
<!DOCTYPE html> <!DOCTYPE html>
@ -13,23 +14,21 @@ const { title, description } = Astro.props;
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} /> <meta name="generator" content={Astro.generator} />
<meta name="description" content={description} /> <meta name="description" content="Hi! I'm Andrew aka DarkCat09, a 13-years-old fullstack developer from Russia" />
<slot name="metadata" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<title>{title}</title> <title>{title}</title>
</head> </head>
<body> <body>
<Menu />
<slot /> <slot />
</body> </body>
</html> </html>
<style lang="less" is:global> <style lang="less" is:global>
@import "/src/styles/theme.less"; @import "/src/styles/theme.less";
@import "/src/styles/max_width.less";
body { body {
.theme-mixin();
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -44,25 +43,13 @@ const { title, description } = Astro.props;
main { main {
margin: auto; margin: auto;
padding: 0.25rem; padding: 0.25rem;
max-width: @max-width; max-width: 300rem;
}
article {
max-width: 100vw;
width: fit-content;
margin: auto;
} }
section { section {
margin: 0.5rem 0; margin: 0.5rem 0;
} }
.card {
border: 0.125rem dashed var(--bg-sec);
border-radius: var(--bdrs);
padding: 0.625rem;
}
hgroup > * { hgroup > * {
margin: 0; margin: 0;
@ -73,19 +60,10 @@ const { title, description } = Astro.props;
font-weight: 500; font-weight: 500;
} }
} }
h1 { font-size: 2.4rem; }
h1 { font-size: 2.50rem; }
h2 { font-size: 2.00rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.40rem; }
h5 { font-size: 1.20rem; }
h6 {
color: var(--fg-sec);
font-size: 1.1rem;
}
a, .link { a, .link {
color: var(--accent-fg); color: var(--accent);
text-decoration: none; text-decoration: none;
&:hover { &:hover {

View file

@ -1,24 +0,0 @@
---
import Layout from "./Layout.astro";
import Menu from "./Menu.astro";
import MenuItem from "../components/MenuItem.astro";
export interface Props {
page: string;
description: string;
}
const { page, description } = Astro.props;
---
<Layout title={"DarkCat09 | " + page} description={description}>
<Menu>
<MenuItem name="Homepage" icon="&#xf015;" link="/" />
<MenuItem name="Projects" icon="&#xf121;" link="/projects" />
<MenuItem name="Services" icon="&#xf233;" link="/services" />
<MenuItem name="Blog" icon="&#xf1ea;" link="/blog" />
</Menu>
<main>
<slot />
</main>
</Layout>

View file

@ -1,37 +0,0 @@
---
import MenuItem from "../components/MenuItem.astro";
import ThemeModal from "../components/ThemeModal.astro";
---
<ThemeModal />
<nav>
<ul>
<slot />
</ul>
<ul>
<MenuItem name="Theme" icon="&#xf53f;" link="#theme" />
</ul>
</nav>
<style lang="less">
@import "/src/styles/max_width.less";
nav {
margin: 0.4rem auto;
max-width: @max-width;
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
}
ul {
margin: 0;
padding: 0;
list-style: none;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
</style>

View file

@ -56,7 +56,7 @@ const { id } = Astro.props;
padding: 1rem; padding: 1rem;
z-index: 102; z-index: 102;
border-radius: var(--bdrs); border-radius: 2rem;
background: var(--bg); background: var(--bg);
} }

View file

@ -1,178 +0,0 @@
---
import BlogLayout from "../../layouts/BlogLayout.astro";
import { getCollection } from "astro:content";
import { AstroComponentFactory } from "astro/dist/runtime/server";
import { MarkdownHeading } from "astro";
type postType = {
id: string;
slug: string;
body: string;
collection: "blog";
data: any;
} & {
render(): Promise<{
Content: AstroComponentFactory;
headings: MarkdownHeading[];
remarkPluginFrontmatter: Record<string, any>;
}>;
};
export async function getStaticPaths() {
const posts = await getCollection("blog");
return posts.map((post) => ({
params: {
slug: post.slug,
},
props: { post },
}));
}
const { slug } = Astro.params;
const post: postType = Astro.props.post;
const postObj = await post.render();
const fm = postObj.remarkPluginFrontmatter;
const title = postObj.headings[0]?.text || '';
const description = fm.description;
const readingTime = fm.readingTime;
let dateStr = slug.split("-", 1)[0];
let date: Date | undefined;
if (isNaN(Number(dateStr))) {
dateStr = undefined;
}
else {
date = new Date(
`${dateStr.slice(0,4)}-` +
`${dateStr.slice(4,6)}-` +
`${dateStr.slice(6,8)}`
)
}
const image = (post.body.match(/(?:\s|^)!\[.*\]\((.*?)\)/) || [])[1];
---
<BlogLayout title={title} description={description}>
<Fragment slot="metadata">
<meta property="og:type" content="article" />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:image" content={image} />
<meta property="article:published_time" content={date?.toISOString()} />
<meta property="article:author" content="DarkCat09" />
<meta property="twitter:card" content="summary" />
<meta property="twitter:title" content={title} />
<meta property="twitter:description" content={description} />
<meta property="twitter:image" content={image} />
</Fragment>
<header>
<h1>{title}</h1>
<address>
on
<time datetime={date?.toISOString()}>{date?.toLocaleDateString()}</time>
by
<a href="https://t.me/dcat09" rel="author">DarkCat09</a>
//
<span id="reading-time">
{readingTime}
</span>
</address>
</header>
<article>
<postObj.Content />
</article>
</BlogLayout>
<style lang="less" is:global>
article {
//padding: 0 0.75rem;
& > h1:first-of-type {
display: none;
}
}
h1, h2, h3, h4, h5, h6 {
margin: 0;
span.icon::before {
content: "\f0c1";
font-size: 1.1rem;
display: none;
}
&:hover span.icon::before {
display: inline-block;
}
}
.heading-link {
display: inline-block;
font-size: 1rem;
}
blockquote {
margin: 0;
padding: 0;
padding-left: 1.2rem;
border-left: 0.25rem solid var(--bg-sec);
}
pre {
padding: 1rem;
border-radius: var(--bdrs);
font-size: 1rem;
font-family:
"JetBrains Mono", "Fira Code", "Iosevka", "Source Code Pro",
"Liberation Mono", "Lucida Console", monospace;
}
img {
display: block;
max-width: 90%;
margin: auto;
}
figcaption {
width: fit-content;
margin: auto;
font-size: 0.9rem;
color: var(--fg-sec);
}
table {
max-width: 90%;
margin: auto;
border-collapse: collapse;
border-bottom: 0.125rem dashed var(--bg-sec);
th, td {
padding: 0.125rem 1rem;
}
th {
background: var(--bg-sec);
&:first-child {
border-top-left-radius: var(--bdrs);
border-bottom-left-radius: var(--bdrs);
}
&:last-child {
border-top-right-radius: var(--bdrs);
border-bottom-right-radius: var(--bdrs);
}
}
tbody > tr {
&:hover {
color: var(--accent-hl);
}
}
}
</style>

View file

@ -1,14 +0,0 @@
---
import BlogLayout from "../../layouts/BlogLayout.astro";
const description =
"DarkCat09's blog about IT. " +
"Reading a QR code without smartphone, " +
"breaking a password on Windows, " +
"coding your own browser... " +
"The simpliest things!";
---
<BlogLayout title="Homepage" description={description}>
//
</BlogLayout>

View file

@ -1,47 +0,0 @@
---
import { getCollection } from "astro:content";
const posts = await getCollection('blog');
const encodedArray =
'["' + posts.map(post => post.slug).join('","') + '"]';
---
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<meta name="robots" content="noindex, nofollow" />
<meta id="posts" data-posts={encodedArray} />
<title>Random post</title>
</head>
<body>
<noscript>
"Random post" feature does not work without JavaScript
</noscript>
</body>
</html>
<style lang="less">
@import "/src/styles/theme.less";
body {
.theme-mixin();
background: var(--bg);
color: var(--fg);
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Liberation Sans', 'Helvetica Neue', sans-serif;
}
noscript {
font-size: 2rem;
}
</style>
<script>
const data = document.getElementById('posts').dataset.posts || "[]"
const arr: Array<string> = JSON.parse(data)
const rand = Math.floor(Math.random() * arr.length)
window.location.href = window.location.origin + '/blog/' + arr[rand]
</script>

View file

@ -1,8 +0,0 @@
---
import BlogLayout from "../../layouts/BlogLayout.astro";
import BlogSearch from "../../components/BlogSearch.astro";
---
<BlogLayout title="Search" description="Search through the blog">
<BlogSearch method={"get"} />
</BlogLayout>

View file

@ -1,8 +0,0 @@
---
import BlogLayout from "../../layouts/BlogLayout.astro";
import BlogSearch from "../../components/BlogSearch.astro";
---
<BlogLayout title="Blog | Search" description="Search through the blog">
<BlogSearch method={"post"} />
</BlogLayout>

View file

@ -1,11 +0,0 @@
---
import BlogLayout from "../../layouts/BlogLayout.astro";
const description =
"Short stories from my life " +
"on the topic of IT";
---
<BlogLayout title="Blog | Shorts" description={description}>
//
</BlogLayout>

View file

@ -1,103 +1,36 @@
--- ---
import MainLayout from '../layouts/MainLayout.astro'; import Layout from '../layouts/Layout.astro';
import Profile from '../components/Profile.astro'; import Profile from '../components/Profile.astro';
import ListItem from '../components/ListItem.astro';
const description =
"Hi! I'm Andrew aka DarkCat09, " +
"a 13-years-old fullstack developer from Russia";
--- ---
<MainLayout page="Homepage" description={description}> <Layout title="DarkCat09 | Homepage">
<article class="centered"> <main>
<hgroup> <hgroup>
<h1>Hi! I'm Andrew.</h1> <h1>Hi! I'm Andrew.</h1>
<h2><span id="age">13</span>-years-old fullstack dev</h2> <h2>13-years-old fullstack dev</h2>
</hgroup> </hgroup>
<section id="profiles"> <section id="profiles">
<Profile app="Gitea" icon="&#xf1d3;" name="DarkCat09" url="https://git.dc09.ru/DarkCat09" /> <Profile app="Gitea" icon="&#xf1d3;" name="DarkCat09" url="https://git.dc09.ru/DarkCat09" />
<Profile app="GitHub" icon="&#xf09b;" name="DarkCat09" url="https://github.com/DarkCat09" /> <Profile app="GitHub" icon="&#xf09b;" name="DarkCat09" url="https://github.com/DarkCat09" />
<Profile app="E-mail" icon="&#xf0e0;" name="darkcat09@vivaldi.net" url="mailto:darkcat09@vivaldi.net" copyName /> <Profile app="E-mail" icon="&#xf0e0;" name="darkcat09@vivaldi.net" url="mailto:darkcat09@vivaldi.net" copyName />
<Profile app="Telegram" icon="&#xf2c6;" name="@darkcat09" url="https://t.me/darkcat09" /> <Profile app="Telegram" icon="&#xf2c6;" name="@darkcat09" url="https://t.me/darkcat09" />
<Profile app="Matrix" icon="&#xf4ad;" name="darkcat09:dc09.ru" url="https://matrix.to/#/@darkcat09:dc09.ru" copyName /> <Profile app="Matrix" icon="&#xf4ad;" name="darkcat09@dc09.ru" url="https://matrix.to/#/@darkcat09:dc09.ru" copyName />
<Profile app="Discord" icon="&#xf392;" name="DarkCat09#5587" url="https://discord.com/app" copyName /> <Profile app="Discord" icon="&#xf392;" name="DarkCat09#5587" url="https://discord.com/app" copyName />
</section> </section>
</article> </main>
<article class="card" id="about"> </Layout>
<ul>
<ListItem icon="&#xf05a;">
<a href="https://t.me/dc09about" target="_blank">
https://t.me/dc09about
</a>
</ListItem>
<ListItem icon="&#xf5a0;">
Russia, Ulyanovsk
</ListItem>
<ListItem icon="&#xf025;">
Favorite music bands:
</ListItem>
<ListItem icon="">
<ul>
<li>Linkin Park</li>
<li>One Direction</li>
<li>Set It Off</li>
<li>Дайте танк (!)</li>
<li>Научно-технический рэп</li>
<li>Imagine Dragons</li>
</ul>
</ListItem>
<ListItem icon="&#xf108;">
Favorite OS: Manjaro Linux
</ListItem>
<ListItem icon="">
<code>
<b>CPU:</b> 6-core Intel Core i5-10400 (-MT MCP-) <b>speed/min/max:</b> 2725/800/4300 MHz<br />
<b>Kernel:</b> 6.3.4-1-MANJARO x86_64 <b>Up:</b> 3h 32m <b>Mem:</b> 6763.3/30935.8 MiB (21.9%)<br />
<b>Storage:</b> 1.36 TiB (15.8% used) <b>Procs:</b> 303 <b>Shell:</b> Zsh <b>inxi:</b> 3.3.27
</code>
</ListItem>
</ul>
</article>
</MainLayout>
<style lang="less"> <style lang="less">
@import "/src/styles/profile_calc.less";
#profiles { #profiles {
display: grid; display: grid;
grid-template-columns: repeat(1, auto); grid-template-columns: repeat(1, auto);
@media (min-width: @profile-width * 2) { @media (min-width: 450px) {
grid-template-columns: repeat(2, auto); grid-template-columns: repeat(2, auto);
} }
@media (min-width: @profile-width * 3) { @media (min-width: 670px) {
grid-template-columns: repeat(3, auto); grid-template-columns: repeat(3, auto);
} }
} }
#about > ul {
list-style: none;
margin: 0;
padding: 0;
}
code {
font-family: 'Hack', 'Liberation Mono', 'Source Code Pro', monospace;
font-size: 0.9rem;
}
</style> </style>
<script>
// in milliseconds
const ageMs = Date.now() - 1247481000000
// in years
let age = ageMs / (1000 * 60 * 60 * 24 * 365.25)
// fallback to default value
// + rounding
age = (age < 13 ? 13 : Math.floor(age))
document.getElementById('age').innerText = String(age)
</script>

View file

@ -1,7 +0,0 @@
---
import MainLayout from "../layouts/MainLayout.astro";
---
<MainLayout page="Projects & Skills" description="">
//
</MainLayout>

View file

@ -1,11 +0,0 @@
---
import MainLayout from "../layouts/MainLayout.astro";
const description =
"Status and description of services " +
"hosted on my VPS on *.dc09.ru";
---
<MainLayout page="Services" description={description}>
//
</MainLayout>

View file

@ -1 +0,0 @@
@max-width: 800px;

View file

@ -1,9 +0,0 @@
@profile-icon-app: 2.3rem;
@profile-icon-copy: 1.8rem;
@profile-text-width: 9.5rem;
@profile-icon-margin: 0.4rem;
@profile-horiz-padding: 0.6rem;
@profile-width: @profile-horiz-padding + @profile-icon-app + @profile-icon-margin + @profile-text-width + @profile-icon-margin + @profile-icon-copy + @profile-horiz-padding;

View file

@ -1,50 +1,30 @@
.theme-mixin(@accent: #6570d6, @bdrs: 2rem, @purebg: false) { @accent: #5070ca;
@bg-pure-light: #fff; body {
@bg-colored-light: hsl( @bg-light: #fff;
hue(@accent), @fg-light: #202020;
15%, 95%,
);
@bg-light: if(@purebg, @bg-pure-light, @bg-colored-light); // background @bg-dark: #222229;
@fg-light: #202020; // foreground @fg-dark: #eee;
@bg-pure-dark: #222;
@bg-colored-dark: hsl(
hue(@accent),
5%, 15%,
);
@bg-dark: if(@purebg, @bg-pure-dark, @bg-colored-dark); // background
@fg-dark: #eee; // foreground
--accent: @accent; --accent: @accent;
--bdrs: @bdrs;
.light-mixin() { .light-mixin() {
--bg: @bg-light; --bg: @bg-light;
--fg: @fg-light; --fg: @fg-light;
--bg-sec: darken(@bg-light, 30%); --bg-sec: darken(@bg-light, 30%);
--fg-sec: lighten(@fg-light, 25%); --fg-sec: lighten(@fg-light, 15%);
--accent-bg: darken(@bg-light, 10%);
@accent-fg: darken(@accent, 7%); --accent-hl: darken(@accent, 15%);
--accent-bg: darken(@bg-light, 8%);
--accent-fg: @accent-fg;
--accent-hl: darken(@accent-fg, 15%);
} }
.dark-mixin() { .dark-mixin() {
--bg: @bg-dark; --bg: @bg-dark;
--fg: @fg-dark; --fg: @fg-dark;
--bg-sec: lighten(@bg-dark, 15%); --bg-sec: lighten(@bg-dark, 15%);
--fg-sec: darken(@fg-dark, 30%); --fg-sec: darken(@bg-light, 25%);
@accent-fg: lighten(@accent, 7%);
--accent-bg: lighten(@bg-dark, 5%); --accent-bg: lighten(@bg-dark, 5%);
--accent-fg: @accent-fg; --accent-hl: lighten(@accent, 15%);
--accent-hl: lighten(@accent-fg, 15%);
} }
.dark-mixin(); .dark-mixin();