Canonical repo for Dong Web (dong.vielle.dev)

chore: minor changes

Changed files
+124 -40
src
+3 -2
astro.config.mjs
··· 1 // @ts-check 2 - import { defineConfig } from 'astro/config'; 3 4 // https://astro.build/config 5 - export default defineConfig({});
··· 1 // @ts-check 2 + import { defineConfig } from "astro/config"; 3 4 // https://astro.build/config 5 + export default defineConfig({ 6 + });
+107 -7
pnpm-lock.yaml
··· 10 dependencies: 11 astro: 12 specifier: ^5.1.8 13 - version: 5.1.8(rollup@4.31.0)(typescript@5.7.3) 14 15 packages: 16 ··· 306 cpu: [x64] 307 os: [win32] 308 309 '@jridgewell/sourcemap-codec@1.5.0': 310 resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} 311 312 '@nodelib/fs.scandir@2.1.5': 313 resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} ··· 470 '@types/nlcst@2.0.3': 471 resolution: {integrity: sha512-vSYNSDe6Ix3q+6Z7ri9lyWqgGhJTmzRjZRqyq15N0Z/1/UnVsno9G/N40NBijoYx2seFDIl0+B2mgAb9mezUCA==} 472 473 '@types/unist@3.0.3': 474 resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} 475 ··· 540 resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} 541 engines: {node: '>=8'} 542 543 camelcase@8.0.0: 544 resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} 545 engines: {node: '>=16'} ··· 592 593 comma-separated-tokens@2.0.3: 594 resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} 595 596 common-ancestor-path@1.0.1: 597 resolution: {integrity: sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==} ··· 1216 resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} 1217 engines: {node: '>=0.10.0'} 1218 1219 space-separated-tokens@2.0.2: 1220 resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} 1221 ··· 1244 strip-bom@3.0.0: 1245 resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} 1246 engines: {node: '>=4'} 1247 1248 tinyexec@0.3.2: 1249 resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} ··· 1288 1289 uncrypto@0.1.3: 1290 resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} 1291 1292 unenv@1.10.0: 1293 resolution: {integrity: sha512-wY5bskBQFL9n3Eca5XnhH6KbUo/tfvkwm9OpcdCvLaeA7piBNbavbOKJySEwQ1V0RH6HvNlSAFRTpvTqgKRQXQ==} ··· 1707 '@img/sharp-win32-x64@0.33.5': 1708 optional: true 1709 1710 '@jridgewell/sourcemap-codec@1.5.0': {} 1711 1712 '@nodelib/fs.scandir@2.1.5': 1713 dependencies: ··· 1845 dependencies: 1846 '@types/unist': 3.0.3 1847 1848 '@types/unist@3.0.3': {} 1849 1850 '@ungap/structured-clone@1.2.1': {} ··· 1876 1877 array-iterate@2.0.1: {} 1878 1879 - astro@5.1.8(rollup@4.31.0)(typescript@5.7.3): 1880 dependencies: 1881 '@astrojs/compiler': 2.10.3 1882 '@astrojs/internal-helpers': 0.4.2 ··· 1928 unist-util-visit: 5.0.0 1929 unstorage: 1.14.4 1930 vfile: 6.0.3 1931 - vite: 6.0.11 1932 - vitefu: 1.0.5(vite@6.0.11) 1933 which-pm: 3.0.0 1934 xxhash-wasm: 1.1.0 1935 yargs-parser: 21.1.1 ··· 1996 dependencies: 1997 fill-range: 7.1.1 1998 1999 camelcase@8.0.0: {} 2000 2001 ccount@2.0.1: {} ··· 2047 optional: true 2048 2049 comma-separated-tokens@2.0.3: {} 2050 2051 common-ancestor-path@1.0.1: {} 2052 ··· 2980 2981 source-map-js@1.2.1: {} 2982 2983 space-separated-tokens@2.0.2: {} 2984 2985 sprintf-js@1.0.3: {} ··· 3011 3012 strip-bom@3.0.0: {} 3013 3014 tinyexec@0.3.2: {} 3015 3016 to-regex-range@5.0.1: ··· 3037 ultrahtml@1.5.3: {} 3038 3039 uncrypto@0.1.3: {} 3040 3041 unenv@1.10.0: 3042 dependencies: ··· 3124 '@types/unist': 3.0.3 3125 vfile-message: 4.0.2 3126 3127 - vite@6.0.11: 3128 dependencies: 3129 esbuild: 0.24.2 3130 postcss: 8.5.1 3131 rollup: 4.31.0 3132 optionalDependencies: 3133 fsevents: 2.3.3 3134 3135 - vitefu@1.0.5(vite@6.0.11): 3136 optionalDependencies: 3137 - vite: 6.0.11 3138 3139 web-namespaces@2.0.1: {} 3140
··· 10 dependencies: 11 astro: 12 specifier: ^5.1.8 13 + version: 5.1.8(@types/node@22.10.10)(rollup@4.31.0)(terser@5.37.0)(typescript@5.7.3) 14 15 packages: 16 ··· 306 cpu: [x64] 307 os: [win32] 308 309 + '@jridgewell/gen-mapping@0.3.8': 310 + resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==} 311 + engines: {node: '>=6.0.0'} 312 + 313 + '@jridgewell/resolve-uri@3.1.2': 314 + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} 315 + engines: {node: '>=6.0.0'} 316 + 317 + '@jridgewell/set-array@1.2.1': 318 + resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} 319 + engines: {node: '>=6.0.0'} 320 + 321 + '@jridgewell/source-map@0.3.6': 322 + resolution: {integrity: sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==} 323 + 324 '@jridgewell/sourcemap-codec@1.5.0': 325 resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} 326 + 327 + '@jridgewell/trace-mapping@0.3.25': 328 + resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} 329 330 '@nodelib/fs.scandir@2.1.5': 331 resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} ··· 488 '@types/nlcst@2.0.3': 489 resolution: {integrity: sha512-vSYNSDe6Ix3q+6Z7ri9lyWqgGhJTmzRjZRqyq15N0Z/1/UnVsno9G/N40NBijoYx2seFDIl0+B2mgAb9mezUCA==} 490 491 + '@types/node@22.10.10': 492 + resolution: {integrity: sha512-X47y/mPNzxviAGY5TcYPtYL8JsY3kAq2n8fMmKoRCxq/c4v4pyGNCzM2R6+M5/umG4ZfHuT+sgqDYqWc9rJ6ww==} 493 + 494 '@types/unist@3.0.3': 495 resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} 496 ··· 561 resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} 562 engines: {node: '>=8'} 563 564 + buffer-from@1.1.2: 565 + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} 566 + 567 camelcase@8.0.0: 568 resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} 569 engines: {node: '>=16'} ··· 616 617 comma-separated-tokens@2.0.3: 618 resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} 619 + 620 + commander@2.20.3: 621 + resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} 622 623 common-ancestor-path@1.0.1: 624 resolution: {integrity: sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==} ··· 1243 resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} 1244 engines: {node: '>=0.10.0'} 1245 1246 + source-map-support@0.5.21: 1247 + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} 1248 + 1249 + source-map@0.6.1: 1250 + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} 1251 + engines: {node: '>=0.10.0'} 1252 + 1253 space-separated-tokens@2.0.2: 1254 resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} 1255 ··· 1278 strip-bom@3.0.0: 1279 resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} 1280 engines: {node: '>=4'} 1281 + 1282 + terser@5.37.0: 1283 + resolution: {integrity: sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==} 1284 + engines: {node: '>=10'} 1285 + hasBin: true 1286 1287 tinyexec@0.3.2: 1288 resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} ··· 1327 1328 uncrypto@0.1.3: 1329 resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} 1330 + 1331 + undici-types@6.20.0: 1332 + resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} 1333 1334 unenv@1.10.0: 1335 resolution: {integrity: sha512-wY5bskBQFL9n3Eca5XnhH6KbUo/tfvkwm9OpcdCvLaeA7piBNbavbOKJySEwQ1V0RH6HvNlSAFRTpvTqgKRQXQ==} ··· 1749 '@img/sharp-win32-x64@0.33.5': 1750 optional: true 1751 1752 + '@jridgewell/gen-mapping@0.3.8': 1753 + dependencies: 1754 + '@jridgewell/set-array': 1.2.1 1755 + '@jridgewell/sourcemap-codec': 1.5.0 1756 + '@jridgewell/trace-mapping': 0.3.25 1757 + optional: true 1758 + 1759 + '@jridgewell/resolve-uri@3.1.2': 1760 + optional: true 1761 + 1762 + '@jridgewell/set-array@1.2.1': 1763 + optional: true 1764 + 1765 + '@jridgewell/source-map@0.3.6': 1766 + dependencies: 1767 + '@jridgewell/gen-mapping': 0.3.8 1768 + '@jridgewell/trace-mapping': 0.3.25 1769 + optional: true 1770 + 1771 '@jridgewell/sourcemap-codec@1.5.0': {} 1772 + 1773 + '@jridgewell/trace-mapping@0.3.25': 1774 + dependencies: 1775 + '@jridgewell/resolve-uri': 3.1.2 1776 + '@jridgewell/sourcemap-codec': 1.5.0 1777 + optional: true 1778 1779 '@nodelib/fs.scandir@2.1.5': 1780 dependencies: ··· 1912 dependencies: 1913 '@types/unist': 3.0.3 1914 1915 + '@types/node@22.10.10': 1916 + dependencies: 1917 + undici-types: 6.20.0 1918 + optional: true 1919 + 1920 '@types/unist@3.0.3': {} 1921 1922 '@ungap/structured-clone@1.2.1': {} ··· 1948 1949 array-iterate@2.0.1: {} 1950 1951 + astro@5.1.8(@types/node@22.10.10)(rollup@4.31.0)(terser@5.37.0)(typescript@5.7.3): 1952 dependencies: 1953 '@astrojs/compiler': 2.10.3 1954 '@astrojs/internal-helpers': 0.4.2 ··· 2000 unist-util-visit: 5.0.0 2001 unstorage: 1.14.4 2002 vfile: 6.0.3 2003 + vite: 6.0.11(@types/node@22.10.10)(terser@5.37.0) 2004 + vitefu: 1.0.5(vite@6.0.11(@types/node@22.10.10)(terser@5.37.0)) 2005 which-pm: 3.0.0 2006 xxhash-wasm: 1.1.0 2007 yargs-parser: 21.1.1 ··· 2068 dependencies: 2069 fill-range: 7.1.1 2070 2071 + buffer-from@1.1.2: 2072 + optional: true 2073 + 2074 camelcase@8.0.0: {} 2075 2076 ccount@2.0.1: {} ··· 2122 optional: true 2123 2124 comma-separated-tokens@2.0.3: {} 2125 + 2126 + commander@2.20.3: 2127 + optional: true 2128 2129 common-ancestor-path@1.0.1: {} 2130 ··· 3058 3059 source-map-js@1.2.1: {} 3060 3061 + source-map-support@0.5.21: 3062 + dependencies: 3063 + buffer-from: 1.1.2 3064 + source-map: 0.6.1 3065 + optional: true 3066 + 3067 + source-map@0.6.1: 3068 + optional: true 3069 + 3070 space-separated-tokens@2.0.2: {} 3071 3072 sprintf-js@1.0.3: {} ··· 3098 3099 strip-bom@3.0.0: {} 3100 3101 + terser@5.37.0: 3102 + dependencies: 3103 + '@jridgewell/source-map': 0.3.6 3104 + acorn: 8.14.0 3105 + commander: 2.20.3 3106 + source-map-support: 0.5.21 3107 + optional: true 3108 + 3109 tinyexec@0.3.2: {} 3110 3111 to-regex-range@5.0.1: ··· 3132 ultrahtml@1.5.3: {} 3133 3134 uncrypto@0.1.3: {} 3135 + 3136 + undici-types@6.20.0: 3137 + optional: true 3138 3139 unenv@1.10.0: 3140 dependencies: ··· 3222 '@types/unist': 3.0.3 3223 vfile-message: 4.0.2 3224 3225 + vite@6.0.11(@types/node@22.10.10)(terser@5.37.0): 3226 dependencies: 3227 esbuild: 0.24.2 3228 postcss: 8.5.1 3229 rollup: 4.31.0 3230 optionalDependencies: 3231 + '@types/node': 22.10.10 3232 fsevents: 2.3.3 3233 + terser: 5.37.0 3234 3235 + vitefu@1.0.5(vite@6.0.11(@types/node@22.10.10)(terser@5.37.0)): 3236 optionalDependencies: 3237 + vite: 6.0.11(@types/node@22.10.10)(terser@5.37.0) 3238 3239 web-namespaces@2.0.1: {} 3240
+7 -28
src/dong-io.ts
··· 66 ]); 67 }; 68 69 - // base 64 overload 70 export async function readDong( 71 dongFile: File, 72 - opts?: { b64: true } 73 ): Promise< 74 | { 75 - image: { data: string; mime: string }; 76 - audio: { data: string; mime: string }; 77 - } 78 - | string 79 - >; 80 - // standard overload 81 - export async function readDong( 82 - dongFile: File, 83 - opts?: { b64: false } 84 - ): Promise< 85 - | { 86 - image: { data: Uint8Array; mime: string }; 87 - audio: { data: Uint8Array; mime: string }; 88 - } 89 - | string 90 - >; 91 - 92 - export async function readDong( 93 - dongFile: File, 94 - opts?: { b64: boolean } 95 - ): Promise< 96 - | { 97 - image: { data: Uint8Array | string; mime: string }; 98 - audio: { data: Uint8Array | string; mime: string }; 99 } 100 | string 101 > { ··· 133 return { 134 image: { 135 mime: imgMimeType, 136 - data: opts?.b64 ? uint8array64(imageBytes) : imageBytes, 137 }, 138 audio: { 139 mime: audMimeType, 140 - data: opts?.b64 ? uint8array64(audioBytes) : audioBytes, 141 }, 142 }; 143 }
··· 66 ]); 67 }; 68 69 export async function readDong( 70 dongFile: File, 71 + 72 ): Promise< 73 | { 74 + image: { data: Uint8Array; b64?: string; mime: string }; 75 + audio: { data: Uint8Array; b64?: string; mime: string }; 76 } 77 | string 78 > { ··· 110 return { 111 image: { 112 mime: imgMimeType, 113 + data: uint8array64(imageBytes), 114 + b64: uint8array64(imageBytes), 115 }, 116 audio: { 117 mime: audMimeType, 118 + data: uint8array64(audioBytes), 119 + b64: uint8array64(audioBytes), 120 }, 121 }; 122 }
+1
src/layouts/Base.astro
··· 79 } 80 } 81 </style> 82 <slot name="head" /> 83 </head> 84 <body>
··· 79 } 80 } 81 </style> 82 + 83 <slot name="head" /> 84 </head> 85 <body>
+6 -3
src/pages/index.astro
··· 131 132 // do not append as this is only for playing audio 133 // loaded here to prevent overlaying the sound 134 - const audio = document.createElement("audio"); 135 136 dongSelect.type = "file"; 137 dongSelect.accept = ".dong"; ··· 161 // get files 162 const dongFile = dongSelect.files[0]; 163 164 - const res = await readDong(dongFile, { b64: true }); 165 if (typeof res === "string") { 166 errormsg.innerText = res; 167 return; 168 } 169 170 - image.src = `data:${res.image.mime};base64,${res.image.data}`; 171 172 // audio play 173 audio.src = `data:${res.audio.mime};base64,${res.audio.data}`; ··· 190 191 button { 192 background-color: var(--accent); 193 } 194 195 body {
··· 131 132 // do not append as this is only for playing audio 133 // loaded here to prevent overlaying the sound 134 + const audio = new Audio(); 135 136 dongSelect.type = "file"; 137 dongSelect.accept = ".dong"; ··· 161 // get files 162 const dongFile = dongSelect.files[0]; 163 164 + const res = await readDong(dongFile); 165 if (typeof res === "string") { 166 errormsg.innerText = res; 167 return; 168 } 169 170 + image.src = `data:${res.image.mime};base64,${res.image.b64}`; 171 172 // audio play 173 audio.src = `data:${res.audio.mime};base64,${res.audio.data}`; ··· 190 191 button { 192 background-color: var(--accent); 193 + &:empty { 194 + display: none; 195 + } 196 } 197 198 body {