]> git.localhorst.tv Git - alttp.git/commitdiff
sticky schedule group headings
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 22 Feb 2023 15:49:12 +0000 (16:49 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Wed, 22 Feb 2023 15:49:12 +0000 (16:49 +0100)
resources/js/components/episodes/List.js
resources/sass/episodes.scss

index a28fa4848968b9e2fa2a455cec44c55b7b74a8c9..6f46e75add208811a83362e9521fb041ca4ab5bd 100644 (file)
@@ -18,7 +18,9 @@ const List = ({ episodes, onAddRestream, onEditRestream }) => {
 
        return <div className="episodes-list">
                {Object.entries(grouped).map(([day, group]) => <div key={day}>
-                       <h2 className="text-center my-5">{moment(day).format('dddd, L')}</h2>
+                       <h2 className="text-center episodes-group-heading">
+                               {moment(day).format('dddd, L')}
+                       </h2>
                        {group.map(episode =>
                                <Item
                                        episode={episode}
index d4d686b6950241615b10a587686f26e3517d63bb..33722576817344250a27a469df59fb66034894f0 100644 (file)
@@ -1,3 +1,13 @@
+.episodes-group-heading {
+       position: sticky;
+       top: 0;
+       margin: 2rem 0 0 0;
+       padding: 1rem 0 3rem 0;
+       background: $body-bg;
+       background: linear-gradient(180deg, $body-bg, $body-bg 65%, transparent);
+       z-index: 1;
+}
+
 .episodes-item {
        &.is-active {
                border-color: $success !important;