From e76f65409f3089954e1cb26c42a91f2fe7d6da28 Mon Sep 17 00:00:00 2001 From: Vladimir Rubin Date: Wed, 27 Nov 2024 19:31:17 +0200 Subject: [PATCH] style(homepage): change out the defaults --- assets/tailwind.config.js | 153 +++++++++------- lib/exmr_web/components/layouts/app.html.heex | 16 +- .../controllers/page_html/home.html.heex | 168 +++--------------- priv/static/favicon.ico | Bin 152 -> 15406 bytes priv/static/images/logo.svg | 7 +- 5 files changed, 109 insertions(+), 235 deletions(-) diff --git a/assets/tailwind.config.js b/assets/tailwind.config.js index 669b8f5..2e6b547 100644 --- a/assets/tailwind.config.js +++ b/assets/tailwind.config.js @@ -1,74 +1,91 @@ // See the Tailwind configuration guide for advanced usage // https://tailwindcss.com/docs/configuration -const plugin = require("tailwindcss/plugin") -const fs = require("fs") -const path = require("path") +const plugin = require("tailwindcss/plugin"); +const fs = require("fs"); +const path = require("path"); module.exports = { - content: [ - "./js/**/*.js", - "../lib/exmr_web.ex", - "../lib/exmr_web/**/*.*ex" - ], - theme: { - extend: { - colors: { - brand: "#FD4F00", - } - }, - }, - plugins: [ - require("@tailwindcss/forms"), - // Allows prefixing tailwind classes with LiveView classes to add rules - // only when LiveView classes are applied, for example: - // - //
- // - plugin(({addVariant}) => addVariant("phx-click-loading", [".phx-click-loading&", ".phx-click-loading &"])), - plugin(({addVariant}) => addVariant("phx-submit-loading", [".phx-submit-loading&", ".phx-submit-loading &"])), - plugin(({addVariant}) => addVariant("phx-change-loading", [".phx-change-loading&", ".phx-change-loading &"])), + content: ["./js/**/*.js", "../lib/exmr_web.ex", "../lib/exmr_web/**/*.*ex"], + theme: { + extend: { + colors: { + brand: "#C47BC6", + }, + }, + }, + plugins: [ + require("@tailwindcss/forms"), + // Allows prefixing tailwind classes with LiveView classes to add rules + // only when LiveView classes are applied, for example: + // + //
+ // + plugin(({ addVariant }) => + addVariant("phx-click-loading", [ + ".phx-click-loading&", + ".phx-click-loading &", + ]), + ), + plugin(({ addVariant }) => + addVariant("phx-submit-loading", [ + ".phx-submit-loading&", + ".phx-submit-loading &", + ]), + ), + plugin(({ addVariant }) => + addVariant("phx-change-loading", [ + ".phx-change-loading&", + ".phx-change-loading &", + ]), + ), - // Embeds Heroicons (https://heroicons.com) into your app.css bundle - // See your `CoreComponents.icon/1` for more information. - // - plugin(function({matchComponents, theme}) { - let iconsDir = path.join(__dirname, "../deps/heroicons/optimized") - let values = {} - let icons = [ - ["", "/24/outline"], - ["-solid", "/24/solid"], - ["-mini", "/20/solid"], - ["-micro", "/16/solid"] - ] - icons.forEach(([suffix, dir]) => { - fs.readdirSync(path.join(iconsDir, dir)).forEach(file => { - let name = path.basename(file, ".svg") + suffix - values[name] = {name, fullPath: path.join(iconsDir, dir, file)} - }) - }) - matchComponents({ - "hero": ({name, fullPath}) => { - let content = fs.readFileSync(fullPath).toString().replace(/\r?\n|\r/g, "") - let size = theme("spacing.6") - if (name.endsWith("-mini")) { - size = theme("spacing.5") - } else if (name.endsWith("-micro")) { - size = theme("spacing.4") - } - return { - [`--hero-${name}`]: `url('data:image/svg+xml;utf8,${content}')`, - "-webkit-mask": `var(--hero-${name})`, - "mask": `var(--hero-${name})`, - "mask-repeat": "no-repeat", - "background-color": "currentColor", - "vertical-align": "middle", - "display": "inline-block", - "width": size, - "height": size - } - } - }, {values}) - }) - ] -} + // Embeds Heroicons (https://heroicons.com) into your app.css bundle + // See your `CoreComponents.icon/1` for more information. + // + plugin(function({ matchComponents, theme }) { + let iconsDir = path.join(__dirname, "../deps/heroicons/optimized"); + let values = {}; + let icons = [ + ["", "/24/outline"], + ["-solid", "/24/solid"], + ["-mini", "/20/solid"], + ["-micro", "/16/solid"], + ]; + icons.forEach(([suffix, dir]) => { + fs.readdirSync(path.join(iconsDir, dir)).forEach((file) => { + let name = path.basename(file, ".svg") + suffix; + values[name] = { name, fullPath: path.join(iconsDir, dir, file) }; + }); + }); + matchComponents( + { + hero: ({ name, fullPath }) => { + let content = fs + .readFileSync(fullPath) + .toString() + .replace(/\r?\n|\r/g, ""); + let size = theme("spacing.6"); + if (name.endsWith("-mini")) { + size = theme("spacing.5"); + } else if (name.endsWith("-micro")) { + size = theme("spacing.4"); + } + return { + [`--hero-${name}`]: `url('data:image/svg+xml;utf8,${content}')`, + "-webkit-mask": `var(--hero-${name})`, + mask: `var(--hero-${name})`, + "mask-repeat": "no-repeat", + "background-color": "currentColor", + "vertical-align": "middle", + display: "inline-block", + width: size, + height: size, + }; + }, + }, + { values }, + ); + }), + ], +}; diff --git a/lib/exmr_web/components/layouts/app.html.heex b/lib/exmr_web/components/layouts/app.html.heex index e23bfc8..9b83af0 100644 --- a/lib/exmr_web/components/layouts/app.html.heex +++ b/lib/exmr_web/components/layouts/app.html.heex @@ -5,23 +5,9 @@

