Sunday, 10 November 2024

Scroll

 <!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Smooth Scroll Animation</title>

    <link rel="stylesheet" href="css/bootstrap.min.css">

    <link rel="stylesheet" href="css/fontawesome-all.css"/>

    <link rel="stylesheet" href="fonts/stylesheet.css">


<style>


body {

  margin: 0;  

  font-family: Arial, sans-serif;

}

.scrollMain {padding: 0; background: green;

  position: fixed; top: 0; width: 100%; z-index: 1;

  }

  

.image-container {

    min-height: 150px; 

    transition: transform 0.1s ease-out;

    position: relative;

}


.animated-image { position: absolute; left: 50%; transform: translateX(-50%);

  width: 150px; margin: auto; display: block;

  height: auto;

}

 


</style>

</head>

<body>


<!-- START testimonial -->

<section class="scrollMain">

    <div class="container">

<div class="row">

<div class="col-lg-12">

  <div class="image-container">

<img src="images/Cameron.png" class="animated-image" />

  </div>

</div>

</div>

</div>

</section>

<!-- END testimonial -->



<!-- START testimonial -->

<section class="testimonialsMain" style="color: #fff; background: red;">

    <div class="container">

<div class="row">

<div class="col-lg-12">

  <h1> 

<h1> Develop and maintain WordPress websites, ensuring high performance and user experience. </h1>  

<h1> Customize themes and plugins to meet specific project requirements. </h1>  

<h1> Collaborate with the design and content teams to implement new features and updates. </h1>  

<h1> Troubleshoot and resolve website issues, including bugs and security vulnerabilities. </h1>  

<h1> Optimize website performance, including speed and SEO considerations. </h1>  

<h1> Stay up-to-date with the latest WordPress trends and best practices. </h1>  

<h1> Develop and maintain WordPress websites, ensuring high performance and user experience. </h1>  

<h1> Customize themes and plugins to meet specific project requirements. </h1>  

<h1> Collaborate with the design and content teams to implement new features and updates. </h1>  

<h1> Troubleshoot and resolve website issues, including bugs and security vulnerabilities. </h1>  

<h1> Optimize website performance, including speed and SEO considerations. </h1>  

<h1> Stay up-to-date with the latest WordPress trends and best practices. </h1>  

<h1> Develop and maintain WordPress websites, ensuring high performance and user experience. </h1>  

<h1> Customize themes and plugins to meet specific project requirements. </h1>  

<h1> Collaborate with the design and content teams to implement new features and updates. </h1>  

<h1> Troubleshoot and resolve website issues, including bugs and security vulnerabilities. </h1>  

<h1> Optimize website performance, including speed and SEO considerations. </h1>  

<h1> Stay up-to-date with the latest WordPress trends and best practices. </h1>  

<h1> Develop and maintain WordPress websites, ensuring high performance and user experience. </h1>  

<h1> Customize themes and plugins to meet specific project requirements. </h1>  

<h1> Collaborate with the design and content teams to implement new features and updates. </h1>  

<h1> Troubleshoot and resolve website issues, including bugs and security vulnerabilities. </h1>  

<h1> Optimize website performance, including speed and SEO considerations. </h1>  

<h1> Stay up-to-date with the latest WordPress trends and best practices. </h1>  

  

  </h1>  

</div>

</div>

</div>

</section>

<!-- END testimonial -->


<!-- END testimonial

  <script>

window.addEventListener('scroll', () => {

  const image = document.querySelector('.animated-image');

  const scrollPosition = window.scrollY;

  const maxOffset = 200; // Maximum translateX offset in pixels


  // Calculate translateX based on scroll position

  // Moving left as we scroll down and right as we scroll up

  const translateX = Math.min(scrollPosition / 5, maxOffset) * -1;


  // Apply the transformation to move the image horizontally

  image.style.transform = `translate(-50%, -50%) translateX(${translateX}px)`;

});


  </script>

 -->


 

  <script>

window.addEventListener('scroll', () => {

  const image = document.querySelector('.animated-image');

  const scrollPosition = window.scrollY;

  const maxOffset = 480; // Maximum translateX offset in pixels


  // Calculate translateX based on scroll position

  // Moving left as we scroll down and right as we scroll up

  const translateX = Math.min(scrollPosition / 1, maxOffset) * -1;


  // Apply the transformation to move the image horizontally

  image.style.transform = `translateX(-50%) translateX(${translateX}px)`;

});


  </script>

</body>

</html>


Twitter Bird Gadget