From e1ecd0cb986a2eabd25bf85e4892bf2a05a43f12 Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Sat, 11 Dec 2021 14:04:05 +0100 Subject: [PATCH] feat(fs.dev): Added theme support --- package.json | 4 +- packages/freesewing.dev/hooks/useApp.js | 42 +++++ packages/freesewing.dev/next.config.mjs | 4 +- packages/freesewing.dev/package.json | 3 +- packages/freesewing.dev/pages/_app.js | 2 +- packages/freesewing.dev/pages/index.js | 39 ++--- .../components/elements/h1.js | 13 ++ .../components/icon/icons.js | 84 +++++++++ .../components/icon/index.js | 29 ++++ .../components/layouts/default.js | 60 +++++++ .../components/navigation/primary.js | 32 ++++ .../components/theme-picker.js | 13 ++ .../components/wrappers/app.jsx | 58 ------- .../components/wrappers/page.js | 68 ++++++++ packages/freesewing.shared/config/next.mjs | 14 +- .../config/tailwind.config.js | 14 ++ .../hooks/useLocalStorage.js | 32 ++++ packages/freesewing.shared/package.json | 21 +++ .../styles/globals.css | 5 + .../freesewing.shared/themes/bureaucrats.js | 55 ++++++ packages/freesewing.shared/themes/dark.js | 43 +++++ packages/freesewing.shared/themes/hax0r.js | 53 ++++++ packages/freesewing.shared/themes/index.js | 13 ++ .../freesewing.shared/themes/kindergarten.js | 54 ++++++ packages/freesewing.shared/themes/light.js | 162 ++++++++++++++++++ yarn.lock | 13 +- 26 files changed, 834 insertions(+), 96 deletions(-) create mode 100644 packages/freesewing.dev/hooks/useApp.js create mode 100644 packages/freesewing.shared/components/elements/h1.js create mode 100644 packages/freesewing.shared/components/icon/icons.js create mode 100644 packages/freesewing.shared/components/icon/index.js create mode 100644 packages/freesewing.shared/components/layouts/default.js create mode 100644 packages/freesewing.shared/components/navigation/primary.js create mode 100644 packages/freesewing.shared/components/theme-picker.js delete mode 100644 packages/freesewing.shared/components/wrappers/app.jsx create mode 100644 packages/freesewing.shared/components/wrappers/page.js create mode 100644 packages/freesewing.shared/hooks/useLocalStorage.js create mode 100644 packages/freesewing.shared/package.json rename packages/{freesewing.dev => freesewing.shared}/styles/globals.css (68%) create mode 100644 packages/freesewing.shared/themes/bureaucrats.js create mode 100644 packages/freesewing.shared/themes/dark.js create mode 100644 packages/freesewing.shared/themes/hax0r.js create mode 100644 packages/freesewing.shared/themes/index.js create mode 100644 packages/freesewing.shared/themes/kindergarten.js create mode 100644 packages/freesewing.shared/themes/light.js diff --git a/package.json b/package.json index c81e2ed6936..c17cbb0cfda 100644 --- a/package.json +++ b/package.json @@ -114,6 +114,8 @@ }, "version": "0.0.0", "dependencies": { - "jsonfile": "^6.1.0" + "jsonfile": "^6.1.0", + "postcss": "^8.4.4", + "tailwindcss": "^3.0.1" } } diff --git a/packages/freesewing.dev/hooks/useApp.js b/packages/freesewing.dev/hooks/useApp.js new file mode 100644 index 00000000000..c4f6b1fd218 --- /dev/null +++ b/packages/freesewing.dev/hooks/useApp.js @@ -0,0 +1,42 @@ +import { useState } from 'react' +// Stores state in local storage +import useLocalStorage from 'shared/hooks/useLocalStorage.js' + +function useApp(full = true) { + + // User color scheme preference + const prefersDarkMode = (typeof window !== 'undefined' && typeof window.matchMedia === 'function') + ? window.matchMedia(`(prefers-color-scheme: dark`).matches + : null + + // React State + const [primaryMenu, setPrimaryMenu] = useState(false) + + // Persistent state + const [account, setAccount] = useLocalStorage('account', { username: false }) + const [theme, setTheme] = useLocalStorage('theme', prefersDarkMode ? 'dark' : 'light') + + + // State methods + const togglePrimaryMenu = () => setPrimaryMenu(!primaryMenu) + const openPrimaryMenu = () => setPrimaryMenu(true) + const closePrimaryMenu = () => setPrimaryMenu(false) + + + return { + // State + primaryMenu, + theme, + + // State setters + setPrimaryMenu, + setTheme, + + // State handlers + togglePrimaryMenu, + } + +} + +export default useApp + diff --git a/packages/freesewing.dev/next.config.mjs b/packages/freesewing.dev/next.config.mjs index 03af1ad5bf7..05d14efe112 100644 --- a/packages/freesewing.dev/next.config.mjs +++ b/packages/freesewing.dev/next.config.mjs @@ -1,3 +1,3 @@ -import config from '../freesewing.shared/config/next.mjs' +import configBuilder from '../freesewing.shared/config/next.mjs' -export default config +export default configBuilder('dev') diff --git a/packages/freesewing.dev/package.json b/packages/freesewing.dev/package.json index 629d42a2a1c..fb9145d019b 100644 --- a/packages/freesewing.dev/package.json +++ b/packages/freesewing.dev/package.json @@ -16,12 +16,13 @@ "@mdx-js/runtime": "next", "daisyui": "^1.16.2", "next": "latest", + "react-swipeable": "^6.2.0", "remark-gfm": "^3.0.1", "remark-jargon": "^2.19.5" }, "devDependencies": { "autoprefixer": "^10.4.0", "postcss": "^8.4.4", - "tailwindcss": "^3.0.0" + "tailwindcss": "^3.0.1" } } diff --git a/packages/freesewing.dev/pages/_app.js b/packages/freesewing.dev/pages/_app.js index 733afc5399c..e125a54674f 100644 --- a/packages/freesewing.dev/pages/_app.js +++ b/packages/freesewing.dev/pages/_app.js @@ -1,4 +1,4 @@ -import '../styles/globals.css' +import 'shared/styles/globals.css' const FreeSewingDev = ({ Component, pageProps }) => diff --git a/packages/freesewing.dev/pages/index.js b/packages/freesewing.dev/pages/index.js index 6d6f6bd2689..fb6b56a96e0 100644 --- a/packages/freesewing.dev/pages/index.js +++ b/packages/freesewing.dev/pages/index.js @@ -1,28 +1,19 @@ -import Head from 'next/head' -import Image from 'next/image' +import Page from 'shared/components/wrappers/page.js' +import useApp from 'site/hooks/useApp.js' +import ThemePicker from 'shared/components/theme-picker.js' -export default function Home() { +export default (props) => { + const app = useApp() return ( -
- - Create Next App - - - - -
-

- Welcome to Next.js! -

- - -

- Get started by editing{' '} - pages/index.js -

- -
- -
+ +

+ +

