From de3551de86168ea28b77df9aaf54e64712d44d46 Mon Sep 17 00:00:00 2001 From: "husni.zuhdi@accelbyte.net" Date: Mon, 12 Aug 2024 22:32:20 +0700 Subject: [PATCH 1/9] feat(css): add tailwind config, input file, and output file --- statics/input.css | 3 + statics/styles.css | 1134 +++++++++++++++++++++++++++++++++++++++++--- tailwind.config.js | 9 + 3 files changed, 1083 insertions(+), 63 deletions(-) create mode 100644 statics/input.css create mode 100644 tailwind.config.js diff --git a/statics/input.css b/statics/input.css new file mode 100644 index 0000000..b5c61c9 --- /dev/null +++ b/statics/input.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/statics/styles.css b/statics/styles.css index 189f04e..de00097 100644 --- a/statics/styles.css +++ b/statics/styles.css @@ -1,90 +1,1098 @@ -/* Color Pallete */ -/**/ -/* Eerie Black: #1C2321 */ -/* Thistle: #C4B7CB */ -/* PalePurple: #F1E4F3 */ -/* HonoluluBlue: #007CBE */ -/* NonPhotoBlue: #8DE4FF */ -.body { - margin: 0px; - padding: 0px; - letter-spacing: 0.1px; - display: flex; - flex-direction: column; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Helvetica", sans-serif; - font-size: 20px; +/* +! tailwindcss v3.4.4 | MIT License | https://tailwindcss.com +*/ + +/* +1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) +2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) +*/ + +*, +::before, +::after { + box-sizing: border-box; + /* 1 */ + border-width: 0; + /* 2 */ + border-style: solid; + /* 2 */ + border-color: #e5e7eb; + /* 2 */ +} + +::before, +::after { + --tw-content: ''; +} + +/* +1. Use a consistent sensible line-height in all browsers. +2. Prevent adjustments of font size after orientation changes in iOS. +3. Use a more readable tab size. +4. Use the user's configured `sans` font-family by default. +5. Use the user's configured `sans` font-feature-settings by default. +6. Use the user's configured `sans` font-variation-settings by default. +7. Disable tap highlights on iOS +*/ + +html, +:host { + line-height: 1.5; + /* 1 */ + -webkit-text-size-adjust: 100%; + /* 2 */ + -moz-tab-size: 4; + /* 3 */ + -o-tab-size: 4; + tab-size: 4; + /* 3 */ + font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + /* 4 */ + font-feature-settings: normal; + /* 5 */ + font-variation-settings: normal; + /* 6 */ + -webkit-tap-highlight-color: transparent; + /* 7 */ +} + +/* +1. Remove the margin in all browsers. +2. Inherit line-height from `html` so users can set them as a class directly on the `html` element. +*/ + +body { + margin: 0; + /* 1 */ + line-height: inherit; + /* 2 */ +} + +/* +1. Add the correct height in Firefox. +2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) +3. Ensure horizontal rules are visible by default. +*/ + +hr { + height: 0; + /* 1 */ + color: inherit; + /* 2 */ + border-top-width: 1px; + /* 3 */ +} + +/* +Add the correct text decoration in Chrome, Edge, and Safari. +*/ + +abbr:where([title]) { + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; +} + +/* +Remove the default font size and weight for headings. +*/ + +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: inherit; + font-weight: inherit; +} + +/* +Reset links to optimize for opt-in styling instead of opt-out. +*/ + +a { + color: inherit; + text-decoration: inherit; +} + +/* +Add the correct font weight in Edge and Safari. +*/ + +b, +strong { + font-weight: bolder; +} + +/* +1. Use the user's configured `mono` font-family by default. +2. Use the user's configured `mono` font-feature-settings by default. +3. Use the user's configured `mono` font-variation-settings by default. +4. Correct the odd `em` font sizing in all browsers. +*/ + +code, +kbd, +samp, +pre { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + /* 1 */ + font-feature-settings: normal; + /* 2 */ + font-variation-settings: normal; + /* 3 */ + font-size: 1em; + /* 4 */ +} + +/* +Add the correct font size in all browsers. +*/ + +small { + font-size: 80%; +} + +/* +Prevent `sub` and `sup` elements from affecting the line height in all browsers. +*/ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* +1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) +2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) +3. Remove gaps between table borders by default. +*/ + +table { + text-indent: 0; + /* 1 */ + border-color: inherit; + /* 2 */ + border-collapse: collapse; + /* 3 */ +} + +/* +1. Change the font styles in all browsers. +2. Remove the margin in Firefox and Safari. +3. Remove default padding in all browsers. +*/ + +button, +input, +optgroup, +select, +textarea { + font-family: inherit; + /* 1 */ + font-feature-settings: inherit; + /* 1 */ + font-variation-settings: inherit; + /* 1 */ + font-size: 100%; + /* 1 */ + font-weight: inherit; + /* 1 */ + line-height: inherit; + /* 1 */ + letter-spacing: inherit; + /* 1 */ + color: inherit; + /* 1 */ + margin: 0; + /* 2 */ + padding: 0; + /* 3 */ +} + +/* +Remove the inheritance of text transform in Edge and Firefox. +*/ + +button, +select { + text-transform: none; +} + +/* +1. Correct the inability to style clickable types in iOS and Safari. +2. Remove default button styles. +*/ + +button, +input:where([type='button']), +input:where([type='reset']), +input:where([type='submit']) { + -webkit-appearance: button; + /* 1 */ + background-color: transparent; + /* 2 */ + background-image: none; + /* 2 */ +} + +/* +Use the modern Firefox focus style for all focusable elements. +*/ + +:-moz-focusring { + outline: auto; +} + +/* +Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) +*/ + +:-moz-ui-invalid { + box-shadow: none; +} + +/* +Add the correct vertical alignment in Chrome and Firefox. +*/ + +progress { + vertical-align: baseline; +} + +/* +Correct the cursor style of increment and decrement buttons in Safari. +*/ + +::-webkit-inner-spin-button, +::-webkit-outer-spin-button { + height: auto; +} + +/* +1. Correct the odd appearance in Chrome and Safari. +2. Correct the outline style in Safari. +*/ + +[type='search'] { + -webkit-appearance: textfield; + /* 1 */ + outline-offset: -2px; + /* 2 */ +} + +/* +Remove the inner padding in Chrome and Safari on macOS. +*/ + +::-webkit-search-decoration { + -webkit-appearance: none; +} + +/* +1. Correct the inability to style clickable types in iOS and Safari. +2. Change font properties to `inherit` in Safari. +*/ + +::-webkit-file-upload-button { + -webkit-appearance: button; + /* 1 */ + font: inherit; + /* 2 */ +} + +/* +Add the correct display in Chrome and Safari. +*/ + +summary { + display: list-item; +} + +/* +Removes the default spacing and border for appropriate elements. +*/ + +blockquote, +dl, +dd, +h1, +h2, +h3, +h4, +h5, +h6, +hr, +figure, +p, +pre { + margin: 0; +} + +fieldset { + margin: 0; + padding: 0; +} + +legend { + padding: 0; +} + +ol, +ul, +menu { + list-style: none; + margin: 0; + padding: 0; +} + +/* +Reset default styling for dialogs. +*/ + +dialog { + padding: 0; +} + +/* +Prevent resizing textareas horizontally by default. +*/ + +textarea { + resize: vertical; +} + +/* +1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) +2. Set the default placeholder color to the user's configured gray 400 color. +*/ + +input::-moz-placeholder, textarea::-moz-placeholder { + opacity: 1; + /* 1 */ + color: #9ca3af; + /* 2 */ +} + +input::placeholder, +textarea::placeholder { + opacity: 1; + /* 1 */ + color: #9ca3af; + /* 2 */ +} + +/* +Set the default cursor for buttons. +*/ + +button, +[role="button"] { + cursor: pointer; +} + +/* +Make sure disabled buttons don't get the pointer cursor. +*/ + +:disabled { + cursor: default; +} + +/* +1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) +2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) + This can trigger a poorly considered lint error in some tools but is included by design. +*/ + +img, +svg, +video, +canvas, +audio, +iframe, +embed, +object { + display: block; + /* 1 */ + vertical-align: middle; + /* 2 */ +} + +/* +Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) +*/ + +img, +video { + max-width: 100%; + height: auto; +} + +/* Make elements with the HTML hidden attribute stay hidden by default */ + +[hidden] { + display: none; +} + +*, ::before, ::after { + --tw-border-spacing-x: 0; + --tw-border-spacing-y: 0; + --tw-translate-x: 0; + --tw-translate-y: 0; + --tw-rotate: 0; + --tw-skew-x: 0; + --tw-skew-y: 0; + --tw-scale-x: 1; + --tw-scale-y: 1; + --tw-pan-x: ; + --tw-pan-y: ; + --tw-pinch-zoom: ; + --tw-scroll-snap-strictness: proximity; + --tw-gradient-from-position: ; + --tw-gradient-via-position: ; + --tw-gradient-to-position: ; + --tw-ordinal: ; + --tw-slashed-zero: ; + --tw-numeric-figure: ; + --tw-numeric-spacing: ; + --tw-numeric-fraction: ; + --tw-ring-inset: ; + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: rgb(59 130 246 / 0.5); + --tw-ring-offset-shadow: 0 0 #0000; + --tw-ring-shadow: 0 0 #0000; + --tw-shadow: 0 0 #0000; + --tw-shadow-colored: 0 0 #0000; + --tw-blur: ; + --tw-brightness: ; + --tw-contrast: ; + --tw-grayscale: ; + --tw-hue-rotate: ; + --tw-invert: ; + --tw-saturate: ; + --tw-sepia: ; + --tw-drop-shadow: ; + --tw-backdrop-blur: ; + --tw-backdrop-brightness: ; + --tw-backdrop-contrast: ; + --tw-backdrop-grayscale: ; + --tw-backdrop-hue-rotate: ; + --tw-backdrop-invert: ; + --tw-backdrop-opacity: ; + --tw-backdrop-saturate: ; + --tw-backdrop-sepia: ; + --tw-contain-size: ; + --tw-contain-layout: ; + --tw-contain-paint: ; + --tw-contain-style: ; +} + +::backdrop { + --tw-border-spacing-x: 0; + --tw-border-spacing-y: 0; + --tw-translate-x: 0; + --tw-translate-y: 0; + --tw-rotate: 0; + --tw-skew-x: 0; + --tw-skew-y: 0; + --tw-scale-x: 1; + --tw-scale-y: 1; + --tw-pan-x: ; + --tw-pan-y: ; + --tw-pinch-zoom: ; + --tw-scroll-snap-strictness: proximity; + --tw-gradient-from-position: ; + --tw-gradient-via-position: ; + --tw-gradient-to-position: ; + --tw-ordinal: ; + --tw-slashed-zero: ; + --tw-numeric-figure: ; + --tw-numeric-spacing: ; + --tw-numeric-fraction: ; + --tw-ring-inset: ; + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: rgb(59 130 246 / 0.5); + --tw-ring-offset-shadow: 0 0 #0000; + --tw-ring-shadow: 0 0 #0000; + --tw-shadow: 0 0 #0000; + --tw-shadow-colored: 0 0 #0000; + --tw-blur: ; + --tw-brightness: ; + --tw-contrast: ; + --tw-grayscale: ; + --tw-hue-rotate: ; + --tw-invert: ; + --tw-saturate: ; + --tw-sepia: ; + --tw-drop-shadow: ; + --tw-backdrop-blur: ; + --tw-backdrop-brightness: ; + --tw-backdrop-contrast: ; + --tw-backdrop-grayscale: ; + --tw-backdrop-hue-rotate: ; + --tw-backdrop-invert: ; + --tw-backdrop-opacity: ; + --tw-backdrop-saturate: ; + --tw-backdrop-sepia: ; + --tw-contain-size: ; + --tw-contain-layout: ; + --tw-contain-paint: ; + --tw-contain-style: ; +} + +.container { + width: 100%; +} + +@media (min-width: 640px) { + .container { + max-width: 640px; + } +} + +@media (min-width: 768px) { + .container { + max-width: 768px; + } +} + +@media (min-width: 1024px) { + .container { + max-width: 1024px; + } +} + +@media (min-width: 1280px) { + .container { + max-width: 1280px; + } +} + +@media (min-width: 1536px) { + .container { + max-width: 1536px; + } +} + +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border-width: 0; +} + +.absolute { + position: absolute; +} + +.relative { + position: relative; +} + +.-inset-0 { + inset: -0px; +} + +.-inset-0\.5 { + inset: -0.125rem; +} + +.inset-y-0 { + top: 0px; + bottom: 0px; +} + +.left-0 { + left: 0px; +} + +.mx-6 { + margin-left: 1.5rem; + margin-right: 1.5rem; +} + +.mx-auto { + margin-left: auto; + margin-right: auto; +} + +.mb-4 { + margin-bottom: 1rem; +} + +.me-12 { + margin-inline-end: 3rem; +} + +.me-3 { + margin-inline-end: 0.75rem; +} + +.me-6 { + margin-inline-end: 1.5rem; +} + +.mt-10 { + margin-top: 2.5rem; +} + +.mt-4 { + margin-top: 1rem; +} + +.mt-6 { + margin-top: 1.5rem; +} + +.block { + display: block; +} + +.flex { + display: flex; +} + +.inline-flex { + display: inline-flex; +} + +.grid { + display: grid; +} + +.hidden { + display: none; +} + +.h-16 { + height: 4rem; +} + +.h-6 { + height: 1.5rem; +} + +.h-8 { + height: 2rem; +} + +.h-full { + height: 100%; +} + +.min-h-full { + min-height: 100%; +} + +.w-6 { + width: 1.5rem; +} + +.w-auto { + width: auto; +} + +.max-w-7xl { + max-width: 80rem; +} + +.flex-1 { + flex: 1 1 0%; +} + +.flex-shrink-0 { + flex-shrink: 0; +} + +.grow { + flex-grow: 1; +} + +.place-items-center { + place-items: center; +} + +.items-center { + align-items: center; +} + +.justify-center { + justify-content: center; +} + +.justify-between { + justify-content: space-between; +} + +.gap-8 { + gap: 2rem; +} + +.gap-x-6 { + -moz-column-gap: 1.5rem; + column-gap: 1.5rem; +} + +.space-x-4 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(1rem * var(--tw-space-x-reverse)); + margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse))); +} + +.space-y-1 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(0.25rem * var(--tw-space-y-reverse)); +} + +.rounded-md { + border-radius: 0.375rem; +} + +.border-b-2 { + border-bottom-width: 2px; +} + +.border-neutral-200 { + --tw-border-opacity: 1; + border-color: rgb(229 229 229 / var(--tw-border-opacity)); +} + +.bg-black\/5 { + background-color: rgb(0 0 0 / 0.05); +} + +.bg-gray-800 { + --tw-bg-opacity: 1; + background-color: rgb(31 41 55 / var(--tw-bg-opacity)); +} + +.bg-gray-900 { + --tw-bg-opacity: 1; + background-color: rgb(17 24 39 / var(--tw-bg-opacity)); +} + +.bg-indigo-600 { + --tw-bg-opacity: 1; + background-color: rgb(79 70 229 / var(--tw-bg-opacity)); +} + +.bg-white { + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); +} + +.bg-zinc-50 { + --tw-bg-opacity: 1; + background-color: rgb(250 250 250 / var(--tw-bg-opacity)); +} + +.p-2 { + padding: 0.5rem; +} + +.p-6 { + padding: 1.5rem; +} + +.px-2 { + padding-left: 0.5rem; + padding-right: 0.5rem; +} + +.px-3 { + padding-left: 0.75rem; + padding-right: 0.75rem; } -.navbar { - position: sticky; - top: 0; - background-color: #1C2321; - overflow: hidden; +.px-3\.5 { + padding-left: 0.875rem; + padding-right: 0.875rem; } -.navbar a { - float: left; - color: #F1E4F3; - text-align: center; - text-decoration: none; - padding: 5px; +.px-6 { + padding-left: 1.5rem; + padding-right: 1.5rem; } -.navbar a:hover { - background-color: #C4B7CB; - color: #1C2321; +.py-10 { + padding-top: 2.5rem; + padding-bottom: 2.5rem; } -.navbar a.special { - background-color: #007CBE; - color: #F1E4F3; +.py-2 { + padding-top: 0.5rem; + padding-bottom: 0.5rem; } -.navbar a.auth { - float: right; +.py-2\.5 { + padding-top: 0.625rem; + padding-bottom: 0.625rem; } -.main { - flex: 1; - padding: 5px 100px 5px 100px; +.py-24 { + padding-top: 6rem; + padding-bottom: 6rem; } -.main a.btn { - background-color: #8DE4FF; - color: #1C2321; +.pb-3 { + padding-bottom: 0.75rem; } -.paragraph { - padding-left: 0px; - padding-right: 0px; +.pt-2 { + padding-top: 0.5rem; } -.btn { - cursor: pointer; +.text-center { + text-align: center; +} + +.text-3xl { + font-size: 1.875rem; + line-height: 2.25rem; +} + +.text-base { + font-size: 1rem; + line-height: 1.5rem; +} + +.text-sm { + font-size: 0.875rem; + line-height: 1.25rem; +} + +.font-bold { + font-weight: 700; +} + +.font-medium { + font-weight: 500; +} + +.font-semibold { + font-weight: 600; +} + +.uppercase { + text-transform: uppercase; +} + +.leading-7 { + line-height: 1.75rem; +} + +.tracking-tight { + letter-spacing: -0.025em; +} + +.text-gray-300 { + --tw-text-opacity: 1; + color: rgb(209 213 219 / var(--tw-text-opacity)); +} + +.text-gray-400 { + --tw-text-opacity: 1; + color: rgb(156 163 175 / var(--tw-text-opacity)); +} + +.text-gray-600 { + --tw-text-opacity: 1; + color: rgb(75 85 99 / var(--tw-text-opacity)); +} + +.text-gray-900 { + --tw-text-opacity: 1; + color: rgb(17 24 39 / var(--tw-text-opacity)); +} + +.text-indigo-600 { + --tw-text-opacity: 1; + color: rgb(79 70 229 / var(--tw-text-opacity)); +} + +.text-white { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +.shadow-sm { + --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); + --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +.hover\:bg-gray-700:hover { + --tw-bg-opacity: 1; + background-color: rgb(55 65 81 / var(--tw-bg-opacity)); +} + +.hover\:bg-indigo-500:hover { + --tw-bg-opacity: 1; + background-color: rgb(99 102 241 / var(--tw-bg-opacity)); +} + +.hover\:text-white:hover { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +.focus\:outline-none:focus { + outline: 2px solid transparent; + outline-offset: 2px; +} + +.focus\:ring-2:focus { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} + +.focus\:ring-inset:focus { + --tw-ring-inset: inset; +} + +.focus\:ring-white:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity)); +} + +.focus-visible\:outline:focus-visible { + outline-style: solid; +} + +.focus-visible\:outline-2:focus-visible { + outline-width: 2px; +} + +.focus-visible\:outline-offset-2:focus-visible { + outline-offset: 2px; +} + +.focus-visible\:outline-indigo-600:focus-visible { + outline-color: #4f46e5; +} + +@media (min-width: 640px) { + .sm\:ml-6 { + margin-left: 1.5rem; + } + + .sm\:block { + display: block; + } + + .sm\:hidden { + display: none; + } + + .sm\:items-stretch { + align-items: stretch; + } + + .sm\:justify-start { + justify-content: flex-start; + } + + .sm\:px-6 { + padding-left: 1.5rem; + padding-right: 1.5rem; + } + + .sm\:py-32 { + padding-top: 8rem; + padding-bottom: 8rem; + } + + .sm\:text-5xl { + font-size: 3rem; + line-height: 1; + } +} + +@media (min-width: 768px) { + .md\:grid-cols-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + + .md\:justify-start { + justify-content: flex-start; + } + + .md\:text-left { + text-align: left; + } +} + +@media (min-width: 1024px) { + .lg\:block { + display: block; + } + + .lg\:grid-cols-4 { + grid-template-columns: repeat(4, minmax(0, 1fr)); + } + + .lg\:justify-between { + justify-content: space-between; + } + + .lg\:px-8 { + padding-left: 2rem; + padding-right: 2rem; + } + + .lg\:text-left { + text-align: left; + } +} + +@media (prefers-color-scheme: dark) { + .dark\:border-white\/10 { + border-color: rgb(255 255 255 / 0.1); + } + + .dark\:bg-neutral-700 { + --tw-bg-opacity: 1; + background-color: rgb(64 64 64 / var(--tw-bg-opacity)); + } + + .dark\:text-white\/75 { + color: rgb(255 255 255 / 0.75); + } } -.flex-container { - display: flex; - flex-direction: row; - flex-wrap: wrap; - justify-content: start; - align-items: start; +.\[\&\>svg\]\:h-4>svg { + height: 1rem; } -.flex-container > div { - width: 500px; - margin: 0px; - padding: 0px; +.\[\&\>svg\]\:h-5>svg { + height: 1.25rem; } -.footer { - padding: 10px; - display: inine-block; - text-align: center; - color: #F1E4F3; - background-color: #1C2321; +.\[\&\>svg\]\:w-4>svg { + width: 1rem; } -.footer a { - color: #F1E4F3; +.\[\&\>svg\]\:w-5>svg { + width: 1.25rem; } diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 0000000..9e65336 --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,9 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: ["./internal/templates/*.html", "./internal/templates/**/*.html"], + theme: { + extend: {}, + }, + plugins: [], +} + From 6cc14c4bc69bd49332514387c7781c38b78460c5 Mon Sep 17 00:00:00 2001 From: "husni.zuhdi@accelbyte.net" Date: Mon, 12 Aug 2024 22:32:46 +0700 Subject: [PATCH 2/9] chore: add favicon files --- statics/favicon/apple-touch-icon.png | Bin 0 -> 7508 bytes statics/favicon/favicon-16x16.png | Bin 0 -> 424 bytes statics/favicon/favicon-32x32.png | Bin 0 -> 742 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 statics/favicon/apple-touch-icon.png create mode 100644 statics/favicon/favicon-16x16.png create mode 100644 statics/favicon/favicon-32x32.png diff --git a/statics/favicon/apple-touch-icon.png b/statics/favicon/apple-touch-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..e8a68207c6162201ef1c1b297ff104cef20ef9ea GIT binary patch literal 7508 zcmeHs*E<|u)b5Ol-a>TIyQtBI7$!OiqPHj^n5c;v#OMhTElQM(I(jcrLzEzhGK@M* zLJaj{_p**Mom-S+x; z^Ie3b-JqV_l<$>e(f~_?{J~-I$C$qm--)dkEhy>VZmdxD1ZFvi@R-92guID12D2x%La5$JFL zTH`nF{g@VyY6Ohaspn9|pn=O+`@c*18H3IrQ#p!W0U+U*y9z&+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_ie3)eF)OZPo~5FZAU3jm9~uq%;|G_l^2rI&@?kyr9cBzTh4E zDZ%w|_9=jwC*qe3sOgu+e!Z9(wqVn|-Nh?I#a>b9Gwg+g+i)W46F@;*jYUDE1=p^QLRs6PK_4yFVB~PgKL(!iN{P(w@InTUX-^ z+k!`VWk2S$WnDc15W1!&-^oDN+b&;gli=Fc9&6;qAe0;8V4^brzTDxhKMQ7XH9MI( z+zT%+DthhDK@i1Kv7ra+>+73lgMT0%iwjEKG}_`2t9}rTxO~M-TEE~6`pcvFxyh4v n;mWzBg}~AGm*Bs31!~VZYYO`l^yvDx6ritdq*bfo^y>cro5zWE literal 0 HcmV?d00001 diff --git a/statics/favicon/favicon-16x16.png b/statics/favicon/favicon-16x16.png new file mode 100644 index 0000000000000000000000000000000000000000..ebb7a6c8380774f3104637228cd54ef345ac970c GIT binary patch literal 424 zcmV;Z0ayNsP)GPVBw^Ve~1U-Nm88b%P2R8nhctj%)l z-+u;%%UAz(%<65dL^mL{xGwjnl*q*20=$ge*B*w>>1|kpVt~0m%dw;gR)!gieluLY zhH3~{v!uwxS3b6k0;jJs@Lafq-GHT5f_+dkQ`A4zzpfz!o#p%)0P2bGYk-I07%2yk4g-)-)W(w!X)4STgmqX9ff;~HGl~mfCL+6J?|)^6InULw+Kkl& z=!Pf-Dzon2@DAwbx4CnWoQ<3?P`rRFky=_8%*ezrAU+ZphB(jVu@_*(ZmmW(S#BY zMX)zT1lwyaNz(u-TrHU zCd4v1anIigugL9Ow*|oMgtIX1YIoZ1EVQ-(Y(SJ+g^7sofkDMCIGJx_68(_1zAls)sZFi=^*MTtU zZ~{b)+&*6k5afgnuvKwo3Y=DX6{ZAO`LeRnYC+ZR*UzCG@JmMp4ubaNZL`lU6eF`C za<04wRM+3=WNyEvv8rrQ&^h3mXwVB}sDcZ952zqASIvFYo{vyK4|Vbddh4B6{l;(q Y5A=~ Date: Mon, 12 Aug 2024 22:33:28 +0700 Subject: [PATCH 3/9] chore: update statics file handler and endpoint --- internal/src/handler.rs | 2 +- internal/src/router.rs | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/internal/src/handler.rs b/internal/src/handler.rs index 16150ae..06901bc 100644 --- a/internal/src/handler.rs +++ b/internal/src/handler.rs @@ -27,7 +27,7 @@ pub async fn handler(cfg: Config) -> std::io::Result<()> { .app_data(web::Data::new(blogs_data.clone())) .app_data(web::Data::new(config.clone())) .service(web::resource("/").route(web::get().to(profile))) - .service(web::resource("/styles.css").route(web::get().to(styles))) + .service(web::resource("/statics/{static_file}").route(web::get().to(statics))) .service(web::resource("/blogs").route(web::get().to(get_blogs))) .service(web::resource("/blogs/{blogid}").route(web::get().to(get_blog))) .service(web::resource("/version").route(web::get().to(get_version))) diff --git a/internal/src/router.rs b/internal/src/router.rs index 94ea33f..0e018cf 100644 --- a/internal/src/router.rs +++ b/internal/src/router.rs @@ -5,11 +5,24 @@ use actix_files::NamedFile; use actix_web::{web, Responder, Result}; use actix_web_lab::respond::Html; use askama::Template; -use log::info; +use log::{error, info}; -pub async fn styles() -> Result { - let styles = NamedFile::open("./statics/styles.css").expect("Failed to render styles.css"); - Ok(styles) +pub async fn statics(path: web::Path) -> Result { + info!("Statics path: {}", path.clone()); + let static_path = match path.into_inner().as_str() { + "styles.css" => Ok(format!("./statics/styles.css")), + "apple-touch-icon.png" => Ok(format!("./statics/favicon/apple-touch-icon.png")), + "favicon-16x16.png" => Ok(format!("./statics/favicon/favicon-16x16.png")), + "favicon-32x32.png" => Ok(format!("./statics/favicon/favicon-32x32.png")), + _ => { + let err = "Failed to get static path. Statics path is not allowed."; + error!("{}", err); + Err(err) + } + } + .expect("Failed to get static path"); + let static_file = NamedFile::open(static_path).expect("Failed to render static file(s)"); + Ok(static_file) } pub async fn profile() -> Result { From 402237179ea8949122733cf31acc3272fb3e9b5d Mon Sep 17 00:00:00 2001 From: "husni.zuhdi@accelbyte.net" Date: Mon, 12 Aug 2024 22:33:58 +0700 Subject: [PATCH 4/9] docs: add tailwindcss to tech stack --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6f1875a..8e79300 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ My Portfolio webiste * [Askama](https://github.com/djc/askama) * [Markdown-rs](https://github.com/wooorm/markdown-rs) * [Taskfile](https://taskfile.dev/) +* [TailwindCSS](https://tailwindcss.com/) ## How to use From 2030170de0b9a38991f54a8ec282bd093b22bc54 Mon Sep 17 00:00:00 2001 From: "husni.zuhdi@accelbyte.net" Date: Mon, 12 Aug 2024 22:34:15 +0700 Subject: [PATCH 5/9] chore: add build tailwind task --- Taskfile.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Taskfile.yml b/Taskfile.yml index af22803..c2a44a2 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -5,8 +5,14 @@ tasks: summary: Run unit test with logs cmds: - RUST_LOG=debug cargo test -- --nocapture + build-tailwind: + summary: Build tailwindcss + cmds: + - tailwindcss -i ./statics/input.css -o ./statics/styles.css run: summary: Run application with hot-reload + deps: + - build-tailwind cmds: - cargo watch -s 'export $(cat .env | xargs) && cargo run -- -release' update_version: @@ -22,6 +28,8 @@ tasks: EOF compose-run: summary: Run application in docker compose with database + deps: + - build-tailwind cmds: - | export $(cat .env | xargs) From 7b6869e815bbd560c52845f787212f2bcdbdd780 Mon Sep 17 00:00:00 2001 From: "husni.zuhdi@accelbyte.net" Date: Tue, 13 Aug 2024 02:25:06 +0700 Subject: [PATCH 6/9] feat: update input and output css files --- statics/input.css | 15 +++++++ statics/styles.css | 105 ++++++++++++++++++++++++++++++++------------- 2 files changed, 89 insertions(+), 31 deletions(-) diff --git a/statics/input.css b/statics/input.css index b5c61c9..48fb800 100644 --- a/statics/input.css +++ b/statics/input.css @@ -1,3 +1,18 @@ @tailwind base; @tailwind components; @tailwind utilities; + +@layer base { + h1 { + @apply mb-4 mt-6 font-bold uppercase text-2xl md:justify-start; + } + h2 { + @apply mb-2 mt-4 text-xl font-semibold md:justify-start; + } + h3 { + @apply mb-2 mt-4 text-xl md:justify-start; + } + a { + @apply text-blue-500 hover:text-blue-900; + } +} diff --git a/statics/styles.css b/statics/styles.css index de00097..81c2da5 100644 --- a/statics/styles.css +++ b/statics/styles.css @@ -446,6 +446,58 @@ video { display: none; } +h1 { + margin-bottom: 1rem; + margin-top: 1.5rem; + font-size: 1.5rem; + line-height: 2rem; + font-weight: 700; + text-transform: uppercase; +} + +@media (min-width: 768px) { + h1 { + justify-content: flex-start; + } +} + +h2 { + margin-bottom: 0.5rem; + margin-top: 1rem; + font-size: 1.25rem; + line-height: 1.75rem; + font-weight: 600; +} + +@media (min-width: 768px) { + h2 { + justify-content: flex-start; + } +} + +h3 { + margin-bottom: 0.5rem; + margin-top: 1rem; + font-size: 1.25rem; + line-height: 1.75rem; +} + +@media (min-width: 768px) { + h3 { + justify-content: flex-start; + } +} + +a { + --tw-text-opacity: 1; + color: rgb(59 130 246 / var(--tw-text-opacity)); +} + +a:hover { + --tw-text-opacity: 1; + color: rgb(30 58 138 / var(--tw-text-opacity)); +} + *, ::before, ::after { --tw-border-spacing-x: 0; --tw-border-spacing-y: 0; @@ -621,6 +673,10 @@ video { bottom: 0px; } +.bottom-0 { + bottom: 0px; +} + .left-0 { left: 0px; } @@ -635,6 +691,10 @@ video { margin-right: auto; } +.mb-2 { + margin-bottom: 0.5rem; +} + .mb-4 { margin-bottom: 1rem; } @@ -777,13 +837,9 @@ video { border-color: rgb(229 229 229 / var(--tw-border-opacity)); } -.bg-black\/5 { - background-color: rgb(0 0 0 / 0.05); -} - -.bg-gray-800 { +.bg-gray-100 { --tw-bg-opacity: 1; - background-color: rgb(31 41 55 / var(--tw-bg-opacity)); + background-color: rgb(243 244 246 / var(--tw-bg-opacity)); } .bg-gray-900 { @@ -801,11 +857,6 @@ video { background-color: rgb(255 255 255 / var(--tw-bg-opacity)); } -.bg-zinc-50 { - --tw-bg-opacity: 1; - background-color: rgb(250 250 250 / var(--tw-bg-opacity)); -} - .p-2 { padding: 0.5rem; } @@ -862,10 +913,18 @@ video { padding-top: 0.5rem; } +.text-left { + text-align: left; +} + .text-center { text-align: center; } +.font-mono { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; +} + .text-3xl { font-size: 1.875rem; line-height: 2.25rem; @@ -910,11 +969,6 @@ video { color: rgb(209 213 219 / var(--tw-text-opacity)); } -.text-gray-400 { - --tw-text-opacity: 1; - color: rgb(156 163 175 / var(--tw-text-opacity)); -} - .text-gray-600 { --tw-text-opacity: 1; color: rgb(75 85 99 / var(--tw-text-opacity)); @@ -951,6 +1005,10 @@ video { background-color: rgb(99 102 241 / var(--tw-bg-opacity)); } +.hover\:font-bold:hover { + font-weight: 700; +} + .hover\:text-white:hover { --tw-text-opacity: 1; color: rgb(255 255 255 / var(--tw-text-opacity)); @@ -1066,21 +1124,6 @@ video { } } -@media (prefers-color-scheme: dark) { - .dark\:border-white\/10 { - border-color: rgb(255 255 255 / 0.1); - } - - .dark\:bg-neutral-700 { - --tw-bg-opacity: 1; - background-color: rgb(64 64 64 / var(--tw-bg-opacity)); - } - - .dark\:text-white\/75 { - color: rgb(255 255 255 / 0.75); - } -} - .\[\&\>svg\]\:h-4>svg { height: 1rem; } From d55210807e53ba47211bf2bd8ad762cee0265f8c Mon Sep 17 00:00:00 2001 From: "husni.zuhdi@accelbyte.net" Date: Tue, 13 Aug 2024 02:25:56 +0700 Subject: [PATCH 7/9] feat: integrate html files with tailwindcss --- internal/templates/base.html | 174 +++++++++++++++++++++++++------- internal/templates/blog.html | 3 +- internal/templates/blogs.html | 4 +- internal/templates/profile.html | 2 +- 4 files changed, 144 insertions(+), 39 deletions(-) diff --git a/internal/templates/base.html b/internal/templates/base.html index 1f1044d..72e295e 100644 --- a/internal/templates/base.html +++ b/internal/templates/base.html @@ -1,5 +1,5 @@ - + {% block title %}{% endblock %} @@ -8,50 +8,156 @@ - + - - + + + - + - -
+ + + +
{% block content %}

Placeholder content

{% endblock %}
- +
+ diff --git a/internal/templates/blog.html b/internal/templates/blog.html index 0ce7f06..0fa5087 100644 --- a/internal/templates/blog.html +++ b/internal/templates/blog.html @@ -4,8 +4,7 @@ {% block description %}"Blog {{id}} - {{name}}"{% endblock %} {% block content %} -

{{id}} | {{name}}

- +

{{id}} | {{name}}


{{body|safe}} diff --git a/internal/templates/blogs.html b/internal/templates/blogs.html index d611e59..a313585 100644 --- a/internal/templates/blogs.html +++ b/internal/templates/blogs.html @@ -4,10 +4,10 @@ {% block description %}"Husni Naufal Zuhdi Blogs"{% endblock %} {% block content %} -

Blogs

+

Blogs


{% for blog in blogs %} -

+

{{blog.id}} | {{blog.name}}

{% endfor %} diff --git a/internal/templates/profile.html b/internal/templates/profile.html index 637c423..39fad2c 100644 --- a/internal/templates/profile.html +++ b/internal/templates/profile.html @@ -20,8 +20,8 @@

2022 - Now | Site Reliability Engineer at Tokopedia

-

Handle Tokopedia Multi-Cloud Environment

    +
  • Handle Tokopedia Multi-Cloud Environment
  • Onboard several existing Jenkins Pipelines into our new GitHub Action Workflows
  • Rolling out our existing Consul Service Discovery into the Enterprise version
  • Develop Cloud Platform Diary for our Internal Cloud-related Data Analytics Platform
  • From 44af6869309bd36aeb64725e93c9dea1de09d926 Mon Sep 17 00:00:00 2001 From: "husni.zuhdi@accelbyte.net" Date: Tue, 13 Aug 2024 02:38:38 +0700 Subject: [PATCH 8/9] feat: add 404 not found page --- internal/src/handler.rs | 1 + internal/src/model/templates.rs | 4 ++++ internal/src/router.rs | 5 +++++ internal/templates/not_found.html | 25 +++++++++++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 internal/templates/not_found.html diff --git a/internal/src/handler.rs b/internal/src/handler.rs index 06901bc..1c6eec1 100644 --- a/internal/src/handler.rs +++ b/internal/src/handler.rs @@ -31,6 +31,7 @@ pub async fn handler(cfg: Config) -> std::io::Result<()> { .service(web::resource("/blogs").route(web::get().to(get_blogs))) .service(web::resource("/blogs/{blogid}").route(web::get().to(get_blog))) .service(web::resource("/version").route(web::get().to(get_version))) + .service(web::resource("/not-found").route(web::get().to(get_404_not_found))) }) .bind((endpoint, port)) .expect("Failed to start Http Server") diff --git a/internal/src/model/templates.rs b/internal/src/model/templates.rs index bc17be3..545abef 100644 --- a/internal/src/model/templates.rs +++ b/internal/src/model/templates.rs @@ -27,3 +27,7 @@ pub struct Version<'a> { pub build_hash: &'a str, pub build_date: &'a str, } + +#[derive(Template, Debug)] +#[template(path = "not_found.html")] +pub struct NotFound; diff --git a/internal/src/router.rs b/internal/src/router.rs index 0e018cf..d9b53c3 100644 --- a/internal/src/router.rs +++ b/internal/src/router.rs @@ -30,6 +30,11 @@ pub async fn profile() -> Result { Ok(Html(profile)) } +pub async fn get_404_not_found() -> Result { + let html = NotFound.render().expect("Failed to render not_found.html"); + Ok(Html(html)) +} + pub async fn get_blogs(blogs_data: web::Data) -> Result { // Copy data to Template struct let blogs_template: Vec = blogs_data diff --git a/internal/templates/not_found.html b/internal/templates/not_found.html new file mode 100644 index 0000000..a898f28 --- /dev/null +++ b/internal/templates/not_found.html @@ -0,0 +1,25 @@ +{% extends "base.html" %} + +{% block title %}404 Not Found{% endblock %} +{% block description %}"Sorry, we couldn’t find the page you’re looking for"{% endblock %} + +{% block content %} + +
    +
    +

    404

    +

    Page not found

    +

    Sorry, we couldn’t find the page you’re looking for.

    + +
    +
    +{% endblock content %} From bcd9e9238fb8ceefdeea41131af02de36b86207d Mon Sep 17 00:00:00 2001 From: "husni.zuhdi@accelbyte.net" Date: Tue, 13 Aug 2024 02:39:17 +0700 Subject: [PATCH 9/9] chore: update style.css file --- internal/templates/profile.html | 1 - statics/styles.css | 35 ++++++++------------------------- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/internal/templates/profile.html b/internal/templates/profile.html index 39fad2c..e114561 100644 --- a/internal/templates/profile.html +++ b/internal/templates/profile.html @@ -102,7 +102,6 @@

    Linux

    -

    Personal Interests


    diff --git a/statics/styles.css b/statics/styles.css index 81c2da5..a9ac4f9 100644 --- a/statics/styles.css +++ b/statics/styles.css @@ -686,11 +686,6 @@ a:hover { margin-right: 1.5rem; } -.mx-auto { - margin-left: auto; - margin-right: auto; -} - .mb-2 { margin-bottom: 0.5rem; } @@ -771,10 +766,6 @@ a:hover { width: auto; } -.max-w-7xl { - max-width: 80rem; -} - .flex-1 { flex: 1 1 0%; } @@ -847,14 +838,9 @@ a:hover { background-color: rgb(17 24 39 / var(--tw-bg-opacity)); } -.bg-indigo-600 { +.bg-green-600 { --tw-bg-opacity: 1; - background-color: rgb(79 70 229 / var(--tw-bg-opacity)); -} - -.bg-white { - --tw-bg-opacity: 1; - background-color: rgb(255 255 255 / var(--tw-bg-opacity)); + background-color: rgb(22 163 74 / var(--tw-bg-opacity)); } .p-2 { @@ -979,9 +965,9 @@ a:hover { color: rgb(17 24 39 / var(--tw-text-opacity)); } -.text-indigo-600 { +.text-red-700 { --tw-text-opacity: 1; - color: rgb(79 70 229 / var(--tw-text-opacity)); + color: rgb(185 28 28 / var(--tw-text-opacity)); } .text-white { @@ -1000,9 +986,9 @@ a:hover { background-color: rgb(55 65 81 / var(--tw-bg-opacity)); } -.hover\:bg-indigo-500:hover { +.hover\:bg-green-500:hover { --tw-bg-opacity: 1; - background-color: rgb(99 102 241 / var(--tw-bg-opacity)); + background-color: rgb(34 197 94 / var(--tw-bg-opacity)); } .hover\:font-bold:hover { @@ -1046,8 +1032,8 @@ a:hover { outline-offset: 2px; } -.focus-visible\:outline-indigo-600:focus-visible { - outline-color: #4f46e5; +.focus-visible\:outline-green-600:focus-visible { + outline-color: #16a34a; } @media (min-width: 640px) { @@ -1071,11 +1057,6 @@ a:hover { justify-content: flex-start; } - .sm\:px-6 { - padding-left: 1.5rem; - padding-right: 1.5rem; - } - .sm\:py-32 { padding-top: 8rem; padding-bottom: 8rem;