Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media cards: Show waveform on podcast cards #13082

Open
wants to merge 9 commits into
base: jm/media-card-pills
Choose a base branch
from

Conversation

jamesmockett
Copy link
Contributor

@jamesmockett jamesmockett commented Jan 6, 2025

What does this change?

Displays a waveform at the bottom of podcast cards, behind all other content.

NB. The waveform is static and not based on the podcast's audio. The waveform SVG is 720px wide to accommodate different cards widths — it's possible this could be optimised and a repeating pattern used, although experiments with this resulted in gaps where the repetition occurred due to subpixel values in the source SVGs path.

Why?

To clearly distinguish audio content from video content in media cards.

Screenshots

Light Dark
light dark
Screenshot 2025-01-08 at 17 49 34 Screenshot 2025-01-08 at 17 52 19

@jamesmockett jamesmockett marked this pull request as ready for review January 6, 2025 18:09
@jamesmockett jamesmockett requested a review from a team as a code owner January 6, 2025 18:09
@jamesmockett jamesmockett self-assigned this Jan 6, 2025
Copy link

github-actions bot commented Jan 6, 2025

Hello 👋! When you're ready to run Chromatic, please apply the run_chromatic label to this PR.

You will need to reapply the label each time you want to run Chromatic.

Click here to see the Chromatic project.

Copy link

github-actions bot commented Jan 6, 2025

Size Change: +782 B (+0.09%)

Total Size: 892 kB