+ +
) } + diff --git a/packages/freesewing.shared/components/elements/h1.js b/packages/freesewing.shared/components/elements/h1.js new file mode 100644 index 00000000000..9ffb332778c --- /dev/null +++ b/packages/freesewing.shared/components/elements/h1.js @@ -0,0 +1,13 @@ +const H1 = props => ( +

+ {props.children} +

+) + +export default H1 diff --git a/packages/freesewing.shared/components/icon/icons.js b/packages/freesewing.shared/components/icon/icons.js new file mode 100644 index 00000000000..7dd79f26e33 --- /dev/null +++ b/packages/freesewing.shared/components/icon/icons.js @@ -0,0 +1,84 @@ +const blog = "M 4 4.4394531 L 4 7.2695312 C 11.03 7.2695312 16.730469 12.97 16.730469 20 L 19.560547 20 C 19.560547 11.41 12.59 4.4394531 4 4.4394531 z M 4 10.099609 L 4 12.929688 C 7.9 12.929688 11.070312 16.1 11.070312 20 L 13.900391 20 C 13.900391 14.53 9.47 10.099609 4 10.099609 z M 6.1074219 15.640625 A 2.1800001 2.1800001 0 0 0 4 17.820312 A 2.1800001 2.1800001 0 0 0 6.1796875 20 A 2.1800001 2.1800001 0 0 0 8.359375 17.820312 A 2.1800001 2.1800001 0 0 0 6.1796875 15.640625 A 2.1800001 2.1800001 0 0 0 6.1074219 15.640625 z " + +const colors = "M 11.999999,2 C 6.4900002,2 2,6.4899996 2,12 2,17.51 6.4900002,22 11.999999,22 13.38,22 14.5,20.88 14.5,19.5 c 0,-0.61 -0.23,-1.2 -0.64,-1.67 -0.08,-0.1 -0.13,-0.21 -0.13,-0.33 0,-0.28 0.22,-0.5 0.5,-0.5 H 16 c 3.31,0 6,-2.69 6,-6 C 22,6.0399996 17.51,2 11.999999,2 Z M 17.5,13 C 16.67,13 16,12.33 16,11.5 16,10.67 16.67,9.9999996 17.5,9.9999996 18.33,9.9999996 19,10.67 19,11.5 19,12.33 18.33,13 17.5,13 Z m -3,-4.0000004 c -0.83,0 -1.5,-0.67 -1.5,-1.5 0,-0.83 0.67,-1.5 1.5,-1.5 0.83,0 1.5,0.67 1.5,1.5 0,0.83 -0.67,1.5 -1.5,1.5 z M 5.0000002,11.5 c 0,-0.83 0.67,-1.5000004 1.5,-1.5000004 0.8300001,0 1.5000001,0.6700004 1.5000001,1.5000004 0,0.83 -0.67,1.5 -1.5000001,1.5 -0.83,0 -1.5,-0.67 -1.5,-1.5 z M 10.999999,7.4999996 c 0,0.83 -0.669999,1.5 -1.4999986,1.5 -0.8300001,0 -1.5000001,-0.67 -1.5000001,-1.5 0,-0.83 0.67,-1.5 1.5000001,-1.5 0.8299996,0 1.4999986,0.67 1.4999986,1.5 z" + +const community = "M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" + +const designs = 'M 11.974745,2.9104165 c -1.528527,0 -2.784485,1.256277 -2.784485,2.7848068 0,0.7494035 0.300482,1.4388587 0.786371,1.9393863 a 0.79436575,0.79436575 0 0 0 0.0084,0.00839 c 0.38087,0.3808653 0.745407,0.6251708 0.94538,0.8248328 0.19998,0.1996612 0.25013,0.2644989 0.25013,0.519072 V 9.6465486 L 2.0590674,14.913054 c -0.284779,0.164416 -0.836034,0.466125 -1.31649616,0.961104 -0.4804697,0.494981 -0.92450835,1.339947 -0.6668386,2.258534 0.2202611,0.785239 0.7746008,1.348564 1.34156666,1.587845 0.5669735,0.23928 1.0981677,0.23415 1.4684955,0.23415 h 6.2292502 5.582178 6.22925 c 0.370328,0 0.901583,0.0051 1.468557,-0.23415 0.566974,-0.239281 1.121495,-0.802606 1.341756,-1.587845 0.25767,-0.918587 -0.18662,-1.763553 -0.667089,-2.258534 C 22.589235,15.379179 22.03823,15.07747 21.753452,14.913054 L 12.76908,9.7258014 V 8.9869116 c 0,-0.7037243 -0.35623,-1.2837462 -0.716532,-1.6434766 C 11.69477,6.9862306 11.349385,6.7584045 11.114868,6.5255482 10.906224,6.3095381 10.778796,6.0225704 10.778796,5.6952216 c 0,-0.6700011 0.525949,-1.1962032 1.195949,-1.1962032 0.670007,0 1.196206,0.5262021 1.196206,1.1962032 a 0.79428633,0.79428633 0 0 0 0.794335,0.7942692 0.79428633,0.79428633 0 0 0 0.794268,-0.7942692 c 0,-1.5285296 -1.256276,-2.7848051 -2.784809,-2.7848051 z m -0.06859,8.2926595 8.991884,5.191357 c 0.289472,0.167124 0.693472,0.413355 0.943933,0.671385 0.250463,0.258029 0.313011,0.371405 0.247537,0.604827 -0.102886,0.366772 -0.190028,0.402129 -0.359686,0.473732 -0.169667,0.07161 -0.470133,0.09952 -0.803363,0.09952 H 14.697212 9.115034 2.8857834 c -0.3332299,0 -0.6336968,-0.02792 -0.8033621,-0.09952 -0.1696653,-0.07161 -0.2567452,-0.10696 -0.3596267,-0.473732 -0.06548,-0.233422 -0.00303,-0.346798 0.2474764,-0.604827 0.2504623,-0.25803 0.6547126,-0.504259 0.9441829,-0.671385 z' + +const discord = 'M20.222 0c1.406 0 2.54 1.137 2.607 2.475V24l-2.677-2.273-1.47-1.338-1.604-1.398.67 2.205H3.71c-1.402 0-2.54-1.065-2.54-2.476V2.48C1.17 1.142 2.31.003 3.715.003h16.5L20.222 0zm-6.118 5.683h-.03l-.202.2c2.073.6 3.076 1.537 3.076 1.537-1.336-.668-2.54-1.002-3.744-1.137-.87-.135-1.74-.064-2.475 0h-.2c-.47 0-1.47.2-2.81.735-.467.203-.735.336-.735.336s1.002-1.002 3.21-1.537l-.135-.135s-1.672-.064-3.477 1.27c0 0-1.805 3.144-1.805 7.02 0 0 1 1.74 3.743 1.806 0 0 .4-.533.805-1.002-1.54-.468-2.14-1.404-2.14-1.404s.134.066.335.2h.06c.03 0 .044.015.06.03v.006c.016.016.03.03.06.03.33.136.66.27.93.4.466.202 1.065.403 1.8.536.93.135 1.996.2 3.21 0 .6-.135 1.2-.267 1.8-.535.39-.2.87-.4 1.397-.737 0 0-.6.936-2.205 1.404.33.466.795 1 .795 1 2.744-.06 3.81-1.8 3.87-1.726 0-3.87-1.815-7.02-1.815-7.02-1.635-1.214-3.165-1.26-3.435-1.26l.056-.02zm.168 4.413c.703 0 1.27.6 1.27 1.335 0 .74-.57 1.34-1.27 1.34-.7 0-1.27-.6-1.27-1.334.002-.74.573-1.338 1.27-1.338zm-4.543 0c.7 0 1.266.6 1.266 1.335 0 .74-.57 1.34-1.27 1.34-.7 0-1.27-.6-1.27-1.334 0-.74.57-1.338 1.27-1.338z' + +const down = "M 18.119999,7.453333 12,13.56 5.8799998,7.453333 l -1.88,1.88 8.0000002,8 7.999999,-8 z" + +const freesewing = "M 18.5595,0 C 18.065,0.3515 18.0905,0.3065 17.691,0.437 16.775,0.7365 15.8965,0.572 14.854,0.485 14.5405,0.45 14.2295,0.4295 13.926,0.4275 12.3935,0.417 11.092,0.8665 10.8455,2.1215 10.391,2.397 9.973,2.7305 9.559,3.0645 8.675,3.762 8.0095,4.6145 7.5555,5.642 c -0.62,1.5175 -0.06,3.146 0.2175,4.684 0.066,0.36 0.135,0.703 0.172,0.8355 C 7.9975,11.348 8.09,11.526 8.1905,11.686 8.214,11.69 8.338,11.499 8.3675,11.4145 8.4105,11.2915 8.406,11.094 8.359,10.924 8.255,10.5415 8.156,10.231 8.1475,10.075 8.1325,9.782 8.1895,9.5115 8.2965,9.3775 8.3345,9.33 8.4215,9.575 8.399,9.666 8.3725,9.7755 8.3525,9.963 8.361,10.0495 c 0.0235,0.293 0.0665,0.6065 0.12,0.8805 0.0685,0.3535 0.098,0.5805 0.0855,0.6685 -0.009,0.064 -0.039,0.1285 -0.154,0.3265 -0.1,0.1735 -0.152,0.314 -0.16,0.438 -0.0085,0.121 0.028,0.4235 0.062,0.4975 0.0495,0.1155 0.1985,0.237 0.3285,0.267 0.1245,0.0475 0.187,0.146 0.251,0.2565 0.1555,0.2965 0.2755,0.6575 0.3945,1.2015 0.058,0.2605 0.1065,0.493 0.122,0.615 C 8.4505,15.2015 7.221,15.202 6.101,15.202 5.724,15.208 5.043,15.031 4.4185,14.99 4.328,14.013 3.899,12.878 3.165,12.812 2.664,12.7665 2.2485,12.957 1.897,13.7485 l 0.01,0.0425 c 0.2075,-0.1735 0.4265,-0.704 1.2155,-0.6675 0.606,0.0275 0.808,1.1745 0.868,1.8645 -0.369,0.027 -0.683,0.1405 -0.847,0.424 H 3.14 c 0,5e-4 0,0.0015 0.0015,0.0025 C 3.14,15.4155 3.14,15.4165 3.14,15.4175 h 0.0035 c 0.169,0.2905 0.4945,0.403 0.877,0.4255 0.2555,7.225 7.047,8.157 8.903,8.157 6.924,0 9.348,-4.705 9.7125,-6.5685 0.1705,0.794 -0.3665,1.8055 -0.495,2.552 1.4605,-1.6885 1.1965,-3.312 0.9295,-4.945 0.222,0.264 0.5225,0.4275 0.93,0.337 -0.2905,-0.194 -0.6845,-0.058 -0.9205,-0.8765 -0.103,-0.3535 -0.192,-0.6185 -0.2805,-0.841 -0.191,-0.7165 -0.462,-1.401 -0.795,-2.068 -0.281,-0.7235 -0.0955,-1.1925 -0.1235,-1.8135 0.5055,1.667 0.8215,2.1105 1.4115,2.285 -1.484,-1.788 -0.976,-4.5565 -1.8145,-7.0275 0.3795,0.223 0.8125,0.29 1.2735,0.0175 -0.446,-0.127 -0.891,0.2085 -1.531,-0.732 C 20.68,3.268 19.897,2.4915 18.947,1.8065 18.438,1.4745 17.873,1.2515 17.305,1.0445 17.8835,0.8995 18.5295,0.3845 18.5595,0 Z M 17.589,5.5535 c 0.762,0.278 1.602,1.334 1.5925,2.37 v 0.043 0.015 c -0.0205,1.407 -0.66,2.1635 -0.633,3.1005 0.0345,1.1035 0.5095,1.4885 0.604,1.6725 -0.162,-0.6805 -0.257,-1.5365 -0.043,-2.2145 0.275,-0.872 0.5525,-1.594 0.5325,-2.277 -0.01,-0.16 -0.078,-0.7585 -0.1235,-1.0235 0.817,1.179 -0.177,2.8935 0.109,4.0155 0.497,1.9545 2.7245,2.2015 2.0615,6.1395 -0.5835,3.462 -4.5815,6.0895 -8.6795,6.0895 -3.038,0 -8.3025,-1.6815 -8.5625,-7.646 0.6175,-0.044 1.2815,-0.216 1.654,-0.21 1.126,0 2.412,5e-4 3.381,10e-4 0.182,0.821 0.3185,1.019 1.009,1.566 0.768,0.604 0.947,0.6775 2.083,0.6885 1.1365,0.0115 1.4735,-0.232 2.576,-1.275 0.238,-0.279 0.341,-0.6445 0.4565,-0.988 1.134,-0.0105 1.961,-0.0305 2.7745,-0.0685 0.8285,-0.0375 0.9455,0 2.2805,-0.1375 -1.335,-0.1375 -1.452,-0.1 -2.2805,-0.138 -0.792,-0.036 -1.594,-0.0565 -2.6785,-0.0665 0.091,-0.4085 0.221,-0.8075 0.3595,-1.202 0.0855,-0.2325 0.186,-0.459 0.289,-0.6845 l 0.1125,-0.035 c 0.217,-0.077 0.409,-0.242 0.4855,-0.465 0.0985,-0.2955 0.0285,-0.6275 -0.162,-0.869 -0.0655,-0.0905 -0.147,-0.206 -0.1805,-0.257 -0.1005,-0.159 -0.103,-0.2475 -0.018,-0.8385 0.0715,-0.495 0.0795,-0.754 0.03,-1.005 -0.01,-0.1435 -0.011,-0.4385 -0.0155,-0.518 0.038,0.021 0.1205,0.209 0.204,0.4635 0.083,0.2555 0.0965,0.3085 0.1155,0.526 0.021,0.247 -0.0715,0.43 -0.1475,0.7985 -0.038,0.19 -0.0715,0.3665 -0.0715,0.3905 0,0.0255 0.018,0.0795 0.037,0.1215 0.0445,0.094 0.128,0.226 0.1435,0.226 0.2725,-0.3005 0.4325,-0.6715 0.575,-1.048 0.15,-0.426 0.194,-0.878 0.299,-1.3165 C 17.843,9.1155 17.941,8.733 17.9715,8.341 18.033,7.576 17.997,7.036 17.828,6.239 17.7875,6.059 17.6705,5.7155 17.589,5.5535 Z m -2.68,3.7685 c 0.2925,-0.0035 0.582,0.032 0.8575,0.1115 0.3745,0.1435 0.427,0.478 0.496,0.8535 0.0385,0.24 0.037,0.4125 -0.0065,0.6945 -0.0305,0.409 -0.193,0.7255 -0.548,0.948 -0.5355,0.099 -1.108,0.1945 -1.562,-0.16 -0.381,-0.525 -0.6105,-1.1885 -0.523,-1.8355 0.0555,-0.2655 0.179,-0.4035 0.433,-0.486 0.2735,-0.0785 0.563,-0.1215 0.853,-0.126 z m -4.4415,0.0475 c 0.2735,-0.0025 0.55,0.0265 0.702,0.1235 0.6525,0.4415 0.443,1.16 0.185,1.7905 C 10.979,12.109 10.167,12.0785 9.38,12.072 8.9445,11.9445 8.9045,11.5875 8.8415,11.206 8.7875,10.8375 8.6725,10.4425 8.7685,10.072 9.015,9.476 9.916,9.4075 10.4675,9.3695 Z m 9.9515,0.103 c 0.0035,1.5865 0.2745,2.366 0.8185,3.4895 C 20.917,12.3505 20.459,12.0025 20.2885,11.2715 19.9625,9.86 20.314,9.939 20.419,9.4725 Z m -7.9065,1.149 c 0.086,0.087 0.1275,0.207 0.202,0.3025 0.0575,-0.0985 0.1165,-0.1965 0.1905,-0.284 0.0385,10e-4 0.0855,0.077 0.128,0.213 0.182,0.503 0.2175,1.0565 0.4535,1.54 0.2205,0.35 -0.0805,0.554 -0.411,0.57 -0.241,-5e-4 -0.343,-0.165 -0.4845,-0.328 -0.0365,0.1065 -0.106,0.175 -0.189,0.247 -0.211,0.177 -0.6245,0.1115 -0.6885,-0.1675 0.085,-0.533 0.3565,-1.0225 0.5345,-1.5335 0.0885,-0.1865 0.0895,-0.3295 0.2645,-0.5595 z m -3.096,2.6925 c 0.1065,0 0.399,0.1985 0.4585,0.3105 0.041,0.0745 0.1345,0.3645 0.141,0.435 0.0105,0.084 -0.015,0.283 -0.041,0.337 -0.019,0.0385 -0.0335,0.044 -0.0555,0.019 -0.0185,-0.021 -0.2635,-0.491 -0.42,-0.802 -0.123,-0.249 -0.136,-0.2995 -0.083,-0.2995 z m 6.111,0.1555 c 0.004,5e-4 0.01,0.002 0.0155,0.0035 0.033,0.0135 0.01,0.1305 -0.114,0.5555 -0.0235,0.128 -0.0805,0.229 -0.164,0.313 -0.0275,0 -0.04,-0.032 -0.083,-0.2095 -0.0365,-0.1515 -0.0405,-0.2865 -0.015,-0.4075 0.044,-0.1515 0.222,-0.198 0.3605,-0.255 z M 14.786,14.396 c 0.0105,-0.002 0.0205,0.0035 0.0335,0.014 0.045,0.0315 0.0515,0.1145 0.0215,0.277 -0.0365,0.209 -0.0445,0.232 -0.0985,0.2535 -0.0235,0.0105 -0.0655,0.018 -0.0935,0.018 -0.0505,-0.009 -0.0635,-0.05 -0.0515,-0.112 0,-0.13 0.038,-0.243 0.124,-0.3765 0.0325,-0.05 0.049,-0.0715 0.0645,-0.074 z m -4.3165,0.0095 c 0.0345,0 0.1385,0.075 0.177,0.127 0.043,0.055 0.092,0.3825 0.0645,0.439 -0.0315,0.071 -0.1855,0.0355 -0.228,-0.053 -0.026,-0.053 -0.0875,-0.339 -0.0875,-0.407 0,-0.063 0.0305,-0.106 0.074,-0.106 z m 3.9455,0.0865 c 0.042,0.06 0.053,0.137 0.044,0.306 l -0.0085,0.154 -0.044,0.044 c -0.0265,0.0245 -0.0715,0.0545 -0.0985,0.067 -0.0595,0.028 -0.105,0.0305 -0.1135,0.008 -0.01,-0.03 0.007,-0.221 0.0255,-0.2855 0.0215,-0.0665 0.118,-0.265 0.15,-0.307 0.0145,-0.0385 0.0315,0.0095 0.045,0.0135 z m -2.5105,-0.009 c 0.0905,0.023 0.1305,0.1045 0.18,0.1785 l 0.0335,0.066 -0.047,0.1635 c -0.025,0.09 -0.0515,0.171 -0.0595,0.18 -0.009,0.01 -0.0425,0.015 -0.092,0.0145 -0.132,-0.0035 -0.147,-0.009 -0.1825,-0.063 l -0.033,-0.049 0.028,-0.1375 c 0.0405,-0.198 0.06,-0.2575 0.105,-0.3085 0.0235,-0.0275 0.047,-0.0425 0.0675,-0.0445 z m -0.8355,0.1415 0.0745,0.0745 0.0125,0.1685 c 0.0065,0.092 0.0095,0.1775 0.0045,0.188 C 11.156,15.07 11.129,15.074 11.0455,15.074 H 10.937 c -0.058,-0.0635 -0.076,-0.141 -0.1005,-0.221 -0.057,-0.2405 -0.057,-0.35 0.002,-0.3645 0.0965,0.006 0.16,0.076 0.2305,0.136 z m 2.9,-0.1155 c 0.118,0.0315 0.0945,0.219 0.094,0.353 -0.009,0.217 -0.0175,0.262 -0.0455,0.29 -0.0485,0.0485 -0.1835,0.0215 -0.249,-0.0505 -0.0215,-0.026 -0.0235,-0.034 -0.0065,-0.1395 0.0195,-0.1285 0.0445,-0.2085 0.1,-0.3185 0.0405,-0.079 0.0785,-0.1285 0.107,-0.1345 z m -2.663,0.01 c 0.0065,-5e-4 0.017,0 0.027,10e-4 0.075,0.006 0.145,0.055 0.207,0.145 l 0.05,0.0735 c 0.0045,0.1205 0,0.2475 -0.0215,0.3595 -0.013,0.0065 -0.067,0.0165 -0.12,0.0215 C 11.3565,15.128 11.348,15.126 11.316,15.098 11.2715,15.06 11.259,14.9895 11.248,14.7555 11.2415,14.5645 11.246,14.522 11.306,14.519 Z m 1.1345,0.04 c 0.0805,0.017 0.1315,0.06 0.154,0.1305 0.018,0.0605 0.029,0.399 0.0115,0.4225 -0.006,0.01 -0.044,0.0225 -0.0875,0.028 -0.162,0.0205 -0.305,0.005 -0.319,-0.0335 -0.018,-0.044 0.1025,-0.48 0.147,-0.534 0.019,-0.042 0.065,-0.0095 0.094,-0.0135 z m 1.049,0.003 c 0.0355,-0.0035 0.0735,0.0305 0.1105,0.103 0.03,0.0605 0.0345,0.0815 0.0345,0.217 0,0.108 -0.0065,0.1545 -0.018,0.1645 -0.01,0.008 -0.0505,0.0225 -0.0935,0.0335 -0.075,0.0195 -0.0915,0.0215 -0.115,0.0135 L 13.2955,15.073 13.304,15.006 c 0.008,-0.0875 0.0655,-0.2815 0.106,-0.3655 0.024,-0.05 0.0515,-0.075 0.0795,-0.0785 z m -0.489,0.0015 c 0.0235,-10e-4 0.0345,0.0045 0.0495,0.021 0.0355,0.042 0.0805,0.166 0.109,0.2985 0.038,0.1865 0.038,0.186 -0.0435,0.2105 -0.0355,0.011 -0.1105,0.0225 -0.164,0.0255 -0.1765,0.009 -0.19,-0.0015 -0.1685,-0.1575 0.017,-0.139 0.0855,-0.358 0.115,-0.374 0.032,-0.017 0.069,-0.0165 0.1025,-0.024 z M 4.004,15.268 c 0.0015,-5e-4 0.0035,0 0.0035,0 0.0045,0.0975 0.0045,0.196 0.0065,0.294 -0.2475,-0.019 -0.4295,-0.078 -0.4295,-0.1475 0,-0.0685 0.1755,-0.127 0.4195,-0.1465 z m 0.4325,0.0085 c 0.2005,0.025 0.339,0.0775 0.3365,0.138 0,0.061 -0.134,0.113 -0.333,0.1375 C 4.438,15.4605 4.438,15.3685 4.4365,15.2765 Z m 9.363,0.2665 c 0.017,-0.0015 0.0245,-0.003 0.0505,-5e-4 0.104,0.0105 0.119,0.017 0.119,0.052 0,0.046 -0.079,0.1845 -0.1325,0.2325 -0.025,0.024 -0.0595,0.044 -0.0715,0.044 -0.06,0 -0.095,-0.1265 -0.067,-0.243 0.017,-0.063 0.048,-0.0825 0.1015,-0.085 z m -0.3775,0.0415 c 0.0465,-0.004 0.0915,0.0085 0.1365,0.0145 -0.013,0.1315 -0.072,0.239 -0.1815,0.3105 -0.027,0 -0.0405,-0.0515 -0.0405,-0.164 0,-0.134 0.007,-0.1595 0.0855,-0.161 z m -0.414,0.0485 c 0.0965,0 0.1815,0.0045 0.1855,0.01 0.018,0.017 -0.034,0.146 -0.1105,0.277 -0.0655,0.1165 -0.075,0.125 -0.1155,0.128 -0.159,-0.018 -0.1545,-0.2045 -0.179,-0.3325 0,-0.076 0.017,-0.0825 0.2195,-0.0825 z m -1.5045,0.0145 c 0.1105,0.002 0.1535,0.0185 0.1535,0.061 0,0.054 -0.041,0.1615 -0.0645,0.175 C 11.557,15.903 11.554,15.902 11.484,15.829 11.3735,15.705 11.361,15.682 11.5035,15.6475 Z m 0.532,0.0055 c 0.002,0.003 0.0235,0.042 0.045,0.086 0.047,0.0915 0.0505,0.1315 0.017,0.162 -0.079,0.045 -0.0955,0.0195 -0.167,-0.026 -0.083,-0.0785 -0.1485,-0.184 -0.127,-0.206 0.074,-0.0265 0.1555,-0.0165 0.232,-0.016 z m 0.211,0.0025 0.1975,0.0035 c 0.077,0 0.1435,0.004 0.147,0.01 0.0135,0.012 -0.03,0.269 -0.0535,0.327 -0.027,0.065 -0.1215,0.0655 -0.1705,-0.0115 -0.07,-0.1105 -0.116,-0.2035 -0.1175,-0.2675 z" + +const facebook = 'M22.676 0H1.324C.593 0 0 .593 0 1.324v21.352C0 23.408.593 24 1.324 24h11.494v-9.294H9.689v-3.621h3.129V8.41c0-3.099 1.894-4.785 4.659-4.785 1.325 0 2.464.097 2.796.141v3.24h-1.921c-1.5 0-1.792.721-1.792 1.771v2.311h3.584l-.465 3.63H16.56V24h6.115c.733 0 1.325-.592 1.325-1.324V1.324C24 .593 23.408 0 22.676 0' + +const github = 'M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12' + +const google = 'M 12.25009,0 C 7.5567085,0 3.5033589,2.69334 1.530043,6.613315 0.71674427,8.240005 0.25,10.06676 0.25,12.00009 c 0,1.93333 0.46674427,3.759905 1.280043,5.386595 C 3.5033589,21.30666 7.5567085,24 12.25009,24 c 3.239959,0 5.959944,-1.066635 7.94668,-2.906575 2.266629,-2.093365 3.573349,-5.173415 3.573349,-8.826735 0,-0.98666 -0.08023,-1.70661 -0.253496,-2.453265 l -11.266533,0 0,4.45322 6.613137,0 c -0.133283,1.106705 -0.853233,2.77333 -2.453266,3.89327 -1.013315,0.706675 -2.373243,1.199975 -4.159871,1.199975 -3.173318,0 -5.8666835,-2.09327 -6.826777,-4.986605 -0.2533286,-0.746655 -0.399991,-1.54657 -0.399991,-2.373195 0,-0.82672 0.1467055,-1.62672 0.386706,-2.373375 C 6.3834495,6.73338 9.076772,4.63993 12.25009,4.63993 c 2.253301,0 3.773228,0.973465 4.639932,1.786855 L 20.27666,3.12004 C 18.196718,1.186705 15.490049,0 12.25009,0 Z' + +const instagram = 'M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z' + +const language = "M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z" + +const measurements = 'M 1.7792969,4.1816406 C 1.4635303,4.2034836 1.2472407,4.5095002 1.3320312,4.8144531 2.0126746,7.4312978 2.3589401,9.6399539 2.4804688,11.576172 l -0.2792969,0.179687 c -0.2007566,0.128704 -0.362752,0.219425 -0.5644531,0.480469 -0.1008507,0.130522 -0.2414074,0.337804 -0.2460938,0.683594 -0.00469,0.34579 0.2212218,0.709779 0.4121094,0.861328 0.3438312,0.272974 0.5293755,0.265612 0.7070312,0.279297 -0.102277,2.28979 -0.5523838,4.163493 -1.15625,5.869141 -0.266254,0.647707 0.7399311,1.004673 0.9414063,0.333984 0.6291584,-1.777086 1.0947468,-3.759245 1.2011719,-6.16211 0.8587499,0.0021 1.9817457,-0.02871 3.2402343,0.08203 1.266623,0.111458 2.5881834,0.388821 3.6914059,0.923828 -0.8838667,0.895791 -1.5848887,2.046501 -1.9218746,3.492187 l -0.2265625,0.972657 1.9472651,0.455078 0.226563,-0.97461 c 0.285273,-1.223836 0.850633,-2.097458 1.613281,-2.771484 0.508245,0.558951 0.895359,1.267092 1.117188,2.21875 l 0.226562,0.972656 1.949219,-0.453125 -0.228516,-0.974609 c -0.263451,-1.130219 -0.752009,-2.068727 -1.375,-2.835938 1.029043,-0.475861 2.194264,-0.776127 3.316407,-0.958984 1.232141,-0.200782 2.333045,-0.266545 3.220703,-0.341797 0.08818,2.494183 0.568253,4.529139 1.214843,6.355469 0.201481,0.670677 1.207649,0.313718 0.941407,-0.333984 -0.627794,-1.773234 -1.099219,-3.716671 -1.175781,-6.132811 0.04197,-0.0074 0.08942,-0.01089 0.130859,-0.01953 0.203289,-0.04241 0.397475,-0.06086 0.701172,-0.28711 0.151848,-0.113123 0.350634,-0.325838 0.427734,-0.634765 0.0771,-0.308927 -0.0063,-0.622179 -0.105469,-0.806641 -0.19843,-0.368923 -0.391632,-0.467629 -0.59375,-0.601562 l -0.472656,-0.3125 c 0.145104,-1.8337507 0.478549,-3.8949994 1.109375,-6.3203139 0.09171,-0.3306355 -0.169212,-0.6533027 -0.511719,-0.6328125 -0.218769,0.013497 -0.40325,0.1678902 -0.455078,0.3808594 -0.737,2.8335196 -1.100379,5.2405579 -1.199218,7.341797 -0.815925,0.07419 -2.080274,0.132785 -3.554688,0.373047 -1.478459,0.240919 -3.106344,0.671272 -4.574219,1.509765 -0.13911,-0.09127 -0.278493,-0.182969 -0.421875,-0.263671 -1.545631,-0.869966 -3.2877636,-1.195282 -4.8417966,-1.332032 -1.384279,-0.121812 -2.5095809,-0.08087 -3.296875,-0.08008 L 3.4980469,11.929688 C 3.4010459,9.8222094 3.0389322,7.4079513 2.2988281,4.5625 2.2413801,4.3260531 2.0220721,4.1652822 1.7792969,4.1816406 Z' + +const menu = "m 3.0459566,1.9998779 c -0.5540001,0 -0.999939,0.445939 -0.999939,0.9999391 v 2.0003947 c 0,0.5539999 0.4459389,0.9999387 0.999939,0.9999387 H 21.045891 c 0.554,0 1.000456,-0.4459388 1.000456,-0.9999387 V 2.999817 c 0,-0.5540001 -0.446456,-0.9999391 -1.000456,-0.9999391 z M 2.9126312,9.9999063 c -0.5539999,0 -0.9999388,0.4459387 -0.9999388,0.9999387 v 2.000395 c 0,0.554 0.4459389,0.999939 0.9999388,0.999939 H 20.912566 c 0.554,0 0.999939,-0.445939 0.999939,-0.999939 v -2.000395 c 0,-0.554 -0.445939,-0.9999387 -0.999939,-0.9999387 z m 0,8.0000287 c -0.5539999,0 -0.9999388,0.445939 -0.9999388,0.999939 v 1.999878 c 0,0.554 0.4459389,1.000455 0.9999388,1.000455 H 20.912566 c 0.554,0 0.999939,-0.446455 0.999939,-1.000455 v -1.999878 c 0,-0.554 -0.445939,-0.999939 -0.999939,-0.999939 z" + +const middot = "m 15.295,12 a 3,3 0 0 1 -3,3 3,3 0 0 1 -3,-3 3,3 0 0 1 3,-3 3,3 0 0 1 3,3 z" + +const note = 'M 12,3 C 11.54,3 11.07,3.04 10.6,3.14 7.84,3.67 5.64,5.9 5.12,8.66 4.64,11.27 5.6,13.67 7.34,15.22 7.77,15.6 8,16.13 8,16.69 V 19 c 0,1.1 0.9,2 2,2 h 0.28 c 0.35,0.6 0.98,1 1.72,1 0.74,0 1.38,-0.4 1.72,-1 H 14 c 1.1,0 2,-0.9 2,-2 V 16.69 C 16,16.14 16.22,15.6 16.64,15.23 18.09,13.95 19,12.08 19,10 19,6.13 15.87,3 12,3 Z m 2,16 h -4 v -1 h 4 z m 0,-2 h -4 v -1 h 4 z M 12.5,11.41 V 14 h -1 V 11.41 L 9.67,9.59 10.38,8.88 12,10.5 13.62,8.88 14.33,9.59 Z' + +const reddit = 'M 11.710829,0.00384705 C 5.0683862,0.16990815 -0.16221405,5.6505729 0.00384705,12.293016 0.16990814,18.686369 5.3178021,23.833614 11.628124,24.082706 18.270567,24.248767 23.833939,19.018167 24,12.375723 V 11.710829 C 23.833939,5.0683862 18.353273,-0.16221404 11.710829,0.00384705 Z m 5.187788,5.10021625 c 0.15698,0.00649 0.313636,0.048326 0.458939,0.1313569 0.581214,0.3321223 0.912687,1.0793971 0.580565,1.660611 C 17.605998,7.4772452 16.858724,7.808718 16.27751,7.4765965 15.862357,7.3105352 15.614238,6.8947339 15.614238,6.3965506 L 13.038995,5.8159854 12.208689,9.55236 c 1.826672,0.08303 3.48858,0.664893 4.651007,1.495199 0.664245,-0.664245 1.826673,-0.664245 2.490917,0 0.332122,0.332121 0.49786,0.747274 0.49786,1.245457 0.249091,0.747275 -0.249092,1.327193 -0.830306,1.576284 v 0.49948 c 0,2.740009 -3.155161,4.897506 -7.057597,4.897506 -3.9024357,0 -7.0575963,-2.157497 -7.0575963,-4.897506 V 13.8693 C 3.9896377,13.454147 3.6578398,12.458754 3.989962,11.545418 c 0.2490916,-0.664245 0.9120387,-1.08037 1.5762832,-0.99734 0.4981831,0 0.9133359,0.167358 1.2454581,0.499481 C 8.2232228,10.134222 9.8848065,9.55236 11.545418,9.55236 l 0.913011,-4.1515273 c 0,-0.083031 0.08271,-0.1654124 0.08271,-0.1654125 0.08303,-0.08303 0.166711,-0.084328 0.249741,-0.084328 l 2.906069,0.664893 C 15.946037,5.3800751 16.427678,5.084603 16.898617,5.1040633 Z M 9.3026198,12.293016 c -0.6642443,0 -1.2454583,0.581214 -1.2454583,1.245458 0,0.664245 0.498183,1.245459 1.2454583,1.245459 0.6642442,0 1.2454582,-0.581214 1.2454582,-1.245459 0,-0.664244 -0.581214,-1.245458 -1.2454582,-1.245458 z m 5.4813132,0 c -0.664245,0 -1.245459,0.581214 -1.245459,1.245458 0,0.664245 0.581214,1.245459 1.245459,1.245459 0.664245,0 1.245458,-0.581214 1.245458,-1.245459 0,-0.664244 -0.581213,-1.245458 -1.245458,-1.245458 z m -5.3872557,3.943952 c -0.072653,0 -0.135249,0.04021 -0.1767645,0.123249 -0.1660605,0.16606 -0.1660605,0.332121 0,0.415152 0.8303052,0.830306 2.4905922,0.914633 2.9887762,0.914633 0.498183,0 2.077061,-0.08433 2.990396,-0.914633 -0.08303,-0.08303 -0.084,-0.249092 -0.167034,-0.415152 -0.166061,-0.166062 -0.332121,-0.166062 -0.415152,0 -0.498183,0.581213 -1.660611,0.747598 -2.490917,0.747598 -0.830305,0 -1.992733,-0.166385 -2.4909165,-0.747598 -0.08303,-0.08303 -0.1657365,-0.123249 -0.2383882,-0.123249 z' + +const search = "M 16.293883,14.578617 H 15.390508 L 15.070326,14.269869 C 16.190967,12.966267 16.865637,11.27387 16.865637,9.432819 16.865637,5.3276158 13.538021,2 9.432819,2 5.3276158,2 2,5.3276158 2,9.432819 c 0,4.105202 3.3276158,7.432818 7.432819,7.432818 1.841051,0 3.533448,-0.67467 4.83705,-1.795311 l 0.308748,0.320182 v 0.903375 L 20.296169,22 22,20.296169 Z m -6.861064,0 c -2.8473411,0 -5.1457974,-2.298456 -5.1457974,-5.145798 0,-2.8473411 2.2984563,-5.1457974 5.1457974,-5.1457974 2.847342,0 5.145798,2.2984563 5.145798,5.1457974 0,2.847342 -2.298456,5.145798 -5.145798,5.145798 z" + +const showcase = "M 9,2 7.17,4 H 4 C 2.9,4 2,4.9 2,6 v 12 c 0,1.1 0.9,2 2,2 h 16 c 1.1,0 2,-0.9 2,-2 V 6 C 22,4.9 21.1,4 20,4 H 16.83 L 15,2 Z m 3,15 C 9.24,17 7,14.76 7,12 7,9.24 9.24,7 12,7 c 2.76,0 5,2.24 5,5 0,2.76 -2.24,5 -5,5 z m 3.2,-5 A 3.2,3.2 0 0 1 12,15.2 3.2,3.2 0 0 1 8.8,12 3.2,3.2 0 0 1 12,8.8 3.2,3.2 0 0 1 15.2,12 Z" + +const support = "M11.5 2C6.81 2 3 5.81 3 10.5S6.81 19 11.5 19h.5v3c4.86-2.34 8-7 8-11.5C20 5.81 16.19 2 11.5 2zm1 14.5h-2v-2h2v2zm0-3.5h-2c0-3.25 3-3 3-5 0-1.1-.9-2-2-2s-2 .9-2 2h-2c0-2.21 1.79-4 4-4s4 1.79 4 4c0 2.5-3 2.75-3 5z" + +const tip = 'M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z' + +const twitter = 'M23.954 4.569c-.885.389-1.83.654-2.825.775 1.014-.611 1.794-1.574 2.163-2.723-.951.555-2.005.959-3.127 1.184-.896-.959-2.173-1.559-3.591-1.559-2.717 0-4.92 2.203-4.92 4.917 0 .39.045.765.127 1.124C7.691 8.094 4.066 6.13 1.64 3.161c-.427.722-.666 1.561-.666 2.475 0 1.71.87 3.213 2.188 4.096-.807-.026-1.566-.248-2.228-.616v.061c0 2.385 1.693 4.374 3.946 4.827-.413.111-.849.171-1.296.171-.314 0-.615-.03-.916-.086.631 1.953 2.445 3.377 4.604 3.417-1.68 1.319-3.809 2.105-6.102 2.105-.39 0-.779-.023-1.17-.067 2.189 1.394 4.768 2.209 7.557 2.209 9.054 0 13.999-7.496 13.999-13.986 0-.209 0-.42-.015-.63.961-.689 1.8-1.56 2.46-2.548l-.047-.02z' + +const units = 'M 1.2481485,5.9969994 C 0.57472916,5.9969994 0,6.5763504 0,7.2510315 V 14.751864 C 0,15.427642 0.57290973,16 1.2481485,16 H 22.753805 C 23.427222,16 24,15.426545 24,14.751864 V 7.2510315 C 24,6.5752543 23.429042,5.9969994 22.753805,5.9969994 Z M 2.0001628,7.997229 H 2.5021567 V 9.9974209 H 3.4983316 V 7.997229 H 4.5042727 V 9.9974209 H 5.5004476 V 7.997229 h 1.0039881 v 3.004219 H 7.5006105 V 7.997229 H 8.4967853 V 9.9974209 H 9.500773 V 7.997229 h 0.996175 v 2.0001919 h 1.005941 V 7.997229 h 0.996175 v 2.0001919 h 1.003988 V 7.997229 h 0.996175 v 2.0001919 h 1.003987 V 7.997229 h 0.996176 v 3.004219 h 1.003987 V 7.997229 h 0.996176 v 2.0001919 h 1.00594 V 7.997229 h 0.996176 v 2.0001919 h 1.003987 V 7.997229 h 0.494181 V 13.99977 H 19.202735 V 11.659724 H 17.599088 V 13.99977 H 12.801823 V 10.854937 H 11.200131 V 13.99977 H 6.4009116 V 11.659724 H 4.7992186 V 13.99977 H 2.0001628 Z' + +const warning = 'M7.58 4.08L6.15 2.65C3.75 4.48 2.17 7.3 2.03 10.5h2c.15-2.65 1.51-4.97 3.55-6.42zm12.39 6.42h2c-.15-3.2-1.73-6.02-4.12-7.85l-1.42 1.43c2.02 1.45 3.39 3.77 3.54 6.42zM18 11c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2v-5zm-6 11c.14 0 .27-.01.4-.04.65-.14 1.18-.58 1.44-1.18.1-.24.15-.5.15-.78h-4c.01 1.1.9 2 2.01 2z' + + +const withBreasts = 'm 8.233159,2.5000002 c 0,0 0.03684,1.4367676 0.07562,2.1541457 C 8.413989,6.5901608 7.3671071,6.9496995 7.3372662,8.1692173 7.3029172,9.5719723 8.2152,10.315942 8.255388,12.267223 8.290568,13.973294 7.1739465,15.012709 7.1739465,17.259683 9.46861,17.549817 10.668009,19.205086 11.354231,21.5 h 0.109763 0.93923 0.109803 c 0.686181,-2.294914 1.88558,-3.950183 4.180285,-4.240317 0,-2.246974 -1.116622,-3.286389 -1.081483,-4.99246 0.04015,-1.951281 0.952433,-2.6952507 0.918122,-4.0980057 -0.0298,-1.2195178 -1.076723,-1.5790565 -0.971513,-3.5150714 0.0389,-0.7173781 0.07562,-2.1541457 0.07562,-2.1541457 h -0.722313 c 0,1.5276628 -1.146752,3.7763442 -2.978112,3.7763442 -1.831402,0 -2.978154,-2.2486814 -2.978154,-3.7763442 z' + +const withoutBreasts = 'M 6.2021092,6.7988281 C 5.0433189,10.972649 5.2215488,13.211802 5.2215488,16.798828 h 5.8983122 l 0.143133,-1.21128 c 0.331559,-1.834081 0.655671,-2.543616 1.078829,0.07477 l 0.134587,1.136509 h 5.896176 c 0,-3.587026 0.180363,-5.826179 -0.978425,-9.9999999 z' + + + +export default { + blog, + colors, + community, + designs, + discord, + down, + facebook, + fixme: github, + freesewing, + github, + google, + instagram, + language, + measurements, + menu, + middot, + note: down, + reddit, + search, + showcase, + support, + tip, + twitter, + units, + warning, + withBreasts, + withoutBreasts +} diff --git a/packages/freesewing.shared/components/icon/index.js b/packages/freesewing.shared/components/icon/index.js new file mode 100644 index 00000000000..2c6fb1e8a08 --- /dev/null +++ b/packages/freesewing.shared/components/icon/index.js @@ -0,0 +1,29 @@ +import icons from './icons' + +const Icon = ({ + size = 24, + icon = 'github', + color = false, + className = '', + embed = false +}) => { + + const svgProps = { + xmlns: 'http://www.w3.org/2000/svg', + viewBox: '0 0 24 24', + className: className, + } + + if (size && !embed) { + svgProps.width = size + svgProps.height = size + } + + return ( + + + + ) +} + +export default Icon diff --git a/packages/freesewing.shared/components/layouts/default.js b/packages/freesewing.shared/components/layouts/default.js new file mode 100644 index 00000000000..bbae06ab5ba --- /dev/null +++ b/packages/freesewing.shared/components/layouts/default.js @@ -0,0 +1,60 @@ +import { useState } from 'react' +// Shared components +import PrimaryMenu from 'shared/components/navigation/primary' +//import Breadcrumbs from '@/shared/components/navigation/breadcrumbs' +import H1 from 'shared/components/elements/h1' +//import Icon from '@/shared/components/icon' +//import Button from '@/shared/components/elements/button' +// Site components +//import NavigationButtons from '@/site/components/navigation-buttons' +//import Search from '@/site/components/search' + +const iconSize= 48 + +const DefaultLayout = props => { + + const [leftNav, setLeftNav] = useState(false) + + const toggleLeftNav = () => setLeftNav(!leftNav) + + return ( +
+
+ header +
+
+ +
+

