Advertisement
A_God

ghost-slider

Jan 16th, 2025
680
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 3.66 KB | None | 0 0
  1. <div id="ghost-slider">
  2.   <style>
  3.     #ghost-slider {
  4.       font-family: Arial, sans-serif;
  5.       background-color: #f9f9f9;
  6.       display: flex;
  7.       justify-content: center;
  8.       align-items: center;
  9.       height: 100vh;
  10.       margin: 0;
  11.     }
  12.  
  13.     .ghost-slider-container {
  14.       position: relative;
  15.       width: 80%;
  16.       max-width: 1200px;
  17.       overflow: hidden;
  18.     }
  19.  
  20.     .ghost-slider {
  21.       display: flex;
  22.       transition: transform 0.3s ease-in-out;
  23.     }
  24.  
  25.     .ghost-box {
  26.       min-width: 100%;
  27.       padding: 20px;
  28.       box-sizing: border-box;
  29.       background: #fff;
  30.       margin: 10px;
  31.       border-radius: 10px;
  32.       box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  33.       text-align: left;
  34.     }
  35.  
  36.     .ghost-box h3 {
  37.       margin-bottom: 10px;
  38.     }
  39.  
  40.     .ghost-box ul {
  41.       list-style-type: none;
  42.       padding: 0;
  43.     }
  44.  
  45.     .ghost-box li {
  46.       margin-bottom: 8px;
  47.     }
  48.  
  49.     .ghost-e-commerce {
  50.       background-color: #e0f4ff;
  51.     }
  52.  
  53.     .ghost-banking-finance {
  54.       background-color: #d9fbee;
  55.     }
  56.  
  57.     .ghost-restaurants {
  58.       background-color: #fff4d1;
  59.     }
  60.  
  61.     .ghost-navigation {
  62.       position: absolute;
  63.       top: 50%;
  64.       width: 100%;
  65.       display: flex;
  66.       justify-content: space-between;
  67.       transform: translateY(-50%);
  68.     }
  69.  
  70.     .ghost-navigation button {
  71.       background: #fff;
  72.       border: none;
  73.       padding: 10px 20px;
  74.       cursor: pointer;
  75.       font-size: 18px;
  76.       box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  77.       border-radius: 5px;
  78.     }
  79.  
  80.     .ghost-navigation button:hover {
  81.       background: #f0f0f0;
  82.     }
  83.   </style>
  84.   <div class="ghost-slider-container">
  85.     <div class="ghost-slider">
  86.       <div class="ghost-box ghost-e-commerce">
  87.         <h3>E-commerce</h3>
  88.         <ul>
  89.           <li>Accept Native Payments on WhatsApp</li>
  90.           <li>Create Conversational Flows that Convert</li>
  91.           <li>Set up automated checkout workflows</li>
  92.           <li>Categorize products into Collections</li>
  93.         </ul>
  94.       </div>
  95.       <div class="ghost-box ghost-banking-finance">
  96.         <h3>Banking & Finance</h3>
  97.        <ul>
  98.          <li>Carry out KYC processes like ID verification</li>
  99.          <li>Respond to customer queries 24×7</li>
  100.          <li>Showcase your offerings with WhatsApp storefront</li>
  101.        </ul>
  102.      </div>
  103.      <div class="ghost-box ghost-restaurants">
  104.        <h3>Restaurants & Food Businesses</h3>
  105.        <ul>
  106.          <li>Promote your food menu with WhatsApp Catalogs</li>
  107.          <li>Take food orders & payments on WhatsApp</li>
  108.          <li>Offer 24×7 customer support</li>
  109.        </ul>
  110.      </div>
  111.    </div>
  112.    <div class="ghost-navigation">
  113.      <button id="ghost-prev">←</button>
  114.      <button id="ghost-next">→</button>
  115.    </div>
  116.  </div>
  117.  <script>
  118.    (function () {
  119.      const slider = document.querySelector('#ghost-slider .ghost-slider');
  120.       const boxes = document.querySelectorAll('#ghost-slider .ghost-box');
  121.       const prevButton = document.getElementById('ghost-prev');
  122.       const nextButton = document.getElementById('ghost-next');
  123.  
  124.       let currentIndex = 0;
  125.  
  126.       function updateSliderPosition() {
  127.         slider.style.transform = `translateX(-${currentIndex * 100}%)`;
  128.       }
  129.  
  130.       prevButton.addEventListener('click', () => {
  131.         currentIndex = currentIndex > 0 ? currentIndex - 1 : boxes.length - 1;
  132.         updateSliderPosition();
  133.       });
  134.  
  135.       nextButton.addEventListener('click', () => {
  136.         currentIndex = currentIndex < boxes.length - 1 ? currentIndex + 1 : 0;
  137.        updateSliderPosition();
  138.      });
  139.    })();
  140.  </script>
  141. </div>
  142.  
Tags: html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement