Download index.html from Seter2345/setter: direct link, hf CLI and curl.
- Browser
- Download file 21.4 kB
-
https://huggingface.co/spaces/Seter2345/setter/resolve/main/index.html
- Command line
-
hf download hf://spaces/Seter2345/setter/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Seter2345/setter/resolve/main/index.html
21.4 kB
| <html lang="ru"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Скрипт-2-APK Компилятор</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| .gradient-bg { | |
| background: linear-gradient(135deg, #6b73ff 0%, #000dff 100%); | |
| } | |
| .editor-line-numbers { | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 40px; | |
| height: 100%; | |
| background-color: #1e293b; | |
| color: #64748b; | |
| text-align: right; | |
| padding-right: 10px; | |
| padding-top: 10px; | |
| font-family: monospace; | |
| user-select: none; | |
| } | |
| .editor-wrapper { | |
| position: relative; | |
| min-height: 300px; | |
| } | |
| .progress-bar { | |
| height: 6px; | |
| transition: width 0.3s ease; | |
| } | |
| .terminal { | |
| font-family: 'Courier New', monospace; | |
| overflow-y: auto; | |
| scrollbar-width: thin; | |
| } | |
| .terminal-line { | |
| line-height: 1.5; | |
| } | |
| .success { color: #10b981; } | |
| .error { color: #ef4444; } | |
| .warning { color: #f59e0b; } | |
| .info { color: #3b82f6; } | |
| </style> | |
| </head> | |
| <body class="bg-gray-950 text-gray-100 min-h-screen"> | |
| <header class="gradient-bg py-6 shadow-lg"> | |
| <div class="container mx-auto px-4"> | |
| <div class="flex justify-between items-center"> | |
| <div class="flex items-center space-x-3"> | |
| <i class="fab fa-android text-3xl"></i> | |
| <h1 class="text-2xl md:text-3xl font-bold">ScriptToAPK</h1> | |
| </div> | |
| <nav class="hidden md:flex space-x-6"> | |
| <a href="#" class="hover:text-gray-300 transition">Домой</a> | |
| <a href="#" class="hover:text-gray-300 transition">Документация</a> | |
| <a href="#" class="hover:text-gray-300 transition">Примеры</a> | |
| <a href="#" class="hover:text-gray-300 transition">Контакты</a> | |
| </nav> | |
| <button class="md:hidden text-2xl"> | |
| <i class="fas fa-bars"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </header> | |
| <main class="container mx-auto px-4 py-8"> | |
| <div class="grid lg:grid-cols-2 gap-8"> | |
| <!-- Редактор кода --> | |
| <div class="bg-gray-900 rounded-xl shadow-xl overflow-hidden"> | |
| <div class="bg-gray-800 px-6 py-3 flex justify-between items-center border-b border-gray-700"> | |
| <h2 class="font-semibold text-lg flex items-center"> | |
| <i class="fas fa-code mr-2 text-blue-400"></i> | |
| Редактор скрипта | |
| </h2> | |
| <div class="flex space-x-2"> | |
| <button id="sample-btn" class="bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm transition"> | |
| Пример | |
| </button> | |
| <button class="bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm transition"> | |
| <i class="fas fa-trash-alt mr-1"></i> Очистить | |
| </button> | |
| </div> | |
| </div> | |
| <div class="editor-wrapper"> | |
| <div class="editor-line-numbers" id="line-numbers">1</div> | |
| <textarea id="code-editor" class="w-full h-96 bg-gray-900 text-gray-100 p-4 pl-16 font-mono text-sm focus:outline-none resize-none" | |
| spellcheck="false" placeholder="// Ваш код Python/Kotlin/JavaScript скрипта здесь..."></textarea> | |
| </div> | |
| <div class="bg-gray-800 px-6 py-3 border-t border-gray-700"> | |
| <div class="flex justify-between items-center"> | |
| <div class="text-sm text-gray-400"> | |
| <i class="fas fa-language mr-1"></i> | |
| <select id="language-select" class="bg-gray-700 rounded px-2 py-1 text-gray-100"> | |
| <option value="python">Python</option> | |
| <option value="javascript">JavaScript</option> | |
| <option value="kotlin">Kotlin</option> | |
| </select> | |
| </div> | |
| <button id="compile-btn" class="bg-blue-600 hover:bg-blue-500 px-6 py-2 rounded font-medium transition flex items-center"> | |
| <i class="fas fa-cogs mr-2"></i> Компилировать в APK | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Настройки и результат --> | |
| <div class="space-y-8"> | |
| <!-- Настройки APK --> | |
| <div class="bg-gray-900 rounded-xl shadow-xl overflow-hidden"> | |
| <div class="bg-gray-800 px-6 py-3 border-b border-gray-700"> | |
| <h2 class="font-semibold text-lg flex items-center"> | |
| <i class="fas fa-cog mr-2 text-yellow-400"></i> | |
| Настройки APK | |
| </h2> | |
| </div> | |
| <div class="p-6 space-y-4"> | |
| <div> | |
| <label class="block text-sm text-gray-400 mb-1">Имя приложения</label> | |
| <input type="text" class="w-full bg-gray-800 rounded px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Мое приложение" value="Мое приложение"> | |
| </div> | |
| <div> | |
| <label class="block text-sm text-gray-400 mb-1">Идентификатор пакета</label> | |
| <input type="text" class="w-full bg-gray-800 rounded px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="com.example.myapp" value="com.example.myapp"> | |
| </div> | |
| <div> | |
| <label class="block text-sm text-gray-400 mb-1">Версия (1.0)</label> | |
| <input type="text" class="w-full bg-gray-800 rounded px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="1.0" value="1.0"> | |
| </div> | |
| <div> | |
| <label class="block text-sm text-gray-400 mb-1">Минимальная версия Android</label> | |
| <select class="w-full bg-gray-800 rounded px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| <option>Android 5.0 (API 21)</option> | |
| <option selected>Android 8.0 (API 26)</option> | |
| <option>Android 10 (API 29)</option> | |
| <option>Android 11 (API 30)</option> | |
| </select> | |
| </div> | |
| <div class="flex items-center"> | |
| <input type="checkbox" id="internet-permission" class="mr-2" checked> | |
| <label for="internet-permission" class="text-sm text-gray-400">Разрешение интернета</label> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Терминал --> | |
| <div class="bg-gray-900 rounded-xl shadow-xl overflow-hidden h-64"> | |
| <div class="bg-gray-800 px-6 py-3 border-b border-gray-700 flex justify-between items-center"> | |
| <h2 class="font-semibold text-lg flex items-center"> | |
| <i class="fas fa-terminal mr-2 text-green-400"></i> | |
| Процесс компиляции | |
| </h2> | |
| <span class="text-sm text-gray-400 hidden" id="compile-status">Готово</span> | |
| </div> | |
| <div class="p-4 terminal h-52 overflow-y-auto bg-black" id="terminal"> | |
| <div class="terminal-line info">ScriptToAPK Compiler v1.0.0</div> | |
| <div class="terminal-line info">Ожидание скрипта для компиляции...</div> | |
| </div> | |
| </div> | |
| <!-- Прогресс и результат --> | |
| <div id="progress-section" class="hidden"> | |
| <div class="mb-2 text-sm text-gray-400 flex justify-between"> | |
| <span>Прогресс компиляции:</span> | |
| <span id="progress-percent">0%</span> | |
| </div> | |
| <div class="h-2 bg-gray-800 rounded-full overflow-hidden mb-6"> | |
| <div id="progress-bar" class="progress-bar bg-blue-500 w-0"></div> | |
| </div> | |
| <div id="result-section" class="hidden text-center p-6 border-2 border-dashed border-gray-700 rounded-xl"> | |
| <div class="text-green-500 text-5xl mb-4"> | |
| <i class="fas fa-check-circle"></i> | |
| </div> | |
| <h3 class="text-xl font-medium mb-2">APK успешно скомпилирован!</h3> | |
| <p class="text-gray-400 mb-6">Ваш файл готов к скачиванию</p> | |
| <button class="bg-green-600 hover:bg-green-500 px-8 py-3 rounded-lg font-medium transition flex items-center mx-auto"> | |
| <i class="fas fa-download mr-2"></i> Скачать APK (2.1MB) | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </main> | |
| <footer class="bg-gray-900 border-t border-gray-800 py-8 mt-12"> | |
| <div class="container mx-auto px-4 text-center text-gray-400"> | |
| <div class="flex justify-center space-x-6 mb-6"> | |
| <a href="#" class="hover:text-white transition"><i class="fab fa-github text-xl"></i></a> | |
| <a href="#" class="hover:text-white transition"><i class="fab fa-discord text-xl"></i></a> | |
| <a href="#" class="hover:text-white transition"><i class="fab fa-telegram text-xl"></i></a> | |
| <a href="#" class="hover:text-white transition"><i class="fab fa-youtube text-xl"></i></a> | |
| </div> | |
| <p>© 2023 ScriptToAPK Компилятор. Все права защищены.</p> | |
| <p class="mt-2 text-sm">Это демонстрационный интерфейс. Для реальной компиляции требуется серверная часть.</p> | |
| </div> | |
| </footer> | |
| <script> | |
| document.addEventListener('DOMContentLoaded', function() { | |
| const codeEditor = document.getElementById('code-editor'); | |
| const lineNumbers = document.getElementById('line-numbers'); | |
| const compileBtn = document.getElementById('compile-btn'); | |
| const terminal = document.getElementById('terminal'); | |
| const progressSection = document.getElementById('progress-section'); | |
| const progressBar = document.getElementById('progress-bar'); | |
| const progressPercent = document.getElementById('progress-percent'); | |
| const resultSection = document.getElementById('result-section'); | |
| const compileStatus = document.getElementById('compile-status'); | |
| const sampleBtn = document.getElementById('sample-btn'); | |
| const languageSelect = document.getElementById('language-select'); | |
| // Обновление номеров строк | |
| codeEditor.addEventListener('input', updateLineNumbers); | |
| codeEditor.addEventListener('scroll', syncScroll); | |
| function updateLineNumbers() { | |
| const lines = codeEditor.value.split('\n').length; | |
| let numbers = ''; | |
| for (let i = 1; i <= lines; i++) { | |
| numbers += i + '<br>'; | |
| } | |
| lineNumbers.innerHTML = numbers; | |
| } | |
| function syncScroll() { | |
| lineNumbers.scrollTop = codeEditor.scrollTop; | |
| } | |
| // Кнопка "Пример" | |
| sampleBtn.addEventListener('click', function() { | |
| const language = languageSelect.value; | |
| let sampleCode = ''; | |
| switch(language) { | |
| case 'python': | |
| sampleCode = `# Простой калькулятор на Python | |
| import androidhelper | |
| droid = androidhelper.Android() | |
| def show_menu(): | |
| droid.dialogCreateAlert("Калькулятор", "Выберите операцию:") | |
| droid.dialogSetItems(["Сложение", "Вычитание", "Умножение", "Деление"]) | |
| droid.dialogShow() | |
| return droid.dialogGetResponse().result['item'] | |
| while True: | |
| operation = show_menu() | |
| droid.dialogGetInput("Введите первое число", "Число 1:") | |
| num1 = float(droid.dialogGetResponse().result['value']) | |
| droid.dialogGetInput("Введите второе число", "Число 2:") | |
| num2 = float(droid.dialogGetResponse().result['value']) | |
| if operation == 0: | |
| result = num1 + num2 | |
| elif operation == 1: | |
| result = num1 - num2 | |
| elif operation == 2: | |
| result = num1 * num2 | |
| elif operation == 3: | |
| result = num1 / num2 if num2 != 0 else "Ошибка: деление на ноль" | |
| droid.dialogCreateAlert("Результат", f"Результат: {result}") | |
| droid.dialogShow() | |
| `; | |
| break; | |
| case 'javascript': | |
| sampleCode = `// Таймер обратного отсчета на JavaScript | |
| function startCountdown(seconds) { | |
| let counter = seconds; | |
| const interval = setInterval(() => { | |
| counter--; | |
| // Обновляем UI | |
| document.getElementById('countdown-display').innerText = counter; | |
| if (counter <= 0) { | |
| clearInterval(interval); | |
| document.getElementById('countdown-display').innerText = "Время вышло!"; | |
| androidToast("Таймер завершен"); | |
| } | |
| }, 1000); | |
| } | |
| function androidToast(message) { | |
| // Эта функция будет переопределена при компиляции в APK | |
| alert(message); | |
| } | |
| // UI для приложения | |
| document.body.innerHTML = \` | |
| <div style="text-align: center; padding: 20px;"> | |
| <h1>Таймер обратного отсчета</h1> | |
| <input type="number" id="seconds-input" placeholder="Введите секунды" value="10"> | |
| <button onclick="startCountdown(parseInt(document.getElementById('seconds-input').value))"> | |
| Старт | |
| </button> | |
| <div id="countdown-display" style="font-size: 48px; margin-top: 20px;">--</div> | |
| </div> | |
| \`; | |
| `; | |
| break; | |
| case 'kotlin': | |
| sampleCode = `// Простое Android приложение на Kotlin | |
| package com.example.myapp | |
| import android.os.Bundle | |
| import android.widget.Button | |
| import android.widget.TextView | |
| import androidx.appcompat.app.AppCompatActivity | |
| class MainActivity : AppCompatActivity() { | |
| private lateinit var counterText: TextView | |
| private var count = 0 | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setContentView(R.layout.activity_main) | |
| counterText = findViewById(R.id.counter_text) | |
| val incrementBtn = findViewById<Button>(R.id.increment_btn) | |
| incrementBtn.setOnClickListener { | |
| count++ | |
| counterText.text = "Счетчик: \$count" | |
| } | |
| } | |
| } | |
| /* Пример XML разметки (activity_main.xml): | |
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:orientation="vertical" | |
| android:gravity="center"> | |
| <TextView | |
| android:id="@+id/counter_text" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="Счетчик: 0"/> | |
| <Button | |
| android:id="@+id/increment_btn" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="Увеличить"/> | |
| </LinearLayout> | |
| */ | |
| `; | |
| break; | |
| } | |
| codeEditor.value = sampleCode; | |
| updateLineNumbers(); | |
| addTerminalMessage(`Загружен пример скрипта на ${languageSelect.options[languageSelect.selectedIndex].text}`, 'info'); | |
| }); | |
| // Имитация процесса компиляции | |
| compileBtn.addEventListener('click', function() { | |
| if (codeEditor.value.trim() === '') { | |
| addTerminalMessage('Ошибка: Пустой скрипт. Введите код для компиляции.', 'error'); | |
| return; | |
| } | |
| // Сброс состояния | |
| progressSection.classList.remove('hidden'); | |
| progressBar.style.width = '0%'; | |
| progressPercent.textContent = '0%'; | |
| resultSection.classList.add('hidden'); | |
| compileStatus.classList.remove('hidden'); | |
| compileStatus.textContent = 'Компиляция...'; | |
| compileBtn.disabled = true; | |
| compileBtn.classList.add('opacity-50'); | |
| addTerminalMessage('Начало компиляции скрипта в APK...', 'info'); | |
| simulateCompilation(); | |
| }); | |
| function simulateCompilation() { | |
| const steps = [ | |
| {percent: 10, message: 'Анализ скрипта...', type: 'info'}, | |
| {percent: 25, message: 'Оптимизация кода...', type: 'info'}, | |
| {percent: 40, message: 'Создание структуры Android проекта...', type: 'info'}, | |
| {percent: 65, message: 'Компиляция ресурсов...', type: 'info'}, | |
| {percent: 80, message: 'Генерация APK...', type: 'info'}, | |
| {percent: 95, message: 'Подписание APK...', type: 'info'}, | |
| {percent: 100, message: 'Компиляция успешно завершена! APK готов к использованию.', type: 'success'} | |
| ]; | |
| let delay = 0; | |
| steps.forEach(step => { | |
| setTimeout(() => { | |
| progressBar.style.width = step.percent + '%'; | |
| progressPercent.textContent = step.percent + '%'; | |
| addTerminalMessage(step.message, step.type); | |
| if (step.percent === 100) { | |
| compileStatus.textContent = 'Готово'; | |
| compileBtn.disabled = false; | |
| compileBtn.classList.remove('opacity-50'); | |
| resultSection.classList.remove('hidden'); | |
| } | |
| }, delay); | |
| delay += 500 + Math.random() * 1000; | |
| }); | |
| } | |
| function addTerminalMessage(message, type) { | |
| const now = new Date(); | |
| const timeStr = now.toLocaleTimeString(); | |
| const messageElement = document.createElement('div'); | |
| messageElement.className = `terminal-line ${type}`; | |
| messageElement.innerHTML = `[${timeStr}] ${message}`; | |
| terminal.appendChild(messageElement); | |
| terminal.scrollTop = terminal.scrollHeight; | |
| } | |
| updateLineNumbers(); | |
| }); | |
| </script> | |
| <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Seter2345/setter" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |