HTML CSS AND JAVASCRIPT CODE FOR SAAS APPLICATION

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Advanced SaaS App</title>
  <style>
    /* Basic Styles */
    body {
      font-family: Arial, sans-serif;
      background-color: #f4f4f9;
      margin: 0;
      padding: 0;
    }
    header {
      background-color: #333;
      color: white;
      text-align: center;
      padding: 1em 0;
      font-size: 1.5em;
    }
    footer {
      text-align: center;
      padding: 1em 0;
      background-color: #333;
      color: white;
    }
    .container {
      width: 100%;
      max-width: 1200px;
      margin: 0 auto;
      padding: 20px;
    }
    .hidden {
      display: none;
    }
    .emoji {
      font-size: 2em;
    }
    button {
      background-color: #4CAF50;
      color: white;
      padding: 10px 20px;
      border: none;
      cursor: pointer;
      font-size: 1em;
    }
    button:hover {
      background-color: #45a049;
    }
    input, select {
      padding: 10px;
      margin: 10px 0;
      font-size: 1em;
      width: 100%;
    }
    .emoji-buttons button {
      font-size: 2em;
      margin: 5px;
    }
    .notification {
      background-color: #ffeb3b;
      padding: 10px;
      border-radius: 5px;
      margin-top: 20px;
      font-size: 1.2em;
    }
  </style>
</head>
<body>
  <header>
    Advanced SaaS Application <span class="emoji">🚀</span>
  </header>

  <div class="container">
    <!-- Login Section -->
    <div id="login" class="hidden">
      <h2>Login</h2>
      <form id="loginForm">
        <input type="text" placeholder="Username" required>
        <input type="password" placeholder="Password" required>
        <button type="submit">Login <span class="emoji">🔑</span></button>
      </form>
      <p>Don't have an account? <span class="emoji">🖊️</span> <a href="javascript:void(0)" onclick="showSection('signup')">Sign Up</a></p>
    </div>

    <!-- Sign Up Section -->
    <div id="signup" class="hidden">
      <h2>Sign Up</h2>
      <form id="signupForm">
        <input type="text" placeholder="Username" required>
        <input type="email" placeholder="Email" required>
        <input type="password" placeholder="Password" required>
        <button type="submit">Sign Up <span class="emoji">📝</span></button>
      </form>
      <p>Already have an account? <a href="javascript:void(0)" onclick="showSection('login')">Login</a></p>
    </div>

    <!-- Forgot Password Section -->
    <div id="forgotPassword" class="hidden">
      <h2>Reset Password</h2>
      <form id="resetPasswordForm">
        <input type="email" placeholder="Enter your email" required>
        <button type="submit">Send Reset Link <span class="emoji">📧</span></button>
      </form>
      <p>Remembered your password? <a href="javascript:void(0)" onclick="showSection('login')">Login</a></p>
    </div>

    <!-- Dashboard Section -->
    <div id="dashboard" class="hidden">
      <h2>Welcome, <span id="userName">User</span>! <span class="emoji">🎉</span></h2>
      <p>Current Subscription: <span id="subscriptionStatus">Not Subscribed</span> <span class="emoji">💳</span></p>
      <div class="notification">
        <span class="emoji">🔔</span> You have new updates!
      </div>

      <h3>Your Activity <span class="emoji">📊</span></h3>
      <ul id="activityLog">
        <!-- Populated dynamically -->
      </ul>

      <h3>Give Feedback <span class="emoji">💬</span></h3>
      <form id="feedbackForm">
        <textarea placeholder="Your feedback" required></textarea>
        <div class="emoji-buttons">
          <button type="button" onclick="addEmoji('😀')">😀</button>
          <button type="button" onclick="addEmoji('😍')">😍</button>
          <button type="button" onclick="addEmoji('😎')">😎</button>
          <button type="button" onclick="addEmoji('😢')">😢</button>
        </div>
        <button type="submit">Submit Feedback</button>
      </form>

      <h3>Invoice Section <span class="emoji">💵</span></h3>
      <form id="invoiceForm">
        <input type="text" id="invoiceName" placeholder="Client Name" required>
        <input type="email" id="invoiceEmail" placeholder="Client Email" required>
        <select id="invoicePlan">
          <option value="Basic">Basic Plan - $10</option>
          <option value="Standard">Standard Plan - $20</option>
          <option value="Premium">Premium Plan - $30</option>
        </select>
        <button type="submit">Generate Invoice <span class="emoji">🧾</span></button>
      </form>
      <h3>Generated Invoice:</h3>
      <ul id="invoiceDetails">
        <!-- Populated dynamically -->
      </ul>
    </div>
  </div>

  <footer>
    <p>© 2024 Advanced SaaS App <span class="emoji">🌍</span></p>
  </footer>

  <script>
    // Function to show sections
    function showSection(id) {
      const sections = document.querySelectorAll('.container > div');
      sections.forEach((section) => section.classList.add('hidden'));
      document.getElementById(id).classList.remove('hidden');
    }

    // Add emoji to feedback textarea
    function addEmoji(emoji) {
      const feedbackText = document.querySelector('#feedbackForm textarea');
      feedbackText.value += emoji;
    }

    // Handling login
    document.getElementById('loginForm').addEventListener('submit', function(event) {
      event.preventDefault();
      alert('Login Successful!');
      showSection('dashboard');
    });

    // Handling signup
    document.getElementById('signupForm').addEventListener('submit', function(event) {
      event.preventDefault();
      alert('Sign Up Successful!');
      showSection('login');
    });

    // Handling password reset
    document.getElementById('resetPasswordForm').addEventListener('submit', function(event) {
      event.preventDefault();
      alert('Password Reset Link Sent!');
      showSection('login');
    });

    // Handling feedback submission
    document.getElementById('feedbackForm').addEventListener('submit', function(event) {
      event.preventDefault();
      alert('Thank you for your feedback! <span class="emoji">❤️</span>');
    });

    // Handling invoice generation
    document.getElementById('invoiceForm').addEventListener('submit', function(event) {
      event.preventDefault();
      const clientName = document.getElementById('invoiceName').value;
      const clientEmail = document.getElementById('invoiceEmail').value;
      const plan = document.getElementById('invoicePlan').value;
      const invoiceDetails = `
        <li>Client Name: ${clientName} <span class="emoji">👤</span></li>
        <li>Client Email: ${clientEmail} <span class="emoji">📧</span></li>
        <li>Plan: ${plan} <span class="emoji">💳</span></li>
      `;
      document.getElementById('invoiceDetails').innerHTML = invoiceDetails;
    });

    // Simulating activity log in the dashboard
    const activities = ['Logged in', 'Updated profile', 'Generated invoice'];
    const activityLog = document.getElementById('activityLog');
    activities.forEach((activity) => {
      const li = document.createElement('li');
      li.textContent = activity;
      activityLog.appendChild(li);
    });

    // Start by showing login page
    showSection('login');
  </script>
</body>
</html>
JavaScript

Leave a Reply

Your email address will not be published. Required fields are marked *


error: Content is protected !!
Scroll to Top
MacroNepal
Verified by MonsterInsights