Skip to content

Commit 19979cf

Browse files
amCap1712MonkeyDoanshg1214
authored
YIM 2024 (#3105)
* YIM: Set up 2024 routes * YIM: Create YIM '24 page * Add gallery at the bottom will be used for cover art composites, putting top albums as a placeholder * YIM: update images * YIM: tweak cover art mosaic gallery * Fix get_listens_from_dump invocation * fix top discoveries and allow 2024 in api call * YIM: Add generated SVGs for 2024 still needs some tweaks, but setting everything in place * YIM: fix buddies images * YIM: continue work on generated SVG images * YIM: Update Canvg library * YIM: misc fixes * YIM: Add season name to loaded SVGs They're customized by season! * YIM: add cover art mosaics gallery * YIM: Add season selection icons + fix lazy loading * Revert update of Canvg package Having a build error after the minor update. Don't have time or headspace to fix now, and update is not required. Do the de-volution ! * YIM: Fix SVGs styles * YIM: Fix playlist svgs * YIM: Fix mosaics fetch * YIM: Fix mosaic images size * YIM: update colors * YIM: add header image * feat: Add Genre Graph * chore: Install @nivo/treemap * feat: Display TreeMap for genre data * format: PEP8 - Lint SQL Query * feat: Improve wordings * Update YearInMusic2024.tsx * YIM24: rework SVG images sasving the SVG as PNG does not support blend modes, so we do some modifications to simplify our lives * YIM: continue fixing SVG images * YIM: remove blend mode from SVG background images * YIM: Guess what? more SVG fixes * YIM: more SVG tweaks * format: Lint YIM CSS * feat: Use the season text colors for treemap graph * feat: Hide Follow button on own YIM page * Fix & escaping in YIM coverart templates * YIM: limit mosaic image size They get just too big * YIM: fix image folder path * Update YIM email templates * YIM: max width for mosaic gallery images they get toobig otherwise and you lose some of the mosaic effect from not seeing the whole image at once. Users can click the images to open them full size in their browser anyway to get a closer look, let the browser handle zooming and panning. * YIM: Fix email max size I was seeing a weird bug in the MacOS email client ("Mail" *rolls eyes*) with image centering/size, and I think this should fix it Left the simpler `max-width: 600px` declaration as a fallback just in case because I know HTML clients' CSS support leaves to be desired. * YIM: Load Inter font earlier for SVG rendering Otherwise when saving or sharing the image the font is not rendered and the default one is used * YIM: Tweak templates Fix some issue with rendering the SVGs to canvas because of nested title elements. Also fixes LB-1675 where links in the SVG are relative and point to non-existing pages on api.LB that should point to LB. Even better would be to detect beta-api.LB and test-api.LB and point to beta.LB and test.LB respectively. * YIM: Define width and height for all images in SVG templates Otherwise CanVG freaks out and placement of images is all wrong or they are not appearing at all. * YIM: more SVG templates tweaks * YIM: Transparent color for treemap root element Otherwise it darkens all the other colors * YIM template: force text color * Update email templates according to feedback * refactor: Lint files * refactor: Cleanup * fix: Tests --------- Co-authored-by: Monkey Do <[email protected]> Co-authored-by: anshg1214 <[email protected]>
2 parents 6f1615a + cd65128 commit 19979cf

File tree

120 files changed

+3072
-127
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+3072
-127
lines changed

frontend/css/explore.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
opacity: 0.5;
4040
background: linear-gradient(
4141
0.36deg,
42-
rgba(53, 48, 112, 0.8) 0.42%,
42+
rgba(53, 48, 112, 0.6) 0.42%,
4343
rgba(53, 48, 112, 0.1) 99.8%
4444
);
4545
z-index: 10;

frontend/css/year-in-music.less

+84-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@import "/node_modules/swiper/swiper.less";
33
@import "/node_modules/swiper/modules/navigation/navigation.less";
44
@import "/node_modules/swiper/modules/effect-coverflow/effect-coverflow.less";
5+
@import "/node_modules/swiper/modules/effect-cube/effect-cube.less";
56

67
/* latin */
78
@font-face {
@@ -112,8 +113,7 @@
112113
}
113114
}
114115
}
115-
116-
.swiper {
116+
#top-albums .swiper {
117117
width: 100%;
118118
perspective: 900px;
119119
background-color: whitesmoke;
@@ -194,6 +194,7 @@
194194
}
195195

