Cyperpunk-girl-333 Posted April 10, 2021 Share Posted April 10, 2021 Site URL: https://codepen.io/redspiderfish/pen/MYmeYz?js-preprocessor=none Hi how do I add this to my website I don't know where to insert the code found in this code pen. https://codepen.io/redspiderfish/pen/MYmeYz?js-preprocessor=none please help! however i will be changing the image to Beyondspace 1 Link to comment
Beyondspace Posted April 10, 2021 Share Posted April 10, 2021 <!--Image grabbed from: http://www.giantbomb.com/astro-boy-omega-factor/3030-2253/characters/--> <div id="bee"> <img src="//content.invisioncic.com/p289038/monthly_2021_04/2042369419_mouserov.png.780f6ae1eb5d64a63dcbd0a02dc08f49.png" /> </div> <style>.left { -moz-transform: scaleX(-1); -o-transform: scaleX(-1); -webkit-transform: scaleX(-1); transform: scaleX(-1); filter: FlipH; -ms-filter: "FlipH"; } .right { -moz-transform: scaleX(1); -o-transform: scaleX(1); -webkit-transform: scaleX(1); transform: scaleX(1); filter: FlipH; -ms-filter: "FlipH"; } #bee {transition: transform .1s}</style> <script> var bee = document.getElementById("bee"); document.addEventListener("mousemove", getMouse); bee.style.position = "absolute"; //css var beepos = {x:0, y:0}; setInterval(followMouse, 50); var mouse = {x:0, y:0}; //mouse.x, mouse.y var dir = "right"; function getMouse(e){ mouse.x = e.pageX; mouse.y = e.pageY; //Checking directional change if(mouse.x > beepos.x){ dir = "right"; } else { dir = "left"; } } function followMouse(){ //1. find distance X , distance Y var distX = mouse.x - beepos.x; var distY = mouse.y - beepos.y; //Easing motion //Progressive reduction of distance beepos.x += distX/5; beepos.y += distY/2; bee.style.left = beepos.x + "px"; bee.style.top = beepos.y + "px"; //Apply css class if (dir == "right"){ bee.setAttribute("class", "right"); } else { bee.setAttribute("class", "left"); } } </script> 7 hours ago, christina_marie_333 said: Site URL: https://codepen.io/redspiderfish/pen/MYmeYz?js-preprocessor=none Hi how do I add this to my website I don't know where to insert the code found in this code pen. https://codepen.io/redspiderfish/pen/MYmeYz?js-preprocessor=none please help! however i will be changing the image to Create new code block and paste this content, the content type is HTML. Heads up: the text below is long BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) 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
Cyperpunk-girl-333 Posted April 10, 2021 Author Share Posted April 10, 2021 Thank you I'll try this do i add it in the design css or advanced code injection? Thank you so much 🙂 Link to comment
Cyperpunk-girl-333 Posted April 10, 2021 Author Share Posted April 10, 2021 Hi I am getting a syntx error? When adding that code to design custom css Link to comment
Beyondspace Posted April 10, 2021 Share Posted April 10, 2021 (edited) 2 minutes ago, christina_marie_333 said: Hi I am getting a syntx error? When adding that code to design custom css Use advance code injection, since it has javascript code, it will require advance plan or higher Edited April 10, 2021 by bangank36 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) 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
Cyperpunk-girl-333 Posted April 10, 2021 Author Share Posted April 10, 2021 this is the website it is for https://crissy-webpage-design.squarespace.com Link to comment
Beyondspace Posted April 10, 2021 Share Posted April 10, 2021 5 minutes ago, christina_marie_333 said: this is the website it is for https://crissy-webpage-design.squarespace.com Did you add code to settings-advanced-code injection-footer? BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) 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
Cyperpunk-girl-333 Posted April 10, 2021 Author Share Posted April 10, 2021 Hello I upgraded to a higher subscription with javascript Do I had code to settings - design custom CSS <!--Image grabbed from: http://www.giantbomb.com/astro-boy-omega-factor/3030-2253/characters/--> <div id="bee"> <img src="//content.invisioncic.com/p289038/monthly_2021_04/2042369419_mouserov.png.780f6ae1eb5d64a63dcbd0a02dc08f49.png" /> </div> <style>.left { -moz-transform: scaleX(-1); -o-transform: scaleX(-1); -webkit-transform: scaleX(-1); transform: scaleX(-1); filter: FlipH; -ms-filter: "FlipH"; } .right { -moz-transform: scaleX(1); -o-transform: scaleX(1); -webkit-transform: scaleX(1); transform: scaleX(1); filter: FlipH; -ms-filter: "FlipH"; } #bee {transition: transform .1s}</style> <script> var bee = document.getElementById("bee"); document.addEventListener("mousemove", getMouse); bee.style.position = "absolute"; //css var beepos = {x:0, y:0}; setInterval(followMouse, 50); var mouse = {x:0, y:0}; //mouse.x, mouse.y var dir = "right"; function getMouse(e){ mouse.x = e.pageX; mouse.y = e.pageY; //Checking directional change if(mouse.x > beepos.x){ dir = "right"; } else { dir = "left"; } } function followMouse(){ //1. find distance X , distance Y var distX = mouse.x - beepos.x; var distY = mouse.y - beepos.y; //Easing motion //Progressive reduction of distance beepos.x += distX/5; beepos.y += distY/2; bee.style.left = beepos.x + "px"; bee.style.top = beepos.y + "px"; //Apply css class if (dir == "right"){ bee.setAttribute("class", "right"); } else { bee.setAttribute("class", "left"); } } </script> Or do I add if as a code block? Or do I add it to the header or footer ? Advanced Code Injection? I understand the code I just don't no where to copy and paste it on the sqaurespace website? Thank you for your help I've been trying for months Link to comment
Cyperpunk-girl-333 Posted April 10, 2021 Author Share Posted April 10, 2021 yay it worked !!!!!!!! How do I slow down the follow speed so its got a bigger delay please see on website now https://crissy-webpage-design.squarespace.com Thank you for your help Link to comment
Cyperpunk-girl-333 Posted April 17, 2021 Author Share Posted April 17, 2021 Hi bangank36 how do I make the image change to a different Url image when I hover the mouse over links on the navigation or links on the site? is that possible ? Thank you so much you are the most helpful person on sqaurespace forum Link to comment
paul2009 Posted April 17, 2021 Share Posted April 17, 2021 For information, I found it really difficult to reach the cart. Clicking the cart icon didn't do anything. About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥. Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links. Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional. Link to comment
Cyperpunk-girl-333 Posted April 18, 2021 Author Share Posted April 18, 2021 12 hours ago, paul2009 said: For information, I found it really difficult to reach the cart. Clicking the cart icon didn't do anything. Hi Paul how do i fix this put keep the lemon? Link to comment
Cyperpunk-girl-333 Posted May 7, 2021 Author Share Posted May 7, 2021 On 4/11/2021 at 1:04 AM, bangank36 said: <!--Image grabbed from: http://www.giantbomb.com/astro-boy-omega-factor/3030-2253/characters/--> <div id="bee"> <img src="//content.invisioncic.com/p289038/monthly_2021_04/2042369419_mouserov.png.780f6ae1eb5d64a63dcbd0a02dc08f49.png" /> </div> <style>.left { -moz-transform: scaleX(-1); -o-transform: scaleX(-1); -webkit-transform: scaleX(-1); transform: scaleX(-1); filter: FlipH; -ms-filter: "FlipH"; } .right { -moz-transform: scaleX(1); -o-transform: scaleX(1); -webkit-transform: scaleX(1); transform: scaleX(1); filter: FlipH; -ms-filter: "FlipH"; } #bee {transition: transform .1s}</style> <script> var bee = document.getElementById("bee"); document.addEventListener("mousemove", getMouse); bee.style.position = "absolute"; //css var beepos = {x:0, y:0}; setInterval(followMouse, 50); var mouse = {x:0, y:0}; //mouse.x, mouse.y var dir = "right"; function getMouse(e){ mouse.x = e.pageX; mouse.y = e.pageY; //Checking directional change if(mouse.x > beepos.x){ dir = "right"; } else { dir = "left"; } } function followMouse(){ //1. find distance X , distance Y var distX = mouse.x - beepos.x; var distY = mouse.y - beepos.y; //Easing motion //Progressive reduction of distance beepos.x += distX/5; beepos.y += distY/2; bee.style.left = beepos.x + "px"; bee.style.top = beepos.y + "px"; //Apply css class if (dir == "right"){ bee.setAttribute("class", "right"); } else { bee.setAttribute("class", "left"); } } </script> Create new code block and paste this content, the content type is HTML. Heads up: the text below is long How do I stop the mouse 🐀 from tracking to far to the right 👉 moving the screen across on mobile and desktop. Please help Link to comment
Cyperpunk-girl-333 Posted May 7, 2021 Author Share Posted May 7, 2021 On 4/17/2021 at 11:56 PM, paul2009 said: For information, I found it really difficult to reach the cart. Clicking the cart icon didn't do anything. Would you know how I can stop the mouse 🐀 from tracking to far to the right 👉, as requested in few post Link to comment
creedon Posted May 9, 2021 Share Posted May 9, 2021 I think I have addressed the cursor creep issue in another thread. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. 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