bike-bear-logobike-bear-logobike-bear-logobike-bear-logo
✕
Published by bikebear on June 30, 2026
Categories
  • GSAP
  • Layout
  • DateJune 30, 2026
THATS THE REASON

why Sweet Tape exists. Three generations, one shared belief.

That a humble product, made with enough heart, could show up for anyone chasing the things that matter most to them.

HTML

<section class="mwg_effect062">
    <div class="container">
        
			<div class="sub-head-dark">THATS THE REASON</div>
<h2 class="animate">why Sweet Tape exists.
Three generations,
one shared belief.</h2>

<p>That a humble product, made with enough heart, could show up for anyone chasing the things that matter most to them.</p>
			
    </div>
    <div class="medias">
        <img src="https://sweet-tape.com/wp-content/uploads/2026/05/Group-511.svg" alt="">
        <img src="https://sweet-tape.com/wp-content/uploads/2026/05/Group-403.svg" alt="">
        <img src="https://sweet-tape.com/wp-content/uploads/2026/05/Group-424.svg" alt="">
        <img src="https://sweet-tape.com/wp-content/uploads/2026/06/Group-643-copy.svg" alt="">
        <img src="https://sweet-tape.com/wp-content/uploads/2026/06/Group-645.svg" alt="">
        <img src="https://sweet-tape.com/wp-content/uploads/2026/06/Group-575.svg" alt="">
        <img src="https://sweet-tape.com/wp-content/uploads/2026/05/Group-511.svg" alt="">
        <img src="https://sweet-tape.com/wp-content/uploads/2026/05/Group-403.svg" alt="">
        <img src="https://sweet-tape.com/wp-content/uploads/2026/05/Group-424.svg" alt="">
        <img src="https://sweet-tape.com/wp-content/uploads/2026/06/Group-643-copy.svg" alt="">
        <img src="https://sweet-tape.com/wp-content/uploads/2026/06/Group-645.svg" alt="">
        <img src="https://sweet-tape.com/wp-content/uploads/2026/06/Group-575.svg" alt="">
    </div>
</section>

CSS

  .mwg_effect062 {
    height: 100dvh;
    overflow: hidden;
    position: relative;
    background: #c6fe00;
  }
 
  .mwg_effect062 .container {
    display: grid;
    place-items: center;
    height: 100%;
    width: 100%;
    position: absolute;
    pointer-events: none;
    z-index: 1;
	      margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
	      max-width: fit-content;
  }
 
  .mwg_effect062 .text {
    font-size: clamp(2rem, 6vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
    text-align: center;
    line-height: 1.1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1em;
  }
 
  .mwg_effect062 .text-g {
    color: #888;
  }
 
  .mwg_effect062 img {
    width: 14vw;
    height: 14vw;
    min-width: 80px;
    min-height: 80px;
    max-width: 140px;
    max-height: 140px;
    position: absolute;
    top: 0;
    left: 0;
    object-fit: cover;
    z-index: 5;
    border-radius: 12px;
  }
 
  .mwg_effect062 .medias img {
    width: 1px;
    height: 1px;
    top: 0;
    left: 0;
    position: absolute;
    visibility: hidden;
    pointer-events: none;
  }

JS

<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
   <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollTrigger.min.js"></script>
<script>
jQuery(document).ready(function( $ ){
 
  const root = document.querySelector('.mwg_effect062')
  const images = []
 
  root.querySelectorAll('.medias img').forEach(image => {
    images.push(image.getAttribute('src'))
  })
 
  let isTouch = false
  if (window.matchMedia('(hover: none)').matches) isTouch = true
 
  let incr = 0,
      oldIncrX = 0,
      oldIncrY = 0,
      resetDist = window.innerWidth / (isTouch ? 3 : 8),
      indexImg = 0
 
  const rectTop = () => root.getBoundingClientRect().top
 
  const W = window.innerWidth
  const H = window.innerHeight
  const clampX = gsap.utils.clamp(0, W)
  const clampY = gsap.utils.clamp(0, H)
 
  function applyMove(clientX, clientY) {
    const valX = clampX(clientX)
    const valY = clampY(clientY)
 
    incr += Math.abs(valX - oldIncrX) + Math.abs(valY - oldIncrY)
    if (incr > resetDist) {
      incr = 0
      createMedia(valX, valY - rectTop(), valX - oldIncrX, valY - oldIncrY)
    }
    oldIncrX = valX
    oldIncrY = valY
  }
 
  function handleMouseMove(e) {
    applyMove(e.clientX, e.clientY)
  }
 
  function handleTouchMove(e) {
    if (!e.touches || !e.touches[0]) return
    applyMove(e.touches[0].clientX, e.touches[0].clientY)
  }
 
  const initPointer = (clientX, clientY) => {
    oldIncrX = clampX(clientX)
    oldIncrY = clampY(clientY)
  }
 
  root.addEventListener('mousemove', (e) => initPointer(e.clientX, e.clientY), { once: true })
  root.addEventListener('touchstart', (e) => {
    if (!e.touches || !e.touches[0]) return
    initPointer(e.touches[0].clientX, e.touches[0].clientY)
  }, { once: true, passive: true })
 
  root.addEventListener('mousemove', handleMouseMove)
  root.addEventListener('touchmove', handleTouchMove, { passive: true })
 
  function createMedia(x, y, deltaX, deltaY) {
    const image = document.createElement('img')
    image.setAttribute('src', images[indexImg])
    root.appendChild(image)
 
    const w = image.offsetWidth
    const h = image.offsetHeight
    const cx = x - w / 2
    const cy = y - h / 2
 
    const rndRot     = (Math.random() - 0.5) * 30
    const overshootX = cx + deltaX * 3.5
    const overshootY = cy + deltaY * 3.5
 
    const tl = gsap.timeline({
      onComplete: () => {
        if (root.contains(image)) root.removeChild(image)
        tl && tl.kill()
      }
    })
 
    tl.fromTo(image, {
      x: cx,
      y: cy,
      scaleX: 1.3,
      scaleY: 1.3,
      rotation: rndRot,
      opacity: 1
    }, {
      scaleX: 1,
      scaleY: 1,
      ease: 'elastic.out(2, 0.6)',
      duration: 0.6
    })
 
    tl.to(image, {
      x: overshootX,
      y: overshootY,
      rotation: (Math.random() - 0.5) * 30,
      ease: 'power2.out',
      duration: 0.25
    }, '<')
 
    tl.to(image, {
      x: cx,
      y: cy,
      ease: 'elastic.out(1.4, 0.5)',
      duration: 0.55
    })
 
    tl.to(image, {
      scale: 0.5,
      opacity: 0,
      ease: 'back.in(1.5)',
      duration: 0.3,
      delay: 0.1
    })
 
    indexImg = (indexImg + 1) % images.length
  }
 
});
	</script>

Related posts

June 30, 2026

Flilp Bento Hover Effect


Read more
June 30, 2026

Matter JS


Read more
March 31, 2026

Text Marquee GSAP


Read more
© 2026 Betheme by Muffin group | All Rights Reserved | Powered by WordPress