harvestfilmco Posted December 16, 2020 Posted December 16, 2020 Site URL: https://harvestfilmcompany.com/work I have a .GIF image displayed at the top of the "Page Content" section, which looks great on desktop, however the image when it is displayed on mobile, it is far too small to view. I know that Squarespace sites are responsive, however, in this case I created a second custom .GIF image to better fit mobile use. What I am attempting to do is display one .GIF only on desktop and a separate .GIF only on mobile. The second .GIF formatted for mobile use is imported into Squarespace's "Custom Files" folder. I have some experience with coding but this exceeds my capabilities. This is the code that I have been working with, trying out different inputs in different places within the main "Custom CSS" window, and the "Advanced Page Settings CSS" window: @media only screen and (max-width: 640px) { image: url(https://static1.squarespace.com/static/5d6037ded262bd00018f22f9/t/5fd90ed9d927c34ff5eb5c7e/1608060634352/Mobile+V1.gif); } I am wondering if what I am trying to do is possible, and if not, am I able to make it so the first .GIF is displayed on desktop, and then is hidden on mobile?
Beyondspace Posted December 16, 2020 Posted December 16, 2020 10 hours ago, harvestfilmco said: Site URL: https://harvestfilmcompany.com/work I have a .GIF image displayed at the top of the "Page Content" section, which looks great on desktop, however the image when it is displayed on mobile, it is far too small to view. I know that Squarespace sites are responsive, however, in this case I created a second custom .GIF image to better fit mobile use. What I am attempting to do is display one .GIF only on desktop and a separate .GIF only on mobile. The second .GIF formatted for mobile use is imported into Squarespace's "Custom Files" folder. I have some experience with coding but this exceeds my capabilities. This is the code that I have been working with, trying out different inputs in different places within the main "Custom CSS" window, and the "Advanced Page Settings CSS" window: @media only screen and (max-width: 640px) { image: url(https://static1.squarespace.com/static/5d6037ded262bd00018f22f9/t/5fd90ed9d927c34ff5eb5c7e/1608060634352/Mobile+V1.gif); } I am wondering if what I am trying to do is possible, and if not, am I able to make it so the first .GIF is displayed on desktop, and then is hidden on mobile? Kindly paste this into design->Custom css @media only screen and (max-width: 768px) { #block-yui_3_17_2_1_1607017561137_11291 .sqs-block-image-figure > div { padding-bottom: 20% !important; overflow: hidden; background: url(https://static1.squarespace.com/static/5d6037ded262bd00018f22f9/t/5fd90ed9d927c34ff5eb5c7e/1608060634352/Mobile+V1.gif); background-size: cover; } #block-yui_3_17_2_1_1607017561137_11291 .sqs-block-image-figure > div img { opacity: 0 !important; } } BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - PDF Lightbox popup - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> No-code customisations for Squarespace
harvestfilmco Posted December 18, 2020 Author Posted December 18, 2020 On 12/16/2020 at 5:24 AM, bangank36 said: Kindly paste this into design->Custom css @media only screen and (max-width: 768px) { #block-yui_3_17_2_1_1607017561137_11291 .sqs-block-image-figure > div { padding-bottom: 20% !important; overflow: hidden; background: url(https://static1.squarespace.com/static/5d6037ded262bd00018f22f9/t/5fd90ed9d927c34ff5eb5c7e/1608060634352/Mobile+V1.gif); background-size: cover; } #block-yui_3_17_2_1_1607017561137_11291 .sqs-block-image-figure > div img { opacity: 0 !important; } } Aw thank you so much! This code worked like a charm. Follow up question, if I want to change the spacing and remove some of the negative space above and below the .gif, what do I add to the code to change that?
Beyondspace Posted December 19, 2020 Posted December 19, 2020 7 hours ago, harvestfilmco said: Aw thank you so much! This code worked like a charm. Follow up question, if I want to change the spacing and remove some of the negative space above and below the .gif, what do I add to the code to change that? #block-yui_3_17_2_1_1608062302505_12334 { display: none; } #block-yui_3_17_2_1_1607017561137_11291 { padding-top: 0; padding-bottom: 0; } BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox - PDF Lightbox popup - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> No-code customisations for Squarespace
harvestfilmco Posted December 21, 2020 Author Posted December 21, 2020 On 12/18/2020 at 6:51 PM, bangank36 said: #block-yui_3_17_2_1_1608062302505_12334 { display: none; } #block-yui_3_17_2_1_1607017561137_11291 { padding-top: 0; padding-bottom: 0; } Thank you!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.