- v<%= Application.spec(:phoenix, :vsn) %> + v<%= Application.spec(:exmr, :vsn) %>

-
diff --git a/lib/exmr_web/controllers/page_html/home.html.heex b/lib/exmr_web/controllers/page_html/home.html.heex index dc1820b..d9d3147 100644 --- a/lib/exmr_web/controllers/page_html/home.html.heex +++ b/lib/exmr_web/controllers/page_html/home.html.heex @@ -7,23 +7,23 @@ class="absolute inset-0 h-full w-full" preserveAspectRatio="xMinYMid slice" > - +
- -

- Phoenix Framework - - v<%= Application.spec(:phoenix, :vsn) %> + +

+ ExMR + + v<%= Application.spec(:exmr, :vsn) %>

- Peace of mind from prototype to production. + hell yeah

- Build rich, interactive web applications quickly, with less code and fewer moving parts. Join our growing community of developers using Phoenix to craft APIs, HTML5 apps and more, for fun or at scale. + y'all really though i'm gonna be serious? lol

+
+ <.link navigate={~p"/exams"} class="underline hover:text-red-400 transition-all ease-in-out">exams +

diff --git a/priv/static/favicon.ico b/priv/static/favicon.ico index 7f372bfc21cdd8cb47585339d5fa4d9dd424402f..2344190b5f4a9a3046025ac225395647b2d64253 100644 GIT binary patch literal 15406 zcmeHN4^&iT79UVhf<#6V3k5;~`mFLaq57Z(Q?E?m&qG#21BY%MMa zb+dYzO})^iqy8HT=m6Vo>s3|g${EPSyLbX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