Spaces:
Running
Running
| <html lang="it"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Applicazione di Gestione Argomenti</title> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; | |
| } | |
| :root { | |
| --primary: #4361ee; | |
| --secondary: #3a0ca3; | |
| --accent: #7209b7; | |
| --light: #f8f9fa; | |
| --dark: #212529; | |
| --success: #4cc9f0; | |
| --warning: #f72585; | |
| --card-bg: #ffffff; | |
| --shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | |
| --radius: 12px; | |
| } | |
| body { | |
| background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); | |
| color: var(--dark); | |
| min-height: 100vh; | |
| padding: 20px; | |
| } | |
| .header { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| padding: 20px; | |
| background: var(--primary); | |
| color: white; | |
| border-radius: var(--radius); | |
| margin-bottom: 30px; | |
| box-shadow: var(--shadow); | |
| } | |
| .header h1 { | |
| font-size: 1.8rem; | |
| font-weight: 700; | |
| } | |
| .header a { | |
| color: white; | |
| text-decoration: none; | |
| font-size: 0.9rem; | |
| opacity: 0.9; | |
| transition: opacity 0.3s; | |
| } | |
| .header a:hover { | |
| opacity: 1; | |
| text-decoration: underline; | |
| } | |
| .container { | |
| max-width: 1200px; | |
| margin: 0 auto; | |
| } | |
| .app-description { | |
| text-align: center; | |
| margin-bottom: 40px; | |
| padding: 20px; | |
| background: var(--card-bg); | |
| border-radius: var(--radius); | |
| box-shadow: var(--shadow); | |
| } | |
| .app-description h2 { | |
| color: var(--secondary); | |
| margin-bottom: 15px; | |
| font-size: 1.6rem; | |
| } | |
| .app-description p { | |
| font-size: 1.1rem; | |
| line-height: 1.6; | |
| color: #555; | |
| } | |
| .topics-grid { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); | |
| gap: 25px; | |
| margin-bottom: 40px; | |
| } | |
| .topic-card { | |
| background: var(--card-bg); | |
| border-radius: var(--radius); | |
| padding: 25px; | |
| box-shadow: var(--shadow); | |
| transition: transform 0.3s, box-shadow 0.3s; | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .topic-card:hover { | |
| transform: translateY(-5px); | |
| box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); | |
| } | |
| .topic-card.incomplete { | |
| border-left: 5px solid var(--warning); | |
| } | |
| .topic-card.complete { | |
| border-left: 5px solid var(--success); | |
| } | |
| .topic-header { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| margin-bottom: 15px; | |
| } | |
| .topic-title { | |
| font-size: 1.3rem; | |
| font-weight: 600; | |
| color: var(--secondary); | |
| } | |
| .topic-status { | |
| display: inline-block; | |
| padding: 5px 12px; | |
| border-radius: 20px; | |
| font-size: 0.8rem; | |
| font-weight: 600; | |
| } | |
| .status-incomplete { | |
| background: rgba(247, 37, 133, 0.2); | |
| color: var(--warning); | |
| } | |
| .status-complete { | |
| background: rgba(76, 201, 240, 0.2); | |
| color: var(--success); | |
| } | |
| .topic-description { | |
| color: #666; | |
| margin-bottom: 20px; | |
| line-height: 1.5; | |
| } | |
| .progress-container { | |
| margin-bottom: 15px; | |
| } | |
| .progress-label { | |
| display: flex; | |
| justify-content: space-between; | |
| margin-bottom: 5px; | |
| font-size: 0.9rem; | |
| color: #555; | |
| } | |
| .progress-bar { | |
| height: 8px; | |
| background: #e9ecef; | |
| border-radius: 4px; | |
| overflow: hidden; | |
| } | |
| .progress-fill { | |
| height: 100%; | |
| border-radius: 4px; | |
| transition: width 0.5s ease; | |
| } | |
| .progress-incomplete { | |
| background: var(--warning); | |
| width: 30%; | |
| } | |
| .progress-complete { | |
| background: var(--success); | |
| width: 100%; | |
| } | |
| .topic-actions { | |
| display: flex; | |
| gap: 10px; | |
| margin-top: 15px; | |
| } | |
| .btn { | |
| padding: 8px 16px; | |
| border: none; | |
| border-radius: 6px; | |
| font-weight: 600; | |
| cursor: pointer; | |
| transition: all 0.3s; | |
| display: flex; | |
| align-items: center; | |
| gap: 5px; | |
| } | |
| .btn-primary { | |
| background: var(--primary); | |
| color: white; | |
| } | |
| .btn-primary:hover { | |
| background: var(--secondary); | |
| } | |
| .btn-secondary { | |
| background: #e9ecef; | |
| color: var(--dark); | |
| } | |
| .btn-secondary:hover { | |
| background: #dee2e6; | |
| } | |
| .add-topic-section { | |
| background: var(--card-bg); | |
| border-radius: var(--radius); | |
| padding: 25px; | |
| box-shadow: var(--shadow); | |
| margin-bottom: 40px; | |
| } | |
| .add-topic-section h2 { | |
| color: var(--secondary); | |
| margin-bottom: 20px; | |
| font-size: 1.5rem; | |
| } | |
| .form-group { | |
| margin-bottom: 20px; | |
| } | |
| .form-group label { | |
| display: block; | |
| margin-bottom: 8px; | |
| font-weight: 600; | |
| color: var(--dark); | |
| } | |
| .form-control { | |
| width: 100%; | |
| padding: 12px 15px; | |
| border: 1px solid #ddd; | |
| border-radius: 6px; | |
| font-size: 1rem; | |
| transition: border 0.3s; | |
| } | |
| .form-control:focus { | |
| outline: none; | |
| border-color: var(--primary); | |
| } | |
| textarea.form-control { | |
| min-height: 100px; | |
| resize: vertical; | |
| } | |
| .stats-section { | |
| display: grid; | |
| grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); | |
| gap: 20px; | |
| margin-bottom: 40px; | |
| } | |
| .stat-card { | |
| background: var(--card-bg); | |
| border-radius: var(--radius); | |
| padding: 25px; | |
| box-shadow: var(--shadow); | |
| text-align: center; | |
| } | |
| .stat-value { | |
| font-size: 2.5rem; | |
| font-weight: 700; | |
| margin-bottom: 10px; | |
| } | |
| .stat-incomplete { | |
| color: var(--warning); | |
| } | |
| .stat-complete { | |
| color: var(--success); | |
| } | |
| .stat-total { | |
| color: var(--primary); | |
| } | |
| .stat-label { | |
| font-size: 1rem; | |
| color: #666; | |
| } | |
| .empty-state { | |
| text-align: center; | |
| padding: 60px 20px; | |
| background: var(--card-bg); | |
| border-radius: var(--radius); | |
| box-shadow: var(--shadow); | |
| margin-bottom: 40px; | |
| } | |
| .empty-state i { | |
| font-size: 4rem; | |
| color: #dee2e6; | |
| margin-bottom: 20px; | |
| } | |
| .empty-state h3 { | |
| color: var(--secondary); | |
| margin-bottom: 15px; | |
| font-size: 1.5rem; | |
| } | |
| .empty-state p { | |
| color: #666; | |
| max-width: 500px; | |
| margin: 0 auto 25px; | |
| line-height: 1.6; | |
| } | |
| @media (max-width: 768px) { | |
| .topics-grid { | |
| grid-template-columns: 1fr; | |
| } | |
| .header { | |
| flex-direction: column; | |
| gap: 15px; | |
| text-align: center; | |
| } | |
| .topic-actions { | |
| flex-direction: column; | |
| } | |
| } | |
| @media (max-width: 480px) { | |
| .stats-section { | |
| grid-template-columns: 1fr; | |
| } | |
| .header h1 { | |
| font-size: 1.5rem; | |
| } | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <header class="header"> | |
| <h1><i class="fas fa-tasks"></i> Gestione Argomenti</h1> | |
| <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">Built with anycoder</a> | |
| </header> | |
| <section class="app-description"> | |
| <h2>Organizza e Completa i Tuoi Argomenti</h2> | |
| <p>Questa applicazione ti aiuta a tenere traccia degli argomenti che stai studiando o sviluppando. Aggiungi nuovi argomenti, monitora il loro progresso e segnalali come completati quando hai finito.</p> | |
| </section> | |
| <section class="stats-section"> | |
| <div class="stat-card"> | |
| <div class="stat-value stat-total">5</div> | |
| <div class="stat-label">Argomenti Totali</div> | |
| </div> | |
| <div class="stat-card"> | |
| <div class="stat-value stat-complete">2</div> | |
| <div class="stat-label">Completati</div> | |
| </div> | |
| <div class="stat-card"> | |
| <div class="stat-value stat-incomplete">3</div> | |
| <div class="stat-label">Incompleti</div> | |
| </div> | |
| </section> | |
| <section class="add-topic-section"> | |
| <h2><i class="fas fa-plus-circle"></i> Aggiungi Nuovo Argomento</h2> | |
| <form id="topic-form"> | |
| <div class="form-group"> | |
| <label for="topic-title">Titolo Argomento</label> | |
| <input type="text" id="topic-title" class="form-control" placeholder="Inserisci il titolo dell'argomento" required> | |
| </div> | |
| <div class="form-group"> | |
| <label for="topic-description">Descrizione</label> | |
| <textarea id="topic-description" class="form-control" placeholder="Descrivi l'argomento in dettaglio"></textarea> | |
| </div> | |
| <button type="submit" class="btn btn-primary"> | |
| <i class="fas fa-save"></i> Salva Argomento | |
| </button> | |
| </form> | |
| </section> | |
| <div class="topics-grid" id="topics-container"> | |
| <!-- Topic cards will be dynamically added here --> | |
| </div> | |
| <div class="empty-state" id="empty-state" style="display: none;"> | |
| <i class="fas fa-folder-open"></i> | |
| <h3>Nessun Argomento Aggiunto</h3> | |
| <p>Inizia aggiungendo il tuo primo argomento utilizzando il modulo sopra. Puoi tracciare il progresso e segnare gli argomenti come completati.</p> | |
| <button class="btn btn-primary" onclick="document.getElementById('topic-title').focus()"> | |
| <i class="fas fa-plus"></i> Aggiungi Primo Argomento | |
| </button> | |
| </div> | |
| </div> | |
| <script> | |
| // Sample initial data | |
| let topics = [ | |
| { | |
| id: 1, | |
| title: "Introduzione a HTML", | |
| description: "Fondamenti del linguaggio di markup HTML, tag essenziali e struttura di base di una pagina web.", | |
| completed: true | |
| }, | |
| { | |
| id: 2, | |
| title: "CSS Moderno e Responsive", | |
| description: "Utilizzo di CSS Grid, Flexbox, variabili CSS e media queries per creare layout moderni e responsive.", | |
| completed: false | |
| }, | |
| { | |
| id: 3, | |
| title: "JavaScript Base", | |
| description: "Variabili, funzioni, strutture di controllo e manipolazione del DOM con JavaScript.", | |
| completed: true | |
| }, | |
| { | |
| id: 4, | |
| title: "Framework JavaScript", | |
| description: "Panoramica sui principali framework JavaScript come React, Vue e Angular.", | |
| completed: false | |
| }, | |
| { | |
| id: 5, | |
| title: "Accessibilità Web", | |
| description: "Principi di accessibilità, ARIA roles e best practices per siti web accessibili.", | |
| completed: false | |
| } | |
| ]; | |
| // DOM elements | |
| const topicsContainer = document.getElementById('topics-container'); | |
| const emptyState = document.getElementById('empty-state'); | |
| const topicForm = document.getElementById('topic-form'); | |
| // Render topics | |
| function renderTopics() { | |
| topicsContainer.innerHTML = ''; | |
| if (topics.length === 0) { | |
| emptyState.style.display = 'block'; | |
| return; | |
| } | |
| emptyState.style.display = 'none'; | |
| topics.forEach(topic => { | |
| const topicCard = document.createElement('div'); | |
| topicCard.className = `topic-card ${topic.completed ? 'complete' : 'incomplete'}`; | |
| topicCard.innerHTML = ` | |
| <div class="topic-header"> | |
| <h3 class="topic-title">${topic.title}</h3> | |
| <span class="topic-status ${topic.completed ? 'status-complete' : 'status-incomplete'}"> | |
| ${topic.completed ? 'Completato' : 'Incompleto'} | |
| </span> | |
| </div> | |
| <p class="topic-description">${topic.description}</p> | |
| <div class="progress-container"> | |
| <div class="progress-label"> | |
| <span>Progresso</span> | |
| <span>${topic.completed ? '100%' : '30%'}</span> | |
| </div> | |
| <div class="progress-bar"> | |
| <div class="progress-fill ${topic.completed ? 'progress-complete' : 'progress-incomplete'}"></div> | |
| </div> | |
| </div> | |
| <div class="topic-actions"> | |
| <button class="btn ${topic.completed ? 'btn-secondary' : 'btn-primary'}" onclick="toggleTopicStatus(${topic.id})"> | |
| <i class="fas ${topic.completed ? 'fa-undo' : 'fa-check'}"></i> | |
| ${topic.completed ? 'Riapri' : 'Completa'} | |
| </button> | |
| <button class="btn btn-secondary" onclick="deleteTopic(${topic.id})"> | |
| <i class="fas fa-trash"></i> Elimina | |
| </button> | |
| </div> | |
| `; | |
| topicsContainer.appendChild(topicCard); | |
| }); | |
| updateStats(); | |
| } | |
| // Update statistics | |
| function updateStats() { | |
| const total = topics.length; | |
| const completed = topics.filter(topic => topic.completed).length; | |
| const incomplete = total - completed; | |
| document.querySelector('.stat-total').textContent = total; | |
| document.querySelector('.stat-complete').textContent = completed; | |
| document.querySelector('.stat-incomplete').textContent = incomplete; | |
| } | |
| // Toggle topic status | |
| function toggleTopicStatus(id) { | |
| const topicIndex = topics.findIndex(topic => topic.id === id); | |
| if (topicIndex !== -1) { | |
| topics[topicIndex].completed = !topics[topicIndex].completed; | |
| renderTopics(); | |
| } | |
| } | |
| // Delete topic | |
| function deleteTopic(id) { | |
| if (confirm('Sei sicuro di voler eliminare questo argomento?')) { | |
| topics = topics.filter(topic => topic.id !== id); | |
| renderTopics(); | |
| } | |
| } | |
| // Add new topic | |
| topicForm.addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| const title = document.getElementById('topic-title').value; | |
| const description = document.getElementById('topic-description').value; | |
| if (title.trim() === '') { | |
| alert('Inserisci un titolo per l\'argomento'); | |
| return; | |
| } | |
| const newTopic = { | |
| id: topics.length > 0 ? Math.max(...topics.map(t => t.id)) + 1 : 1, | |
| title: title, | |
| description: description || 'Nessuna descrizione fornita', | |
| completed: false | |
| }; | |
| topics.push(newTopic); | |
| renderTopics(); | |
| // Reset form | |
| topicForm.reset(); | |
| }); | |
| // Initial render | |
| renderTopics(); | |
| </script> | |
| </body> | |
| </html> |