Spaces:
Running
Running
create a project management that features centralize work with flexible views (List, Board, Calendar, Timeline), robust task management (dependencies, custom fields, subtasks), powerful automation (rules, workflows), team collaboration tools (Inbox, comments, status updates), and advanced reporting (dashboards, portfolios) to provide visibility, accountability, and streamline projects from start to finish.
ea012db verified Download components/sidebar.js from jcondes0829/workflowwizard-pro: direct link, hf CLI and curl.
- Browser
- Download file 13.8 kB
-
https://huggingface.co/spaces/jcondes0829/workflowwizard-pro/resolve/main/components/sidebar.js
- Command line
-
hf download hf://spaces/jcondes0829/workflowwizard-pro/components/sidebar.js
-
curl -L -o sidebar.js https://huggingface.co/spaces/jcondes0829/workflowwizard-pro/resolve/main/components/sidebar.js
13.8 kB
| class CustomSidebar extends HTMLElement { | |
| constructor() { | |
| super(); | |
| this.activePage = this.getAttribute('active-page') || 'dashboard'; | |
| this.isMobileMenuOpen = false; | |
| } | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.render(); | |
| this.addEventListeners(); | |
| } | |
| static get observedAttributes() { | |
| return ['active-page']; | |
| } | |
| attributeChangedCallback(name, oldValue, newValue) { | |
| if (name === 'active-page' && oldValue !== newValue) { | |
| this.activePage = newValue; | |
| this.render(); | |
| } | |
| } | |
| render() { | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| :host { | |
| display: block; | |
| font-family: system-ui, -apple-system, sans-serif; | |
| } | |
| aside { | |
| width: 16rem; | |
| background: white; | |
| border-right: 1px solid #e5e7eb; | |
| height: calc(100vh - 4rem); | |
| position: fixed; | |
| left: 0; | |
| top: 4rem; | |
| transform: translateX(0); | |
| transition: transform 0.3s ease; | |
| z-index: 40; | |
| } | |
| @media (max-width: 768px) { | |
| aside { | |
| transform: translateX(-100%); | |
| } | |
| aside.mobile-open { | |
| transform: translateX(0); | |
| box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1); | |
| } | |
| .overlay { | |
| display: none; | |
| position: fixed; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| bottom: 0; | |
| background: rgba(0, 0, 0, 0.5); | |
| z-index: 35; | |
| } | |
| .overlay.active { | |
| display: block; | |
| } | |
| } | |
| .nav-item { | |
| padding: 0.75rem 1rem; | |
| border-radius: 0.5rem; | |
| color: #6b7280; | |
| text-decoration: none; | |
| display: flex; | |
| align-items: center; | |
| gap: 0.75rem; | |
| transition: all 0.2s ease; | |
| margin: 0.125rem 0.5rem; | |
| } | |
| .nav-item:hover { | |
| background: #f9fafb; | |
| color: #374151; | |
| } | |
| .nav-item.active { | |
| background: #fef2f2; | |
| color: #dc2626; | |
| font-weight: 500; | |
| } | |
| .nav-item.active i { | |
| color: #dc2626; | |
| } | |
| .nav-item i { | |
| width: 1.25rem; | |
| height: 1.25rem; | |
| } | |
| .team-member { | |
| width: 1.75rem; | |
| height: 1.75rem; | |
| border-radius: 50%; | |
| border: 2px solid white; | |
| background: #f3f4f6; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| font-size: 0.75rem; | |
| font-weight: 500; | |
| } | |
| .team-member.avatar-1 { background: #fbb6ce; } | |
| .team-member.avatar-2 { background: #c6f6d5; } | |
| .team-member.avatar-3 { background: #fed7d7; } | |
| .team-member.avatar-4 { background: #e9d8fd; } | |
| .team-member.avatar-5 { background: #bee3f8; } | |
| .section-title { | |
| color: #9ca3af; | |
| font-size: 0.75rem; | |
| font-weight: 600; | |
| text-transform: uppercase; | |
| letter-spacing: 0.05em; | |
| margin: 1.5rem 0 0.5rem 0; | |
| } | |
| .workspace-stats { | |
| background: #f9fafb; | |
| border-radius: 0.5rem; | |
| padding: 1rem; | |
| margin-top: auto; | |
| } | |
| .progress-bar { | |
| height: 0.375rem; | |
| background: #e5e7eb; | |
| border-radius: 9999px; | |
| overflow: hidden; | |
| } | |
| .progress-fill { | |
| height: 100%; | |
| background: #10b981; | |
| border-radius: 9999px; | |
| transition: width 0.3s ease; | |
| } | |
| </style> | |
| <div class="overlay" id="sidebar-overlay"></div> | |
| <aside id="sidebar" class="flex flex-col"> | |
| <!-- Navigation --> | |
| <div class="flex-1 p-4 overflow-y-auto"> | |
| <nav class="space-y-1"> | |
| <a href="index.html" class="nav-item ${this.activePage === 'dashboard' ? 'active' : ''}"> | |
| <i data-feather="layout"></i> | |
| <span>Dashboard</span> | |
| </a> | |
| <a href="projects.html" class="nav-item ${this.activePage === 'projects' ? 'active' : ''}"> | |
| <i data-feather="folder"></i> | |
| <span>Projects</span> | |
| </a> | |
| <a href="tasks.html" class="nav-item ${this.activePage === 'tasks' ? 'active' : ''}"> | |
| <i data-feather="check-circle"></i> | |
| <span>My Tasks</span> | |
| </a> | |
| <a href="board.html" class="nav-item ${this.activePage === 'board' ? 'active' : ''}"> | |
| <i data-feather="columns"></i> | |
| <span>Board View</span> | |
| </a> | |
| <a href="calendar.html" class="nav-item ${this.activePage === 'calendar' ? 'active' : ''}"> | |
| <i data-feather="calendar"></i> | |
| <span>Calendar</span> | |
| </a> | |
| <a href="timeline.html" class="nav-item ${this.activePage === 'timeline' ? 'active' : ''}"> | |
| <i data-feather="bar-chart-2"></i> | |
| <span>Timeline</span> | |
| </a> | |
| <a href="automation.html" class="nav-item ${this.activePage === 'automation' ? 'active' : ''}"> | |
| <i data-feather="zap"></i> | |
| <span>Automation</span> | |
| </a> | |
| <a href="inbox.html" class="nav-item ${this.activePage === 'inbox' ? 'active' : ''}"> | |
| <i data-feather="inbox"></i> | |
| <span>Inbox</span> | |
| </a> | |
| <a href="reporting.html" class="nav-item ${this.activePage === 'reporting' ? 'active' : ''}"> | |
| <i data-feather="bar-chart"></i> | |
| <span>Reporting</span> | |
| </a> | |
| </nav> | |
| <div class="section-title px-4 mt-8">Teams</div> | |
| <nav class="space-y-1 mt-2"> | |
| <a href="team-design.html" class="nav-item"> | |
| <div class="team-member avatar-1">D</div> | |
| <span>Design Team</span> | |
| <span class="ml-auto text-xs px-2 py-1 bg-blue-100 text-blue-800 rounded-full">12</span> | |
| </a> | |
| <a href="team-dev.html" class="nav-item"> | |
| <div class="team-member avatar-2">DV</div> | |
| <span>Development</span> | |
| <span class="ml-auto text-xs px-2 py-1 bg-green-100 text-green-800 rounded-full">8</span> | |
| </a> | |
| <a href="team-marketing.html" class="nav-item"> | |
| <div class="team-member avatar-3">M</div> | |
| <span>Marketing</span> | |
| <span class="ml-auto text-xs px-2 py-1 bg-purple-100 text-purple-800 rounded-full">15</span> | |
| </a> | |
| </nav> | |
| <div class="section-title px-4 mt-8">Views</div> | |
| <div class="flex flex-wrap gap-2 p-4"> | |
| <button class="px-3 py-1.5 text-sm rounded-lg bg-primary-100 text-primary-800 font-medium"> | |
| List | |
| </button> | |
| <button class="px-3 py-1.5 text-sm rounded-lg bg-gray-100 text-gray-700 hover:bg-gray-200"> | |
| Board | |
| </button> | |
| <button class="px-3 py-1.5 text-sm rounded-lg bg-gray-100 text-gray-700 hover:bg-gray-200"> | |
| Calendar | |
| </button> | |
| <button class="px-3 py-1.5 text-sm rounded-lg bg-gray-100 text-gray-700 hover:bg-gray-200"> | |
| Timeline | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Workspace Stats --> | |
| <div class="workspace-stats mx-4 mb-4"> | |
| <div class="flex items-center justify-between mb-2"> | |
| <span class="text-sm font-medium text-gray-700">Workspace Usage</span> | |
| <span class="text-sm font-semibold text-gray-900">75%</span> | |
| </div> | |
| <div class="progress-bar"> | |
| <div class="progress-fill" style="width: 75%"></div> | |
| </div> | |
| <p class="text-xs text-gray-500 mt-2">12 of 16 projects in use</p> | |
| </div> | |
| <!-- Team Members --> | |
| <div class="px-4 pb-4"> | |
| <p class="text-sm font-medium text-gray-700 mb-3">Team Online</p> | |
| <div class="flex -space-x-2"> | |
| <div class="team-member avatar-1" title="Designer">D</div> | |
| <div class="team-member avatar-2" title="Developer">DV</div> | |
| <div class="team-member avatar-3" title="Marketing">M</div> | |
| <div class="team-member avatar-4" title="PM">PM</div> | |
| <div class="team-member avatar-5" title="QA">QA</div> | |
| <div class="team-member bg-gray-200 text-gray-700" title="+2">+2</div> | |
| </div> | |
| </div> | |
| </aside> | |
| `; | |
| setTimeout(() => { | |
| feather.replace(); | |
| }, 100); | |
| } | |
| addEventListeners() { | |
| setTimeout(() => { | |
| // Close sidebar when clicking on overlay (mobile) | |
| const overlay = this.shadowRoot.getElementById('sidebar-overlay'); | |
| if (overlay) { | |
| overlay.addEventListener('click', () => { | |
| this.closeMobileMenu(); | |
| }); | |
| } | |
| // Add click handlers for view buttons | |
| const viewButtons = this.shadowRoot.querySelectorAll('button'); | |
| viewButtons.forEach(button => { | |
| button.addEventListener('click', () => { | |
| if (button.textContent === 'List') { | |
| window.location.href = 'tasks.html?view=list'; | |
| } else if (button.textContent === 'Board') { | |
| window.location.href = 'board.html'; | |
| } else if (button.textContent === 'Calendar') { | |
| window.location.href = 'calendar.html'; | |
| } else if (button.textContent === 'Timeline') { | |
| window.location.href = 'timeline.html'; | |
| } | |
| }); | |
| }); | |
| }, 100); | |
| } | |
| toggleMobileMenu() { | |
| this.isMobileMenuOpen = !this.isMobileMenuOpen; | |
| const sidebar = this.shadowRoot.getElementById('sidebar'); | |
| const overlay = this.shadowRoot.getElementById('sidebar-overlay'); | |
| if (sidebar) { | |
| sidebar.classList.toggle('mobile-open', this.isMobileMenuOpen); | |
| } | |
| if (overlay) { | |
| overlay.classList.toggle('active', this.isMobileMenuOpen); | |
| } | |
| // Prevent body scroll when menu is open | |
| document.body.style.overflow = this.isMobileMenuOpen ? 'hidden' : 'auto'; | |
| } | |
| closeMobileMenu() { | |
| this.isMobileMenuOpen = false; | |
| const sidebar = this.shadowRoot.getElementById('sidebar'); | |
| const overlay = this.shadowRoot.getElementById('sidebar-overlay'); | |
| if (sidebar) { | |
| sidebar.classList.remove('mobile-open'); | |
| } | |
| if (overlay) { | |
| overlay.classList.remove('active'); | |
| } | |
| document.body.style.overflow = 'auto'; | |
| } | |
| } | |
| customElements.define('custom-sidebar', CustomSidebar); |