{"id":768,"date":"2024-02-09T10:40:52","date_gmt":"2024-02-09T16:40:52","guid":{"rendered":"https:\/\/frontendmasters.com\/blog\/?p=768"},"modified":"2024-02-09T10:40:52","modified_gmt":"2024-02-09T16:40:52","slug":"velvette","status":"publish","type":"post","link":"https:\/\/frontendmasters.com\/blog\/velvette\/","title":{"rendered":"Velvette"},"content":{"rendered":"\n<p>While I was over on Codrops reading Adam&#8217;s article <a href=\"https:\/\/tympanus.net\/codrops\/2024\/01\/17\/a-practical-introduction-to-scroll-driven-animations-with-css-scroll-and-view\/\">about Scroll-Driven animation<\/a>, I also read Noam Rosenthal&#8217;s <a href=\"https:\/\/tympanus.net\/codrops\/2024\/01\/19\/making-css-view-transitions-easy-with-velvette\/\">article about View Transitions<\/a>. Noam is also at Google and working on the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/View_Transitions_API\">View Transitions API<\/a>, so knows it pretty intimately, and found enough gaps that a library around it was warranted. That&#8217;s what <a href=\"https:\/\/github.com\/noamr\/velvette?tab=readme-ov-file\">Velvette<\/a> is: a library around making certain things easier with the View Transitions API. <\/p>\n\n\n\n<p>The #1 thing I wanted to try was &#8220;generate unique view-transition-names&#8221;. If you want a whole bunch of elements to all transition, every single one of them needs to have a unique <code>view-transition-name<\/code>. This is annoying verging on untenable in CSS, so the usual approach is using inline styles in the HTML. Unfortunately, the best Velvette can do is map the <code>id<\/code> of the element to the <code>view-transition-name<\/code>, so you&#8217;re having to craft unique identifiers anyway. Why not just toss a UUID on them or something? <\/p>\n\n\n\n<p>I was able to get it working, but ultimately didn&#8217;t find it very useful.<\/p>\n\n\n\n<!--more-->\n\n\n\n<div class=\"wp-block-cp-codepen-gutenberg-embed-block cp_embed_wrapper\"><iframe id=\"cp_embed_VwRGXpR\" src=\"\/\/codepen.io\/anon\/embed\/VwRGXpR?height=750&amp;theme-id=47434&amp;slug-hash=VwRGXpR&amp;default-tab=result\" height=\"750\" scrolling=\"no\" frameborder=\"0\" allowfullscreen allowpaymentrequest name=\"CodePen Embed VwRGXpR\" title=\"CodePen Embed VwRGXpR\" class=\"cp_embed_iframe\" style=\"width:100%;overflow:hidden\">CodePen Embed Fallback<\/iframe><\/div>\n","protected":false},"excerpt":{"rendered":"<p>While I was over on Codrops reading Adam&#8217;s article about Scroll-Driven animation, I also read Noam Rosenthal&#8217;s article about View Transitions. Noam is also at Google and working on the View Transitions API, so knows it pretty intimately, and found enough gaps that a library around it was warranted. That&#8217;s what Velvette is: a library [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":771,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[29],"tags":[102,101],"class_list":["post-768","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-the-beat","tag-velvette","tag-view-transitions"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/frontendmasters.com\/blog\/wp-content\/uploads\/2024\/02\/velvette-thumb.jpg?fit=1000%2C500&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/768","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/comments?post=768"}],"version-history":[{"count":3,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/768\/revisions"}],"predecessor-version":[{"id":772,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/posts\/768\/revisions\/772"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media\/771"}],"wp:attachment":[{"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/media?parent=768"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/categories?post=768"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendmasters.com\/blog\/wp-json\/wp\/v2\/tags?post=768"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}