Virtual Business Card Generator JavaScript, HTML

👤 Sharing: AI
```html
<!DOCTYPE html>
<html>
<head>
  <title>Virtual Business Card Generator</title>
  <style>
    body {
      font-family: sans-serif;
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      background-color: #f0f0f0;
    }

    .card-container {
      display: flex;
      gap: 20px;
    }

    .input-form {
      background-color: #fff;
      padding: 20px;
      border-radius: 8px;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
      width: 300px;
    }

    .input-form label {
      display: block;
      margin-bottom: 5px;
    }

    .input-form input {
      width: 100%;
      padding: 8px;
      margin-bottom: 10px;
      border: 1px solid #ccc;
      border-radius: 4px;
      box-sizing: border-box;
    }

    .input-form button {
      background-color: #4CAF50;
      color: white;
      padding: 10px 15px;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      width: 100%;
    }

    .input-form button:hover {
      background-color: #3e8e41;
    }

    .business-card {
      background-color: #fff;
      border: 1px solid #ddd;
      border-radius: 8px;
      padding: 20px;
      width: 300px;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
      text-align: center;
    }

    .business-card h2 {
      margin-top: 0;
      color: #333;
    }

    .business-card p {
      margin-bottom: 5px;
      color: #555;
    }
  </style>
</head>
<body>

  <div class="card-container">
    <div class="input-form">
      <label for="name">Name:</label>
      <input type="text" id="name" name="name"><br><br>

      <label for="title">Title:</label>
      <input type="text" id="title" name="title"><br><br>

      <label for="phone">Phone:</label>
      <input type="text" id="phone" name="phone"><br><br>

      <label for="email">Email:</label>
      <input type="email" id="email" name="email"><br><br>

      <label for="company">Company:</label>
      <input type="text" id="company" name="company"><br><br>

      <button onclick="generateCard()">Generate Card</button>
    </div>

    <div class="business-card" id="card">
      <h2>Your Name</h2>
      <p>Title</p>
      <p>Phone: 123-456-7890</p>
      <p>Email: example@example.com</p>
      <p>Company Name</p>
    </div>
  </div>


  <script>
    function generateCard() {
      let name = document.getElementById("name").value;
      let title = document.getElementById("title").value;
      let phone = document.getElementById("phone").value;
      let email = document.getElementById("email").value;
      let company = document.getElementById("company").value;

      let card = document.getElementById("card");
      card.innerHTML = `
        <h2>${name || "Your Name"}</h2>
        <p>${title || "Title"}</p>
        <p>Phone: ${phone || "123-456-7890"}</p>
        <p>Email: ${email || "example@example.com"}</p>
        <p>${company || "Company Name"}</p>
      `;
    }
  </script>

</body>
</html>
```
👁️ Viewed: 9

Comments