Filename Size Change
dotcom-rendering/dist/3453.client.web.********************.js 0 B -12.3 kB (removed) 🏆
dotcom-rendering/dist/4020.client.web.********************.js 13.1 kB +13.1 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
dotcom-rendering/dist/1076.client.web.********************.js 3.41 kB 0 B
dotcom-rendering/dist/1262.client.web.********************.js 4.49 kB 0 B
dotcom-rendering/dist/1301.client.web.********************.js 4.06 kB 0 B
dotcom-rendering/dist/1401.client.web.********************.js 441 B 0 B
dotcom-rendering/dist/1477.client.web.********************.js 3.52 kB 0 B
dotcom-rendering/dist/1714.client.web.********************.js 2.87 kB 0 B
dotcom-rendering/dist/1891.client.web.********************.js 3.83 kB 0 B
dotcom-rendering/dist/1908.client.web.********************.js 4.25 kB 0 B
dotcom-rendering/dist/2188.client.web.********************.js 6.21 kB +1 B (+0.02%)
dotcom-rendering/dist/2482.client.web.********************.js 44.8 kB 0 B
dotcom-rendering/dist/280.client.web.********************.js 531 B 0 B
dotcom-rendering/dist/3213.client.web.********************.js 5.42 kB 0 B
dotcom-rendering/dist/3366.client.web.********************.js 2.19 kB 0 B
dotcom-rendering/dist/342.client.web.********************.js 4.18 kB 0 B
dotcom-rendering/dist/3473.client.web.********************.js 3.74 kB 0 B
dotcom-rendering/dist/3769.client.web.********************.js 22.7 kB 0 B
dotcom-rendering/dist/3789.client.web.********************.js 3.42 kB 0 B
dotcom-rendering/dist/39.client.web.********************.js 3.06 kB 0 B
dotcom-rendering/dist/3937.client.web.********************.js 3.85 kB 0 B
dotcom-rendering/dist/4237.client.web.********************.js 3.22 kB 0 B
dotcom-rendering/dist/4501.client.web.********************.js 4.29 kB 0 B
dotcom-rendering/dist/4684.client.web.********************.js 3.17 kB 0 B
dotcom-rendering/dist/4714.client.web.********************.js 6.15 kB 0 B
dotcom-rendering/dist/5095.client.web.********************.js 4.17 kB 0 B
dotcom-rendering/dist/5550.client.web.********************.js 11.2 kB 0 B
dotcom-rendering/dist/5721.client.web.********************.js 3.64 kB 0 B
dotcom-rendering/dist/5922.client.web.********************.js 8.08 kB 0 B
dotcom-rendering/dist/6021.client.web.********************.js 11 kB +13 B (+0.12%)
dotcom-rendering/dist/6061.client.web.********************.js 3.63 kB 0 B
dotcom-rendering/dist/6080.client.web.********************.js 3.27 kB 0 B
dotcom-rendering/dist/6398.client.web.********************.js 2.92 kB 0 B
dotcom-rendering/dist/6574.client.web.********************.js 3.54 kB 0 B
dotcom-rendering/dist/6627.client.web.********************.js 10.3 kB 0 B
dotcom-rendering/dist/6876.client.web.********************.js 2.67 kB 0 B
dotcom-rendering/dist/6880.client.web.********************.js 5.78 kB 0 B
dotcom-rendering/dist/6882.client.web.********************.js 12.8 kB 0 B
dotcom-rendering/dist/6903.client.web.********************.js 3.21 kB 0 B
dotcom-rendering/dist/6931.client.web.********************.js 2.56 kB 0 B
dotcom-rendering/dist/6940.client.web.********************.js 526 B 0 B
dotcom-rendering/dist/7026.client.web.********************.js 5.41 kB 0 B
dotcom-rendering/dist/7116.client.web.********************.js 23 kB 0 B
dotcom-rendering/dist/719.client.web.********************.js 3.48 kB 0 B
dotcom-rendering/dist/7350.client.web.********************.js 3.32 kB 0 B
dotcom-rendering/dist/7351.client.web.********************.js 2.44 kB 0 B
dotcom-rendering/dist/7460.client.web.********************.js 6.85 kB 0 B
dotcom-rendering/dist/7513.client.web.********************.js 157 B 0 B
dotcom-rendering/dist/7540.client.web.********************.js 2.7 kB 0 B
dotcom-rendering/dist/7546.client.web.********************.js 7.38 kB 0 B
dotcom-rendering/dist/7861.client.web.********************.js 617 B 0 B
dotcom-rendering/dist/8030.client.web.********************.js 3.36 kB 0 B
dotcom-rendering/dist/8067.client.web.********************.js 3.38 kB 0 B
dotcom-rendering/dist/8920.client.web.********************.js 3.41 kB 0 B
dotcom-rendering/dist/895.client.web.********************.js 5.14 kB 0 B
dotcom-rendering/dist/9242.client.web.********************.js 3.75 kB 0 B
dotcom-rendering/dist/9288.client.web.********************.js 2.51 kB 0 B
dotcom-rendering/dist/9558.client.web.********************.js 3.53 kB 0 B
dotcom-rendering/dist/9646.client.web.********************.js 6.32 kB 0 B
dotcom-rendering/dist/9665.client.web.********************.js 4.04 kB 0 B
dotcom-rendering/dist/9735.client.web.********************.js 4.46 kB 0 B
dotcom-rendering/dist/9766.client.web.********************.js 3.2 kB 0 B
dotcom-rendering/dist/9771.client.web.********************.js 3.69 kB 0 B
dotcom-rendering/dist/9995.client.web.********************.js 20.3 kB 0 B
dotcom-rendering/dist/Accessibility-importable.client.web.********************.js 6.31 kB 0 B
dotcom-rendering/dist/AdBlockAsk-importable.client.web.********************.js 2.85 kB 0 B
dotcom-rendering/dist/AdPortals-importable.client.web.********************.js 4.85 kB 0 B
dotcom-rendering/dist/AlreadyVisited-importable.client.web.********************.js 423 B 0 B
dotcom-rendering/dist/AppsEpic-importable.client.web.********************.js 3.63 kB 0 B
dotcom-rendering/dist/AppsFooter-importable.client.web.********************.js 2.7 kB 0 B
dotcom-rendering/dist/AppsLightboxImage-importable.client.web.********************.js 2.66 kB 0 B
dotcom-rendering/dist/AppsLightboxImageStore-importable.client.web.********************.js 2.55 kB 0 B
dotcom-rendering/dist/AudioAtomWrapper-importable.client.web.********************.js 2.59 kB 0 B
dotcom-rendering/dist/AudioPlayerWrapper-importable.client.web.********************.js 6.32 kB 0 B
dotcom-rendering/dist/AuEoy2024Wrapper-importable.client.web.********************.js 5.52 kB 0 B
dotcom-rendering/dist/AustralianTerritorySwitcher-importable.client.web.********************.js 2.63 kB 0 B
dotcom-rendering/dist/Branding-importable.client.web.********************.js 2.86 kB 0 B
dotcom-rendering/dist/braze-web-sdk-core.client.web.********************.js 37.2 kB 0 B
dotcom-rendering/dist/BrazeMessaging-importable.client.web.********************.js 1.96 kB 0 B
dotcom-rendering/dist/CalloutBlockComponent-importable.client.web.********************.js 6.75 kB 0 B
dotcom-rendering/dist/CalloutEmbedBlockComponent-importable.client.web.********************.js 5.77 kB 0 B
dotcom-rendering/dist/CardCommentCount-importable.client.web.********************.js 2.66 kB 0 B
dotcom-rendering/dist/Carousel-importable.client.web.********************.js 8.09 kB 0 B
dotcom-rendering/dist/CarouselForNewsletters-importable.client.web.********************.js 5.14 kB 0 B
dotcom-rendering/dist/ChartAtom-importable.client.web.********************.js 538 B 0 B
dotcom-rendering/dist/CommentCount-importable.client.web.********************.js 2.29 kB 0 B
dotcom-rendering/dist/DiscussionApps-importable.client.web.********************.js 1.93 kB 0 B
dotcom-rendering/dist/DiscussionMeta-importable.client.web.********************.js 2.44 kB 0 B
dotcom-rendering/dist/DiscussionWeb-importable.client.web.********************.js 1.74 kB 0 B
dotcom-rendering/dist/DocumentBlockComponent-importable.client.web.********************.js 2.81 kB 0 B
dotcom-rendering/dist/Dropdown-importable.client.web.********************.js 1.72 kB 0 B
dotcom-rendering/dist/EditionSwitcherBanner-importable.client.web.********************.js 3.49 kB 0 B
dotcom-rendering/dist/EmbedBlockComponent-importable.client.web.********************.js 3.94 kB 0 B
dotcom-rendering/dist/EnhancePinnedPost-importable.client.web.********************.js 2.02 kB 0 B
dotcom-rendering/dist/FetchOnwardsData-importable.client.web.********************.js 1.93 kB 0 B
dotcom-rendering/dist/FilterKeyEventsToggle-importable.client.web.********************.js 3.8 kB 0 B
dotcom-rendering/dist/FocusStyles-importable.client.web.********************.js 617 B 0 B
dotcom-rendering/dist/FollowWrapper-importable.client.web.********************.js 2.52 kB 0 B
dotcom-rendering/dist/FooterLabel-importable.client.web.********************.js 343 B 0 B
dotcom-rendering/dist/FooterReaderRevenueLinks-importable.client.web.********************.js 3.5 kB 0 B
dotcom-rendering/dist/frameworks.client.web.********************.js 20.9 kB 0 B
dotcom-rendering/dist/FrontSubNav-importable.client.web.********************.js 7.37 kB 0 B
dotcom-rendering/dist/GetCricketScoreboard-importable.client.web.********************.js 6.24 kB 0 B
dotcom-rendering/dist/GetMatchNav-importable.client.web.********************.js 11.4 kB 0 B
dotcom-rendering/dist/GetMatchStats-importable.client.web.********************.js 7.95 kB 0 B
dotcom-rendering/dist/GetMatchTabs-importable.client.web.********************.js 2.56 kB 0 B
dotcom-rendering/dist/guardian-braze-components-banner.client.web.********************.js 15.8 kB 0 B
dotcom-rendering/dist/guardian-braze-components-end-of-article.client.web.********************.js 10.2 kB 0 B
dotcom-rendering/dist/GuideAtomWrapper-importable.client.web.********************.js 783 B 0 B
dotcom-rendering/dist/index.client.web.********************.js 44.9 kB +1 B (0%)
dotcom-rendering/dist/InstagramBlockComponent-importable.client.web.********************.js 2.9 kB 0 B
dotcom-rendering/dist/InteractiveAtomMessenger-importable.client.web.********************.js 851 B 0 B
dotcom-rendering/dist/InteractiveBlockComponent-importable.client.web.********************.js 8.47 kB 0 B
dotcom-rendering/dist/InteractiveContentsBlockComponent-importable.client.web.********************.js 3.74 kB 0 B
dotcom-rendering/dist/KeyEventsCarousel-importable.client.web.********************.js 5.68 kB 0 B
dotcom-rendering/dist/KnowledgeQuizAtom-importable.client.web.********************.js 3.48 kB 0 B
dotcom-rendering/dist/LatestLinks-importable.client.web.********************.js 7.21 kB 0 B
dotcom-rendering/dist/LightboxHash-importable.client.web.********************.js 434 B 0 B
dotcom-rendering/dist/LightboxLayout-importable.client.web.********************.js 6.53 kB 0 B
dotcom-rendering/dist/LiveBlogEpic-importable.client.web.********************.js 3.55 kB 0 B
dotcom-rendering/dist/LiveblogNotifications-importable.client.web.********************.js 4.82 kB 0 B
dotcom-rendering/dist/Liveness-importable.client.web.********************.js 4.72 kB 0 B
dotcom-rendering/dist/ManyNewsletterSignUp-importable.client.web.********************.js 7.05 kB 0 B
dotcom-rendering/dist/MapEmbedBlockComponent-importable.client.web.********************.js 5.87 kB 0 B
dotcom-rendering/dist/Metrics-importable.client.web.********************.js 2.69 kB 0 B
dotcom-rendering/dist/MostViewedFooter-importable.client.web.********************.js 4.67 kB 0 B
dotcom-rendering/dist/MostViewedFooterData-importable.client.web.********************.js 6.86 kB 0 B
dotcom-rendering/dist/MostViewedRightWithAd-importable.client.web.********************.js 5.04 kB 0 B
dotcom-rendering/dist/OnwardsUpper-importable.client.web.********************.js 5.32 kB 0 B
dotcom-rendering/dist/PersonalityQuizAtom-importable.client.web.********************.js 3.65 kB 0 B
dotcom-rendering/dist/ProfileAtom-importable.client.web.********************.js 543 B 0 B
dotcom-rendering/dist/ProfileAtomWrapper-importable.client.web.********************.js 802 B 0 B
dotcom-rendering/dist/PulsingDot-importable.client.web.********************.js 750 B 0 B
dotcom-rendering/dist/QandaAtom-importable.client.web.********************.js 543 B 0 B
dotcom-rendering/dist/ReaderRevenueDev-importable.client.web.********************.js 468 B 0 B
dotcom-rendering/dist/readerRevenueDevUtils.client.web.********************.js 1.74 kB 0 B
dotcom-rendering/dist/RelativeTime-importable.client.web.********************.js 2.53 kB 0 B
dotcom-rendering/dist/RichLinkComponent-importable.client.web.********************.js 6.01 kB 0 B
dotcom-rendering/dist/ScrollableFeature-importable.client.web.********************.js 4.58 kB 0 B
dotcom-rendering/dist/ScrollableHighlights-importable.client.web.********************.js 5.61 kB 0 B
dotcom-rendering/dist/ScrollableMedium-importable.client.web.********************.js 2.35 kB -1 B (-0.04%)
dotcom-rendering/dist/ScrollableSmall-importable.client.web.********************.js 2.32 kB -3 B (-0.13%)
dotcom-rendering/dist/SecureSignup-importable.client.web.********************.js 6.5 kB 0 B
dotcom-rendering/dist/SendTargetingParams-importable.client.web.********************.js 2.22 kB 0 B
dotcom-rendering/dist/sentry.client.web.********************.js 794 B 0 B
dotcom-rendering/dist/SetABTests-importable.client.web.********************.js 3.69 kB 0 B
dotcom-rendering/dist/SetAdTargeting-importable.client.web.********************.js 485 B 0 B
dotcom-rendering/dist/ShareButton-importable.client.web.********************.js 4.65 kB 0 B
dotcom-rendering/dist/shimport.client.web.********************.js 2.8 kB 0 B
dotcom-rendering/dist/ShowHideContainers-importable.client.web.********************.js 730 B 0 B
dotcom-rendering/dist/ShowMore-importable.client.web.********************.js 3.27 kB 0 B
dotcom-rendering/dist/SignInGateMain.client.web.********************.js 4.46 kB 0 B
dotcom-rendering/dist/SignInGateMainCheckoutComplete.client.web.********************.js 5.55 kB 0 B
dotcom-rendering/dist/SignInGateSelector-importable.client.web.********************.js 5.83 kB 0 B
dotcom-rendering/dist/SlideshowCarousel-importable.client.web.********************.js 4.36 kB 0 B
dotcom-rendering/dist/SlotBodyEnd-importable.client.web.********************.js 4.83 kB 0 B
dotcom-rendering/dist/SpotifyBlockComponent-importable.client.web.********************.js 5.68 kB 0 B
dotcom-rendering/dist/StickyBottomBanner-importable.client.web.********************.js 6.16 kB 0 B
dotcom-rendering/dist/StickyLiveblogAskWrapper-importable.client.web.********************.js 8.13 kB 0 B
dotcom-rendering/dist/SubNav-importable.client.web.********************.js 2.41 kB 0 B
dotcom-rendering/dist/TableOfContents-importable.client.web.********************.js 3.46 kB 0 B
dotcom-rendering/dist/TimelineAtom-importable.client.web.********************.js 1.23 kB 0 B
dotcom-rendering/dist/Titlepiece-importable.client.web.********************.js 13.5 kB 0 B
dotcom-rendering/dist/TopBar-importable.client.web.********************.js 9.29 kB 0 B
dotcom-rendering/dist/TopBarSupport-importable.client.web.********************.js 2.49 kB 0 B
dotcom-rendering/dist/TweetBlockComponent-importable.client.web.********************.js 1.13 kB 0 B
dotcom-rendering/dist/UnsafeEmbedBlockComponent-importable.client.web.********************.js 2.91 kB 0 B
dotcom-rendering/dist/UsEoy2024Wrapper-importable.client.web.********************.js 6.03 kB 0 B
dotcom-rendering/dist/VideoFacebookBlockComponent-importable.client.web.********************.js 5.88 kB 0 B
dotcom-rendering/dist/VineBlockComponent-importable.client.web.********************.js 2.78 kB 0 B
dotcom-rendering/dist/YoutubeBlockComponent-importable.client.web.********************.js 3.61 kB 0 B