{props.title}

+ {props.children} +
+
+
footer
+
+ ) +} + +export default DefaultLayout diff --git a/packages/freesewing.shared/components/navigation/primary.js b/packages/freesewing.shared/components/navigation/primary.js new file mode 100644 index 00000000000..92afdcde0fe --- /dev/null +++ b/packages/freesewing.shared/components/navigation/primary.js @@ -0,0 +1,32 @@ +import Icon from 'shared/components/icon/index.js' + +const PrimaryMenu = props => { + + return ( + + ) +} + +export default PrimaryMenu diff --git a/packages/freesewing.shared/components/theme-picker.js b/packages/freesewing.shared/components/theme-picker.js new file mode 100644 index 00000000000..980364c6fb8 --- /dev/null +++ b/packages/freesewing.shared/components/theme-picker.js @@ -0,0 +1,13 @@ +import themes from 'shared/themes/index.js' + +const ThemePicker = ({ app }) => { + return ( + + ) +} + +export default ThemePicker diff --git a/packages/freesewing.shared/components/wrappers/app.jsx b/packages/freesewing.shared/components/wrappers/app.jsx deleted file mode 100644 index 18583f700c0..00000000000 --- a/packages/freesewing.shared/components/wrappers/app.jsx +++ /dev/null @@ -1,58 +0,0 @@ -import React, { useState, useEffect } from 'react' -//import {themeChange} from "theme-change" -//import Head from 'next/head' -//import { useHotkeys } from 'react-hotkeys-hook' -//import themes from '@/shared/themes' -//import { useRouter } from 'next/router' -//import config from '@/site/freesewing.config.js' -// Shared components -//import ProgressBar from '@/shared/components/progress-bar' -//import Navbar from '@/shared/components/sections/navbar' -//import Footer from '@/site/components/footer' -//import Layout from '@/shared/components/layouts/default' -//import useNavigation from '@/shared/hooks/useNavigation' - -/* This component should wrap all page content */ -const AppWrapper= props => { - const router = useRouter() - const path = router.asPath - const locale = router.locale || config.language - const tree = useNavigation(locale, path) - - // Trigger search with Ctrl+k - useHotkeys('ctrl+k', (evt) => { - evt.preventDefault() - setSearch(true) - }) - - const [menu, setMenu] = useState(false) - const [search, setSearch] = useState(false) - - useEffect(() => { - themeChange(false) - }, [menu]) - - const childProps = { - menu, setMenu, toggleMenu: () => setMenu(!menu), - search, setSearch, toggleSearch: () => setSearch(!search), - path, tree, - title: props.title, - t: props.t ? props.t : (x) => x, - locale, languages: config.languages, - } - - return ( -
- - {!props.noNavbar && } - {props.noLayout - ? props.children - : {props.children} - } - {!props.noFooter && !menu &&
} -
- ) -} - -export default AppWrapper - diff --git a/packages/freesewing.shared/components/wrappers/page.js b/packages/freesewing.shared/components/wrappers/page.js new file mode 100644 index 00000000000..310ce3bef19 --- /dev/null +++ b/packages/freesewing.shared/components/wrappers/page.js @@ -0,0 +1,68 @@ +import React, { useState, useEffect } from 'react' +import { useSwipeable } from 'react-swipeable' +//import {themeChange} from "theme-change" +//import Head from 'next/head' +//import { useHotkeys } from 'react-hotkeys-hook' +//import themes from '@/shared/themes' +//import { useRouter } from 'next/router' +//import config from '@/site/freesewing.config.js' +// Shared components +import Layout from 'shared/components/layouts/default' +//import ProgressBar from '@/shared/components/progress-bar' +//import Navbar from '@/shared/components/sections/navbar' +//import Footer from '@/site/components/footer' +//import useNavigation from '@/shared/hooks/useNavigation' +// + + +/* This component should wrap all page content */ +const AppWrapper= props => { + + const swipeHandlers = useSwipeable({ + onSwipedLeft: evt => (props.app.primaryMenu) ? props.app.setPrimaryMenu(false) : null, + onSwipedRight: evt => (props.app.primaryMenu) ? null : props.app.setPrimaryMenu(true), + trackMouse: true + }) + + //const router = useRouter() + //const path = router.asPath + //const locale = router.locale || config.language + //const tree = useNavigation(locale, path) + + // Trigger search with Ctrl+k + //useHotkeys('ctrl+k', (evt) => { + // evt.preventDefault() + // setSearch(true) + //}) + + //const [menu, setMenu] = useState(false) + //const [search, setSearch] = useState(false) + + //useEffect(() => { + // themeChange(false) + //}, [menu]) + + const childProps = { + app: props.app, + title: props.title, + } + // menu, setMenu, toggleMenu: () => setMenu(!menu), + // search, setSearch, toggleSearch: () => setSearch(!search), + // path, tree, + // title: props.title, + // t: props.t ? props.t : (x) => x, + // locale, languages: config.languages, + //} + + return ( +
+ {props.noLayout + ? props.children + : {props.children} + } +
+ ) +} + +export default AppWrapper + diff --git a/packages/freesewing.shared/config/next.mjs b/packages/freesewing.shared/config/next.mjs index 603b2755e88..7a469c6b689 100644 --- a/packages/freesewing.shared/config/next.mjs +++ b/packages/freesewing.shared/config/next.mjs @@ -1,8 +1,9 @@ +import path from 'path' import remarkGfm from 'remark-gfm' import remarkJargon from 'remark-jargon' import { jargon } from '@freesewing/i18n' -const config = { +const config = site => ({ experimental: { externalDir: true, esmExternals: true, @@ -13,12 +14,10 @@ const config = { // Fixes npm packages that depend on node modules if (!options.isServer) { config.resolve.fallback.fs = false + config.resolve.fallback.path = false config.resolve.fallback.child_process = false } - // Prevent symlink loops - config.resolve.symlinks = false - // MDX support config.module.rules.push({ test: /\.md?$/, @@ -36,6 +35,7 @@ const config = { } ] }) + // Fix for nextjs bug #17806 config.module.rules.push({ test: /index.mjs$/, @@ -45,8 +45,12 @@ const config = { } }) + // Aliases + config.resolve.alias.shared = path.resolve('../freesewing.shared/') + config.resolve.alias.site = path.resolve(`../freesewing.${site}/`) + return config } -} +}) export default config diff --git a/packages/freesewing.shared/config/tailwind.config.js b/packages/freesewing.shared/config/tailwind.config.js index dac434b3b7a..05f0da188e5 100644 --- a/packages/freesewing.shared/config/tailwind.config.js +++ b/packages/freesewing.shared/config/tailwind.config.js @@ -1,8 +1,22 @@ +// Handle themes +const allThemes = require('../themes') +const themes = {} +for (const theme in allThemes) themes[theme] = allThemes[theme].config + module.exports = { content: [ './pages/*.js', './pages/**/*.js', + '../freesewing.shared/components/**/*.js', ], + daisyui: { + styled: true, + themes: [ themes ], + base: true, + utils: true, + logs: true, + rtl: false, + }, theme: { extend: { colors: require('daisyui/colors'), diff --git a/packages/freesewing.shared/hooks/useLocalStorage.js b/packages/freesewing.shared/hooks/useLocalStorage.js new file mode 100644 index 00000000000..1739e7bcf8a --- /dev/null +++ b/packages/freesewing.shared/hooks/useLocalStorage.js @@ -0,0 +1,32 @@ +import { useState } from 'react' + +// See: https://usehooks.com/useLocalStorage/ + +function useLocalStorage(key, initialValue) { + const prefix = 'fs_' + const [storedValue, setStoredValue] = useState(() => { + if (typeof window === 'undefined') return initialValue // SSR has no window object + try { + const item = window.localStorage.getItem(prefix + key) + return item ? JSON.parse(item) : initialValue + } catch (error) { + console.log(error) + return initialValue + } + }) + + const setValue = (value) => { + if (typeof window === 'undefined') return null // SSR has no window object + try { + const valueToStore = value instanceof Function ? value(storedValue) : value + setStoredValue(valueToStore) + window.localStorage.setItem(prefix + key, JSON.stringify(valueToStore)) + } catch (error) { + console.log(error) + } + } + + return [storedValue, setValue] +} + +export default useLocalStorage diff --git a/packages/freesewing.shared/package.json b/packages/freesewing.shared/package.json new file mode 100644 index 00000000000..c7bd313dbd5 --- /dev/null +++ b/packages/freesewing.shared/package.json @@ -0,0 +1,21 @@ +{ + "name": "freesewing.shared", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev -p 3002", + "develop": "next dev -p 3002", + "build": "next build", + "export": "next build && next export", + "start": "next start -p 3002", + "serve": "pm2 start npm --name 'freesewing.dev' -- run start" + }, + "dependencies": { + "daisyui": "^1.16.2" + }, + "devDependencies": { + "autoprefixer": "^10.4.0", + "postcss": "^8.4.4", + "tailwindcss": "^3.0.1" + } +} diff --git a/packages/freesewing.dev/styles/globals.css b/packages/freesewing.shared/styles/globals.css similarity index 68% rename from packages/freesewing.dev/styles/globals.css rename to packages/freesewing.shared/styles/globals.css index 394fe408818..6cbc2280e24 100644 --- a/packages/freesewing.dev/styles/globals.css +++ b/packages/freesewing.shared/styles/globals.css @@ -8,3 +8,8 @@ body { Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; } +@media only screen and (max-width: 600px) { + .primary-menu { + transform: translateX(-100%); + } +} diff --git a/packages/freesewing.shared/themes/bureaucrats.js b/packages/freesewing.shared/themes/bureaucrats.js new file mode 100644 index 00000000000..c701fce13c8 --- /dev/null +++ b/packages/freesewing.shared/themes/bureaucrats.js @@ -0,0 +1,55 @@ +const colors = require('tailwindcss/colors') +const gray = colors.trueGray + +module.exports = { + icon: "👨‍💼", + config: { + 'fontFamily': 'Iowan Old Style, Apple Garamond, Baskerville, Times New Roman, Droid Serif, Times, Source Serif Pro, serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol', + 'primary': colors.blue['600'], + 'primary-focus': colors.blue['500'], + 'primary-content': '#fff', + + 'secondary': colors.blue['600'], + 'secondary-focus': colors.blue['200'], + 'secondary-content': colors.blue['700'], + + 'accent': colors.blue['500'], + 'accent-focus': colors.yellow['400'], + 'accent-content': gray['900'], + + 'neutral': colors.blue['900'], + 'neutral-focus': colors.blue['800'], + 'neutral-content': colors.blue['100'], + + 'base-100': '#ffffff', + 'base-200': gray['200'], + 'base-300': gray['400'], + 'base-content': gray['700'], + + 'info': colors.blue['400'], + 'success': colors.green['600'], + 'warning': colors.amber['500'], + 'error': colors.red['600'], + + '--rounded-box': '2px', + '--rounded-btn': '2px', + + '--pattern-fabric': colors.trueGray['700'], + '--pattern-lining': colors.emerald['500'], + '--pattern-interfacing': colors.trueGray['400'], + '--pattern-canvas': colors.amber['600'], + '--pattern-various': colors.red['500'], + '--pattern-mark': colors.blue['500'], + '--pattern-contrast': colors.pink['500'], + '--pattern-note': colors.violet['500'], + + ".mdx.prose a" : { + color: colors.blue['600'], + 'text-decoration': 'underline', + }, + ".mdx.prose a:hover" : { + color: colors.blue['500'], + 'text-decoration': 'underline', + }, + } +} diff --git a/packages/freesewing.shared/themes/dark.js b/packages/freesewing.shared/themes/dark.js new file mode 100644 index 00000000000..ce5b9627e8b --- /dev/null +++ b/packages/freesewing.shared/themes/dark.js @@ -0,0 +1,43 @@ +const colors = require('tailwindcss/colors') +const gray = colors.trueGray + +module.exports = { + icon: "🌚", + config: { + 'fontFamily': '-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif', + 'primary': gray['300'], + 'primary-focus': colors.violet['300'], + 'primary-content': gray['900'], + + 'secondary': colors.violet['500'], + 'secondary-focus': colors.violet['400'], + 'secondary-content': colors.violet['900'], + + 'accent': colors.emerald['500'], + 'accent-focus': colors.emerald['400'], + 'accent-content': gray['900'], + + 'neutral': gray['900'], + 'neutral-focus': gray['800'], + 'neutral-content': gray['300'], + + 'base-100': gray['800'], + 'base-200': gray['700'], + 'base-300': gray['600'], + 'base-content': gray['300'], + + 'info': colors.emerald['700'], + 'success': colors.green['500'], + 'warning': colors.amber['500'], + 'error': colors.red['400'], + + '--pattern-fabric': colors.trueGray['300'], + '--pattern-lining': colors.emerald['700'], + '--pattern-interfacing': colors.trueGray['500'], + '--pattern-canvas': colors.amber['700'], + '--pattern-various': colors.red['700'], + '--pattern-mark': colors.blue['700'], + '--pattern-contrast': colors.pink['600'], + '--pattern-note': colors.violet['600'], + } +} diff --git a/packages/freesewing.shared/themes/hax0r.js b/packages/freesewing.shared/themes/hax0r.js new file mode 100644 index 00000000000..c5f550680e4 --- /dev/null +++ b/packages/freesewing.shared/themes/hax0r.js @@ -0,0 +1,53 @@ +const colors = require('tailwindcss/colors') +const gray = colors.trueGray + +module.exports = { + icon: "👩‍💻", + config: { + 'fontFamily': `ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", "Fira Mono", "Droid Sans Mono", "Courier New", monospace;`, + 'primary': colors.lime['600'], + 'primary-focus': colors.lime['700'], + 'primary-content': colors.lime['100'], + + 'secondary': colors.lime['600'], + 'secondary-focus': colors.lime['500'], + 'secondary-content': colors.lime['100'], + + 'accent': colors.yellow['400'], + 'accent-focus': colors.yellow['500'], + 'accent-content': gray['900'], + + 'neutral': colors.lime['900'], + 'neutral-focus': gray['200'], + 'neutral-content': colors.lime['300'], + + 'base-100': '#002808', + 'base-200': '#002808', + 'base-300': colors.lime['900'], + 'base-content': colors.lime['500'], + + 'info': colors.lime['700'], + 'success': colors.green['600'], + 'warning': colors.amber['400'], + 'error': colors.red['400'], + + '--rounded-btn': '0', + + '--pattern-fabric': colors.trueGray['700'], + '--pattern-lining': colors.emerald['500'], + '--pattern-interfacing': colors.trueGray['400'], + '--pattern-canvas': colors.amber['600'], + '--pattern-various': colors.red['500'], + '--pattern-mark': colors.blue['500'], + '--pattern-contrast': colors.pink['500'], + '--pattern-note': colors.violet['500'], + + ".mdx.prose a" : { + color: colors.lime['600'], + 'text-decoration': 'underline', + }, + ".mdx.prose a:hover" : { + color: colors.lime['500'], + }, + } +} diff --git a/packages/freesewing.shared/themes/index.js b/packages/freesewing.shared/themes/index.js new file mode 100644 index 00000000000..958bbbf122e --- /dev/null +++ b/packages/freesewing.shared/themes/index.js @@ -0,0 +1,13 @@ +const light = require('./light') +const dark = require('./dark') +const bureaucrats = require('./bureaucrats') +const kindergarten = require('./kindergarten') +const hax0r = require('./hax0r') + +module.exports = { + light, + dark, + bureaucrats, + kindergarten, + hax0r, +} diff --git a/packages/freesewing.shared/themes/kindergarten.js b/packages/freesewing.shared/themes/kindergarten.js new file mode 100644 index 00000000000..d0597e053e9 --- /dev/null +++ b/packages/freesewing.shared/themes/kindergarten.js @@ -0,0 +1,54 @@ +const colors = require('tailwindcss/colors') +const gray = colors.trueGray + +module.exports = { + icon: "🐕", + config: { + 'fontFamily': "Chalkboard,comic sans ms,\"sanssecondaryerif\"", + 'primary': colors.emerald['600'], + 'primary-focus': colors.emerald['500'], + 'primary-content': '#fff', + + 'secondary': colors.fuchsia['600'], + 'secondary-focus': colors.fuchsia['500'], + 'secondary-content': colors.gray['800'], + + 'accent': colors.green['500'], + 'accent-focus': colors.yellow['400'], + 'accent-content': gray['900'], + + 'neutral': colors.emerald['900'], + 'neutral-focus': gray['200'], + 'neutral-content': colors.emerald['100'], + + 'base-100': colors.yellow['200'], + 'base-200': colors.yellow['300'], + 'base-300': colors.yellow['400'], + 'base-content': gray['700'], + + 'info': colors.pink['400'], + 'success': colors.green['600'], + 'warning': colors.amber['600'], + 'error': colors.red['600'], + + '--rounded-btn': '10rem', + + '--pattern-fabric': colors.trueGray['700'], + '--pattern-lining': colors.emerald['500'], + '--pattern-interfacing': colors.trueGray['400'], + '--pattern-canvas': colors.amber['600'], + '--pattern-various': colors.red['500'], + '--pattern-mark': colors.blue['500'], + '--pattern-contrast': colors.pink['500'], + '--pattern-note': colors.violet['500'], + + ".mdx.prose a" : { + color: colors.fuchsia['600'], + 'text-decoration': 'none', + }, + ".mdx.prose a:hover" : { + color: colors.fuchsia['500'], + 'text-decoration': 'underline', + }, + } +} diff --git a/packages/freesewing.shared/themes/light.js b/packages/freesewing.shared/themes/light.js new file mode 100644 index 00000000000..af78530804d --- /dev/null +++ b/packages/freesewing.shared/themes/light.js @@ -0,0 +1,162 @@ +/** + * This is a theme file for FreeSewing's NextJS-based website + * + * You can change colors, fonts, and a few other things here. + * While technically, you can change more, it's really not recommended. + * Best to stick to the examples in this light theme + * + * If you want to make your own theme, copy this file to a new name. + * Update ../index.js to include it, and you're good to go. + */ + +/* + * We're using the TailwindCSS colors. + * Let's include them so we can reference them by name. + * For a full list, see: https://tailwindcss.com/docs/customizing-colors + */ +const colors = require('tailwindcss/colors') + +module.exports = { + icon: "🌞", + config: { + + /* FONTS + * + * This will apply to everything except code blocks + */ + + // fontFamily: The font family to use. + 'fontFamily': '-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif', + + /* COLORS + * + * These names are a bit 'bootstrap' like, which can be misleading. + * We don't really use primary and secondary colors, nor do we have + * a warning color and so on. + * However, these names are used under the hood by TailwindCSS + * and DaisyUI, so we're stuck with them. + * + * Read the descriptions below to understand what each color is used for. + */ + + // base-100: The default background color + 'base-100': colors.trueGray['100'], + // base-200: A slightly different background color, used for hovers and so on + 'base-200': colors.trueGray['200'], + // base-300: A shade midway between dark and light + 'base-300': colors.trueGray['400'], + // base-content: The default text color + 'base-content': colors.trueGray['700'], + + // primary: The main brand color and color of the primary button + 'primary': colors.trueGray['900'], + // primary-focus: The :hover color for the primary button + 'primary-focus': colors.violet['600'], + // primary-content: The text color for the primary button + 'primary-content': colors.trueGray['200'], + + // secondary: The link color + 'secondary': colors.violet['500'], + // secondary: The :hover link color + 'secondary-focus': colors.violet['400'], + // secondary: An alternative link color for on dark backgrounds + // Typically a light shade of the secondary color + 'secondary-content': colors.violet['300'], + + // accent: The accent color is used to highlight active things + // Should be something is positive/neutral. Avoid red or orange. + 'accent': colors.emerald['500'], + // accent-focus: The :hover color for the accent button + 'accent-focus': colors.emerald['400'], + // accent-content: The text color for the accent button + 'accent-content': colors.trueGray['900'], + + // neutral: Used as the background for the footer and code blocks. + // Should always be dark(ish) because of prism syntax highlighting + 'neutral': colors.trueGray['800'], + // neutral-focus: Typically a shade lighter than neutral + 'neutral-focus': colors.trueGray['700'], + // neutral-content: The text color on neutral backgrounds + 'neutral-content': colors.trueGray['200'], + + // info: Used rarely, can be another color best somewhat neutral looking + // and should work with the default text color + 'info': colors.amber['300'], + // success: Used rarely, but if it is it's in notifications indicating success + // Typically some shade of green + 'success': colors.green['500'], + // warning: We don't do warnings, but this is used for the tabs under code blocks + // and a couple of other UI elements. + 'warning': colors.amber['500'], + // error: Used rarely, but if it is it's in notifications indicating success + // or the danger button + // Typically some shade of red + 'error': colors.red['600'], + + /* VARIOUS + * + * These are additional variables to control other aspects of the theme + */ + + // border-radius for cards and other big elements + '--rounded-box': '0.5rem', + // border-radius for buttons and similar elements + '--rounded-btn': '0.5rem', + // border-radius for badges and other small elements + '--rounded-badge': '1.9rem', + // bounce animation time for button + '--animation-btn': '0.25s', + // bounce animation time for checkbox, toggle, etc + '--animation-input': '.4s', + // default card-body padding + '--padding-card': '2rem', + // default text case for buttons + '--btn-text-case': 'uppercase', + // default padding for navbar + '--navbar-padding': '.5rem', + // default border size for button + '--border-btn': '1px', + // focus ring size for button and inputs + '--focus-ring': '2px', + // focus ring offset size for button and inputs + '--focus-ring-offset': '2px', + + /* FREESEWING PATTERN COLORS + * + * These are variables to style FreeSewing SVG output (drafts, examples, and so on) + */ + + // Color for the main fabric + '--pattern-fabric': colors.trueGray['700'], + // Color for lining fabric + '--pattern-lining': colors.emerald['500'], + // Color for interfacing + '--pattern-interfacing': colors.trueGray['400'], + // Color for canvas + '--pattern-canvas': colors.amber['600'], + // Color for various fabric types + '--pattern-various': colors.red['500'], + // Color for marking things on a pattern + '--pattern-mark': colors.blue['500'], + // Color to provide contrast on a pattern + '--pattern-contrast': colors.pink['500'], + // Color for noting things on a pattern + '--pattern-note': colors.violet['500'], + + /* ADVANCED + * + * You can override CSS this way, but ask yourself: why? + * + * One thing we do is take care of links in MDX content. + * Since this content is styled by the TailwindCSS Typography + * plugin, it won't follow the theme link styling. + */ + ".mdx.prose a" : { + color: colors.violet['500'], + 'text-decoration': 'none', + }, + ".mdx.prose a:hover" : { + color: colors.violet['400'], + }, + } +} diff --git a/yarn.lock b/yarn.lock index f7786e04a64..16a5d763384 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18224,6 +18224,11 @@ react-side-effect@^2.1.0: resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.1.tgz#66c5701c3e7560ab4822a4ee2742dee215d72eb3" integrity sha512-2FoTQzRNTncBVtnzxFOk2mCpcfxQpenBMbk5kSVBg5UcPqV9fRbgY2zhb7GTWWOlpFmAxhClBDlIq8Rsubz1yQ== +react-swipeable@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/react-swipeable/-/react-swipeable-6.2.0.tgz#057271cb7a6fb4af9d2a3f6d80ccdf33e2f64d47" + integrity sha512-nWQ8dEM8e/uswZLSIkXUsAnQmnX4MTcryOHBQIQYRMJFDpgDBSiVbKsz/BZVCIScF4NtJh16oyxwaNOepR6xSw== + react-tooltip@4.2.18: version "4.2.18" resolved "https://registry.yarnpkg.com/react-tooltip/-/react-tooltip-4.2.18.tgz#2fb8c5e115c4e5476f94081f4bb2ba77f5b2297f" @@ -21272,10 +21277,10 @@ table@^6.0.9: string-width "^4.2.0" strip-ansi "^6.0.0" -tailwindcss@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.0.0.tgz#f7dfd30996b3b1a84d656aaf3c8b6810b70d3d42" - integrity sha512-UPAp2PS5vojAvGClJFIkdh2hfFyaSWo09Ma9j2vZYW+ANhTvpUHFjY85JgtrvvXXREtDvOXy2BxW1yHOz8apCg== +tailwindcss@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.0.1.tgz#bef72ff45d5cfed79bb648d30da952e521e98da4" + integrity sha512-EVDXVZkcueZ77/zfOJw7XkzCuxe5TCiT/S9pw9P183oRzSuwMZ7WO+W/L76jbJQA5qxGeUBJOVOLVBuAUfeZ3g== dependencies: arg "^5.0.1" chalk "^4.1.2"