Spaces:
Running
Running
Download components/contact-form.js from jacodejong/pixelcraft-studio: direct link, hf CLI and curl.
- Browser
- Download file 2.43 kB
-
https://huggingface.co/spaces/jacodejong/pixelcraft-studio/resolve/main/components/contact-form.js
- Command line
-
hf download hf://spaces/jacodejong/pixelcraft-studio/components/contact-form.js
-
curl -L -o contact-form.js https://huggingface.co/spaces/jacodejong/pixelcraft-studio/resolve/main/components/contact-form.js
2.43 kB
| class CustomContactForm extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| } | |
| .form-input { | |
| transition: all 0.3s ease; | |
| border: 1px solid #e5e7eb; | |
| } | |
| .form-input:focus { | |
| border-color: #6366f1; | |
| box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); | |
| } | |
| </style> | |
| <form class="bg-white rounded-xl shadow-lg p-8"> | |
| <div class="mb-6"> | |
| <label for="name" class="block text-gray-700 font-medium mb-2">Name</label> | |
| <input type="text" id="name" name="name" required | |
| class="form-input w-full px-4 py-3 rounded-lg border focus:outline-none"> | |
| </div> | |
| <div class="mb-6"> | |
| <label for="email" class="block text-gray-700 font-medium mb-2">Email</label> | |
| <input type="email" id="email" name="email" required | |
| class="form-input w-full px-4 py-3 rounded-lg border focus:outline-none"> | |
| </div> | |
| <div class="mb-6"> | |
| <label for="subject" class="block text-gray-700 font-medium mb-2">Subject</label> | |
| <input type="text" id="subject" name="subject" | |
| class="form-input w-full px-4 py-3 rounded-lg border focus:outline-none"> | |
| </div> | |
| <div class="mb-6"> | |
| <label for="message" class="block text-gray-700 font-medium mb-2">Message</label> | |
| <textarea id="message" name="message" rows="5" required | |
| class="form-input w-full px-4 py-3 rounded-lg border focus:outline-none"></textarea> | |
| </div> | |
| <button type="submit" | |
| class="w-full bg-indigo-600 text-white font-semibold px-6 py-3 rounded-lg hover:bg-indigo-700 transition-all duration-300"> | |
| Send Message | |
| </button> | |
| </form> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-contact-form', CustomContactForm); |