From 9af4c79947c8a4195a85caf994b6e55c88ee6fda Mon Sep 17 00:00:00 2001 From: Lukas Kucharczyk Date: Mon, 19 Aug 2024 21:58:43 +0200 Subject: [PATCH] improve game view --- games/static/base.css | 93 ++++++++++-- games/templates/components.yml | 1 + games/templates/components/h1.html | 8 ++ games/templates/components/simple_table.html | 2 +- games/templates/view_game.html | 108 ++------------ games/views/game.py | 140 ++++++++++++++++++- 6 files changed, 237 insertions(+), 115 deletions(-) create mode 100644 games/templates/components/h1.html diff --git a/games/static/base.css b/games/static/base.css index ef56f73..ba8af4f 100644 --- a/games/static/base.css +++ b/games/static/base.css @@ -1390,6 +1390,10 @@ input:checked + .toggle-bg { margin-bottom: 2rem; } +.me-2 { + margin-inline-end: 0.5rem; +} + .ml-1 { margin-left: 0.25rem; } @@ -1402,6 +1406,10 @@ input:checked + .toggle-bg { margin-inline-start: 0px; } +.ms-2 { + margin-inline-start: 0.5rem; +} + .ms-2\.5 { margin-inline-start: 0.625rem; } @@ -1414,6 +1422,14 @@ input:checked + .toggle-bg { margin-top: 1rem; } +.mb-5 { + margin-bottom: 1.25rem; +} + +.mb-6 { + margin-bottom: 1.5rem; +} + .block { display: block; } @@ -1826,6 +1842,11 @@ input:checked + .toggle-bg { border-color: rgb(220 215 254 / var(--tw-border-opacity)); } +.bg-blue-100 { + --tw-bg-opacity: 1; + background-color: rgb(225 239 254 / var(--tw-bg-opacity)); +} + .bg-blue-700 { --tw-bg-opacity: 1; background-color: rgb(26 86 219 / var(--tw-bg-opacity)); @@ -1900,6 +1921,11 @@ input:checked + .toggle-bg { padding-right: 0.5rem; } +.px-2\.5 { + padding-left: 0.625rem; + padding-right: 0.625rem; +} + .px-3 { padding-left: 0.75rem; padding-right: 0.75rem; @@ -1920,6 +1946,11 @@ input:checked + .toggle-bg { padding-right: 1.5rem; } +.py-0\.5 { + padding-top: 0.125rem; + padding-bottom: 0.125rem; +} + .py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; @@ -1961,6 +1992,10 @@ input:checked + .toggle-bg { text-align: center; } +.text-right { + text-align: right; +} + .align-top { vertical-align: top; } @@ -2026,6 +2061,10 @@ input:checked + .toggle-bg { font-weight: 700; } +.font-extrabold { + font-weight: 800; +} + .font-medium { font-weight: 500; } @@ -2050,15 +2089,28 @@ input:checked + .toggle-bg { line-height: 2.25rem; } +.leading-none { + line-height: 1; +} + .leading-tight { line-height: 1.25; } +.tracking-tight { + letter-spacing: -0.025em; +} + .text-blue-600 { --tw-text-opacity: 1; color: rgb(28 100 242 / var(--tw-text-opacity)); } +.text-blue-800 { + --tw-text-opacity: 1; + color: rgb(30 66 159 / var(--tw-text-opacity)); +} + .text-gray-300 { --tw-text-opacity: 1; color: rgb(209 213 219 / var(--tw-text-opacity)); @@ -2718,6 +2770,11 @@ textarea:disabled:is(.dark *) { border-color: transparent; } +.dark\:bg-blue-200:is(.dark *) { + --tw-bg-opacity: 1; + background-color: rgb(195 221 253 / var(--tw-bg-opacity)); +} + .dark\:bg-blue-600:is(.dark *) { --tw-bg-opacity: 1; background-color: rgb(28 100 242 / var(--tw-bg-opacity)); @@ -2761,6 +2818,11 @@ textarea:disabled:is(.dark *) { color: rgb(63 131 248 / var(--tw-text-opacity)); } +.dark\:text-blue-800:is(.dark *) { + --tw-text-opacity: 1; + color: rgb(30 66 159 / var(--tw-text-opacity)); +} + .dark\:text-gray-200:is(.dark *) { --tw-text-opacity: 1; color: rgb(229 231 235 / var(--tw-text-opacity)); @@ -2876,6 +2938,11 @@ textarea:disabled:is(.dark *) { --tw-ring-color: rgb(63 131 248 / var(--tw-ring-opacity)); } +.dark\:focus\:ring-blue-800:focus:is(.dark *) { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(30 66 159 / var(--tw-ring-opacity)); +} + .dark\:focus\:ring-gray-600:focus:is(.dark *) { --tw-ring-opacity: 1; --tw-ring-color: rgb(75 85 99 / var(--tw-ring-opacity)); @@ -2887,10 +2954,6 @@ textarea:disabled:is(.dark *) { } @media (min-width: 640px) { - .sm\:inline { - display: inline; - } - .sm\:table-cell { display: table-cell; } @@ -2916,10 +2979,6 @@ textarea:disabled:is(.dark *) { padding-right: 1rem; } - .sm\:pl-12 { - padding-left: 3rem; - } - .sm\:pl-2 { padding-left: 0.5rem; } @@ -2928,10 +2987,6 @@ textarea:disabled:is(.dark *) { padding-left: 1rem; } - .sm\:pl-6 { - padding-left: 1.5rem; - } - .sm\:decoration-2 { text-decoration-thickness: 2px; } @@ -3003,6 +3058,11 @@ textarea:disabled:is(.dark *) { padding-bottom: 0.5rem; } + .md\:text-5xl { + font-size: 3rem; + line-height: 1; + } + .md\:text-blue-700 { --tw-text-opacity: 1; color: rgb(26 86 219 / var(--tw-text-opacity)); @@ -3053,6 +3113,11 @@ textarea:disabled:is(.dark *) { .lg\:max-w-lg { max-width: 32rem; } + + .lg\:text-6xl { + font-size: 3.75rem; + line-height: 1; + } } @media (min-width: 1536px) { @@ -3070,6 +3135,10 @@ textarea:disabled:is(.dark *) { --tw-space-x-reverse: 1; } +.rtl\:text-left:where([dir="rtl"], [dir="rtl"] *) { + text-align: left; +} + .rtl\:text-right:where([dir="rtl"], [dir="rtl"] *) { text-align: right; } diff --git a/games/templates/components.yml b/games/templates/components.yml index a9528a4..efe6bf9 100644 --- a/games/templates/components.yml +++ b/games/templates/components.yml @@ -7,3 +7,4 @@ components: simple_table: "components/simple_table.html" button_group_sm: "components/button_group_sm.html" button_group_button_sm: "components/button_group_button_sm.html" + h1: "components/h1.html" diff --git a/games/templates/components/h1.html b/games/templates/components/h1.html new file mode 100644 index 0000000..a532283 --- /dev/null +++ b/games/templates/components/h1.html @@ -0,0 +1,8 @@ +

+ {{ children }} + {% if badge %} + + {{ badge }} + + {% endif %} +

diff --git a/games/templates/components/simple_table.html b/games/templates/components/simple_table.html index 679f8ea..ab68ac2 100644 --- a/games/templates/components/simple_table.html +++ b/games/templates/components/simple_table.html @@ -13,7 +13,7 @@ - {% if page_obj %} + {% if page_obj and elided_page_range %}