compressed-size-action

d="M0 34.5198h2.3009v5.4792H0v-5.4792ZM3.4508 19.287h2.2999v20.712H3.4508V19.287ZM6.9016.7672h2.2999V39.999H6.9016V.7671Zm3.4498.658h2.3009V39.999h-2.3009V1.4251Zm3.4508.7661h2.2999V39.999h-2.2999V2.1913Zm3.4498 1.6444h2.3009V40H17.252V3.8357Zm3.4508 1.8628h2.2999V39.999h-2.2999V5.6985Zm3.4508 1.972h2.2999V39.999h-2.2999V7.6705Zm3.4498.9865h2.3009v31.342h-2.3009V8.657Zm3.4508-2.629h2.2999V40h-2.2999V6.028Zm3.4498 1.0957h2.3009V40H34.504V7.1237Zm3.4508.1091h2.2999V39.999h-2.2999V7.2328Zm3.4519 1.7537h2.2998V39.999h-2.2998V8.9865Zm3.4498 1.7536h2.3008V40h-2.3008V10.7401Zm3.4508-4.1652h2.2998V39.999h-2.2998V6.5749Zm3.4498 1.316h2.3008V39.999h-2.3008V7.8908Zm3.4508-1.8629h2.2998V40h-2.2998V6.028Zm3.4508 1.4242h2.2998V40h-2.2998V7.4522Zm3.4498 1.4241h2.3008V39.999h-2.3008V8.8763Zm3.4508 1.4242h2.2998V39.999h-2.2998V10.3005Zm3.4498 1.7536h2.3008V39.999h-2.3008V12.0541Zm3.4508 1.5343h2.2998V39.999h-2.2998V13.5884Zm3.4508 2.4106h2.2998v24h-2.2998v-24Zm3.4498-.2193h2.3008V39.999h-2.3008V15.7797Zm3.4508-4.8213h2.2998V39.999h-2.2998V10.9584Zm3.4498 1.2049h2.3008V39.999h-2.3008V12.1633Zm3.4508 1.2067h2.2998v26.629h-2.2998V13.37Zm3.4508.5469h2.2998V39.999h-2.2998V13.9169Zm3.4498.2193h2.3009V39.999h-2.3009V14.1362Zm3.4505 1.2058h2.3v24.657h-2.3V15.342Zm3.452 1.2058h2.3V40h-2.3V16.5478Zm3.45 1.315h2.301V39.999h-2.301V17.8628Zm3.451.1092h2.3v22.027h-2.3V17.972Zm3.45-.4387h2.3V39.999h-2.3V17.5333Zm3.45 1.2058h2.3V40h-2.3V18.7391Zm3.451 1.315h2.3V39.999h-2.3V20.0541Zm3.45.8773h2.301V40h-2.301V20.9314Zm3.451-12.055h2.3V39.999h-2.3V8.8763Zm3.45 1.9729h2.3V39.999h-2.3V10.8493Zm3.45.5468h2.3V39.999h-2.3V11.3961Zm3.451-.9855h2.3V39.999h-2.3V10.4106Zm3.45-3.397h2.301V39.999h-2.301V7.0135ZM144.92 8h2.3v31.999h-2.3V8Zm3.45 1.0956h2.3V39.999h-2.3V9.0956Zm3.45 1.315h2.3V39.999h-2.3V10.4106Zm3.451 1.4251h2.3V40h-2.3V11.8357Zm3.45.5479h2.301V39.999h-2.301V12.3836Zm3.451-7.8908h2.3V39.999h-2.3V4.4927Zm3.451.8773h2.3V39.999h-2.3V5.37Zm3.45-.658h2.3V39.999h-2.3V4.712Zm3.451 1.7536h2.3V39.999h-2.3V6.4657Zm3.45 1.2048h2.301V39.999h-2.301V7.6705Zm3.451 1.974h2.3V40h-2.3V9.6444ZM182.875 8h2.3v31.999h-2.3V8Zm3.45-3.5072h2.3V39.999h-2.3V4.4927Zm3.451-.657h2.3V40h-2.3V3.8357Zm3.45 1.2048h2.301V39.999h-2.301V5.0406Zm3.451-1.973h2.3V39.999h-2.3V3.0676Zm3.45 1.2068h2.3V39.999h-2.3V4.2744Zm3.45-.4386h2.3V40h-2.3V3.8357Zm3.451 1.5343h2.3V39.999h-2.3V5.37Zm3.45 1.2048h2.301V39.999h-2.301V6.5749Zm3.451 1.973h2.3V40h-2.3V8.5478Zm3.451 1.3149h2.299V39.999h-2.299V9.8628Zm3.449 2.8493h2.301V39.999h-2.301V12.7121Zm3.451 1.8628h2.3V39.999h-2.3V14.5749Zm3.451-1.6435h2.301V40h-2.301V12.9314Zm3.451-7.1237h2.3V39.999h-2.3V5.8077ZM234.633 8h2.3v31.999h-2.3V8Zm3.449 1.7536h2.301V39.999h-2.301V9.7536Zm3.451 1.0957h2.3V39.999h-2.3V10.8493Zm3.45.6579h2.301V39.999h-2.301V11.5072Zm3.451.4377h2.3V39.999h-2.3V11.9449Zm3.451 1.4251h2.3v26.629h-2.3V13.37Zm3.449-8.4386h2.301V40h-2.301V4.9314Zm3.451.3285h2.3V39.999h-2.3V5.2599Zm3.45 1.315h2.301V39.999h-2.301V6.5749ZM265.686 8h2.3v31.999h-2.3V8Zm3.451 1.5333h2.3V39.999h-2.3V9.5333Zm3.449-.5468h2.301V39.999h-2.301V8.9865Zm3.451 1.4241h2.3V39.999h-2.3V10.4106Zm3.45-.4386h2.301v30.027h-2.301V9.972Zm3.451 1.0956h2.3V39.999h-2.3V11.0676Zm3.451.9865h2.3V39.999h-2.3V12.0541Zm3.45 1.3159h2.301v26.629h-2.301V13.37Zm3.451.7662h2.3V39.999h-2.3V14.1362Zm3.45 1.0967h2.301V39.999h-2.301V15.2329Zm3.451-.5489h2.3v25.315h-2.3V14.684Zm3.451-.8763h2.3V39.999h-2.3V13.8077Zm3.449 1.2049h2.301V39.999h-2.301V15.0126Zm3.451 1.2067h2.3V40h-2.3V16.2193Zm3.45 1.5333h2.301V39.999h-2.301V17.7526Zm3.451 1.6435h2.301V39.999h-2.301V19.3961Zm3.451-7.2328h2.3V39.999h-2.3V12.1633Zm3.449 1.2067h2.301v26.629h-2.301V13.37Zm3.451-.6579h2.3V39.999h-2.3V12.7121Zm3.451 1.2048h2.3V39.999h-2.3V13.9169Zm3.45 1.2068h2.301V40h-2.301V15.1237Zm3.451.9855h2.3V39.999h-2.3V16.1092Zm3.45-12.3836h2.3V39.999h-2.3V3.7256Zm3.45 2.9585h2.3V39.999h-2.3V6.684Zm3.451-.5469h2.3V39.999h-2.3V6.1372Zm3.451 1.4242h2.301V39.999h-2.301V7.5613Zm3.451 1.315h2.3V39.999h-2.3V8.8763Zm3.45-3.7257h2.3V39.999h-2.3V5.1507Zm3.45 2.1913h2.3v32.657h-2.3V7.342Zm3.451 2.5208h2.3V39.999h-2.3V9.8628Zm3.45 1.4242h2.301v28.712H369.2V11.287Zm3.451 1.4251h2.3V39.999h-2.3V12.7121Zm3.45 1.2048h2.3V39.999h-2.3V13.9169Zm3.45-.1092h2.3V39.999h-2.3V13.8077Zm3.451 1.6445h2.3V40h-2.3V15.4522Zm3.45-.3285h2.301V40h-2.301V15.1237Zm3.451-8.5488h2.3V39.999h-2.3V6.5749Zm3.45.7671h2.3v32.657h-2.3V7.342Zm3.45 1.0957h2.3V39.999h-2.3V8.4377Zm3.451.658h2.3V39.999h-2.3V9.0956Zm3.45 1.6444h2.301V40h-2.301V10.7401Zm3.451.4377h2.3V39.999h-2.3V11.1778Zm3.451.8763h2.301V39.999h-2.301V12.0541Zm3.45 1.4251h2.3V39.999h-2.3V13.4792Zm3.451-.9864h2.3V39.999h-2.3V12.4928Zm3.45 1.3149h2.301V39.999h-2.301V13.8077Zm3.451-3.1778h2.3V39.999h-2.3V10.6299Zm3.45 1.4242h2.3V39.999h-2.3V12.0541Zm3.45 1.2058h2.3V40h-2.3V13.2599Zm3.451-2.63h2.3V39.999h-2.3V10.6299Zm3.45 1.315h2.301V39.999h-2.301V11.9449Zm3.451.7672h2.3V39.999h-2.3V12.7121Zm3.45-3.288h2.301V39.999h-2.301V9.4241Zm3.45 1.7537h2.3V39.999h-2.3V11.1778Zm3.451-4.1643h2.3V39.999h-2.3V7.0135Zm3.45-.3294h2.301V39.999h-2.301V6.684Zm3.451 1.2067h2.3V39.999h-2.3V7.8908Zm3.45 1.2048h2.301V39.999h-2.301V9.0956Zm3.45.1092h2.3V39.999h-2.3V9.2048Zm3.451-4.054h2.3V39.999h-2.3V5.1507Zm3.451-3.946h2.301V39.999h-2.301V1.2048Zm3.451 3.3981h2.3V39.999h-2.3V4.6029Zm3.45 1.314h2.301V39.999h-2.301V5.9169Zm3.45.9874h2.3V39.999h-2.3V6.9043Zm3.451 1.972h2.3V39.999h-2.3V8.8763Zm3.45-7.6715h2.301V39.999h-2.301V1.2048Zm3.451 1.0957h2.3V39.999h-2.3V2.3005Zm3.45 3.398h2.301V39.999h-2.301V5.6985Zm3.451 2.4107h2.299V39.999h-2.299V8.1092Zm3.45-1.6435h2.3V39.999h-2.3V6.4657Zm3.45 1.6435h2.301V39.999h-2.301V8.1092Zm3.451.658h2.3V39.999h-2.3V8.7671Zm3.45 1.4241h2.301V39.999h-2.301V10.1913Zm3.45 1.0957h2.3v28.712h-2.3V11.287Zm3.451 1.3159h2.3V39.999h-2.3V12.6029Zm3.45 1.7536h2.301V40h-2.301V14.3565Zm3.451-.8773h2.3V39.999h-2.3V13.4792Zm3.45-.3295h2.301V39.999h-2.301V13.1497Zm3.451.8774h2.3V40h-2.3V14.0271Zm3.451.2193h2.3V39.999h-2.3V14.2464Zm3.45-10.5208h2.301V39.999h-2.301V3.7256Zm3.451 1.0957h2.3V39.999h-2.3V4.8212Zm3.45 1.9729h2.301V39.999h-2.301V6.7942Zm3.451.9855h2.299V39.999h-2.299V7.7797Zm3.45 1.0966h2.3V39.999h-2.3V8.8763Zm3.45-.3285h2.301V40h-2.301V8.5478Zm3.451-6.9034h2.3V40h-2.3V1.6444Zm3.45 1.4232h2.301V39.999h-2.301V3.0676Zm3.451 1.2068h2.299V39.999h-2.299V4.2744Zm3.45 2.63h2.3V39.999h-2.3V6.9043ZM576.227 0h2.301v39.999h-2.301V0Zm3.451 2.4116h2.3V40h-2.3V2.4116Zm3.451.9855h2.3V39.999h-2.3V3.3971Zm3.45 1.0957h2.3V39.999h-2.3V4.4927Zm3.45.5478h2.3V39.999h-2.3V5.0406Zm3.451-1.7527h2.301V39.999h-2.301V3.288Zm3.451 1.315h2.3V39.999h-2.3V4.6029Zm3.451 1.0957h2.3V39.999h-2.3V5.6985Zm3.45 2.5207h2.303V40h-2.303V8.2193Zm3.452-.4396h2.3V39.999h-2.3V7.7797Zm3.45 1.2068h2.301V39.999h-2.301V8.9865Zm3.451 2.3005h2.3v28.712h-2.3V11.287Zm3.451 1.2058h2.3V39.999h-2.3V12.4928Zm3.45-3.288h2.3V39.999h-2.3V9.2048Zm3.45 1.4251h2.3V39.999h-2.3V10.6299Zm3.451.4377h2.301V39.999h-2.301V11.0676Zm3.451.9865h2.3V39.999h-2.3V12.0541Zm3.451 1.2058h2.3V40h-2.3V13.2599Zm3.45.8763h2.301V39.999h-2.301V14.1362Zm3.451.2203h2.299V40h-2.299V14.3565Zm3.449 1.2049h2.301V39.999h-2.301V15.5614Zm3.451 1.4251h2.3V39.999h-2.3V16.9865Zm3.451 1.0956h2.3V39.999h-2.3V18.0821Zm3.45 1.314h2.301V39.999h-2.301V19.3961Zm3.45-5.9169h2.3V39.999h-2.3V13.4792Zm3.451-7.7807h2.3V39.999h-2.3V5.6985Zm3.45 1.4252h2.301V40h-2.301V7.1237Zm3.451.3285h2.3V40h-2.3V7.4522Zm3.45 1.972h2.301V39.999h-2.301V9.4241Zm3.451 1.7536h2.299V39.999h-2.299V11.1778Zm3.45 2.1922h2.3v26.629h-2.3V13.37Zm3.45 1.4242h2.301V39.999h-2.301V14.7942Zm3.451-.4377h2.3V40h-2.3V14.3565Zm3.451.5469h2.301V39.999h-2.301V14.9034Zm3.451-.2194h2.299v25.315h-2.299V14.684Zm3.45 1.6445h2.3V39.999h-2.3V16.3285Zm3.45-4.0551h2.301V39.999h-2.301V12.2734Zm3.451-2.5198h2.3V39.999h-2.3V9.7536Zm3.45.9865h2.301V40h-2.301V10.7401Zm3.451.8763h2.299V39.999h-2.299V11.6164Zm3.45 1.315h2.3V40h-2.3V12.9314Zm3.45 2.1923H720V40h-2.301V15.1237Z"
/>
</svg>
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only Max would know how to do it properly… I don’t. It may be that whomever supplied this will need to snap those paths to pixels. They are not only off, but also not even aligned to any other grid or to each other:

image

It will allow also to optimise it to ~50% as this precision is insane…

Unless what is attached is any better (this is the best I can do, sadly).
wave_x10_svgo_illustrator_random_play.svg.zip

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I immediately thought of Max when I had a look at this! I tried snapping the path to the pixel grid in Figma, but it didn't seem to do anything, perhaps as it's a single path so only aligned the edges? I'll go back to design and see if they're able to optimise it. That would also help with using a section of this as a repeating pattern rather than having to have a super wide SVG. (The sub pixel values make the join obvious where the pattern repeats due to the spacing being slightly off.)

Copy link
Contributor

@mxdvl mxdvl Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’ll definitely need to round things up for them to look crisp!

If you favour readability I would use line or rect elements which are very explicit in how they are drawn. It’s a bit hard to parse one massive path with rectangles in it…

If you favour making the SVG as small as possible I would use a pattern and a mask or clipPath for cropping the height of individual lines.

If you favour making them look a bit random I’d offset each wavelength by a deterministic value between 0 and the width of the repeating pattern.


You could even use CSS if you know the maximum width of a card.


Or if you’d willing to consider dynamic wavelengths…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Max 🙏 With a bit of manual tweaking I've rounded things up which has also made the SVG quite a bit smaller. Without any subpixel values to worry about I think using a pattern might be the way to go. I like the idea of offsetting the wave too as it allows the use of a single static SVG whilst adding some visual difference. (The podcast carousel, for example, will have multiple adjacent cards with the waveform so it would be nice if they don't all look identical!)

