diff --git a/eleventy.config.js b/eleventy.config.js index d780aec..a1f0e89 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -87,16 +87,16 @@ export default async function (eleventyConfig) { // --------------------- Passthrough File Copy // -- same path - ['src/assets/fonts/', 'src/assets/images/template', 'src/assets/og-images'].forEach(path => + ['./src/assets/fonts/', './src/assets/images/template', './src/assets/og-images'].forEach(path => eleventyConfig.addPassthroughCopy(path) ); eleventyConfig.addPassthroughCopy({ // -- to root - 'src/assets/images/favicon/*': '/', + './src/assets/images/favicon/*': './', // -- node_modules - 'node_modules/lite-youtube-embed/src/lite-yt-embed.{css,js}': `assets/components/` + './node_modules/lite-youtube-embed/src/lite-yt-embed.{css,js}': `./assets/components/` }); // --------------------- Build Settings diff --git a/package-lock.json b/package-lock.json index ca90e1f..9437db6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1772,9 +1772,9 @@ "license": "MIT" }, "node_modules/autoprefixer": { - "version": "10.4.19", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.19.tgz", - "integrity": "sha512-BaENR2+zBZ8xXhM4pUaKUxlVdxZ0EZhjvbopwnXmxRUfqDmwSpC2lAi/QXvx7NRdPCo1WKEcEF6mV64si1z4Ew==", + "version": "10.4.20", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.20.tgz", + "integrity": "sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==", "dev": true, "funding": [ { @@ -1792,11 +1792,11 @@ ], "license": "MIT", "dependencies": { - "browserslist": "^4.23.0", - "caniuse-lite": "^1.0.30001599", + "browserslist": "^4.23.3", + "caniuse-lite": "^1.0.30001646", "fraction.js": "^4.3.7", "normalize-range": "^0.1.2", - "picocolors": "^1.0.0", + "picocolors": "^1.0.1", "postcss-value-parser": "^4.2.0" }, "bin": { @@ -2016,9 +2016,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001646", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001646.tgz", - "integrity": "sha512-dRg00gudiBDDTmUhClSdv3hqRfpbOnU28IpI1T6PBTLWa+kOj0681C8uML3PifYfREuBrVjDGhL3adYpBT6spw==", + "version": "1.0.30001650", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001650.tgz", + "integrity": "sha512-fgEc7hP/LB7iicdXHUI9VsBsMZmUmlVJeQP2qqQW+3lkqVhbmjEU8zp+h5stWeilX+G7uXuIUIIlWlDw9jdt8g==", "dev": true, "funding": [ { @@ -2876,9 +2876,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.4.tgz", - "integrity": "sha512-orzA81VqLyIGUEA77YkVA1D+N+nNfl2isJVjjmOyrlxuooZ19ynb+dOlaDTqd/idKRS9lDCSBmtzM+kyCsMnkA==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.5.tgz", + "integrity": "sha512-QR7/A7ZkMS8tZuoftC/jfqNkZLQO779SSW3YuZHP4eXpj3EffGLFcB/Xu9AAZQzLccTiCV+EmUo3ha4mQ9wnlA==", "dev": true, "license": "ISC" }, @@ -4502,9 +4502,9 @@ } }, "node_modules/luxon": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.4.tgz", - "integrity": "sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.5.0.tgz", + "integrity": "sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==", "license": "MIT", "engines": { "node": ">=12" @@ -5339,9 +5339,9 @@ } }, "node_modules/postcss": { - "version": "8.4.40", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.40.tgz", - "integrity": "sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==", + "version": "8.4.41", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz", + "integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==", "funding": [ { "type": "opencollective", @@ -5367,13 +5367,13 @@ } }, "node_modules/postcss-calc": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-10.0.0.tgz", - "integrity": "sha512-OmjhudoNTP0QleZCwl1i6NeBwN+5MZbY5ersLZz69mjJiDVv/p57RjRuKDkHeDWr4T+S97wQfsqRTNoDHB2e3g==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-10.0.1.tgz", + "integrity": "sha512-pp1Z3FxtxA+xHAoWXcOXgnBN1WPu4ZiJ5LWGjKyf9MMreagAsaTUtnqFK1y1sHhyJddAkYTPu6XSuLgb3oYCjw==", "dev": true, "license": "MIT", "dependencies": { - "postcss-selector-parser": "^6.0.16", + "postcss-selector-parser": "^6.1.1", "postcss-value-parser": "^4.2.0" }, "engines": { @@ -7360,9 +7360,9 @@ } }, "node_modules/terser": { - "version": "5.31.3", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.3.tgz", - "integrity": "sha512-pAfYn3NIZLyZpa83ZKigvj6Rn9c/vd5KfYGX7cN1mnzqgDcxWvrU5ZtAfIKhEXz9nRecw4z3LXkjaq96/qZqAA==", + "version": "5.31.4", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.4.tgz", + "integrity": "sha512-3OU03GgblDgu0g+sdnsVzhBPxnjV+WJuMmocN1qBBZDQ3ia7jZQSAkePeKbPlYAejGXUTYe1CmSaUeV51mvaIw==", "dev": true, "license": "BSD-2-Clause", "dependencies": { diff --git a/package.json b/package.json index 414953e..9da8261 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,10 @@ "node": ">=20.x.x" }, "scripts": { - "clean": "rimraf dist src/_includes/css src/_includes/scripts", + "clean": "rimraf dist ./src/_includes/css ./src/_includes/scripts", "favicons": "node ./src/_config/setup/generate-favicons.js", "screenshots": "node ./src/_config/setup/generate-screenshots.js", - "dev:clean": "rimraf src/assets/og-images", + "dev:clean": "rimraf ./src/assets/og-images", "dev:11ty": "cross-env ELEVENTY_ENV=development eleventy --serve --watch", "build:11ty": "cross-env ELEVENTY_ENV=production eleventy", "start": "run-p dev:*", @@ -21,7 +21,7 @@ "keywords": [], "repository": { "type": "git", - "url": "https://github.com/madrilene/eleventy-excellent.git" + "url": "https://github.com/rawsta/rawdev.git" }, "dependencies": { "@11ty/eleventy": "^3.0.0-beta.1", diff --git a/src/_config/plugins/css-config.js b/src/_config/plugins/css-config.js index 1c186ec..b26742a 100644 --- a/src/_config/plugins/css-config.js +++ b/src/_config/plugins/css-config.js @@ -15,14 +15,14 @@ export const cssConfig = eleventyConfig => { compile: async (inputContent, inputPath) => { const paths = []; if (inputPath.endsWith('/src/assets/css/global/global.css')) { - paths.push('dist/assets/css/global.css'); - paths.push('src/_includes/css/global.css'); // Assuming you might want to keep naming consistent for ease + paths.push('./dist/assets/css/global.css'); + paths.push('./src/_includes/css/global.css'); // Assuming you might want to keep naming consistent for ease } else if (inputPath.includes('/src/assets/css/bundle/')) { const baseName = path.basename(inputPath); - paths.push(`src/_includes/css/${baseName}`); + paths.push(`./src/_includes/css/${baseName}`); } else if (inputPath.includes('/src/assets/css/components/')) { const baseName = path.basename(inputPath); - paths.push(`dist/assets/css/components/${baseName}`); + paths.push(`./dist/assets/css/components/${baseName}`); } else { return; } diff --git a/src/_includes/components/burger-template.njk b/src/_includes/components/burger-template.njk deleted file mode 100644 index f4038ce..0000000 --- a/src/_includes/components/burger-template.njk +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/src/_includes/components/card.njk b/src/_includes/components/card.njk deleted file mode 100644 index 03ee756..0000000 --- a/src/_includes/components/card.njk +++ /dev/null @@ -1,19 +0,0 @@ -
  • -
    -
    - - {% set definedDate = item.date %} - {% include "components/date.njk" %} - {% if activateTags and item.data.tags.length > 1 %} - - {% endif %} - -
    - {% if headingContext === "h2" %} -

    {{ item.data.title }}

    - {% else %} -

    {{ item.data.title }}

    - {% endif %} -

    {{ item.data.description }}

    -
    -
  • diff --git a/src/_includes/components/custom-split.webc b/src/_includes/components/custom-split.webc deleted file mode 100644 index 57e456c..0000000 --- a/src/_includes/components/custom-split.webc +++ /dev/null @@ -1,4 +0,0 @@ - - -

    - \ No newline at end of file diff --git a/src/_includes/components/date.njk b/src/_includes/components/date.njk deleted file mode 100644 index fa02366..0000000 --- a/src/_includes/components/date.njk +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/src/_includes/components/details.njk b/src/_includes/components/details.njk deleted file mode 100644 index 5728534..0000000 --- a/src/_includes/components/details.njk +++ /dev/null @@ -1,36 +0,0 @@ - - -{% for item in itemList %} -
    - {{ item.data.title }} - {{ item.templateContent | safe }} -
    -{% endfor %} - - diff --git a/src/_includes/components/edit-on.njk b/src/_includes/components/edit-on.njk deleted file mode 100644 index 534e064..0000000 --- a/src/_includes/components/edit-on.njk +++ /dev/null @@ -1,9 +0,0 @@ -{% if meta.viewRepo.allow %} -
    -

    - {{ meta[page.lang].blog.githubEdit }} - - {{ meta.viewRepo.infoText }} - . -

    -{% endif %} diff --git a/src/_includes/components/gallery.njk b/src/_includes/components/gallery.njk deleted file mode 100644 index a647ebd..0000000 --- a/src/_includes/components/gallery.njk +++ /dev/null @@ -1,42 +0,0 @@ -
    - {% for item in gallery %} - - - {% eleventyImage item.image, item.alt, item.caption %} - - - - {% endfor %} -
    - - diff --git a/src/_includes/components/inline-svg.webc b/src/_includes/components/inline-svg.webc deleted file mode 100644 index 0ffa48e..0000000 --- a/src/_includes/components/inline-svg.webc +++ /dev/null @@ -1,45 +0,0 @@ - - - \ No newline at end of file diff --git a/src/_includes/components/pagination.njk b/src/_includes/components/pagination.njk deleted file mode 100644 index 8064459..0000000 --- a/src/_includes/components/pagination.njk +++ /dev/null @@ -1,38 +0,0 @@ -
    - -
    diff --git a/src/_includes/components/post-tags.njk b/src/_includes/components/post-tags.njk deleted file mode 100644 index 07626b9..0000000 --- a/src/_includes/components/post-tags.njk +++ /dev/null @@ -1,7 +0,0 @@ -{% if tags.size > 1 %} -
    - {% for tag in tags %} - {{ tag }} - {% endfor %} -
    -{% endif %} diff --git a/src/_includes/components/snipp-card.njk b/src/_includes/components/snipp-card.njk deleted file mode 100644 index f8e01f5..0000000 --- a/src/_includes/components/snipp-card.njk +++ /dev/null @@ -1,18 +0,0 @@ -
  • -
    -
    - - - - {% if headingContext === "h2" %} -

    {{ item.data.title }}

    - {% else %} -

    {{ item.data.title }}

    - {% endif %} -
    -
    - {{ item.data.description }} -

    {{ item.content | safe }}

    -
    -
    -
  • diff --git a/src/_includes/components/theme-switch.njk b/src/_includes/components/theme-switch.njk deleted file mode 100644 index 2fef20d..0000000 --- a/src/_includes/components/theme-switch.njk +++ /dev/null @@ -1,18 +0,0 @@ - diff --git a/src/_includes/theme-toggle-inline.js b/src/_includes/theme-toggle-inline.js deleted file mode 100644 index d90fdf2..0000000 --- a/src/_includes/theme-toggle-inline.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{var r="theme-preference",n="{{ meta.themeSwitch.light }}",d="{{ meta.themeSwitch.dark }}",t={value:s()};window.onload=()=>{let e=document.querySelector("#light-theme-toggle"),l=document.querySelector("#dark-theme-toggle"),o=document.querySelector("[data-theme-switcher]");o&&(o.removeAttribute("hidden"),a(),e.addEventListener("click",()=>c("light")),l.addEventListener("click",()=>c("dark")),e.setAttribute("aria-pressed",t.value==="light"),l.setAttribute("aria-pressed",t.value==="dark"))};window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:e})=>{t.value=e?"dark":"light",i()});function c(e){t.value=e,document.querySelector("#light-theme-toggle").setAttribute("aria-pressed",e==="light"),document.querySelector("#dark-theme-toggle").setAttribute("aria-pressed",e==="dark"),i()}function s(){return localStorage.getItem(r)?localStorage.getItem(r):window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function i(){localStorage.setItem(r,t.value),a()}function a(){document.firstElementChild.setAttribute("data-theme",t.value),document.querySelector("#light-theme-toggle")?.setAttribute("aria-label",n),document.querySelector("#dark-theme-toggle")?.setAttribute("aria-label",d)}a();})(); diff --git a/src/assets/scripts/easteregg.js b/src/assets/scripts/easteregg.js deleted file mode 100644 index ec73909..0000000 --- a/src/assets/scripts/easteregg.js +++ /dev/null @@ -1,40 +0,0 @@ -// @TODO: change trigger words -const eleventyCode = ['e', 'l', 'e', 'v', 'e', 'n', 't', 'y']; -const rawstaCode = ['r', 'a', 'w', 's', 't', 'a']; - -let indexEleventy = 0; -let indexExcellent = 0; - -// Trigger confetti if someone enters "eleventy" or "rawsta" -document.addEventListener('keydown', event => { - if (eleventyCode[indexEleventy] === event.key.toLowerCase()) { - ++indexEleventy; - } else { - indexEleventy = 0; - } - - if (rawstaCode[indexExcellent] === event.key.toLowerCase()) { - ++indexExcellent; - } else { - indexExcellent = 0; - } - - if (indexEleventy === eleventyCode.length || indexExcellent === rawstaCode.length) { - console.log('Hooray Eleventy!'); - indexEleventy = 0; - indexExcellent = 0; - // TODO: make confetti work local - import('https://esm.run/canvas-confetti').then(module => { - const confetti = module.default; - const scalar = 4; - const particleCount = 30; - const star = confetti.shapeFromText({text: '🛸', scalar}); - - confetti({ - shapes: [star], - scalar, - particleCount - }); - }); - } -}); diff --git a/src/assets/scripts/masonry.js b/src/assets/scripts/masonry.js deleted file mode 100644 index da37124..0000000 --- a/src/assets/scripts/masonry.js +++ /dev/null @@ -1,41 +0,0 @@ -// ----- masonry fallback if CSS masonry not supported, solution by Ana Tudor: https://codepen.io/thebabydino/pen/yLYppjK - -const supportMasonry = CSS.supports('grid-template-rows', 'masonry'); - -if ( !supportMasonry ) { - let grids = [...document.querySelectorAll('.grid[data-rows="masonry"]')]; - - if (grids.length && getComputedStyle(grids[0]).gridTemplateRows !== 'masonry') { - grids = grids.map( grid => ({ - _el: grid, - gap: parseFloat( getComputedStyle( grid ).rowGap ), - items: [...grid.childNodes] - .filter( c => c.nodeType === 1 && +getComputedStyle(c).gridColumnEnd !== -1 ) - .map( c => ( {_el: c} ) ), - ncol: 0 - })); - - function layout() { - grids.forEach(grid => { - const ncol = getComputedStyle(grid._el).gridTemplateColumns.split(' ').length; - if ( grid.ncol !== ncol ) { - grid.ncol = ncol; - grid.items.forEach( c => c._el.style.removeProperty('margin-block-start') ); - if ( grid.ncol > 1 ) { - grid.items.slice( ncol ).forEach( ( c, i ) => { - const prev_fin = grid.items[i]._el.getBoundingClientRect().bottom; - const curr_ini = c._el.getBoundingClientRect().top; - c._el.style.marginTop = `${prev_fin + grid.gap - curr_ini}px`; - }); - } - } - }); - } - - addEventListener('load', e => { - layout(); - addEventListener( 'resize', layout, false ); - }, false - ); - } -} diff --git a/src/assets/scripts/nav-drawer.js b/src/assets/scripts/nav-drawer.js deleted file mode 100644 index f8e00e0..0000000 --- a/src/assets/scripts/nav-drawer.js +++ /dev/null @@ -1,34 +0,0 @@ -// © Manuel Matuzović: https://web.dev/website-navigation/ - -const nav = document.querySelector('nav'); -const list = nav.querySelector('ul'); -const burgerClone = document.querySelector('#burger-template').content.cloneNode(true); -const svg = nav.querySelector('svg'); - -const button = burgerClone.querySelector('button'); -button.addEventListener('click', e => { - const isOpen = button.getAttribute('aria-expanded') === 'true'; - button.setAttribute('aria-expanded', !isOpen); -}); - -// avoid DRY: disabling menu -const disableMenu = () => { - button.setAttribute('aria-expanded', false); -}; - -// close on escape -nav.addEventListener('keyup', e => { - if (e.code === 'Escape') { - disableMenu(); - } -}); - -// close if clicked outside of event target -document.addEventListener('click', e => { - const isClickInsideElement = nav.contains(e.target); - if (!isClickInsideElement) { - disableMenu(); - } -}); - -nav.insertBefore(burgerClone, list); diff --git a/src/assets/scripts/theme-toggle.js b/src/assets/scripts/theme-toggle.js deleted file mode 100644 index f97dc06..0000000 --- a/src/assets/scripts/theme-toggle.js +++ /dev/null @@ -1,67 +0,0 @@ -const storageKey = 'theme-preference'; -const lightLabel = '{{ meta.themeSwitch.light }}'; -const darkLabel = '{{ meta.themeSwitch.dark }}'; - -const theme = { - value: getColorPreference() -}; - -window.onload = () => { - const lightThemeToggle = document.querySelector('#light-theme-toggle'); - const darkThemeToggle = document.querySelector('#dark-theme-toggle'); - const switcher = document.querySelector('[data-theme-switcher]'); - - if (!switcher) { - return; - } - - switcher.removeAttribute('hidden'); - reflectPreference(); - - lightThemeToggle.addEventListener('click', () => onClick('light')); - darkThemeToggle.addEventListener('click', () => onClick('dark')); - - lightThemeToggle.setAttribute('aria-pressed', theme.value === 'light'); - darkThemeToggle.setAttribute('aria-pressed', theme.value === 'dark'); -}; - -// sync with system changes -window - .matchMedia('(prefers-color-scheme: dark)') - .addEventListener('change', ({matches: isDark}) => { - theme.value = isDark ? 'dark' : 'light'; - setPreference(); - }); - -function onClick(themeValue) { - theme.value = themeValue; - document - .querySelector('#light-theme-toggle') - .setAttribute('aria-pressed', themeValue === 'light'); - document - .querySelector('#dark-theme-toggle') - .setAttribute('aria-pressed', themeValue === 'dark'); - setPreference(); -} - -function getColorPreference() { - if (localStorage.getItem(storageKey)) { - return localStorage.getItem(storageKey); - } else { - return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; - } -} - -function setPreference() { - localStorage.setItem(storageKey, theme.value); - reflectPreference(); -} - -function reflectPreference() { - document.firstElementChild.setAttribute('data-theme', theme.value); - document.querySelector('#light-theme-toggle')?.setAttribute('aria-label', lightLabel); - document.querySelector('#dark-theme-toggle')?.setAttribute('aria-label', darkLabel); -} - -// set early so no page flashes / CSS is made aware -reflectPreference(); diff --git a/src/_includes/svg/arrow.svg b/src/assets/svg/various/arrow.svg similarity index 100% rename from src/_includes/svg/arrow.svg rename to src/assets/svg/various/arrow.svg diff --git a/src/_includes/svg/divider-edgy.svg b/src/assets/svg/various/divider-edgy.svg similarity index 100% rename from src/_includes/svg/divider-edgy.svg rename to src/assets/svg/various/divider-edgy.svg diff --git a/src/_includes/svg/divider-pixels.svg b/src/assets/svg/various/divider-pixels.svg similarity index 100% rename from src/_includes/svg/divider-pixels.svg rename to src/assets/svg/various/divider-pixels.svg diff --git a/src/_includes/svg/divider-raw.svg b/src/assets/svg/various/divider-raw.svg similarity index 100% rename from src/_includes/svg/divider-raw.svg rename to src/assets/svg/various/divider-raw.svg diff --git a/src/_includes/svg/divider-soft-bottom.svg b/src/assets/svg/various/divider-soft-bottom.svg similarity index 100% rename from src/_includes/svg/divider-soft-bottom.svg rename to src/assets/svg/various/divider-soft-bottom.svg diff --git a/src/_includes/svg/divider-soft-top.svg b/src/assets/svg/various/divider-soft-top.svg similarity index 100% rename from src/_includes/svg/divider-soft-top.svg rename to src/assets/svg/various/divider-soft-top.svg diff --git a/src/_includes/svg/divider-waves.svg b/src/assets/svg/various/divider-waves.svg similarity index 100% rename from src/_includes/svg/divider-waves.svg rename to src/assets/svg/various/divider-waves.svg diff --git a/src/_includes/svg/heart.svg b/src/assets/svg/various/heart.svg similarity index 100% rename from src/_includes/svg/heart.svg rename to src/assets/svg/various/heart.svg diff --git a/src/_includes/svg/moon.svg b/src/assets/svg/various/moon.svg similarity index 100% rename from src/_includes/svg/moon.svg rename to src/assets/svg/various/moon.svg diff --git a/src/_includes/svg/platform-bluesky.svg b/src/assets/svg/various/platform-bluesky.svg similarity index 100% rename from src/_includes/svg/platform-bluesky.svg rename to src/assets/svg/various/platform-bluesky.svg diff --git a/src/_includes/svg/platform-github.svg b/src/assets/svg/various/platform-github.svg similarity index 100% rename from src/_includes/svg/platform-github.svg rename to src/assets/svg/various/platform-github.svg diff --git a/src/_includes/svg/platform-gitlab.svg b/src/assets/svg/various/platform-gitlab.svg similarity index 100% rename from src/_includes/svg/platform-gitlab.svg rename to src/assets/svg/various/platform-gitlab.svg diff --git a/src/_includes/svg/platform-instagram.svg b/src/assets/svg/various/platform-instagram.svg similarity index 100% rename from src/_includes/svg/platform-instagram.svg rename to src/assets/svg/various/platform-instagram.svg diff --git a/src/_includes/svg/platform-kofi.svg b/src/assets/svg/various/platform-kofi.svg similarity index 100% rename from src/_includes/svg/platform-kofi.svg rename to src/assets/svg/various/platform-kofi.svg diff --git a/src/_includes/svg/platform-linkedin.svg b/src/assets/svg/various/platform-linkedin.svg similarity index 100% rename from src/_includes/svg/platform-linkedin.svg rename to src/assets/svg/various/platform-linkedin.svg diff --git a/src/_includes/svg/platform-mastodon.svg b/src/assets/svg/various/platform-mastodon.svg similarity index 100% rename from src/_includes/svg/platform-mastodon.svg rename to src/assets/svg/various/platform-mastodon.svg diff --git a/src/_includes/svg/platform-pinterest.svg b/src/assets/svg/various/platform-pinterest.svg similarity index 100% rename from src/_includes/svg/platform-pinterest.svg rename to src/assets/svg/various/platform-pinterest.svg diff --git a/src/_includes/svg/platform-tiktok.svg b/src/assets/svg/various/platform-tiktok.svg similarity index 100% rename from src/_includes/svg/platform-tiktok.svg rename to src/assets/svg/various/platform-tiktok.svg diff --git a/src/_includes/svg/platform-youtube.svg b/src/assets/svg/various/platform-youtube.svg similarity index 100% rename from src/_includes/svg/platform-youtube.svg rename to src/assets/svg/various/platform-youtube.svg diff --git a/src/_includes/svg/rawsta.svg b/src/assets/svg/various/rawsta.svg similarity index 100% rename from src/_includes/svg/rawsta.svg rename to src/assets/svg/various/rawsta.svg diff --git a/src/_includes/svg/rss.svg b/src/assets/svg/various/rss.svg similarity index 100% rename from src/_includes/svg/rss.svg rename to src/assets/svg/various/rss.svg diff --git a/src/_includes/svg/star.svg b/src/assets/svg/various/star.svg similarity index 100% rename from src/_includes/svg/star.svg rename to src/assets/svg/various/star.svg diff --git a/src/_includes/svg/sun.svg b/src/assets/svg/various/sun.svg similarity index 100% rename from src/_includes/svg/sun.svg rename to src/assets/svg/various/sun.svg diff --git a/src/utilities/clamp-generator.js b/src/utilities/clamp-generator.js deleted file mode 100644 index 2752f17..0000000 --- a/src/utilities/clamp-generator.js +++ /dev/null @@ -1,41 +0,0 @@ -/** © Andy Bell - https://buildexcellentwebsit.es/ */ - -const viewports = require('../_data/designTokens/viewports.json'); - -/** - * Takes an array of tokens and sends back and array of name - * and clamp pairs for CSS fluid values. - * - * @param {array} tokens array of {name: string, min: number, max: number} - * @returns {array} {name: string, value: string} - */ -const clampGenerator = tokens => { - const rootSize = 16; - - return tokens.map(({name, min, max}) => { - if (min === max) { - return `${min / rootSize}rem`; - } - - // Convert the min and max sizes to rems - const minSize = min / rootSize; - const maxSize = max / rootSize; - - // Convert the pixel viewport sizes into rems - const minViewport = viewports.min / rootSize; - const maxViewport = viewports.max / rootSize; - - // Slope and intersection allow us to have a fluid value but also keep that sensible - const slope = (maxSize - minSize) / (maxViewport - minViewport); - const intersection = -1 * minViewport * slope + minSize; - - return { - name, - value: `clamp(${minSize}rem, ${intersection.toFixed(2)}rem + ${( - slope * 100 - ).toFixed(2)}vw, ${maxSize}rem)` - }; - }); -}; - -module.exports = clampGenerator; diff --git a/src/utilities/tokens-to-tailwind.js b/src/utilities/tokens-to-tailwind.js deleted file mode 100644 index 3875918..0000000 --- a/src/utilities/tokens-to-tailwind.js +++ /dev/null @@ -1,22 +0,0 @@ -/** © Andy Bell - https://buildexcellentwebsit.es/ */ - -const slugify = require('slugify'); - -/** - * Converts human readable tokens into tailwind config friendly ones - * - * @param {array} tokens {name: string, value: any} - * @return {object} {key, value} - */ -const tokensToTailwind = tokens => { - const nameSlug = text => slugify(text, {lower: true}); - let response = {}; - - tokens.forEach(({name, value}) => { - response[nameSlug(name)] = value; - }); - - return response; -}; - -module.exports = tokensToTailwind;