196196
&.yim-2022,
197+
&.yim-2024,
197198
&.yim-2023 {
198199
--swiper-theme-color: @2022red;
199200
/* Main header section at the top with logo */
@@ -409,7 +410,8 @@
409410
box-shadow: inset 0px 11px 8px -10px #ccc;
410411
}
411412
}
412-
&.yim-2023 {
413+
&.yim-2023,
414+
&.yim-2024 {
413415
--selectedColor: #4c6c52;
414416
--swiper-navigation-color: var(--selectedColor);
415417
@cream: #f0eee2;
@@ -646,4 +648,83 @@
646648
}
647649
}
648650
}
651+
&.yim-2024 {
652+
--backgroundColor: #4c6c52;
653+
--cardBackgroundColor: #fefff5;
654+
--accentColor: #2b9f7a;
655+
--selectedColor: var(--accentColor);
656+
--swiper-navigation-color: var(--accentColor);
657+
@text-color: var(--accentColor);
658+
@content-background-color: var(--cardBackgroundColor);
659+
background-color: var(--backgroundColor);
660+
color: @text-color;
661+
.content-card {
662+
background: @content-background-color;
663+
color: @text-color;
664+
.heading,
665+
.small-stat {
666+
color: inherit;
667+
}
668+
.heading {
669+
aspect-ratio: unset;
670+
h3,
671+
h4 {
672+
margin: 0;
673+
}
674+
}
675+
.img-header {
676+
mix-blend-mode: multiply;
677+
}
678+
}
679+
.small-stat {
680+
font-weight: 300;
681+
}
682+
.scrollable-area::after {
683+
background: linear-gradient(
684+
0deg,
685+
var(--cardBackgroundColor),
686+
transparent
687+
);
688+
}
689+
.btn-info,
690+
.yim-share-button {
691+
background-color: var(--accentColor);
692+
}
693+
.color-picker {
694+
flex-wrap: wrap;
695+
gap: 2em;
696+
> div {
697+
&:first-of-type {
698+
width: 100%;
699+
font-weight: bold;
700+
font-size: larger;
701+
}
702+
text-align: center;
703+
text-align: -webkit-center;
704+
.color-selector {
705+
background: none;
706+
}
707+
}
708+
}
709+
.swiper,
710+
.graph-container {
711+
background-color: var(--backgroundColor);
712+
}
713+
.swiper-cube .swiper-slide {
714+
text-align: center;
715+
img {
716+
max-width: min(90vw, 90vh);
717+
}
718+
}
719+
#buddies .buddy .img-container img {
720+
width: 100%;
721+
mix-blend-mode: multiply;
722+
}
723+
#main-header .header-image {
724+
margin: 0;
725+
width: initial;
726+
mix-blend-mode: multiply;
727+
margin-inline: auto;
728+
}
729+
}
649730
}
16.4 KB
23.1 KB

frontend/js/src/explore/Explore.tsx

+7-28
Original file line numberDiff line numberDiff line change
@@ -105,34 +105,13 @@ export default function ExplorePage() {
105105
<hr />
106106
</div>
107107
<div className="row">
108-
<div className="explore-card-container">
109-
<div className="explore-card">
110-
<div
111-
className="explore-card-img-overlay"
112-
style={{ mixBlendMode: "difference" }}
113-
>
114-
{" "}
115-
</div>
116-
<div className="explore-card-img-clip flex-center">
117-
<div
118-
style={{
119-
fontSize: "6em",
120-
fontWeight: "bold",
121-
fontFamily: "Roboto",
122-
transform: "rotate(-8deg)",
123-
color: COLOR_LB_ORANGE,
124-
}}
125-
>
126-
2024
127-
</div>
128-
</div>
129-
<div className="explore-card-text">
130-
<div className="explore-card-text-name">
131-
Your Year in Music 2024
132-
</div>
133-
<div>Coming Soon</div>
134-
</div>
135-
</div>
108+
<div>
109+
<ExploreCard
110+
name="Your Year in Music 2024"
111+
desc="Review"
112+
img_name="year-in-music-2024.png"
113+
url={`/user/${currentUser.name}/year-in-music/2024/`}
114+
/>
136115
</div>
137116
<div>
138117
<ExploreCard

frontend/js/src/explore/layout.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ const links: NavbarLink[] = [
1313
{ to: "similar-users/", label: "Similar Users" },
1414
{ to: "lb-radio/", label: "LB Radio" },
1515
{ to: "art-creator/", label: "Art Creator" },
16+
{ to: "year-in-music/2024/", label: "Year in Music 2024" },
1617
{ to: "year-in-music/2023/", label: "Year in Music 2023" },
1718
{ to: "year-in-music/2022/", label: "Year in Music 2022" },
1819
{ to: "year-in-music/2021/", label: "Year in Music 2021" },
19-
{ to: "year-in-music/", label: "Year in Music 2023" },
20+
{ to: "year-in-music/", label: "Year in Music 2024" },
2021
{ to: "ai-brainz/", label: "AI Brainz" },
2122
];
2223

frontend/js/src/settings/link-listens/MultiTrackMBIDMappingModal.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ export default NiceModal.create(
300300
matchingTracks && Object.entries(matchingTracks);
301301
const hasMatches = Boolean(matchingTracksEntries?.length);
302302
const unmatchedItems =
303-
unlinkedListens.filter((md) => !matchingTracks?.[md.recording_msid]) ?? [];
303+
unlinkedListens.filter((md) => !matchingTracks?.[md.recording_msid]) ??
304+
[];
304305

305306
// We may need to escape or replace the Lucene search special characters
306307
// + - && || ! ( ) { } [ ] ^ " ~ * ? : \ / as described in

frontend/js/src/user/routes/userRoutes.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,17 @@ const getUserRoutes = (): RouteObject[] => {
127127
children: [
128128
{
129129
index: true,
130+
element: <Navigate to="./2024" replace />,
131+
},
132+
{
133+
path: "2024/",
130134
lazy: async () => {
131-
const YearInMusic2023 = await import(
132-
"../year-in-music/2023/YearInMusic2023"
135+
const YearInMusic2024 = await import(
136+
"../year-in-music/2024/YearInMusic2024"
133137
);
134-
return { Component: YearInMusic2023.YearInMusicWrapper };
138+
return { Component: YearInMusic2024.YearInMusicWrapper };
135139
},
136-
loader: RouteQueryLoader("year-in-music-2023"),
140+
loader: RouteQueryLoader("year-in-music-2024"),
137141
},
138142
{
139143
path: "2023/",

frontend/js/src/user/year-in-music/2021/YearInMusic2021.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ export default class YearInMusic extends React.Component<
491491
</div>
492492

493493
{yearInMusicData.top_releases ? (
494-
<div id="releases-coverflow">
494+
<div id="top-albums">
495495
<Swiper
496496
modules={[Navigation, Keyboard, EffectCoverflow]}
497497
spaceBetween={15}

0 commit comments

Comments
 (0)