From 8be0fceb696f09f687519ddf41bb81d77e38ee31 Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 23 Apr 2020 18:51:12 -0400 Subject: [PATCH] Minor tweaks to css and js --- frontEndSrc/css.js | 58 +-- frontEndSrc/css/src/general.css | 4 + frontEndSrc/js/template-helpers.js | 9 +- frontEndSrc/package.json | 4 +- frontEndSrc/yarn.lock | 630 ++++++++++++++++------------- public/css/auto.min.css | 2 +- public/css/dark.min.css | 2 +- public/css/light.min.css | 2 +- public/es/scripts.js | 9 +- public/js/scripts.min.js | 6 +- public/js/scripts.min.js.map | 2 +- 11 files changed, 405 insertions(+), 323 deletions(-) diff --git a/frontEndSrc/css.js b/frontEndSrc/css.js index 4b02f04e..0ff7a60b 100644 --- a/frontEndSrc/css.js +++ b/frontEndSrc/css.js @@ -28,39 +28,43 @@ const processOptions = { stage: 0, }; -(async () => { - // Basic theme - const lightMin = await postcss() +try { + (async () => { + // Basic theme + const lightMin = await postcss() .use(atImport()) .use(cssNext(processOptions)) .use(cssNano(minOptions)) .process(lightCss, { from: 'css/light.css', to: '/public/css/light.min.css', + }).catch(console.error); + fs.writeFileSync('../public/css/light.min.css', lightMin.css); + + // Dark theme + const darkFullMin = await postcss() + .use(atImport()) + .use(cssNext(processOptions)) + .use(cssNano(minOptions)) + .process(fullDarkCss, { + from: 'css/dark.css', + to: '/public/css/dark.min.css', }); - fs.writeFileSync('../public/css/light.min.css', lightMin); + fs.writeFileSync('../public/css/dark.min.css', darkFullMin.css); - // Dark theme - const darkFullMin = await postcss() - .use(atImport()) - .use(cssNext(processOptions)) - .use(cssNano(minOptions)) - .process(fullDarkCss, { - from: 'css/dark.css', - to: '/public/css/dark.min.css', - }); - fs.writeFileSync('../public/css/dark.min.css', darkFullMin); + // Dark override + const darkMin = await postcss() + .use(atImport()) + .use(cssNext(processOptions)) + .use(cssNano(minOptions)) + .process(darkCss, { + from: 'css/dark-override.css', + to: '/public/css/dark.min.css', + }).catch(console.error); + const autoDarkCss = `${lightMin} @media (prefers-color-scheme: dark) { ${darkMin.css} }` + fs.writeFileSync('../public/css/auto.min.css', autoDarkCss) - // Dark override - const darkMin = await postcss() - .use(atImport()) - .use(cssNext(processOptions)) - .use(cssNano(minOptions)) - .process(darkCss, { - from: 'css/dark-override.css', - to: '/public/css/dark.min.css', - }); - const autoDarkCss = `${lightMin} @media (prefers-color-scheme: dark) { ${darkMin} }` - fs.writeFileSync('../public/css/auto.min.css', autoDarkCss) - -})(); \ No newline at end of file + })(); +} catch (e) { + console.error(e) +} diff --git a/frontEndSrc/css/src/general.css b/frontEndSrc/css/src/general.css index b37d4c85..5b95418d 100644 --- a/frontEndSrc/css/src/general.css +++ b/frontEndSrc/css/src/general.css @@ -87,6 +87,10 @@ tbody > tr:nth-child(odd) { background: #ddd; } +select[multiple] { + width: 100%; +} + a:hover, a:active { color: var(--link-hover-color) } diff --git a/frontEndSrc/js/template-helpers.js b/frontEndSrc/js/template-helpers.js index d9038c22..caf054b3 100644 --- a/frontEndSrc/js/template-helpers.js +++ b/frontEndSrc/js/template-helpers.js @@ -12,9 +12,7 @@ export function renderAnimeSearchResults (data) { data.forEach(x => { const item = x.attributes; - const titles = item.titles.reduce((prev, current) => { - return prev + `${current}
`; - }, []); + const titles = item.titles.join('
'); results.push(`