I am trying to get an EMAIIL signup on my password page.

I am trying to get an EMAIIL signup on my password page.

sonder23
Visitor
2 0 0

I have the code on my website, everything is working smoothly but I keep receiving an error on my password page. Website domain is 

dwdrby-q8.myshopify.com

 

 

 

 

 

<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>{{ shop.name }}</title>
  {{ content_for_header }}
  <style>
    body, html {
      margin: 0;
      padding: 0;
      height: 100%;
      font-family: "Helvetica", sans-serif;
      color: #fff;
      overflow: hidden; /* Prevent scrolling */
      cursor: url('https://cdn.shopify.com/s/files/1/0697/3417/0773/files/sonderlogo.png?v=1738036767'), pointer; /* Custom cursor */
    }

    .video-container {
      position: fixed; /* Fix the video in place */
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 1; /* Bring the video to the front */
    }

    video {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      object-fit: cover; /* Ensure video fills the screen */
    }

    .header {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      padding: 10px 40px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(0, 0, 0, 0.5); /* Semi-transparent background for header */
      z-index: 2; /* Ensure header is above the video */
      font-weight: bold;
    }

    .header img {
      height: 118px; /* Significantly larger logo */
    }

    .live-clock {
      font-size: 18px; /* Larger font size */
      text-align: center; /* Center the text */
      padding: 0 20px; /* Add padding for better spacing */
      position: relative;
      z-index: 2;
      max-width: 300px; /* Set a max width for the text */
      white-space: nowrap; /* Prevent text from wrapping */
      overflow: hidden; /* Hide excess text */
      text-overflow: ellipsis; /* Add ellipsis for cutoff text */
      color: #fff;
    }

    .live-clock img {
      vertical-align: middle;
      width: 20px; /* Adjust icon size */
      height: 20px;
      margin-left: 5px;
    }

    .content {
      position: relative;
      z-index: 1; /* Ensure content is above the video but below header */
      text-align: center;
      top: 50%;
      transform: translateY(-50%);
    }

    .content h1 {
      font-size: 36px;
      text-transform: lowercase;
      margin-bottom: 20px;
    }

    .signup-button {
      padding: 10px 20px;
      background-color: lime;
      color: #000;
      font-size: 18px;
      border: none;
      cursor: pointer;
      text-transform: lowercase;
    }

    .signup-button:hover {
      background-color: #00cc00;
    }

    .modal {
      display: none;
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: rgba(0, 0, 0, 0.9);
      color: #fff;
      padding: 20px;
      z-index: 3; /* Ensure modal is above all other content */
      width: 90%;
      max-width: 400px;
      text-align: center;
    }

    .modal input {
      margin: 10px 0;
      padding: 10px;
      width: 80%;
    }

    .modal button {
      padding: 10px 20px;
      background-color: lime;
      color: #000;
      border: none;
      cursor: pointer;
      text-transform: lowercase;
    }

    .modal button:hover {
      background-color: #00cc00;
    }

    .close-modal {
      position: absolute;
      top: 10px;
      right: 10px;
      cursor: pointer;
    }
  </style>
</head>
<body>
  <div class="video-container">
    <!-- Background Video -->
    <video autoplay muted loop playsinline>
      <source src="https://cdn.shopify.com/videos/c/o/v/edbe183d2eb144538d668899a1d42286.mp4" type="video/mp4">
      Your browser does not support the video tag.
    </video>
  </div>

  <!-- Coming Soon Bar -->
  <div class="coming-soon">coming soon...</div>

  <!-- Store Header -->
  <div class="header">
    <img src="https://cdn.shopify.com/s/files/1/0697/3417/0773/files/sonderlogo.png?v=1738036767" alt="sonder logo">
    <div class="live-clock" id="live-clock">Loading time and weather...</div>
  </div>

  <!-- Main Content -->
  <div class="content">
    <h1>sonder</h1>
    <button class="signup-button" id="signup-button">sign up for drop</button>
  </div>

  <!-- Modal for Signup Form -->
  <div class="modal" id="signup-modal">
    <div class="close-modal" id="close-modal">&#10005;</div>
    <h2>sign up for drop</h2>
    <form id="signup-form" action="/contact" method="POST">
      <input type="hidden" name="form_type" value="contact">
      <input type="hidden" name="utf8" value="✓">
      <input type="text" name="contact[name]" placeholder="Your Name" required>
      <input type="email" name="contact[email]" placeholder="Your Email" required>
      <button type="submit">submit</button>
    </form>
  </div>

  <!-- Footer -->
  {{ content_for_layout }}

  <!-- JavaScript -->
  <script>
    // Live Clock and Weather Placeholder
    const liveClockElement = document.getElementById('live-clock');

    async function updateClockAndWeather() {
      const now = new Date();
      const options = { hour: '2-digit', minute: '2-digit', second: '2-digit' };
      const timeString = now.toLocaleTimeString(undefined, options);

      try {
        const response = await fetch('https://api.open-meteo.com/v1/forecast?latitude=35&longitude=139&current_weather=true');
        const weatherData = await response.json();
        const temperature = (weatherData.current_weather.temperature * 9/5) + 32; // Convert Celsius to Fahrenheit
        const weatherCode = weatherData.current_weather.weathercode; // Simplified, use this for icons or descriptions

        // Determine weather icon based on weather code
        let weatherIcon = '';
        if (weatherCode === 1) {
          weatherIcon = '☀️'; // Sunny
        } else if (weatherCode === 2 || weatherCode === 3) {
          weatherIcon = '☁️'; // Cloudy
        } else if (weatherCode === 4) {
          weatherIcon = '🌙'; // Night time / Moon
        } else {
          weatherIcon = ''; // Unknown weather
        }

        liveClockElement.innerHTML = `${timeString} - ${Math.round(temperature)}°F ${weatherIcon}`;
      } catch (error) {
        liveClockElement.textContent = `${timeString} - Weather unavailable`;
      }
    }

    setInterval(updateClockAndWeather, 1000);
    updateClockAndWeather();

    // Signup Modal
    const signupButton = document.getElementById('signup-button');
    const signupModal = document.getElementById('signup-modal');
    const closeModal = document.getElementById('close-modal');

    signupButton.addEventListener('click', () => {
      signupModal.style.display = 'block';
    });

    closeModal.addEventListener('click', () => {
      signupModal.style.display = 'none';
    });

    // Form Submission Logic
    document.getElementById('signup-form').addEventListener('submit', async function(event) {
      event.preventDefault(); // Prevent form from redirecting

      const formData = new FormData(this); // Gather form data

      try {
        const response = await fetch('/contact', {
          method: 'POST',
          body: formData,
          headers: {
            'Accept': 'application/json', // Request JSON response
            'X-Requested-With': 'XMLHttpRequest', // Indicates an AJAX request
          },
        });

        if (response.ok) {
          const result = await response.json(); // Parse JSON response
          if (result.success) {
            alert('Thank you for signing up!');
            this.reset(); // Clear the form
            signupModal.style.display = 'none'; // Close the modal
          } else {
            // Handle Shopify's validation errors
            if (result.errors) {
              alert('Please fix the following errors:\n' + Object.values(result.errors).join('\n'));
            } else {
              alert('There was an issue submitting your form. Please try again.');
            }
          }
        } else {
          // Handle server errors
          const errorData = await response.json();
          console.error('Server response error:', errorData);
          alert('There was an issue submitting your form. Please try again.');
        }
      } catch (error) {
        console.error('Fetch error:', error); // Log any network errors
        alert('There was an error processing your request.');
      }
    });
  </script>
</body>
</html>

 

 

 

 

 Please help!!!

Replies 0 (0)