Copy link
Contributor

@mxdvl mxdvl Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to shrink it a tad more, you can use strokes instead of fills:

<path
  stroke-width="2" stroke="#eee"
  d="M1,34V40M4,19V40M7,1V40M10,1V40M13,2V40M16,4V40M19,6V40M22,8V40M25,9V40
    M28,6V40M31,7V40M34,7V40M37,9V40M40,11V40M43,7V40M46,8V40M49,6V40M52,7V40
    M55,9V40M58,10V40M61,12V40M64,14V40M67,16V40M70,16V40M73,11V40M76,12V40
    M79,13V40M82,14V40M85,14V40M88,15V40M91,16V40M94,18V40M97,18V40M100,17V40
    M103,19V40M106,20V40M109,21V40M112,9V40M115,11V40M118,11V40M121,10V40M124,7V40
    M127,8V40M130,9V40M133,10V40M136,12V40M139,12V40M142,4V40M145,5V40M148,5V40
    M151,6V40M154,8V40M157,10V40M160,8V40M163,4V40M166,4V40M169,5V40M172,3V40
    M175,4V40M178,4V40M181,5V40M184,7V40M187,8V40M190,10V40M193,13V40M196,15V40 
    M199,13V40M202,6V40M205,8V40M208,10V40M211,11V40M214,11V40M217,12V40M220,13V40
    M223,5V40M226,5V40M229,7V40M232,8V40M235,9V40M238,9V40M241,10V40M244,10V40
    M247,11V40M250,12V40M253,13V40M256,14V40M259,15V40M262,15V40M265,14V40
    M268,15V40M271,16V40M274,18V40M277,19V40M280,12V40M283,13V40M286,13V40
    M289,14V40M292,15V40M295,16V40M298,4V40"
/>

This brings the d character count from 4,297 to 920.

Copy link
Contributor

@mxdvl mxdvl Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh and remember that if you define a pattern once it can be reused across different inline SVGs – if you want to keep your HTML compliant no two elements can share the same id!

Otherwise make sure to useId… like I should have done previously.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise make sure to useId

That's exactly what I would have forgot to do! 🤦 Using simple lines and stroke rather than drawing filled rectangles is also a great idea. (And makes the path easier to read.)

Thanks so much for all of the pointers and advice 🙏 Using the simplified path as a repeating pattern has resulted in a much more compact SVG, but one that also works at any width. I haven't added an offset yet, but will look at that in a follow up PR before enabling this for existing containers.

@jamesmockett jamesmockett force-pushed the jm/media-card-pills branch 4 times, most recently from 7f20356 to b8fe14b Compare January 8, 2025 15:47
@jamesmockett jamesmockett added the run_chromatic Runs chromatic when label is applied label Jan 8, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants