diff --git a/.vscode/settings.json b/.vscode/settings.json index 6860d4a..fd13945 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,7 +7,7 @@ "terminal.background": "#1f1f1f", "terminal.ansiYellow": "#b38210" //BROWN UNIX ANSI }, - "workbench.colorTheme": "Mr Pink", + "workbench.colorTheme": "Cotion Theme", // --------------------------------------------------------- "[ruby]": { "editor.defaultFormatter": "Shopify.ruby-lsp", // Use the Ruby LSP as the default formatter diff --git a/app/assets/css/input.css b/app/assets/css/input.css deleted file mode 100644 index 9a418db..0000000 --- a/app/assets/css/input.css +++ /dev/null @@ -1,51 +0,0 @@ -@import "tailwindcss"; - -.table { - text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2); - display: flex; - flex-direction: column; - width: 40%; - border: 1px solid #e0e0e0; - border-radius: 6px; - margin-top: 30px; - background-color: #fafafa; -} - -.table-header, -.table-row { - display: flex; - padding: 12px; - border-bottom: 1px solid #eaeaea; -} - -.cell { - display: flex; - flex: 1; - padding: 8px 12px; - align-items: center; -} - -.table-header { - background-color: #f5f7fa; - font-weight: 600; - color: #a51010; -} - -.btn { - text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2); - display: inline-block; - background-color: #b7e1ff; - color: #0f0f0f; - padding: 1px 10px; - margin-right: 8px; - border: none; - border-radius: 6px; - text-decoration: none; - font-size: 14px; - cursor: pointer; - transition: background-color 0.3s ease; -} - -.btn:hover { - background-color: #f6fafe; -} \ No newline at end of file diff --git a/app/assets/css/output.css b/app/assets/css/output.css deleted file mode 100644 index 18fd34f..0000000 --- a/app/assets/css/output.css +++ /dev/null @@ -1,204 +0,0 @@ -/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */ -@layer theme, base, components, utilities; -@layer theme { - :root, :host { - --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; - --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", - "Courier New", monospace; - --default-font-family: var(--font-sans); - --default-mono-font-family: var(--font-mono); - } -} -@layer base { - *, ::after, ::before, ::backdrop, ::file-selector-button { - box-sizing: border-box; - margin: 0; - padding: 0; - border: 0 solid; - } - html, :host { - line-height: 1.5; - -webkit-text-size-adjust: 100%; - tab-size: 4; - font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); - font-feature-settings: var(--default-font-feature-settings, normal); - font-variation-settings: var(--default-font-variation-settings, normal); - -webkit-tap-highlight-color: transparent; - } - hr { - height: 0; - color: inherit; - border-top-width: 1px; - } - abbr:where([title]) { - -webkit-text-decoration: underline dotted; - text-decoration: underline dotted; - } - h1, h2, h3, h4, h5, h6 { - font-size: inherit; - font-weight: inherit; - } - a { - color: inherit; - -webkit-text-decoration: inherit; - text-decoration: inherit; - } - b, strong { - font-weight: bolder; - } - code, kbd, samp, pre { - font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace); - font-feature-settings: var(--default-mono-font-feature-settings, normal); - font-variation-settings: var(--default-mono-font-variation-settings, normal); - font-size: 1em; - } - small { - font-size: 80%; - } - sub, sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; - } - sub { - bottom: -0.25em; - } - sup { - top: -0.5em; - } - table { - text-indent: 0; - border-color: inherit; - border-collapse: collapse; - } - :-moz-focusring { - outline: auto; - } - progress { - vertical-align: baseline; - } - summary { - display: list-item; - } - ol, ul, menu { - list-style: none; - } - img, svg, video, canvas, audio, iframe, embed, object { - display: block; - vertical-align: middle; - } - img, video { - max-width: 100%; - height: auto; - } - button, input, select, optgroup, textarea, ::file-selector-button { - font: inherit; - font-feature-settings: inherit; - font-variation-settings: inherit; - letter-spacing: inherit; - color: inherit; - border-radius: 0; - background-color: transparent; - opacity: 1; - } - :where(select:is([multiple], [size])) optgroup { - font-weight: bolder; - } - :where(select:is([multiple], [size])) optgroup option { - padding-inline-start: 20px; - } - ::file-selector-button { - margin-inline-end: 4px; - } - ::placeholder { - opacity: 1; - } - @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) { - ::placeholder { - color: currentcolor; - @supports (color: color-mix(in lab, red, red)) { - color: color-mix(in oklab, currentcolor 50%, transparent); - } - } - } - textarea { - resize: vertical; - } - ::-webkit-search-decoration { - -webkit-appearance: none; - } - ::-webkit-date-and-time-value { - min-height: 1lh; - text-align: inherit; - } - ::-webkit-datetime-edit { - display: inline-flex; - } - ::-webkit-datetime-edit-fields-wrapper { - padding: 0; - } - ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field { - padding-block: 0; - } - ::-webkit-calendar-picker-indicator { - line-height: 1; - } - :-moz-ui-invalid { - box-shadow: none; - } - button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button { - appearance: button; - } - ::-webkit-inner-spin-button, ::-webkit-outer-spin-button { - height: auto; - } - [hidden]:where(:not([hidden="until-found"])) { - display: none !important; - } -} -@layer utilities { - .visible { - visibility: visible; - } - .absolute { - position: absolute; - } - .fixed { - position: fixed; - } - .static { - position: static; - } - .container { - width: 100%; - @media (width >= 40rem) { - max-width: 40rem; - } - @media (width >= 48rem) { - max-width: 48rem; - } - @media (width >= 64rem) { - max-width: 64rem; - } - @media (width >= 80rem) { - max-width: 80rem; - } - @media (width >= 96rem) { - max-width: 96rem; - } - } - .contents { - display: contents; - } - .inline { - display: inline; - } - .table { - display: table; - } - .table-row { - display: table-row; - } -} diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css deleted file mode 100644 index e69de29..0000000 diff --git a/app/assets/stylesheets/input.css b/app/assets/stylesheets/input.css new file mode 100644 index 0000000..a461c50 --- /dev/null +++ b/app/assets/stylesheets/input.css @@ -0,0 +1 @@ +@import "tailwindcss"; \ No newline at end of file diff --git a/app/assets/stylesheets/output.css b/app/assets/stylesheets/output.css new file mode 100644 index 0000000..5797f5b --- /dev/null +++ b/app/assets/stylesheets/output.css @@ -0,0 +1,681 @@ +/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */ +@layer properties; +@layer theme, base, components, utilities; +@layer theme { + :root, :host { + --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", + "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; + --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", + "Courier New", monospace; + --color-red-500: oklch(63.7% 0.237 25.331); + --color-red-600: oklch(57.7% 0.245 27.325); + --color-yellow-400: oklch(85.2% 0.199 91.936); + --color-yellow-500: oklch(79.5% 0.184 86.047); + --color-green-600: oklch(62.7% 0.194 149.214); + --color-green-700: oklch(52.7% 0.154 150.069); + --color-blue-500: oklch(62.3% 0.214 259.815); + --color-blue-600: oklch(54.6% 0.245 262.881); + --color-blue-700: oklch(48.8% 0.243 264.376); + --color-blue-800: oklch(42.4% 0.199 265.638); + --color-gray-50: oklch(98.5% 0.002 247.839); + --color-gray-100: oklch(96.7% 0.003 264.542); + --color-gray-200: oklch(92.8% 0.006 264.531); + --color-gray-300: oklch(87.2% 0.01 258.338); + --color-gray-500: oklch(55.1% 0.027 264.364); + --color-gray-600: oklch(44.6% 0.03 256.802); + --color-gray-700: oklch(37.3% 0.034 259.733); + --color-gray-800: oklch(27.8% 0.033 256.848); + --color-black: #000; + --color-white: #fff; + --spacing: 0.25rem; + --text-sm: 0.875rem; + --text-sm--line-height: calc(1.25 / 0.875); + --text-base: 1rem; + --text-base--line-height: calc(1.5 / 1); + --text-4xl: 2.25rem; + --text-4xl--line-height: calc(2.5 / 2.25); + --font-weight-extralight: 200; + --font-weight-normal: 400; + --font-weight-medium: 500; + --font-weight-semibold: 600; + --font-weight-bold: 700; + --radius-md: 0.375rem; + --radius-lg: 0.5rem; + --default-transition-duration: 150ms; + --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + --default-font-family: var(--font-sans); + --default-mono-font-family: var(--font-mono); + } +} +@layer base { + *, ::after, ::before, ::backdrop, ::file-selector-button { + box-sizing: border-box; + margin: 0; + padding: 0; + border: 0 solid; + } + html, :host { + line-height: 1.5; + -webkit-text-size-adjust: 100%; + tab-size: 4; + font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); + font-feature-settings: var(--default-font-feature-settings, normal); + font-variation-settings: var(--default-font-variation-settings, normal); + -webkit-tap-highlight-color: transparent; + } + hr { + height: 0; + color: inherit; + border-top-width: 1px; + } + abbr:where([title]) { + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; + } + h1, h2, h3, h4, h5, h6 { + font-size: inherit; + font-weight: inherit; + } + a { + color: inherit; + -webkit-text-decoration: inherit; + text-decoration: inherit; + } + b, strong { + font-weight: bolder; + } + code, kbd, samp, pre { + font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace); + font-feature-settings: var(--default-mono-font-feature-settings, normal); + font-variation-settings: var(--default-mono-font-variation-settings, normal); + font-size: 1em; + } + small { + font-size: 80%; + } + sub, sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; + } + sub { + bottom: -0.25em; + } + sup { + top: -0.5em; + } + table { + text-indent: 0; + border-color: inherit; + border-collapse: collapse; + } + :-moz-focusring { + outline: auto; + } + progress { + vertical-align: baseline; + } + summary { + display: list-item; + } + ol, ul, menu { + list-style: none; + } + img, svg, video, canvas, audio, iframe, embed, object { + display: block; + vertical-align: middle; + } + img, video { + max-width: 100%; + height: auto; + } + button, input, select, optgroup, textarea, ::file-selector-button { + font: inherit; + font-feature-settings: inherit; + font-variation-settings: inherit; + letter-spacing: inherit; + color: inherit; + border-radius: 0; + background-color: transparent; + opacity: 1; + } + :where(select:is([multiple], [size])) optgroup { + font-weight: bolder; + } + :where(select:is([multiple], [size])) optgroup option { + padding-inline-start: 20px; + } + ::file-selector-button { + margin-inline-end: 4px; + } + ::placeholder { + opacity: 1; + } + @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) { + ::placeholder { + color: currentcolor; + @supports (color: color-mix(in lab, red, red)) { + color: color-mix(in oklab, currentcolor 50%, transparent); + } + } + } + textarea { + resize: vertical; + } + ::-webkit-search-decoration { + -webkit-appearance: none; + } + ::-webkit-date-and-time-value { + min-height: 1lh; + text-align: inherit; + } + ::-webkit-datetime-edit { + display: inline-flex; + } + ::-webkit-datetime-edit-fields-wrapper { + padding: 0; + } + ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field { + padding-block: 0; + } + ::-webkit-calendar-picker-indicator { + line-height: 1; + } + :-moz-ui-invalid { + box-shadow: none; + } + button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button { + appearance: button; + } + ::-webkit-inner-spin-button, ::-webkit-outer-spin-button { + height: auto; + } + [hidden]:where(:not([hidden="until-found"])) { + display: none !important; + } +} +@layer utilities { + .visible { + visibility: visible; + } + .absolute { + position: absolute; + } + .fixed { + position: fixed; + } + .static { + position: static; + } + .container { + width: 100%; + @media (width >= 40rem) { + max-width: 40rem; + } + @media (width >= 48rem) { + max-width: 48rem; + } + @media (width >= 64rem) { + max-width: 64rem; + } + @media (width >= 80rem) { + max-width: 80rem; + } + @media (width >= 96rem) { + max-width: 96rem; + } + } + .mt-4 { + margin-top: calc(var(--spacing) * 4); + } + .mt-6 { + margin-top: calc(var(--spacing) * 6); + } + .mt-8 { + margin-top: calc(var(--spacing) * 8); + } + .mb-4 { + margin-bottom: calc(var(--spacing) * 4); + } + .mb-6 { + margin-bottom: calc(var(--spacing) * 6); + } + .ml-2 { + margin-left: calc(var(--spacing) * 2); + } + .contents { + display: contents; + } + .flex { + display: flex; + } + .grid { + display: grid; + } + .inline { + display: inline; + } + .inline-block { + display: inline-block; + } + .table { + display: table; + } + .table-row { + display: table-row; + } + .w-20 { + width: calc(var(--spacing) * 20); + } + .w-40 { + width: calc(var(--spacing) * 40); + } + .w-48 { + width: calc(var(--spacing) * 48); + } + .w-50 { + width: calc(var(--spacing) * 50); + } + .w-64 { + width: calc(var(--spacing) * 64); + } + .w-\[40\%\] { + width: 40%; + } + .w-\[90px\] { + width: 90px; + } + .flex-1 { + flex: 1; + } + .border-collapse { + border-collapse: collapse; + } + .resize { + resize: both; + } + .grid-cols-4 { + grid-template-columns: repeat(4, minmax(0, 1fr)); + } + .flex-col { + flex-direction: column; + } + .items-center { + align-items: center; + } + .justify-between { + justify-content: space-between; + } + .justify-center { + justify-content: center; + } + .gap-2 { + gap: calc(var(--spacing) * 2); + } + .gap-3 { + gap: calc(var(--spacing) * 3); + } + .divide-y { + :where(& > :not(:last-child)) { + --tw-divide-y-reverse: 0; + border-bottom-style: var(--tw-border-style); + border-top-style: var(--tw-border-style); + border-top-width: calc(1px * var(--tw-divide-y-reverse)); + border-bottom-width: calc(1px * calc(1 - var(--tw-divide-y-reverse))); + } + } + .divide-gray-200 { + :where(& > :not(:last-child)) { + border-color: var(--color-gray-200); + } + } + .rounded-lg { + border-radius: var(--radius-lg); + } + .rounded-md { + border-radius: var(--radius-md); + } + .border { + border-style: var(--tw-border-style); + border-width: 1px; + } + .border-b { + border-bottom-style: var(--tw-border-style); + border-bottom-width: 1px; + } + .border-\[\#E0E0E0\] { + border-color: #E0E0E0; + } + .border-\[\#EAEAEA\] { + border-color: #EAEAEA; + } + .border-gray-300 { + border-color: var(--color-gray-300); + } + .bg-\[\#B7E1FF\] { + background-color: #B7E1FF; + } + .bg-\[\#F5F7FA\] { + background-color: #F5F7FA; + } + .bg-\[\#FAFAFA\] { + background-color: #FAFAFA; + } + .bg-blue-600 { + background-color: var(--color-blue-600); + } + .bg-gray-100 { + background-color: var(--color-gray-100); + } + .bg-green-600 { + background-color: var(--color-green-600); + } + .bg-red-500 { + background-color: var(--color-red-500); + } + .bg-yellow-400 { + background-color: var(--color-yellow-400); + } + .px-1 { + padding-inline: calc(var(--spacing) * 1); + } + .px-2 { + padding-inline: calc(var(--spacing) * 2); + } + .px-3 { + padding-inline: calc(var(--spacing) * 3); + } + .px-4 { + padding-inline: calc(var(--spacing) * 4); + } + .py-1 { + padding-block: calc(var(--spacing) * 1); + } + .py-1\.5 { + padding-block: calc(var(--spacing) * 1.5); + } + .py-2 { + padding-block: calc(var(--spacing) * 2); + } + .py-3 { + padding-block: calc(var(--spacing) * 3); + } + .text-center { + text-align: center; + } + .font-sans { + font-family: var(--font-sans); + } + .font-serif { + font-family: var(--font-serif); + } + .text-4xl { + font-size: var(--text-4xl); + line-height: var(--tw-leading, var(--text-4xl--line-height)); + } + .text-base { + font-size: var(--text-base); + line-height: var(--tw-leading, var(--text-base--line-height)); + } + .text-sm { + font-size: var(--text-sm); + line-height: var(--tw-leading, var(--text-sm--line-height)); + } + .font-bold { + --tw-font-weight: var(--font-weight-bold); + font-weight: var(--font-weight-bold); + } + .font-extralight { + --tw-font-weight: var(--font-weight-extralight); + font-weight: var(--font-weight-extralight); + } + .font-medium { + --tw-font-weight: var(--font-weight-medium); + font-weight: var(--font-weight-medium); + } + .font-normal { + --tw-font-weight: var(--font-weight-normal); + font-weight: var(--font-weight-normal); + } + .font-semibold { + --tw-font-weight: var(--font-weight-semibold); + font-weight: var(--font-weight-semibold); + } + .text-\[\#0F0F0F\] { + color: #0F0F0F; + } + .text-\[\#A51010\] { + color: #A51010; + } + .text-black { + color: var(--color-black); + } + .text-blue-600 { + color: var(--color-blue-600); + } + .text-gray-500 { + color: var(--color-gray-500); + } + .text-gray-600 { + color: var(--color-gray-600); + } + .text-gray-700 { + color: var(--color-gray-700); + } + .text-gray-800 { + color: var(--color-gray-800); + } + .text-red-600 { + color: var(--color-red-600); + } + .text-white { + color: var(--color-white); + } + .font-stretch-95\% { + font-stretch: 95%; + } + .font-stretch-100\% { + font-stretch: 100%; + } + .underline { + text-decoration-line: underline; + } + .shadow-\[1px_1px_1px_rgba\(0\,0\,0\,0\.2\)\] { + --tw-shadow: 1px 1px 1px var(--tw-shadow-color, rgba(0,0,0,0.2)); + box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); + } + .shadow-sm { + --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)); + box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); + } + .outline { + outline-style: var(--tw-outline-style); + outline-width: 1px; + } + .transition { + transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events; + transition-timing-function: var(--tw-ease, var(--default-transition-timing-function)); + transition-duration: var(--tw-duration, var(--default-transition-duration)); + } + .hover\:bg-\[\#F6FAFE\] { + &:hover { + @media (hover: hover) { + background-color: #F6FAFE; + } + } + } + .hover\:bg-blue-700 { + &:hover { + @media (hover: hover) { + background-color: var(--color-blue-700); + } + } + } + .hover\:bg-gray-50 { + &:hover { + @media (hover: hover) { + background-color: var(--color-gray-50); + } + } + } + .hover\:bg-green-700 { + &:hover { + @media (hover: hover) { + background-color: var(--color-green-700); + } + } + } + .hover\:bg-red-600 { + &:hover { + @media (hover: hover) { + background-color: var(--color-red-600); + } + } + } + .hover\:bg-yellow-500 { + &:hover { + @media (hover: hover) { + background-color: var(--color-yellow-500); + } + } + } + .hover\:text-blue-800 { + &:hover { + @media (hover: hover) { + color: var(--color-blue-800); + } + } + } + .focus\:border-blue-500 { + &:focus { + border-color: var(--color-blue-500); + } + } + .focus\:ring-2 { + &:focus { + --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor); + box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); + } + } + .focus\:ring-blue-500 { + &:focus { + --tw-ring-color: var(--color-blue-500); + } + } + .focus\:outline-none { + &:focus { + --tw-outline-style: none; + outline-style: none; + } + } +} +@property --tw-divide-y-reverse { + syntax: "*"; + inherits: false; + initial-value: 0; +} +@property --tw-border-style { + syntax: "*"; + inherits: false; + initial-value: solid; +} +@property --tw-font-weight { + syntax: "*"; + inherits: false; +} +@property --tw-shadow { + syntax: "*"; + inherits: false; + initial-value: 0 0 #0000; +} +@property --tw-shadow-color { + syntax: "*"; + inherits: false; +} +@property --tw-shadow-alpha { + syntax: ""; + inherits: false; + initial-value: 100%; +} +@property --tw-inset-shadow { + syntax: "*"; + inherits: false; + initial-value: 0 0 #0000; +} +@property --tw-inset-shadow-color { + syntax: "*"; + inherits: false; +} +@property --tw-inset-shadow-alpha { + syntax: ""; + inherits: false; + initial-value: 100%; +} +@property --tw-ring-color { + syntax: "*"; + inherits: false; +} +@property --tw-ring-shadow { + syntax: "*"; + inherits: false; + initial-value: 0 0 #0000; +} +@property --tw-inset-ring-color { + syntax: "*"; + inherits: false; +} +@property --tw-inset-ring-shadow { + syntax: "*"; + inherits: false; + initial-value: 0 0 #0000; +} +@property --tw-ring-inset { + syntax: "*"; + inherits: false; +} +@property --tw-ring-offset-width { + syntax: ""; + inherits: false; + initial-value: 0px; +} +@property --tw-ring-offset-color { + syntax: "*"; + inherits: false; + initial-value: #fff; +} +@property --tw-ring-offset-shadow { + syntax: "*"; + inherits: false; + initial-value: 0 0 #0000; +} +@property --tw-outline-style { + syntax: "*"; + inherits: false; + initial-value: solid; +} +@layer properties { + @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) { + *, ::before, ::after, ::backdrop { + --tw-divide-y-reverse: 0; + --tw-border-style: solid; + --tw-font-weight: initial; + --tw-shadow: 0 0 #0000; + --tw-shadow-color: initial; + --tw-shadow-alpha: 100%; + --tw-inset-shadow: 0 0 #0000; + --tw-inset-shadow-color: initial; + --tw-inset-shadow-alpha: 100%; + --tw-ring-color: initial; + --tw-ring-shadow: 0 0 #0000; + --tw-inset-ring-color: initial; + --tw-inset-ring-shadow: 0 0 #0000; + --tw-ring-inset: initial; + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-offset-shadow: 0 0 #0000; + --tw-outline-style: solid; + } + } +} diff --git a/app/controllers/livres_controller.rb b/app/controllers/livres_controller.rb index 4bd8115..7972d92 100644 --- a/app/controllers/livres_controller.rb +++ b/app/controllers/livres_controller.rb @@ -22,6 +22,7 @@ class LivresController < ApplicationController def edit @livre = Livre.find(params[:id]) + render :form, layout: false end def update @@ -33,13 +34,14 @@ def update end end -def destroy -@livre = Livre.find(params[:id]) -@livre.destroy -redirect_to livres_path, notice: "Livre supprimé avec succès." +def destroy +@livre = Livre.find(params[:id]) +@livre.destroy +redirect_to livres_path, notice: "Livre supprimé avec succès." end private + def livre_params params.require(:livre).permit(:titre, :auteur, :date_de_sortie) end diff --git a/app/models/livre.rb b/app/models/livre.rb index a4b31c5..57878a9 100644 --- a/app/models/livre.rb +++ b/app/models/livre.rb @@ -1,3 +1,3 @@ class Livre < ApplicationRecord - validates :titre, :auteur, presence: true + validates :titre, :auteur, :date_de_sortie, presence: true end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 00a2fb4..3ce3d48 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -3,6 +3,9 @@ <%= content_for(:title) || "Bibliotheque" %> + + ... + diff --git a/app/views/livres/_form.html.erb b/app/views/livres/_form.html.erb deleted file mode 100644 index ca3af93..0000000 --- a/app/views/livres/_form.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<%= form_with(model: @livre, local: true) do |form| %> -
- <%= form.label :titre %>
- <%= form.text_field :titre %> -
- -
- <%= form.label :auteur %>
- <%= form.text_field :auteur %> -
- -
- <%= form.label :date_de_sortie %>
- <%= form.date_field :date_de_sortie %> -
- -
- <%= form.submit "Modifier le livre" %> - -
-<% end %> - -> diff --git a/app/views/livres/_ligne.html.erb b/app/views/livres/_ligne.html.erb new file mode 100644 index 0000000..5ae93d7 --- /dev/null +++ b/app/views/livres/_ligne.html.erb @@ -0,0 +1,19 @@ + +
+
<%= livre.titre %>
+
<%= livre.auteur %>
+
<%= livre.date_de_sortie %>
+ + +
+ <%= link_to "Modifier", edit_livre_path(livre), + data: { turbo_frame: "livre_#{livre.id}" }, + class: "shadow-[1px_1px_1px_rgba(0,0,0,0.2)] bg-[#B7E1FF] text-[#0F0F0F] px-3 py-1 rounded-md text-sm hover:bg-[#F6FAFE] transition w-[90px] text-center" %> + + + <%= button_to "Supprimer", livre_path(livre), method: :delete, + data: { confirm: "Supprimer ce livre ?" }, + class: "shadow-[1px_1px_1px_rgba(0,0,0,0.2)] bg-[#B7E1FF] text-[#0F0F0F] px-3 py-1 rounded-md text-sm hover:bg-[#F6FAFE] transition w-[90px] text-center" %> +
+
+
diff --git a/app/views/livres/edit.html.erb b/app/views/livres/edit.html.erb index e1f5864..61d4c9d 100644 --- a/app/views/livres/edit.html.erb +++ b/app/views/livres/edit.html.erb @@ -1,3 +1,10 @@ -

Modifier le livre

+

+ Modifier le livre +

<%= render 'form', livre: @livre %> + +

+ <%= link_to "Retour au catalogue", livres_path, + class: "text-black underline text-sm hover:text-blue-800 transition" %> +

diff --git a/app/views/livres/form.html.erb b/app/views/livres/form.html.erb new file mode 100644 index 0000000..c45d27a --- /dev/null +++ b/app/views/livres/form.html.erb @@ -0,0 +1,10 @@ + + <%= form_with model: @livre, url: livre_path(@livre), method: :patch do |form| %> +
+
<%= form.text_field :titre %>
+
<%= form.text_field :auteur %>
+
<%= form.date_field :date_de_sortie %>
+
<%= form.submit "Enregistrer", class: "btn" %>
+
+ <% end %> +
diff --git a/app/views/livres/index.html.erb b/app/views/livres/index.html.erb index f0c1790..0eec791 100644 --- a/app/views/livres/index.html.erb +++ b/app/views/livres/index.html.erb @@ -1,29 +1,63 @@ -

Catalogue de la bibliothèque

-<%= form_with url: livres_path, method: :get, local: true do %> -

- Rechercher un livre : - <%= text_field_tag :query, params[:query] %> - <%= submit_tag "Rechercher" %> -

-<% end %> -

