File: //var/www/nowruzgan.com/dhconf2025/index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Digital Humanities Conf</title>
  <link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700" rel="stylesheet">
  <style>
    body {
      padding: 0;
      margin: 0;
      font-family: Montserrat;
    }
    .page {
      max-width: 800px;
      margin: 0 auto;
      padding: 100px 10px;
    }
    .logo {
      display: block;
      width: 100%;
    }
    .spacer {
      height: 60px;
    }
    p {
      text-align: center;
      font-size: 20px;
    }
    .fa {
      direction: rtl;
      font-size: 24px;
    }
    a.dl-link {
      padding: 3px 10px;
      border-radius: 3px;
      color: white;
      background-color: #00D2B5;
      text-decoration: none;
      white-space: nowrap;
    }
    form {
      display: block;
      max-width: 400px;
      margin: 0 auto;
    }
    .field {
      margin: 20px 0;
    }
    .field label {
      display: block;
    }
    .field input {
      box-sizing: border-box;
      padding: 10px 20px;
      width: 100%;
    }
    input[type="submit"] {
      background-color: #00D2B5;
      border: none;
      border-radius: 3px;
/*      color: white;*/
      padding: 15px 32px;
      text-align: center;
      text-decoration: none;
      display: inline-block;
      font-size: 16px;
    }
    p.hint {
      font-size: 80%;
    }
    .required {
      color: red;
    }
    .center {
      text-align: center;
    }
  </style>
</head>
<body>
  <div class="page">
    <img src="https://nowruzgan.com/school/wp-content/uploads/2025/01/logoo-dhah-1024x348.png" alt="Digital Humanities & Art History" class="logo">
    <div class="spacer"></div>
    <form id="joinForm">
      <div class="field">
        <label for="name">Name<sup class="required">*</sup></label>
        <input type="text" id="name" name="name" required>
      </div>
      <div class="field">
        <label for="email">Email<sup class="required">*</sup></label>
        <input type="email" id="email" name="email" required>
      </div>
      <div class="center">
        <input type="submit" value="Join Chat Room">
        <p class="hint">It's recommended to use Google Chrome.</p>
      </div>
    </form>
    <div class="spacer"></div>
    <p>Download the detailed conference program <a class="dl-link" href="dhconf2025-program.pdf">here</a>.</p>
    <p class="fa">برنامهی تفصیلی همایش را <a class="dl-link" href="dhconf2025-program.pdf">از اینجا</a> بارگیری کنید.</p>
    <div class="spacer"></div>
  </div>
  <script>
    // Function to generate a SHA-1 checksum
    async function generateChecksum(apiCall, params, secret) {
      const queryString = new URLSearchParams(params).toString();
      const checksumInput = apiCall + queryString + secret;
      const encoder = new TextEncoder();
      const data = encoder.encode(checksumInput);
      const hashBuffer = await crypto.subtle.digest('SHA-1', data);
      const hashArray = Array.from(new Uint8Array(hashBuffer));
      const hashHex = hashArray.map(byte => byte.toString(16).padStart(2, '0')).join('');
      return hashHex;
    }
    document.getElementById('joinForm').addEventListener('submit', async function(event) {
      event.preventDefault(); // Prevent the form from submitting the traditional way
      const name = document.getElementById('name').value;
      const email = document.getElementById('email').value;
      const meetingId = 'nqfa9rvomqts0znst3x4e71gvlaqehjybgec0llc';
      const bbbServerUrl = 'https://gap.nowruzgan.com/bigbluebutton/api/';
      const secret = 'Y5GA1AugPAWbmleo6r7N8gPlrZ9NzJEgrjEOyK4bE';
      // API call and parameters
      const apiCall = 'join';
      const params = {
        fullName: name,
        meetingID: meetingId,
        role: 'viewer',
        redirect: 'true'
      };
      // Generate the checksum
      const checksum = await generateChecksum(apiCall, params, secret);
      // Construct the BBB join URL
      const queryString = new URLSearchParams(params).toString();
      const bbbJoinUrl = `${bbbServerUrl}${apiCall}?${queryString}&checksum=${checksum}`;
      let response = await fetch('reg.php', {
        method: 'POST',
        body: JSON.stringify({name, email})
      }).catch(_ => console.log(1, _));
      if(response)
        console.log(3, await response.text().catch(_ => console.log(2, _)));
      // Redirect the user to the BBB chat room
      window.location.href = bbbJoinUrl;
    });
  </script>
</body>
</html>