Jump to content

failbetter

Circle Member
  • Posts

    75
  • Joined

  • Last visited

Personal Information

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

failbetter's Achievements

  1. This has been going on for almost a year. I cannot understand why it hasn't been fixed yet.
  2. @bangank36 Do you have and advice as to how to integrate gsap animations on squarespace sites? I'm not sure where to start!
  3. Hey @creedon - Yeah because I was just trying it to figure it out - I can do it on a paid site but I still dunno where to put what! Someone said that you'd have to add the images in code blocks but I was thinking if they were in a gallery or something elsewhere in the site with the right names or classes i could maybe implement it....
  4. Hey @creedon Thanks so much! I was forgetting the semicolon! ROOKIE mistake. Works perfectly 😊
  5. Site URL: https://raspberry-garlic-8h62.squarespace.com/ Hi everyone, I am testing a script to see if i can implement on squarespace - but I need it to stop stretching on click. I'm a beginner at JS and cant figure out how to make the action stop when you click. Any help would be greatly appreciated! @creedon @tuanphan Site PW: stretch Here's the JS // stretch text var originalWidth = $("h1").width() var originalHeight = $("h1").height() $(document).on("mousemove", function (event){ var scaleX = event.pageX / originalWidth var scaleY = event.pageY / originalHeight $("h1").css("transform","scale("+ scaleX +","+ scaleY +")") })
  6. Site URL: https://amphibian-pineapple-742d.squarespace.com/portfolio-fluid I am tying to implement a code I got from a superhi tutorial on a squarespace site. I want to have a gallery that doesn't appear until you click. Like this site - studio-push.com I have the script written - just not sure how to implement it in squarespace..... any ideas? // JavaScript to reveal image on click. const images = [ "Folio-1.jpg", "Folio-2.jpg", "Folio-3.jpg" ] let i = 0 function placeImage(x, y){ const nextImage = images[i] const img = document.createImage("img") img.setAttribute("src", nextImage) img.style.left = x + "px" img.style.top = y + "px" // if you want to rotate... //img.style.transform = "rotate (" + (Math.random() * 20 - 10) + "deg)" img.style.transform = "translate(-50%,-50%) scale(0.5)" document.body.appendChild(img) i = i + 1 if (i >= images.length) { i = 0 } } document.addEventListener("click", function(event){ event.preventDefault() placeImage(event.pageX,event.pageY ) }) ///on mobile document.addEventListener("touchend", function(event){ event.preventDefault() placeImage(event.pageX,event.pageY ) }) This code works when I use on the SuperHi site but just cant quite wrap my head around how to implement it in squarespace.... Added this in the code Injection footer: <!-- Image adder --> <script src="/s/imageadder.js"></script> <!-- Image Adder --> then added the imageadder.js file into site as a link.... Just can't figure out the next steps... code block with something like this where images are in a page with a gallery?? <article class="imageadder" data-url=“/portfolio”></article> Would greatly appreciate some help with this @creedon @tuanphan or anyone! ps site is under development but page is :https://amphibian-pineapple-742d.squarespace.com/portfolio-fluid password: sos
  7. Is it possible to keep the original aspect ratio in a grid gallery? like I have a mixed grid gallery of landscape and portrait images. Is it possible to keep them the same ratio and equivalent size?
  8. Site URL: https://www.byhutch.com Hi, I designed a site on Cargo for an artist and I would like to use the same .js file to animate a background image on squarespace but I am not sure how to implement it. I have added the image as a background, added the script to the footer injection and i have this code in the css. ///testing parallax section[data-section-id="629bd39be10a3e30d5e26b57"] { .section-background img { ??????? } } here's the script.... const sections = document.querySelectorAll("section") const bodyTag = document.querySelector("body") const addMovement = function () { const topViewport = window.pageYOffset const midViewport = topViewport + (window.innerHeight / 2) // lets find the middle of each section // (section, index) => {} sections.forEach((section, index) => { const topSection = section.offsetTop const midSection = topSection + (section.offsetHeight / 2) // how far away is the section from the visible area of the page const distanceToSection = midViewport - midSection // pick the tags to parallax const image = section.querySelector("img") const contentTag = section.querySelector("div") // weight down this distance let rotation = distanceToSection / 100 let contentDist = -1 * distanceToSection / 2 // for all the even sections, rotate the other way // is the index divisible by two // is the index's remainder zero? // the modulo operator 5 % 2 = 1, 4 % 2 = 0 if (index % 2 == 1) { rotation = rotation * -1 } // apply some parallax image.style.transform = `rotate(${rotation}deg)` contentTag.style.top = `${contentDist}px` contentTag.style.transform = `rotate(${-1 * rotation}deg)` // check the background if (distanceToSection > -100) { const dataBackground = section.getAttribute("data-background") bodyTag.style.backgroundColor = dataBackground } }) } addMovement() document.addEventListener("scroll", function () { addMovement() }) window.addEventListener("resize", function () { addMovement() }) any ideas? @tuanphan @creedon The url I am trying to implement is just a trial site https://radish-hexaflexagon-chhx.squarespace.com/parallax pw:demo
  9. @creedon That is what I was trying to figure out! worked a treat thank you!!!
  10. Thanks @creedon I have put spacer blocks in which works fine for desktop, just still cant get it to be centered in mobile. Even if I don't hide space blocks it still pushes itself to the left.
  11. I'm trying to do it here too - https://www.sucoca.com/shop/p/handmade-chocolate any ideas? @tuanphan
  12. Hi @creedon I am trying to do the same with a logo in the footer of my site...Not sure why it's being a bit of a pain. #block-yui_3_17_2_1_1647446956387_11985 { flex-wrap : nowrap !important; justify-content : center!important; } Is it because it's in the footer? I tried centering with spacer blocks but I've coded them to not be seen on mobile because it works better for rest of site. /* remove spacer block mobile */ @media screen and (max-width:767px) { .spacer-block-id { display: none; } } 😬
  13. no i haven't figured it out at all apart from the 50% width! Still need to make it fully transparent and the links at the bottom left of page...
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.