Spaces:
Running
Running
ช่วยทำเว็บแอพ พี่สามารถถ่ายรูปตัวเอง โดยใช้การเปิดกล้องเท่านั้น และอัพโหลดรูปเข้าไปที่ ChatGPT ผ่าน API key เพื่อที่จะแปลงรูปตัวเอง ให้เป็นรูปคนที่หุ่นดี fit & firm ได้ ทั้งเพศหญิง และเพศชาย โดยที่หน้าไม่เปลี่ยน แต่เปลี่ยนหุ่น และชุดเป็นชุดฟิตเนส เน้นถึงกล้ามท้อง และสัดส่วนที่เหมาะสมกับคนออกกำลังกายเป็นอย่างดี
8bbd13a verified Download components/navbar.js from CSNET/fittransform-pro: direct link, hf CLI and curl.
- Browser
- Download file 4.25 kB
-
https://huggingface.co/spaces/CSNET/fittransform-pro/resolve/main/components/navbar.js
- Command line
-
hf download hf://spaces/CSNET/fittransform-pro/components/navbar.js
-
curl -L -o navbar.js https://huggingface.co/spaces/CSNET/fittransform-pro/resolve/main/components/navbar.js
4.25 kB
| class CustomNavbar extends HTMLElement { | |
| connectedCallback() { | |
| this.attachShadow({ mode: 'open' }); | |
| this.shadowRoot.innerHTML = ` | |
| <style> | |
| nav { | |
| background: white; | |
| box-shadow: 0 2px 5px rgba(0,0,0,0.1); | |
| position: sticky; | |
| top: 0; | |
| z-index: 100; | |
| } | |
| .nav-container { | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| padding: 0 1rem; | |
| } | |
| .nav-links { | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| gap: 2rem; | |
| padding: 1rem 0; | |
| flex-wrap: wrap; | |
| } | |
| .nav-link { | |
| display: flex; | |
| align-items: center; | |
| padding: 0.5rem 1rem; | |
| border-radius: 0.5rem; | |
| text-decoration: none; | |
| color: #4b5563; | |
| font-weight: 500; | |
| transition: all 0.3s ease; | |
| } | |
| .nav-link:hover { | |
| background: linear-gradient(135deg, #10b981 0%, #f97316 100%); | |
| color: white; | |
| transform: translateY(-2px); | |
| } | |
| .nav-link.active { | |
| background: linear-gradient(135deg, #10b981 0%, #059669 100%); | |
| color: white; | |
| } | |
| @media (max-width: 640px) { | |
| .nav-links { | |
| gap: 1rem; | |
| } | |
| .nav-link { | |
| padding: 0.4rem 0.8rem; | |
| font-size: 0.9rem; | |
| } | |
| } | |
| </style> | |
| <nav> | |
| <div class="nav-container"> | |
| <div class="nav-links"> | |
| <a href="#capture" class="nav-link active"> | |
| <i data-feather="camera" style="width: 18px; height: 18px; margin-right: 5px;"></i> | |
| ถ่ายรูป | |
| </a> | |
| <a href="#transform" class="nav-link"> | |
| <i data-feather="zap" style="width: 18px; height: 18px; margin-right: 5px;"></i> | |
| แปลงรูป | |
| </a> | |
| <a href="#compare" class="nav-link"> | |
| <i data-feather="layers" style="width: 18px; height: 18px; margin-right: 5px;"></i> | |
| เปรียบเทียบ | |
| </a> | |
| <a href="#download" class="nav-link"> | |
| <i data-feather="download" style="width: 18px; height: 18px; margin-right: 5px;"></i> | |
| ดาวน์โหลด | |
| </a> | |
| </div> | |
| </div> | |
| </nav> | |
| `; | |
| // Add smooth scroll behavior | |
| this.shadowRoot.querySelectorAll('.nav-link').forEach(link => { | |
| link.addEventListener('click', (e) => { | |
| e.preventDefault(); | |
| const targetId = link.getAttribute('href').substring(1); | |
| const targetElement = document.querySelector(`[id*="${targetId.toLowerCase()}"]`); | |
| if (targetElement) { | |
| // Remove active class from all links | |
| this.shadowRoot.querySelectorAll('.nav-link').forEach(l => l.classList.remove('active')); | |
| // Add active class to clicked link | |
| link.classList.add('active'); | |
| // Smooth scroll to element | |
| targetElement.scrollIntoView({ behavior: 'smooth', block: 'center' }); | |
| } | |
| }); | |
| }); | |
| // Re-initialize feather icons | |
| if (typeof feather !== 'undefined') { | |
| feather.replace(); | |
| } | |
| } | |
| } | |
| customElements.define('custom-navbar', CustomNavbar); |