Nombre total de livres : <%= @livres.count %>

-
-
-
Titre
-
Auteur
-
Date de sortie
-
Actions
+ +

+catalogue de la bibliothèque +

+ +
+ <%= form_with url: livres_path, method: :get, local: true do %> +
+ + + <%= text_field_tag :query, params[:query], + placeholder: "Rechercher un livre...", + class: "border border-gray-300 rounded-md px-3 py-1.5 w-48 focus:outline-none focus:ring-2 focus:ring-blue-500 transition text-sm" %> + + <%= submit_tag "Rechercher", + class: "bg-blue-600 text-white px-4 py-1.5 rounded-md hover:bg-blue-700 transition shadow-sm text-sm" %> +
+ <% end %> +
+ + +

+ Nombre total de livres : <%= @livres.count %> +

+ +
+
+
Titre
+
Auteur
+
Date de sortie
+
Actions
+ <% @livres.each do |livre| %> -
-
<%= livre.titre %>
-
<%= livre.auteur %>
-
<%= livre.date_de_sortie %>
-
- <%= link_to "Modifier", edit_livre_path(livre), class: "btn" %> - <%= button_to "Supprimer", livre_path(livre), method: :delete, data: { confirm: "Supprimer ce livre ?" }, class: "btn" %> + +
+
<%= livre.titre %>
+
<%= livre.auteur %>
+
<%= livre.date_de_sortie %>
+ + +
+ <%= link_to "Modifier", edit_livre_path(livre), + data: { turbo_frame: "livre_#{livre.id}" }, + class: "shadow-[1px_1px_1px_rgba(0,0,0,0.2)] bg-[#B7E1FF] text-[#0F0F0F] px-3 py-1 rounded-md text-sm hover:bg-[#F6FAFE] transition w-[90px] text-center" %> + + + <%= button_to "Supprimer", livre_path(livre), method: :delete, + data: { confirm: "Supprimer ce livre ?" }, + class: "shadow-[1px_1px_1px_rgba(0,0,0,0.2)] bg-[#B7E1FF] text-[#0F0F0F] px-3 py-1 rounded-md text-sm hover:bg-[#F6FAFE] transition w-[90px] text-center" %>
+
<% end %>
-

