erikapruett Posted April 13 Posted April 13 (edited) Hi! I am designing a website. I am trying to get the button animation to look like this website: https://www.mcgeeandco.com/ It works when the button is on fill, but I am trying to figure out how to get the animation to fit inside the box when the button is set to fit. My site: https://purple-gar-wesk.squarespace.com/?password=demo Here is my code: .sqs-block-button-element--medium { border: 1px solid #515151 !important; transform: perspective(0p); color:var(--primaryButtonBackgroundColor) !important; } .sqs-block-button-element--medium:before { content: ""; position: absolute; display: flex; top: 0; right:0; bottom:0; left: 0; z-index:-1; background: #a97d6E; transform: scaleY(0); transform-origin: 50% 100%; transition: 0.4s; } .sqs-block-button-element--medium:hover { color:white !important; border: 1px solid #a97d6e !important; opacity: 1 !important; } .sqs-block-button-element--medium:hover:before { transform: scaleY(1); } Would love help! Thank you! - Erika Edited April 13 by erikapruett
Solution Beyondspace Posted April 15 Solution Posted April 15 On 4/14/2024 at 6:25 AM, erikapruett said: Hi! I am designing a website. I am trying to get the button animation to look like this website: https://www.mcgeeandco.com/ It works when the button is on fill, but I am trying to figure out how to get the animation to fit inside the box when the button is set to fit. My site: https://purple-gar-wesk.squarespace.com/?password=demo Here is my code: .sqs-block-button-element--medium { border: 1px solid #515151 !important; transform: perspective(0p); color:var(--primaryButtonBackgroundColor) !important; } .sqs-block-button-element--medium:before { content: ""; position: absolute; display: flex; top: 0; right:0; bottom:0; left: 0; z-index:-1; background: #a97d6E; transform: scaleY(0); transform-origin: 50% 100%; transition: 0.4s; } .sqs-block-button-element--medium:hover { color:white !important; border: 1px solid #a97d6e !important; opacity: 1 !important; } .sqs-block-button-element--medium:hover:before { transform: scaleY(1); } Would love help! Thank you! - Erika You can try this code .sqs-block-button-element--medium { border: 1px solid #515151 !important; transform: perspective(0p); color: #515151 !important; position: relative; } .sqs-block-button-element--medium:before { content: ""; position: absolute; display: flex; top: 0; right:0; bottom:0; left: 0; z-index:-1; background: #a97d6E; transform: scaleY(0); transform-origin: 50% 100%; transition: 0.4s; } .sqs-block-button-element--medium:hover { color:white !important; border: 1px solid #a97d6e !important; opacity: 1 !important; } .sqs-block-button-element--medium:hover:before { transform: scaleY(1); } Let me know how it works BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Pinch/Zoom images, videos - PDFs Lightbox - ...) </> 🗓️ Delivery Date Picker (Date picker form field) Gallery block 7.1 workaround </> 🤖 Ask me anything
erikapruett Posted April 16 Author Posted April 16 Yes! Works beautifully! Thank you so much. - Erika
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment