| class CustomSettingsForm extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| .settings-form { | |
| display: grid; | |
| gap: 1.5rem; | |
| } | |
| .form-group { | |
| display: grid; | |
| gap: 0.5rem; | |
| } | |
| label { | |
| font-weight: 500; | |
| color: #d1d5db; | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| } | |
| .form-icon { | |
| width: 1rem; | |
| height: 1rem; | |
| color: #8b5cf6; | |
| } | |
| input, select, textarea { | |
| background: rgba(31, 41, 55, 0.7); | |
| border: 1px solid rgba(255, 255, 255, 0.1); | |
| border-radius: 0.375rem; | |
| padding: 0.75rem; | |
| color: white; | |
| width: 100%; | |
| transition: border-color 0.2s; | |
| } | |
| input:focus, select:focus, textarea:focus { | |
| outline: none; | |
| border-color: #8b5cf6; | |
| } | |
| .btn { | |
| display: inline-flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| padding: 0.75rem 1.5rem; | |
| border-radius: 0.375rem; | |
| font-weight: 500; | |
| cursor: pointer; | |
| transition: all 0.2s; | |
| border: none; | |
| margin-top: 1rem; | |
| } | |
| .btn-primary { | |
| background-color: #8b5cf6; | |
| color: white; | |
| } | |
| .btn-primary:hover { | |
| background-color: #7c3aed; | |
| } | |
| .settings-section { | |
| background: rgba(31, 41, 55, 0.5); | |
| border-radius: 0.5rem; | |
| padding: 1.5rem; | |
| } | |
| .section-title { | |
| font-size: 1.25rem; | |
| font-weight: 600; | |
| margin-bottom: 1rem; | |
| color: #8b5cf6; | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| } | |
| .section-icon { | |
| width: 1.25rem; | |
| height: 1.25rem; | |
| } | |
| .grid-cols-2 { | |
| display: grid; | |
| grid-template-columns: repeat(2, minmax(0, 1fr)); | |
| gap: 1.5rem; | |
| } | |
| @media (max-width: 768px) { | |
| .grid-cols-2 { | |
| grid-template-columns: 1fr; | |
| } | |
| } | |
| </style> | |
| <form class="settings-form"> | |
| <div class="settings-section"> | |
| <h3 class="section-title"> | |
| <i data-feather="sliders" class="section-icon"></i> | |
| Core Settings | |
| </h3> | |
| <div class="grid-cols-2"> | |
| <div class="form-group"> | |
| <label for="bot-token"> | |
| <i data-feather="key" class="form-icon"></i> | |
| Telegram Bot Token | |
| </label> | |
| <input type="password" id="bot-token" placeholder="Enter your bot token"> | |
| </div> | |
| <div class="form-group"> | |
| <label for="scan-interval"> | |
| <i data-feather="clock" class="form-icon"></i> | |
| Scan Interval (seconds) | |
| </label> | |
| <input type="number" id="scan-interval" value="10" min="5"> | |
| </div> | |
| </div> | |
| <div class="form-group"> | |
| <label for="base-directory"> | |
| <i data-feather="folder" class="form-icon"></i> | |
| Base Directory to Scan | |
| </label> | |
| <input type="text" id="base-directory" placeholder="/path/to/images"> | |
| </div> | |
| </div> | |
| <div class="settings-section"> | |
| <h3 class="section-title"> | |
| <i data-feather="filter" class="section-icon"></i> | |
| File Filters | |
| </h3> | |
| <div class="grid-cols-2"> | |
| <div class="form-group"> | |
| <label for="file-extensions"> | |
| <i data-feather="file" class="form-icon"></i> | |
| Allowed Extensions | |
| </label> | |
| <input type="text" id="file-extensions" placeholder="jpg,png,gif" value="jpg,png,gif,webp"> | |
| </div> | |
| <div class="form-group"> | |
| <label for="max-file-size"> | |
| <i data-feather="maximize" class="form-icon"></i> | |
| Max File Size (MB) | |
| </label> | |
| <input type="number" id="max-file-size" value="10"> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="settings-section"> | |
| <h3 class="section-title"> | |
| <i data-feather="send" class="section-icon"></i> | |
| Distribution Settings | |
| </h3> | |
| <div class="form-group"> | |
| <label for="chat-id"> | |
| <i data-feather="message-square" class="form-icon"></i> | |
| Target Chat ID | |
| </label> | |
| <input type="text" id="chat-id" placeholder="@username or numeric ID"> | |
| </div> | |
| <div class="form-group"> | |
| <label for="save-to-saved"> | |
| <i data-feather="save" class="form-icon"></i> | |
| Save to Saved Messages | |
| </label> | |
| <select id="save-to-saved"> | |
| <option value="true">Yes</option> | |
| <option value="false">No</option> | |
| </select> | |
| </div> | |
| </div> | |
| <button type="submit" class="btn btn-primary"> | |
| <i data-feather="save"></i> | |
| Save Settings | |
| </button> | |
| </form> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-settings-form', CustomSettingsForm); |