From 51bfa2cb88dd5c29f80bb8f9aa9d724d33a87d45 Mon Sep 17 00:00:00 2001 From: hedy Date: Sat, 20 Jan 2024 14:27:42 +0800 Subject: Events: Initial redesign - Added standalone pages for each event - Added initial design of new layout - Refactored some sidebars and templates to update current/upcoming event - Put two CJ10 assets into their own dedicated folder Includes dummy text for event descriptions and content that is not up-to-date: Current and Upcoming event components. --- pydis_site/static/css/events/base.css | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'pydis_site/static/css') diff --git a/pydis_site/static/css/events/base.css b/pydis_site/static/css/events/base.css index 9e244ed9..3708bd57 100644 --- a/pydis_site/static/css/events/base.css +++ b/pydis_site/static/css/events/base.css @@ -12,9 +12,14 @@ pre { } .panel .panel-heading { - /* - * Remove whitespace between the panel heading and the first item in a panel, - * since it makes the first panel item taller than the others. - */ - margin-bottom: 0 !important + /* + * Remove whitespace between the panel heading and the first item in a panel, + * since it makes the first panel item taller than the others. + */ + margin-bottom: 0 !important +} + +.event-gallery img { + border-radius: 10px; + max-width: 50%; } -- cgit v1.2.3 From 117ead56d30173987ae79fde09ec821fd2d05f4e Mon Sep 17 00:00:00 2001 From: hedy Date: Sun, 21 Jan 2024 18:11:41 +0800 Subject: Events: Use Masonry layout for gallery of events --- pydis_site/static/css/events/base.css | 65 ++++++++++++++++++++++++++ pydis_site/templates/events/index.html | 84 +++++++++++++--------------------- 2 files changed, 98 insertions(+), 51 deletions(-) (limited to 'pydis_site/static/css') diff --git a/pydis_site/static/css/events/base.css b/pydis_site/static/css/events/base.css index 3708bd57..b5cd69a3 100644 --- a/pydis_site/static/css/events/base.css +++ b/pydis_site/static/css/events/base.css @@ -23,3 +23,68 @@ pre { border-radius: 10px; max-width: 50%; } + +/* CSS-only Masonry layout: + * https://tobiasahlin.com/blog/masonry-with-css/ + * + * Adapted for responsiveness: + * - Mobile (<=700px) No columns at all + * - Tablets (700~900px) Two columns Masonry + * - Desktop+ (>=900px) Three columns Masonry + */ +@media (min-width: 700px) { + .event-gallery { + display: flex; + flex-flow: column wrap; + align-content: space-between; + } + + @media (min-width: 900px) { + /* 3 columns */ + .event-gallery { + /* Required. Must be only slightly taller than the tallest column */ + height: 60rem; + } + + .event-gallery .box { + width: calc(33% - 1rem); + margin-bottom: 1rem; + } + + /* Reorder vertically */ + .event-gallery .box:nth-child(3n+1) { order: 1; } + .event-gallery .box:nth-child(3n+2) { order: 2; } + .event-gallery .box:nth-child(3n) { order: 3; } + + /* 2 line breaks to force new columns, for each gap between the three columns. */ + .event-gallery::before, .event-gallery::after { + content: ""; + flex-basis: 100%; + width: 0; + order: 2; + } + } + + @media (max-width: 900px) { + /* 2 columns */ + .event-gallery { + height: 80rem; + } + + .event-gallery .box { + width: calc(50% - 1rem); + margin-bottom: 1rem; + } + + .event-gallery .box:nth-child(2n+1) { order: 1; } + .event-gallery .box:nth-child(2n) { order: 2; } + + /* 1 line break to force a new column, for the gap between the two columns. */ + .event-gallery::before { + content: ""; + flex-basis: 100%; + width: 0; + order: 1; + } + } +} diff --git a/pydis_site/templates/events/index.html b/pydis_site/templates/events/index.html index 85278499..5ed3c61c 100644 --- a/pydis_site/templates/events/index.html +++ b/pydis_site/templates/events/index.html @@ -45,66 +45,48 @@

All events

-