Download index.html from arman213a/fontmagic: direct link, hf CLI and curl.
- Browser
- Download file 17 kB
-
https://huggingface.co/spaces/arman213a/fontmagic/resolve/main/index.html
- Command line
-
hf download hf://spaces/arman213a/fontmagic/index.html
-
curl -L -o index.html https://huggingface.co/spaces/arman213a/fontmagic/resolve/main/index.html
17 kB
| <html lang="fa" dir="rtl" data-theme="light"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>FontMagic - تبدیل فرمت فونت با جادو</title> | |
| <link rel="stylesheet" href="style.css"> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <link rel="icon" href="favicon.ico"> | |
| :root { | |
| --primary-color: #4a6cf7; | |
| --secondary-color: #6a7dfe; | |
| --background-color: #f8f9fa; | |
| --text-color: #333; | |
| --light-gray: #e9ecef; | |
| --border-radius: 8px; | |
| --shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | |
| } | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
| } | |
| body { | |
| background-color: var(--background-color); | |
| color: var(--text-color); | |
| line-height: 1.6; | |
| } | |
| .container { | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| padding: 0 20px; | |
| } | |
| header { | |
| background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); | |
| color: white; | |
| padding: 2rem 0; | |
| text-align: center; | |
| box-shadow: var(--shadow); | |
| } | |
| header h1 { | |
| font-size: 2.5rem; | |
| margin-bottom: 0.5rem; | |
| } | |
| header p { | |
| font-size: 1.1rem; | |
| opacity: 0.9; | |
| } | |
| .converter-section { | |
| background-color: white; | |
| border-radius: var(--border-radius); | |
| padding: 2rem; | |
| margin: 2rem 0; | |
| box-shadow: var(--shadow); | |
| } | |
| .converter-header { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| margin-bottom: 1.5rem; | |
| flex-wrap: wrap; | |
| gap: 1rem; | |
| } | |
| .format-selectors { | |
| display: flex; | |
| align-items: center; | |
| gap: 1rem; | |
| flex-wrap: wrap; | |
| } | |
| .format-selector { | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5rem; | |
| } | |
| select { | |
| padding: 0.5rem 1rem; | |
| border: 1px solid var(--light-gray); | |
| border-radius: var(--border-radius); | |
| background-color: white; | |
| font-size: 1rem; | |
| } | |
| .upload-area { | |
| border: 2px dashed var(--light-gray); | |
| border-radius: var(--border-radius); | |
| padding: 3rem 2rem; | |
| text-align: center; | |
| margin-bottom: 1.5rem; | |
| transition: all 0.3s ease; | |
| cursor: pointer; | |
| } | |
| .upload-area:hover { | |
| border-color: var(--primary-color); | |
| background-color: rgba(74, 108, 247, 0.05); | |
| } | |
| .upload-area i { | |
| font-size: 3rem; | |
| color: var(--primary-color); | |
| margin-bottom: 1rem; | |
| } | |
| .upload-area p { | |
| margin-bottom: 1rem; | |
| } | |
| .btn { | |
| background-color: var(--primary-color); | |
| color: white; | |
| border: none; | |
| padding: 0.75rem 1.5rem; | |
| border-radius: var(--border-radius); | |
| cursor: pointer; | |
| font-size: 1rem; | |
| transition: background-color 0.3s ease; | |
| } | |
| .btn:hover { | |
| background-color: var(--secondary-color); | |
| } | |
| .btn-secondary { | |
| background-color: var(--light-gray); | |
| color: var(--text-color); | |
| } | |
| .btn-secondary:hover { | |
| background-color: #d1d5db; | |
| } | |
| .file-info { | |
| background-color: var(--light-gray); | |
| padding: 1rem; | |
| border-radius: var(--border-radius); | |
| margin-bottom: 1.5rem; | |
| display: none; | |
| } | |
| .file-info.active { | |
| display: block; | |
| } | |
| .actions { | |
| display: flex; | |
| gap: 1rem; | |
| justify-content: center; | |
| flex-wrap: wrap; | |
| } | |
| .supported-formats { | |
| margin-top: 3rem; | |
| } | |
| .formats-grid { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); | |
| gap: 1rem; | |
| margin-top: 1rem; | |
| } | |
| .format-card { | |
| background-color: white; | |
| border-radius: var(--border-radius); | |
| padding: 1rem; | |
| text-align: center; | |
| box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); | |
| transition: transform 0.3s ease; | |
| } | |
| .format-card:hover { | |
| transform: translateY(-5px); | |
| } | |
| .format-card i { | |
| font-size: 2rem; | |
| color: var(--primary-color); | |
| margin-bottom: 0.5rem; | |
| } | |
| footer { | |
| background-color: #2d3748; | |
| color: white; | |
| padding: 2rem 0; | |
| margin-top: 3rem; | |
| } | |
| .footer-content { | |
| display: flex; | |
| justify-content: space-between; | |
| flex-wrap: wrap; | |
| gap: 2rem; | |
| } | |
| .footer-section { | |
| flex: 1; | |
| min-width: 250px; | |
| } | |
| .footer-section h3 { | |
| margin-bottom: 1rem; | |
| font-size: 1.2rem; | |
| } | |
| .footer-section ul { | |
| list-style: none; | |
| } | |
| .footer-section ul li { | |
| margin-bottom: 0.5rem; | |
| } | |
| .footer-section a { | |
| color: #cbd5e0; | |
| text-decoration: none; | |
| transition: color 0.3s ease; | |
| } | |
| .footer-section a:hover { | |
| color: white; | |
| } | |
| .copyright { | |
| text-align: center; | |
| margin-top: 2rem; | |
| padding-top: 1rem; | |
| border-top: 1px solid #4a5568; | |
| } | |
| @media (max-width: 768px) { | |
| .converter-header { | |
| flex-direction: column; | |
| align-items: flex-start; | |
| } | |
| .format-selectors { | |
| width: 100%; | |
| justify-content: space-between; | |
| } | |
| .actions { | |
| flex-direction: column; | |
| } | |
| .btn { | |
| width: 100%; | |
| } | |
| } | |
| </head> | |
| <body> | |
| <custom-navbar></custom-navbar> | |
| <header> | |
| <div class="container"> | |
| <h1><i class="fas fa-magic"></i> FontMagic</h1> | |
| <p>تبدیل فرمتهای مختلف فونت با جادوی تکنولوژی</p> | |
| <div class="theme-switch"> | |
| <button id="theme-toggle" class="btn btn-small"> | |
| <i class="fas fa-moon"></i> حالت شب | |
| </button> | |
| </div> | |
| </div> | |
| </header> | |
| <main class="container"> | |
| <section class="converter-section"> | |
| <div class="converter-header"> | |
| <h2>مبدل فونت</h2> | |
| <div class="format-selectors"> | |
| <div class="format-selector"> | |
| <label for="from-format">از:</label> | |
| <select id="from-format"> | |
| <option value="woff">WOFF</option> | |
| <option value="woff2">WOFF2</option> | |
| <option value="ttf">TTF</option> | |
| <option value="otf">OTF</option> | |
| <option value="eot">EOT</option> | |
| </select> | |
| </div> | |
| <i class="fas fa-exchange-alt"></i> | |
| <div class="format-selector"> | |
| <label for="to-format">به:</label> | |
| <select id="to-format"> | |
| <option value="ttf">TTF</option> | |
| <option value="woff">WOFF</option> | |
| <option value="woff2">WOFF2</option> | |
| <option value="otf">OTF</option> | |
| <option value="eot">EOT</option> | |
| </select> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="upload-area" id="upload-area"> | |
| <i class="fas fa-cloud-upload-alt"></i> | |
| <h3>فایل فونت خود را اینجا رها کنید</h3> | |
| <p>یا برای انتخاب فایل کلیک کنید</p> | |
| <input type="file" id="file-input" accept=".woff,.woff2,.ttf,.otf,.eot" style="display: none;"> | |
| <button class="btn" id="select-file-btn">انتخاب فایل</button> | |
| </div> | |
| <div class="file-info" id="file-info"> | |
| <div class="file-details"> | |
| <p><strong>نام فایل:</strong> <span id="file-name">-</span></p> | |
| <p><strong>اندازه:</strong> <span id="file-size">-</span></p> | |
| <p><strong>فرمت:</strong> <span id="file-format">-</span></p> | |
| </div> | |
| </div> | |
| <div class="actions"> | |
| <button class="btn" id="convert-btn" disabled>تبدیل فونت</button> | |
| <button class="btn btn-secondary" id="reset-btn">شروع مجدد</button> | |
| </div> | |
| </section> | |
| <section class="supported-formats"> | |
| <h2>فرمتهای پشتیبانی شده</h2> | |
| <div class="formats-grid"> | |
| <div class="format-card"> | |
| <i class="fas fa-font"></i> | |
| <h3>WOFF</h3> | |
| <p>Web Open Font Format</p> | |
| </div> | |
| <div class="format-card"> | |
| <i class="fas fa-font"></i> | |
| <h3>WOFF2</h3> | |
| <p>Web Open Font Format 2</p> | |
| </div> | |
| <div class="format-card"> | |
| <i class="fas fa-font"></i> | |
| <h3>TTF</h3> | |
| <p>TrueType Font</p> | |
| </div> | |
| <div class="format-card"> | |
| <i class="fas fa-font"></i> | |
| <h3>OTF</h3> | |
| <p>OpenType Font</p> | |
| </div> | |
| <div class="format-card"> | |
| <i class="fas fa-font"></i> | |
| <h3>EOT</h3> | |
| <p>Embedded OpenType</p> | |
| </div> | |
| </div> | |
| </section> | |
| </main> | |
| <custom-footer></custom-footer> | |
| <script src="components/navbar.js"></script> | |
| <script src="components/footer.js"></script> | |
| <script src="script.js"></script> | |
| document.addEventListener('DOMContentLoaded', function() { | |
| const uploadArea = document.getElementById('upload-area'); | |
| const fileInput = document.getElementById('file-input'); | |
| const selectFileBtn = document.getElementById('select-file-btn'); | |
| const fileInfo = document.getElementById('file-info'); | |
| const fileName = document.getElementById('file-name'); | |
| const fileSize = document.getElementById('file-size'); | |
| const fileFormat = document.getElementById('file-format'); | |
| const convertBtn = document.getElementById('convert-btn'); | |
| const resetBtn = document.getElementById('reset-btn'); | |
| const fromFormat = document.getElementById('from-format'); | |
| const toFormat = document.getElementById('to-format'); | |
| // انتخاب فایل با کلیک روی دکمه | |
| selectFileBtn.addEventListener('click', function() { | |
| fileInput.click(); | |
| }); | |
| // انتخاب فایل با کشیدن و رها کردن | |
| uploadArea.addEventListener('dragover', function(e) { | |
| e.preventDefault(); | |
| uploadArea.style.borderColor = 'var(--primary-color)'; | |
| uploadArea.style.backgroundColor = 'rgba(74, 108, 247, 0.1)'; | |
| }); | |
| uploadArea.addEventListener('dragleave', function() { | |
| uploadArea.style.borderColor = 'var(--light-gray)'; | |
| uploadArea.style.backgroundColor = 'transparent'; | |
| }); | |
| uploadArea.addEventListener('drop', function(e) { | |
| e.preventDefault(); | |
| uploadArea.style.borderColor = 'var(--light-gray)'; | |
| uploadArea.style.backgroundColor = 'transparent'; | |
| if (e.dataTransfer.files.length) { | |
| handleFile(e.dataTransfer.files[0]); | |
| } | |
| }); | |
| // انتخاب فایل از طریق input | |
| fileInput.addEventListener('change', function() { | |
| if (fileInput.files.length) { | |
| handleFile(fileInput.files[0]); | |
| } | |
| }); | |
| // مدیریت فایل انتخاب شده | |
| function handleFile(file) { | |
| const fileExtension = file.name.split('.').pop().toLowerCase(); | |
| // بررسی فرمت فایل | |
| const allowedFormats = ['woff', 'woff2', 'ttf', 'otf', 'eot']; | |
| if (!allowedFormats.includes(fileExtension)) { | |
| alert('فرمت فایل انتخاب شده پشتیبانی نمیشود. لطفاً یک فایل فونت معتبر انتخاب کنید.'); | |
| return; | |
| } | |
| // نمایش اطلاعات فایل | |
| fileName.textContent = file.name; | |
| fileSize.textContent = formatFileSize(file.size); | |
| fileFormat.textContent = fileExtension.toUpperCase(); | |
| // تنظیم فرمت مبدا بر اساس پسوند فایل | |
| fromFormat.value = fileExtension; | |
| // فعال کردن دکمه تبدیل | |
| convertBtn.disabled = false; | |
| // نمایش اطلاعات فایل | |
| fileInfo.classList.add('active'); | |
| } | |
| // فرمتبندی اندازه فایل | |
| function formatFileSize(bytes) { | |
| if (bytes === 0) return '0 Bytes'; | |
| const k = 1024; | |
| const sizes = ['Bytes', 'KB', 'MB', 'GB']; | |
| const i = Math.floor(Math.log(bytes) / Math.log(k)); | |
| return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]; | |
| } | |
| // دکمه تبدیل | |
| convertBtn.addEventListener('click', function() { | |
| if (!fileInput.files.length) { | |
| alert('لطفاً ابتدا یک فایل انتخاب کنید.'); | |
| return; | |
| } | |
| // در اینجا منطق تبدیل فونت باید پیادهسازی شود | |
| // این فقط یک نمونه اولیه است | |
| alert('تبدیل فونت در حال انجام است... (این یک نمونه نمایشی است)'); | |
| // شبیهسازی دانلود فایل تبدیل شده | |
| setTimeout(function() { | |
| alert('تبدیل با موفقیت انجام شد! فایل شما آماده دانلود است.'); | |
| // در اینجا باید لینک دانلود فایل تبدیل شده ارائه شود | |
| // این فقط یک نمونه است | |
| const downloadLink = document.createElement('a'); | |
| downloadLink.href = '#'; | |
| downloadLink.download = 'converted-font.' + toFormat.value; | |
| downloadLink.click(); | |
| }, 2000); | |
| }); | |
| // دکمه شروع مجدد | |
| resetBtn.addEventListener('click', function() { | |
| fileInput.value = ''; | |
| fileInfo.classList.remove('active'); | |
| convertBtn.disabled = true; | |
| fromFormat.value = 'woff'; | |
| toFormat.value = 'ttf'; | |
| }); | |
| }); | |
| </script> | |
| <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script> | |
| </body> | |
| </html> |