casafloralia Posted April 5, 2021 Share Posted April 5, 2021 Site URL: https://casafloraliaa.squarespace.com ps: studio hi everyone, I'd like to have the hover:background portfolio layout on desktop, and the grid: simple on mobile with text alignment to the center. Is that possible? Beyondspace 1 Link to comment
Beyondspace Posted April 7, 2021 Share Posted April 7, 2021 On 4/6/2021 at 2:30 AM, casafloralia said: Site URL: https://casafloraliaa.squarespace.com ps: studio hi everyone, I'd like to have the hover:background portfolio layout on desktop, and the grid: simple on mobile with text alignment to the center. Is that possible? I don't think it possible, would require extensive custom code for this BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🚀 Learn how to rank new pages on Google in 48 hours! If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
tuanphan Posted April 12, 2021 Share Posted April 12, 2021 On 4/6/2021 at 2:30 AM, casafloralia said: Site URL: https://casafloraliaa.squarespace.com ps: studio hi everyone, I'd like to have the hover:background portfolio layout on desktop, and the grid: simple on mobile with text alignment to the center. Is that possible? Hi. Add to Settings . Advanced > Code injection > Header <style> .portfolio-custom { padding: 0 3vw; } .portfolio-custom a { display: block; margin-bottom: 3vw; } .portfolio-custom a img { width: 100%; } .portfolio-custom a h3 { margin-top: 0; } @media screen and (min-width: 800px) { .portfolio-custom { display: none; } } @media screen and (max-width: 800px) { .portfolio-hover { display: none; } } </style> <script src="//code.jquery.com/jquery-3.5.1.min.js"></script> <script> window.onload = function () { if (Static.SQUARESPACE_CONTEXT.collectionId == "5e8a697fd7a6d83f2f1de30e") { $portfolioHover = $(".portfolio-hover"); if ($portfolioHover.length > 0) { var images = []; $portfolioHover.find(".portfolio-hover-bg-img img").each(function () { images.push($(this).data("src")); }); $portfolioHover.parent().prepend('<div class="portfolio-custom">'); $portfolioHover.find(".portfolio-hover-item").each(function (i) { $(".portfolio-custom").append(` <a href="${$(this).attr("href")}"> <img src="${images[i]}" /> <h3>${$(this).text().trim()}</h3> </a> `); }); } } }; </script> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Guest Posted April 12, 2021 Share Posted April 12, 2021 11 hours ago, tuanphan said: Hi. Add to Settings . Advanced > Code injection > Header <style> .portfolio-custom { padding: 0 3vw; } .portfolio-custom a { display: block; margin-bottom: 3vw; } .portfolio-custom a img { width: 100%; } .portfolio-custom a h3 { margin-top: 0; } @media screen and (min-width: 800px) { .portfolio-custom { display: none; } } @media screen and (max-width: 800px) { .portfolio-hover { display: none; } } </style> <script src="//code.jquery.com/jquery-3.5.1.min.js"></script> <script> window.onload = function () { if (Static.SQUARESPACE_CONTEXT.collectionId == "5e8a697fd7a6d83f2f1de30e") { $portfolioHover = $(".portfolio-hover"); if ($portfolioHover.length > 0) { var images = []; $portfolioHover.find(".portfolio-hover-bg-img img").each(function () { images.push($(this).data("src")); }); $portfolioHover.parent().prepend('<div class="portfolio-custom">'); $portfolioHover.find(".portfolio-hover-item").each(function (i) { $(".portfolio-custom").append(` <a href="${$(this).attr("href")}"> <img src="${images[i]}" /> <h3>${$(this).text().trim()}</h3> </a> `); }); } } }; </script> Hi there, thanks for posting this. I just tried the same code for my website but it seems not to work... my website: https://pufferfish-lion-mkrm.squarespace.com/ password: sqr Any idea what's the trick? @tuanphan Link to comment
tuanphan Posted April 14, 2021 Share Posted April 14, 2021 On 4/13/2021 at 1:47 AM, karo said: Hi there, thanks for posting this. I just tried the same code for my website but it seems not to work... my website: https://pufferfish-lion-mkrm.squarespace.com/ password: sqr Any idea what's the trick? @tuanphan You want move title under square border on //workwork page? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
amphotovideo Posted December 1, 2023 Share Posted December 1, 2023 Is there a way to tweak this to have Grid:Overlay for Desktop, and Grid: Simple for Mobile (I found when viewing the grid overlay in tests the text doesn't show because mobile users dont hover over buttons) Link to comment
tuanphan Posted December 3, 2023 Share Posted December 3, 2023 On 12/2/2023 at 3:29 AM, amphotovideo said: Is there a way to tweak this to have Grid:Overlay for Desktop, and Grid: Simple for Mobile (I found when viewing the grid overlay in tests the text doesn't show because mobile users dont hover over buttons) You can set Grid: Overlay on Settings, then use this code to Website Tools (under Not Linked) > Custom CSS to change it to Grid: Simple on Mobile /* Portfolio Overlay to grid mobile */ @media screen and (max-width:767px) { div#gridThumbs { grid-template-columns: repeat(2,1fr); } a.grid-item { height: unset !important; padding-bottom: 0 !important; } .portfolio-text { position: relative !important; opacity: 1 !important; } } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
RGCreative Posted January 30 Share Posted January 30 Hi @tuanphan I have just used your above code to create a portfolio grid in mobile view (using background hover for desktop). Couple of issues though that I was hoping you might be able to help resolve please? 1. The portfolio images and titles have muddled so the wrong titles are sat below the wrong images. 2. I would love the custom mobile view to appear more like grid hover if it's possible. With the images all appearing landscape, same size. And the titles sitting over the images centrally with an opacity overlay so they show more clearly. Website is: https://www.rebeccagaunt.co.uk/portfolio Any help you can offer, hugely appreciated. Thank you. Link to comment
tuanphan Posted February 1 Share Posted February 1 On 1/30/2024 at 7:51 PM, RGCreative said: Hi @tuanphan I have just used your above code to create a portfolio grid in mobile view (using background hover for desktop). Couple of issues though that I was hoping you might be able to help resolve please? 1. The portfolio images and titles have muddled so the wrong titles are sat below the wrong images. 2. I would love the custom mobile view to appear more like grid hover if it's possible. With the images all appearing landscape, same size. And the titles sitting over the images centrally with an opacity overlay so they show more clearly. Website is: https://www.rebeccagaunt.co.uk/portfolio Any help you can offer, hugely appreciated. Thank you. It looks like you figured it out? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
RGCreative Posted February 21 Share Posted February 21 @tuanphan Hello! Yes, all resolved. Really happy with it. Thanks! tuanphan 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment