From df27705b43b9672b920fbe1abcae92a6f18cfce2 Mon Sep 17 00:00:00 2001 From: babayaga Date: Sun, 9 Mar 2025 14:18:01 +0100 Subject: [PATCH] optimization --- astro.config.mjs | 15 +- packages/imagetools/api/utils/getImage.js | 214 +- .../imagetools/api/utils/getImageSources.js | 182 +- packages/imagetools/astroViteConfigs.js | 8 +- public/css/global.css | 235 + public/js/cdn.min.js | 5 + public/js/flowbite.min.js | 2 + src/components/BaseHead.astro | 10 +- tailwind.config.cjs | 24 +- temp/test.html | 10380 ++++++++++++++++ 10 files changed, 10855 insertions(+), 220 deletions(-) create mode 100644 public/css/global.css create mode 100644 public/js/cdn.min.js create mode 100644 public/js/flowbite.min.js diff --git a/astro.config.mjs b/astro.config.mjs index 4864402..0275f4e 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -3,6 +3,8 @@ import tailwindcss from '@tailwindcss/vite' import { imagetools } from "imagetools" import react from "@astrojs/react" import mdx from "@astrojs/mdx"; +import { defineConfig } from 'astro/config'; +import compress from 'vite-plugin-compression'; export default defineConfig({ devToolbar: { @@ -14,13 +16,22 @@ export default defineConfig({ }, vite: { plugins: [ - tailwindcss() + tailwindcss({ + config: './tailwind.config.cjs', + jit: true + }), + compress({ + algorithm: 'gzip', // You can also use 'brotliCompress' for Brotli + threshold: 1024, // Compress files larger than 1KB + deleteOriginFile: false, // Keep original files (optional) + }) ], build: { target: 'esnext', assetsDir: './assets', modulePreload: { polyfill: false }, - commonjsOptions: { esmExternals: true } + commonjsOptions: { esmExternals: true }, + assetsInlineLimit: 1024 }, ssr: { external: ['cacache', 'glob', 'xlsx', 'sharp', '@polymech/kbot-d'] diff --git a/packages/imagetools/api/utils/getImage.js b/packages/imagetools/api/utils/getImage.js index 594918e..567a0d2 100644 --- a/packages/imagetools/api/utils/getImage.js +++ b/packages/imagetools/api/utils/getImage.js @@ -1,107 +1,107 @@ -// @ts-check -import crypto from "node:crypto"; -import objectHash from "object-hash"; -import getImageSources from "./getImageSources.js"; -import getProcessedImage from "./getProcessedImage.js"; -import getArtDirectedImages from "./getArtDirectedImages.js"; -import pMap from "p-map"; - -const imagesData = new Map(); - -const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); - -export default async function ({ - src, - type, - sizes: imagesizes, - format, - breakpoints, - placeholder, - fallbackFormat, - includeSourceFormat, - formatOptions, - artDirectives, - transformConfigs, -}) { - try { - const args = Array.from(arguments); - const hash = objectHash(args); - if (imagesData.has(hash)) { - return imagesData.get(hash); - } - - const start = performance.now(); - - const { path, base, rest, image, imageWidth, imageHeight, imageFormat } = - await getProcessedImage(src, transformConfigs); - - await delay(250); - src = path; - - rest.aspect = `${imageWidth / imageHeight}`; - if (!fallbackFormat) { - fallbackFormat = imageFormat; - } - - // Fetch both image sources and art-directed images - const [mainImage, artDirectedImages] = await pMap( - [ - async () => - await getImageSources( - src, - base, - image, - format, - imageWidth, - imagesizes, - breakpoints, - placeholder, - imageFormat, - formatOptions, - fallbackFormat, - includeSourceFormat, - rest - ), - async () => { - await delay(250); - return await getArtDirectedImages( - artDirectives, - placeholder, - format, - imagesizes, - breakpoints, - fallbackFormat, - includeSourceFormat, - formatOptions, - rest - ); - }, - ], - async (task) => await task(), - { concurrency: 1 } - ); - - // Ensure artDirectedImages is an array - const images = Array.isArray(artDirectedImages) ? [...artDirectedImages, mainImage] : [mainImage]; - - const uuid = crypto.randomBytes(4).toString("hex").toUpperCase(); - - const returnObject = { - uuid, - images, - }; - - imagesData.set(hash, returnObject); - - const end = performance.now(); - - console.log( - `Responsive Image sets generated for ${type} at ${args[0].src} in ${end - start}ms` - ); - - return returnObject; - } catch (error) { - console.error("Error processing images:", error); - throw error; - } -} +// @ts-check +import crypto from "node:crypto"; +import objectHash from "object-hash"; +import getImageSources from "./getImageSources.js"; +import getProcessedImage from "./getProcessedImage.js"; +import getArtDirectedImages from "./getArtDirectedImages.js"; +import pMap from "p-map"; + +const imagesData = new Map(); + +const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); + +export default async function ({ + src, + type, + sizes: imagesizes, + format, + breakpoints, + placeholder, + fallbackFormat, + includeSourceFormat, + formatOptions, + artDirectives, + transformConfigs, +}) { + try { + const args = Array.from(arguments); + const hash = objectHash(args); + if (imagesData.has(hash)) { + return imagesData.get(hash); + } + + const start = performance.now(); + + const { path, base, rest, image, imageWidth, imageHeight, imageFormat } = + await getProcessedImage(src, transformConfigs); + + await delay(100); + src = path; + + rest.aspect = `${imageWidth / imageHeight}`; + if (!fallbackFormat) { + fallbackFormat = imageFormat; + } + + // Fetch both image sources and art-directed images + const [mainImage, artDirectedImages] = await pMap( + [ + async () => + await getImageSources( + src, + base, + image, + format, + imageWidth, + imagesizes, + breakpoints, + placeholder, + imageFormat, + formatOptions, + fallbackFormat, + includeSourceFormat, + rest + ), + async () => { + await delay(100); + return await getArtDirectedImages( + artDirectives, + placeholder, + format, + imagesizes, + breakpoints, + fallbackFormat, + includeSourceFormat, + formatOptions, + rest + ); + }, + ], + async (task) => await task(), + { concurrency: 1 } + ); + + // Ensure artDirectedImages is an array + const images = Array.isArray(artDirectedImages) ? [...artDirectedImages, mainImage] : [mainImage]; + + const uuid = crypto.randomBytes(4).toString("hex").toUpperCase(); + + const returnObject = { + uuid, + images, + }; + + imagesData.set(hash, returnObject); + + const end = performance.now(); + + console.log( + `Responsive Image sets generated for ${type} at ${args[0].src} in ${end - start}ms` + ); + + return returnObject; + } catch (error) { + console.error("Error processing images:", error); + throw error; + } +} diff --git a/packages/imagetools/api/utils/getImageSources.js b/packages/imagetools/api/utils/getImageSources.js index d0dca00..191cf43 100644 --- a/packages/imagetools/api/utils/getImageSources.js +++ b/packages/imagetools/api/utils/getImageSources.js @@ -1,91 +1,91 @@ -// @ts-check -import getSrcset from "./getSrcset.js"; -import getConfigOptions from "./getConfigOptions.js"; -import getFallbackImage from "./getFallbackImage.js"; -import pMap from "p-map"; - -function delay(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); -} - -export default async function getImageSources( - src, - base, - image, - format, - imageWidth, - imagesizes, - breakpoints, - placeholder, - imageFormat, - formatOptions, - fallbackFormat, - includeSourceFormat, - rest -) { - try { - const calculatedConfigs = getConfigOptions( - imageWidth, - imagesizes, - breakpoints, - format, - imageFormat, - fallbackFormat, - includeSourceFormat - ); - - const { formats, requiredBreakpoints } = calculatedConfigs; - imagesizes = calculatedConfigs.imagesizes; - const maxWidth = requiredBreakpoints[requiredBreakpoints.length - 1]; - const sliceLength = -(maxWidth.toString().length + 2); - - const sources = await pMap( - formats, - async (format) => { - try { - await delay(250); - const srcset = await getSrcset(src, base, requiredBreakpoints, format, { - ...rest, - ...formatOptions[format], - }); - - const srcsets = srcset.split(", "); - const srcObject = - format === fallbackFormat - ? { src: srcsets[srcsets.length - 1].slice(0, sliceLength) } - : {}; - - return { - ...srcObject, - format, - srcset, - }; - } catch (error) { - console.error(`Error processing format ${format}:`, error); - return null; - } - }, - { concurrency: 1 } - ); - - const filteredSources = sources.filter(Boolean); - - const sizes = { - width: maxWidth, - height: Math.round(maxWidth / rest.aspect), - }; - - const fallback = await getFallbackImage( - src, - placeholder, - image, - fallbackFormat, - formatOptions, - rest - ) - return { sources: filteredSources, sizes, fallback, imagesizes }; - } catch (error) { - console.error("Error in getImageSources:", error); - return { sources: [], sizes: {}, fallback: null, imagesizes: null }; - } -} +// @ts-check +import getSrcset from "./getSrcset.js"; +import getConfigOptions from "./getConfigOptions.js"; +import getFallbackImage from "./getFallbackImage.js"; +import pMap from "p-map"; + +function delay(ms) { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +export default async function getImageSources( + src, + base, + image, + format, + imageWidth, + imagesizes, + breakpoints, + placeholder, + imageFormat, + formatOptions, + fallbackFormat, + includeSourceFormat, + rest +) { + try { + const calculatedConfigs = getConfigOptions( + imageWidth, + imagesizes, + breakpoints, + format, + imageFormat, + fallbackFormat, + includeSourceFormat + ); + + const { formats, requiredBreakpoints } = calculatedConfigs; + imagesizes = calculatedConfigs.imagesizes; + const maxWidth = requiredBreakpoints[requiredBreakpoints.length - 1]; + const sliceLength = -(maxWidth.toString().length + 2); + + const sources = await pMap( + formats, + async (format) => { + try { + await delay(100); + const srcset = await getSrcset(src, base, requiredBreakpoints, format, { + ...rest, + ...formatOptions[format], + }); + + const srcsets = srcset.split(", "); + const srcObject = + format === fallbackFormat + ? { src: srcsets[srcsets.length - 1].slice(0, sliceLength) } + : {}; + + return { + ...srcObject, + format, + srcset, + }; + } catch (error) { + console.error(`Error processing format ${format}:`, error); + return null; + } + }, + { concurrency: 1 } + ); + + const filteredSources = sources.filter(Boolean); + + const sizes = { + width: maxWidth, + height: Math.round(maxWidth / rest.aspect), + }; + + const fallback = await getFallbackImage( + src, + placeholder, + image, + fallbackFormat, + formatOptions, + rest + ) + return { sources: filteredSources, sizes, fallback, imagesizes }; + } catch (error) { + console.error("Error in getImageSources:", error); + return { sources: [], sizes: {}, fallback: null, imagesizes: null }; + } +} diff --git a/packages/imagetools/astroViteConfigs.js b/packages/imagetools/astroViteConfigs.js index ac86484..50bdeef 100644 --- a/packages/imagetools/astroViteConfigs.js +++ b/packages/imagetools/astroViteConfigs.js @@ -1,12 +1,12 @@ export default { - "environment": "dev", + "environment": "build", "isSsrBuild": false, "projectBase": "", "publicDir": "C:\\Users\\zx\\Desktop\\polymech\\polymech-site\\public\\", "rootDir": "C:\\Users\\zx\\Desktop\\polymech\\polymech-site\\", - "mode": "dev", - "outDir": "dist", - "assetsDir": "/_astro", + "mode": "production", + "outDir": "C:\\Users\\zx\\Desktop\\polymech\\polymech-site\\dist\\", + "assetsDir": "_astro", "sourcemap": false, "assetFileNames": "/_astro/[name]@[width].[hash][extname]" } \ No newline at end of file diff --git a/public/css/global.css b/public/css/global.css new file mode 100644 index 0000000..87ea0de --- /dev/null +++ b/public/css/global.css @@ -0,0 +1,235 @@ +@import "tailwindcss"; + +@plugin "@tailwindcss/typography"; + +@layer components { + .prose-styles { + @apply hover:prose-a:text-black prose prose-blockquote:border-l-black prose-blockquote:text-neutral-600 prose-code:text-black prose-headings:text-black text-neutral-600 prose-pre:rounded-xl prose-pre:p-4 max-w-none prose-headings:font-medium prose-pre:normal-case prose-pre:bg-white; + /* Base layout classes */ + @apply prose max-w-3xl pt-0 mx-auto; + } + .simple-prose-styles { + @apply prose text-xs prose-headings:text-xs prose-pre:normal-case; + } +} +@layer base { + a { + @apply text-blue-400 no-underline transition-colors; + } + a:hover { + @apply underline; + } +} + +@layer base { + table { + @apply min-w-full border-collapse; + } + table thead { + @apply bg-gray-200; + } + table th { + @apply py-3 px-6 text-left text-xs font-medium text-gray-600 uppercase tracking-wider; + } + table td { + @apply py-4 px-6 border-b border-gray-200; + } + table tbody tr { + @apply transition-colors; + } + table tbody tr:nth-child(odd) { + @apply bg-white; + } + table tbody tr:nth-child(even) { + @apply bg-gray-50; + } + table tbody tr:nth-child(odd):hover { + @apply bg-orange-50; + } + table tbody tr:nth-child(even):hover { + @apply bg-orange-100; + } +} +@layer base { + .astro-imagetools-img { + @apply min-w-full border-collapse rounded-lg overflow-hidden; + background-image: none !important; + object-fit: contain; + } + .lightbox-main{ + background-image: none !important; + } +} +@layer base { + .specs-table { + @apply min-w-full border-collapse rounded-lg overflow-hidden; + } + .specs-table thead { + @apply bg-gray-200; + } + .specs-table th { + @apply py-3 px-6 text-left text-xs text-gray-600 uppercase tracking-wider; + } + .specs-table td { + @apply py-4 px-6 border-b border-gray-200; + } + .specs-table tbody tr { + @apply transition-colors; + } + .specs-table tbody tr:nth-child(odd) { + @apply bg-white; + } + .specs-table tbody tr:nth-child(even) { + @apply bg-gray-50; + } + .specs-table tbody tr:nth-child(odd):hover { + @apply bg-orange-50; + } + .specs-table tbody tr:nth-child(even):hover { + @apply bg-orange-100; + } + /* Bold the first column cells */ + .specs-table th:first-child, + .specs-table td:first-child { + @apply font-semibold; + } +} + +@layer components { + .table-default { + @apply min-w-full border-collapse shadow-lg; + } + .table-default thead { + @apply bg-gray-200; + } + .table-default th { + @apply py-3 px-6 text-left text-xs font-medium text-gray-600 uppercase tracking-wider; + } + .table-default td { + @apply py-4 px-6 border-b border-gray-200; + } + .table-default tbody tr { + @apply transition-colors; + } + /* Alternating row colors */ + .table-default tbody tr:nth-child(odd) { + @apply bg-white; + } + .table-default tbody tr:nth-child(even) { + @apply bg-gray-50; + } + /* Hover effects with orange tint */ + .table-default tbody tr:nth-child(odd):hover { + @apply bg-orange-50; + } + .table-default tbody tr:nth-child(even):hover { + @apply bg-orange-100; + } +} + + +@theme { + /* Typography*/ + --font-sans: "Inter", sans-serif; + --font-mono: "IBM PLex Mono", monospace; + --text-xs:1rem; + /* Colors */ + --color-orange-50: hsl(22, 100%, 96%); + --color-orange-100: hsl(25, 100%, 91%); + --color-orange-200: hsl(22, 100%, 82%); + --color-orange-300: hsl(20, 100%, 71%); + --color-orange-400: hsl(16, 100%, 60%); + --color-orange-500: hsl(14, 100%, 52%); + --color-orange-600: hsl(9, 100%, 50%); + --color-orange-700: hsl(6, 98%, 40%); + --color-orange-800: hsl(4, 87%, 34%); + --color-orange-900: hsl(4, 83%, 28%); + --color-orange-950: hsl(1, 89%, 15%); + /* colors */ + --color-white: #fafafa; + --color-black: #12161d; +} + +@supports (font-variation-settings: normal) { + :root { + font-family: InterVariable, sans-serif; + } +} +:root { + /* Typography*/ + font-family: Inter, sans-serif; + font-feature-settings: "liga" 1, "calt" 1, + /* Contextual Alternates */ "dlig" 1, /* Discretionary Ligatures */ "ss07" 1, + /* fSquare punctuation */ "ss08" 1, /* Square quotes */ "zero" 1, + /* Slashed zero */ "tnum" 1, /* Tabular numbers */ "cv03" 1, + /* Open six */ "cv04" 1, /* Open nine */ "cv01" 1, + /* Alternate one */ "cv09", /* Flat-top three */ "cv02" 1; /* Open 4 */ + /* style code blocks*/ + +} + + + + + + + + + +.markdown-content { + @apply prose dark:prose-invert max-w-none font-mono; +} + +/* Headings (Scaled Down & Responsive) */ +.markdown-content h1 { + @apply text-xl font-medium mt-5 mb-3 md:mt-6 md:mb-4; +} +.markdown-content h2 { + @apply text-xs font-medium mt-4 mb-2 md:mt-5 md:mb-3; +} +.markdown-content h3 { + @apply text-sm font-medium mt-3 mb-1 md:mt-4 md:mb-3; +} +.markdown-content h4 { + @apply text-neutral-500 font-medium mt-3 mb-1 md:mt-4 md:mb-2; +} +.markdown-content h5 { + @apply text-sm font-medium mt-2 mb-1 md:mt-3 md:mb-2; +} +.markdown-content h6 { + @apply text-xs font-medium mt-2 mb-1 uppercase md:mt-3 md:mb-2; +} + +/* Paragraphs */ +.markdown-content p { + @apply text-neutral-500 leading-relaxed mb-3 md:mb-4; +} + +/* Lists */ +.markdown-content ul { + @apply list-disc list-inside ml-0 pl-0 md:ml-5; +} +.markdown-content li { + @apply text-neutral-500 leading-relaxed; +} +.markdown-content ol { + @apply list-decimal list-inside ml-3 md:ml-5; +} + +/* Code Blocks */ +.markdown-content pre { + @apply bg-gray-900 text-white p-2 rounded-md overflow-x-auto md:p-3; +} +.markdown-content code { + @apply bg-gray-800 text-xs p-1 rounded-md md:text-sm; +} + +/* Links */ +.markdown-content a { + @apply text-blue-600 hover:underline dark:text-blue-400; +} + +/* Blockquotes */ +.markdown-content blockquote { + @apply border-l-4 border-gray-500 pl-3 italic text-gray-600 md:pl-4; +} diff --git a/public/js/cdn.min.js b/public/js/cdn.min.js new file mode 100644 index 0000000..a3be81c --- /dev/null +++ b/public/js/cdn.min.js @@ -0,0 +1,5 @@ +(()=>{var nt=!1,it=!1,W=[],ot=-1;function Ut(e){Rn(e)}function Rn(e){W.includes(e)||W.push(e),Mn()}function Wt(e){let t=W.indexOf(e);t!==-1&&t>ot&&W.splice(t,1)}function Mn(){!it&&!nt&&(nt=!0,queueMicrotask(Nn))}function Nn(){nt=!1,it=!0;for(let e=0;ee.effect(t,{scheduler:r=>{st?Ut(r):r()}}),at=e.raw}function ct(e){N=e}function Yt(e){let t=()=>{};return[n=>{let i=N(n);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),$(i))},i},()=>{t()}]}function ve(e,t){let r=!0,n,i=N(()=>{let o=e();JSON.stringify(o),r?n=o:queueMicrotask(()=>{t(o,n),n=o}),r=!1});return()=>$(i)}var Xt=[],Zt=[],Qt=[];function er(e){Qt.push(e)}function te(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,Zt.push(t))}function Ae(e){Xt.push(e)}function Oe(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function lt(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}function tr(e){for(e._x_effects?.forEach(Wt);e._x_cleanups?.length;)e._x_cleanups.pop()()}var ut=new MutationObserver(mt),ft=!1;function ue(){ut.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),ft=!0}function dt(){kn(),ut.disconnect(),ft=!1}var le=[];function kn(){let e=ut.takeRecords();le.push(()=>e.length>0&&mt(e));let t=le.length;queueMicrotask(()=>{if(le.length===t)for(;le.length>0;)le.shift()()})}function m(e){if(!ft)return e();dt();let t=e();return ue(),t}var pt=!1,Se=[];function rr(){pt=!0}function nr(){pt=!1,mt(Se),Se=[]}function mt(e){if(pt){Se=Se.concat(e);return}let t=[],r=new Set,n=new Map,i=new Map;for(let o=0;o{s.nodeType===1&&s._x_marker&&r.add(s)}),e[o].addedNodes.forEach(s=>{if(s.nodeType===1){if(r.has(s)){r.delete(s);return}s._x_marker||t.push(s)}})),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{lt(s,o)}),n.forEach((o,s)=>{Xt.forEach(a=>a(s,o))});for(let o of r)t.some(s=>s.contains(o))||Zt.forEach(s=>s(o));for(let o of t)o.isConnected&&Qt.forEach(s=>s(o));t=null,r=null,n=null,i=null}function Ce(e){return z(B(e))}function k(e,t,r){return e._x_dataStack=[t,...B(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function B(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?B(e.host):e.parentNode?B(e.parentNode):[]}function z(e){return new Proxy({objects:e},Dn)}var Dn={ownKeys({objects:e}){return Array.from(new Set(e.flatMap(t=>Object.keys(t))))},has({objects:e},t){return t==Symbol.unscopables?!1:e.some(r=>Object.prototype.hasOwnProperty.call(r,t)||Reflect.has(r,t))},get({objects:e},t,r){return t=="toJSON"?Pn:Reflect.get(e.find(n=>Reflect.has(n,t))||{},t,r)},set({objects:e},t,r,n){let i=e.find(s=>Object.prototype.hasOwnProperty.call(s,t))||e[e.length-1],o=Object.getOwnPropertyDescriptor(i,t);return o?.set&&o?.get?o.set.call(n,r)||!0:Reflect.set(i,t,r)}};function Pn(){return Reflect.ownKeys(this).reduce((t,r)=>(t[r]=Reflect.get(this,r),t),{})}function Te(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:s,enumerable:a}])=>{if(a===!1||s===void 0||typeof s=="object"&&s!==null&&s.__v_skip)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,c,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(e)}function Re(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>In(n,i),s=>ht(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function In(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function ht(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),ht(e[t[0]],t.slice(1),r)}}var ir={};function y(e,t){ir[e]=t}function fe(e,t){let r=Ln(t);return Object.entries(ir).forEach(([n,i])=>{Object.defineProperty(e,`$${n}`,{get(){return i(t,r)},enumerable:!1})}),e}function Ln(e){let[t,r]=_t(e),n={interceptor:Re,...t};return te(e,r),n}function or(e,t,r,...n){try{return r(...n)}catch(i){re(i,e,t)}}function re(e,t,r=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:r}),console.warn(`Alpine Expression Error: ${e.message} + +${r?'Expression: "'+r+`" + +`:""}`,t),setTimeout(()=>{throw e},0)}var Me=!0;function ke(e){let t=Me;Me=!1;let r=e();return Me=t,r}function R(e,t,r={}){let n;return x(e,t)(i=>n=i,r),n}function x(...e){return sr(...e)}var sr=xt;function ar(e){sr=e}function xt(e,t){let r={};fe(r,e);let n=[r,...B(e)],i=typeof t=="function"?$n(n,t):Fn(n,t,e);return or.bind(null,e,t,i)}function $n(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(z([n,...e]),i);Ne(r,o)}}var gt={};function jn(e,t){if(gt[e])return gt[e];let r=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e,o=(()=>{try{let s=new r(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`);return Object.defineProperty(s,"name",{value:`[Alpine] ${e}`}),s}catch(s){return re(s,t,e),Promise.resolve()}})();return gt[e]=o,o}function Fn(e,t,r){let n=jn(t,r);return(i=()=>{},{scope:o={},params:s=[]}={})=>{n.result=void 0,n.finished=!1;let a=z([o,...e]);if(typeof n=="function"){let c=n(n,a).catch(l=>re(l,r,t));n.finished?(Ne(i,n.result,a,s,r),n.result=void 0):c.then(l=>{Ne(i,l,a,s,r)}).catch(l=>re(l,r,t)).finally(()=>n.result=void 0)}}}function Ne(e,t,r,n,i){if(Me&&typeof t=="function"){let o=t.apply(r,n);o instanceof Promise?o.then(s=>Ne(e,s,r,n)).catch(s=>re(s,i,t)):e(o)}else typeof t=="object"&&t instanceof Promise?t.then(o=>e(o)):e(t)}var wt="x-";function C(e=""){return wt+e}function cr(e){wt=e}var De={};function d(e,t){return De[e]=t,{before(r){if(!De[r]){console.warn(String.raw`Cannot find directive \`${r}\`. \`${e}\` will use the default order of execution`);return}let n=G.indexOf(r);G.splice(n>=0?n:G.indexOf("DEFAULT"),0,e)}}}function lr(e){return Object.keys(De).includes(e)}function pe(e,t,r){if(t=Array.from(t),e._x_virtualDirectives){let o=Object.entries(e._x_virtualDirectives).map(([a,c])=>({name:a,value:c})),s=Et(o);o=o.map(a=>s.find(c=>c.name===a.name)?{name:`x-bind:${a.name}`,value:`"${a.value}"`}:a),t=t.concat(o)}let n={};return t.map(dr((o,s)=>n[o]=s)).filter(mr).map(zn(n,r)).sort(Kn).map(o=>Bn(e,o))}function Et(e){return Array.from(e).map(dr()).filter(t=>!mr(t))}var yt=!1,de=new Map,ur=Symbol();function fr(e){yt=!0;let t=Symbol();ur=t,de.set(t,[]);let r=()=>{for(;de.get(t).length;)de.get(t).shift()();de.delete(t)},n=()=>{yt=!1,r()};e(r),n()}function _t(e){let t=[],r=a=>t.push(a),[n,i]=Yt(e);return t.push(i),[{Alpine:K,effect:n,cleanup:r,evaluateLater:x.bind(x,e),evaluate:R.bind(R,e)},()=>t.forEach(a=>a())]}function Bn(e,t){let r=()=>{},n=De[t.type]||r,[i,o]=_t(e);Oe(e,t.original,o);let s=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,i),n=n.bind(n,e,t,i),yt?de.get(ur).push(n):n())};return s.runCleanups=o,s}var Pe=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),Ie=e=>e;function dr(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=pr.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var pr=[];function ne(e){pr.push(e)}function mr({name:e}){return hr().test(e)}var hr=()=>new RegExp(`^${wt}([^:^.]+)\\b`);function zn(e,t){return({name:r,value:n})=>{let i=r.match(hr()),o=r.match(/:([a-zA-Z0-9\-_:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var bt="DEFAULT",G=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",bt,"teleport"];function Kn(e,t){let r=G.indexOf(e.type)===-1?bt:e.type,n=G.indexOf(t.type)===-1?bt:t.type;return G.indexOf(r)-G.indexOf(n)}function J(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}function D(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>D(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)D(n,t,!1),n=n.nextElementSibling}function E(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var _r=!1;function gr(){_r&&E("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),_r=!0,document.body||E("Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's ` - - - - + diff --git a/tailwind.config.cjs b/tailwind.config.cjs index 76a7f6b..bcb0d0d 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -1,12 +1,12 @@ -/** @type {import('tailwindcss').Config} */ -export default { - content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"], - theme: { - extend: {}, - }, - daisyui: { - // Add your daisy ui themes here - themes: ["night"], - }, - plugins: [require("daisyui"), require("@tailwindcss/typography")], - }; +/** @type {import('tailwindcss').Config} */ +export default { + content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"], + theme: { + extend: {}, + }, + plugins: [require("@tailwindcss/typography")], + presets: [ + + + ] + } diff --git a/temp/test.html b/temp/test.html index e69de29..72aed58 100644 --- a/temp/test.html +++ b/temp/test.html @@ -0,0 +1,10380 @@ + + + + Sheetpress Cassandra - EDC450 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+
+
+
+
+
+
+
+
+
+

+ +
Sheetpress Cassandra - EDC450
+
+

+

Flexible, modular dual sheetpress

+

Details / Features

+
    +
  • Sheet thickness up to 45mm
  • +
  • 20T of pressure
  • +
  • Stackable and interlockable (600x1300cm sheets)
  • +
  • hydraulic jack with pneumatic port
  • +
+

Options

+
    +
  • Precise temperature control &monitoring via Omron-Modbus PID controllers
  • +
  • active cooling zone
  • +
  • adaptive pressure control
  • +
  • oil heating
  • +
+
+
+ +
+
+

+
License
+

+

CERN Open Source Hardware License

+
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+ + + + + +
+
+
+ +
+