Spaces:
Running
Running
Download components/toolbar.js from FLEED993/sketchmaster-pro: direct link, hf CLI and curl.
- Browser
- Download file 2.21 kB
-
https://huggingface.co/spaces/FLEED993/sketchmaster-pro/resolve/main/components/toolbar.js
- Command line
-
hf download hf://spaces/FLEED993/sketchmaster-pro/components/toolbar.js
-
curl -L -o toolbar.js https://huggingface.co/spaces/FLEED993/sketchmaster-pro/resolve/main/components/toolbar.js
2.21 kB
| class CustomToolbar extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| .tool-button { | |
| width: 40px; | |
| height: 40px; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| border-radius: 8px; | |
| transition: all 0.2s; | |
| } | |
| .tool-button:hover { | |
| background-color: #e0e7ff; | |
| transform: scale(1.05); | |
| } | |
| .tool-button.active { | |
| background-color: #6366f1; | |
| color: white; | |
| } | |
| </style> | |
| <div class="bg-white rounded-xl shadow-lg p-4 w-full lg:w-16 flex lg:flex-row flex-wrap justify-center gap-2 lg:flex-col"> | |
| <h3 class="text-lg font-semibold mb-3 text-gray-700 lg:hidden">Drawing Tools</h3> | |
| <button class="tool-button active" title="Pen"> | |
| <i data-feather="edit-2" class="w-5 h-5"></i> | |
| </button> | |
| <button class="tool-button" title="Brush"> | |
| <i data-feather="brush" class="w-5 h-5"></i> | |
| </button> | |
| <button class="tool-button" title="Line"> | |
| <i data-feather="minus" class="w-5 h-5"></i> | |
| </button> | |
| <button class="tool-button" title="Shape"> | |
| <i data-feather="square" class="w-5 h-5"></i> | |
| </button> | |
| <button class="tool-button" title="Text"> | |
| <i data-feather="type" class="w-5 h-5"></i> | |
| </button> | |
| <button class="tool-button" title="Eraser"> | |
| <i data-feather="x" class="w-5 h-5"></i> | |
| </button> | |
| <div class="border-t border-gray-200 my-2 lg:my-0 lg:mx-0"></div> | |
| <button class="tool-button" title="Undo" onclick="alert('Undo functionality')"> | |
| <i data-feather="rotate-ccw" class="w-5 h-5"></i> | |
| </button> | |
| <button class="tool-button" title="Redo" onclick="alert('Redo functionality')"> | |
| <i data-feather="rotate-cw" class="w-5 h-5"></i> | |
| </button> | |
| <button class="tool-button" title="Clear" onclick="clearCanvas()"> | |
| <i data-feather="trash-2" class="w-5 h-5"></i> | |
| </button> | |
| </div> | |
| `; | |
| } | |
| } | |
| customElements.define('custom-toolbar', CustomToolbar); |