<%= link_to "Ajouter un nouveau livre", new_livre_path %>

+ + +

+ <%= link_to "Ajouter un nouveau livre", new_livre_path, + class: "text-black underline text-sm hover:text-blue-800 transition" %> +

diff --git a/app/views/livres/new.html.erb b/app/views/livres/new.html.erb index 0b7cf1f..10f602d 100644 --- a/app/views/livres/new.html.erb +++ b/app/views/livres/new.html.erb @@ -20,4 +20,4 @@ <%= form.submit "Créer le livre" %> <% end %> -

<%= link_to "← Retour à la liste", livres_path %>

+

<%= link_to "← Retour au catalogue", livres_path %>

diff --git a/config/routes.rb b/config/routes.rb index a7f4a3f..946212b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,5 @@ Rails.application.routes.draw do - resources :livres, only: [:index, :new, :create, :destroy, :edit, :update] + resources :livres, only: [ :index, :new, :create, :destroy, :edit, :update ] root "livres#index" diff --git a/package-lock.json b/package-lock.json index ad629fd..3363043 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,8 +11,7 @@ "dependencies": { "@tailwindcss/cli": "^4.1.18", "tailwindcss": "^4.1.18" - }, - "devDependencies": {} + } }, "node_modules/@parcel/watcher": { "version": "2.5.6",