From 539c85852fa779c09a7b1346ff261346e3f52a80 Mon Sep 17 00:00:00 2001 From: Leonardo Henrique Constantino Date: Thu, 7 Nov 2024 18:02:30 -0300 Subject: [PATCH] Updates --- .gitignore | 20 ++++++++++++++++++++ assets/favicon-Bh411q7E.ico | Bin 0 -> 1150 bytes assets/index-61U2Gboa.js | 2 ++ assets/index-CylDIjDE.css | 1 + index.html | 17 +++++++++++++++++ 5 files changed, 40 insertions(+) create mode 100644 .gitignore create mode 100644 assets/favicon-Bh411q7E.ico create mode 100644 assets/index-61U2Gboa.js create mode 100644 assets/index-CylDIjDE.css create mode 100644 index.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..21d14f2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +# Arquivos de sistema +.DS_Store +Thumbs.db + +# Módulos e dependências +node_modules/ +npm-debug.log +yarn-error.log +package-lock.json + +# Arquivos de build +dist/ +build/ +*.bundle.js +*.bundle.js.map + +# Outros arquivos +.cache/ +.vscode/ +*.log diff --git a/assets/favicon-Bh411q7E.ico b/assets/favicon-Bh411q7E.ico new file mode 100644 index 0000000000000000000000000000000000000000..8a634550dffd6aa41018c15f8d0377c8fab4e101 GIT binary patch literal 1150 zcmbVMOH30{6de=ShPZI;(zS^zS1xryh>334DFz79l`AwNvOtlKN@$_w(^5dbg-%;& zq4H_zhqiz%whd7Gv*lYpRcoM7j`vM%A-FJcCg;7(n|JOx_s)I8aTn;$%j0Og%9UK? zxGNmTT_eyEtz_0|;y8L|x|D(NOhdqDL%@3u9xFmC^YB zOmw`&gsf74LH-JQMGa>9YGE9x7d$Z^%tOF8C&Xaf=+{MPx*JhZbO%+X1p+Ed3h=xr z9}N$#qq)2g6J0ehD;ot5c3nq?>$T#We*rebAnKl#Asp}{=wCsIuw*yF-Fz3x-rMk1 zT!ymYG36kFRox7`j_GH7uZNc~+AD&pM+zW?c*KjNUwcR;VmQ(k0A3MJOvNxZ6=Fsy zflWhvy*$Tfd5;fCp&|asaSA{7w&C~8!{xBxyGsu6H{t8N2YGcFY@}_|N(B8N<)5va zLD>r3Ks#`JfMg<$Py9!U*Mgm`b@BvEj}Afn;t`y>Hp*WD_v}bcKNfUja-|Fe+1_LP$m%>6XL<0ldhBjSu@PRyRy2V9_y)Xl29)OCfLif^ zxL*W4#$~n3_0OLe7F`ci9dDsgyaO+<7v?^36?o$AZ3c3hj4SZZot+5v5$h%9Ckyr* w4Sc5WY02?V_0OC=)=T8$FHo*5-;7_{Py2*3o1M>j$i4s9I`Omrf&ZO<16P+!$N&HU literal 0 HcmV?d00001 diff --git a/assets/index-61U2Gboa.js b/assets/index-61U2Gboa.js new file mode 100644 index 0000000..f61ae4c --- /dev/null +++ b/assets/index-61U2Gboa.js @@ -0,0 +1,2 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const n of o)if(n.type==="childList")for(const l of n.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function a(o){const n={};return o.integrity&&(n.integrity=o.integrity),o.referrerPolicy&&(n.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?n.credentials="include":o.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(o){if(o.ep)return;o.ep=!0;const n=a(o);fetch(o.href,n)}})();const A={eventHandlers:new Map,initializedContainers:new Set,handlerId:0,init(e=document.body){if(this.initializedContainers.has(e))return;["click","submit","change","input","keyup","keydown","mouseenter","mouseleave","focus","blur"].forEach(a=>{e.addEventListener(a,s=>{let o=s.target;if(o)for(;o&&o!==e&&o instanceof HTMLElement;){const n=o.dataset.handlerId;if(n){const l=this.eventHandlers.get(n);if(l&&l[a]){l[a](s),s.stopPropagation();break}}o=o.parentElement}},{passive:["scroll","touchmove"].includes(a)})}),this.initializedContainers.add(e)},registerEventHandlers(e,t){const a=`h${++this.handlerId}`,s={};return Object.entries(t).forEach(([o,n])=>{const l=o.replace(/^on/i,"").toLowerCase();s[l]=n}),this.eventHandlers.set(a,s),e.dataset.handlerId=a,a},removeEventHandlers(e){this.eventHandlers.delete(e)},cleanup(e){const t=e.dataset.handlerId;t&&(this.removeEventHandlers(t),delete e.dataset.handlerId,--this.handlerId),e.querySelectorAll("[data-handler-id]").forEach(a=>{const s=a,o=s.dataset.handlerId;o&&(this.removeEventHandlers(o),delete s.dataset.handlerId,--this.handlerId)})}},E=({type:e,props:t={}},a=!1,s=document.body)=>{try{if(A.init(s),e!=null&&typeof e!="string")throw new Error(`Invalid element type: ${e}`);const o=e?document.createElement(e):document.createTextNode(t.nodeValue||"");if(e){const n={},l={};Object.entries(t).forEach(([u,p])=>{u.startsWith("on")&&typeof p=="function"?n[u]=p:["children","nodeValue"].includes(u)||(l[u]=p)}),o instanceof HTMLElement&&(Object.keys(n).length>0&&A.registerEventHandlers(o,n),Object.entries(l).forEach(([u,p])=>{if(typeof p!="string"&&typeof p!="number")throw new Error(`Invalid attribute value for ${u}: ${p}`);const h=typeof p=="number"?String(p):p;o.setAttribute(u,h)}));const d=document.createDocumentFragment();(Array.isArray(t.children)?t.children:[]).forEach(u=>{const p=E(u,!1,s);p&&d.appendChild(p)}),o.appendChild(d)}return a?s.appendChild(o):o}catch(o){throw console.error("Error rendering element:",o),o}},N={"pt-br":{app:{title:"📋 Lista de Tarefas",modalLang:{title:"Escolha uma nova lingua."},modalDeleteTasks:{title:"Tem certeza de que deseja remover todas as tarefas?"},"pt-br":"Português 🇧🇷","en-us":"English 🇺🇸","es-es":"Español 🇪🇸"},notifications:{appStarted:"🚀 O aplicativo iniciado com sucesso!",startError:e=>`❌ Ocorreu um erro ao iniciar o aplicativo. ${e}`,themeToggled:e=>`🌓 Alternar Tema para ${e}`,themeChanged:e=>`Tema alterado para ${e} 🌓`,priorityUpdated:e=>`🔄 Prioridade alterada para ${e}`,tasksAdded:"✅ Tarefa(s) adicionada(s) com sucesso!",filtersApplied:"🎯 Filtros aplicados com sucesso!",taskStatusChanged:e=>`Tarefa "${e.title}" ${e.completed?"concluída":"pendente"}!`,taskNotFound:"⚠️ Tarefa não encontrada!",taskDeleted:e=>`🗑️ Tarefa "${e.title}" excluída com sucesso!`,allTasksDeleted:"🗑️ Todas as tarefas excluídas com sucesso!",storageUsage:e=>`🗂️ ~${e} / ~10 MB`,summary:(e,t,a)=>`Total: ${e} | Pendentes: ${t} | Concluídas: ${a} 📊`,languageSelected:e=>`🌐 ${e} Selecionado com sucesso! Clique em OK para aplicar!`},placeholders:{taskInput:"📝 Digite suas tarefas (uma por linha)"},priorities:{low:"Baixa 🔵",medium:"Média 🟠",high:"Alta 🔴"},actions:{addTasks:"➕ Adicionar Tarefas",deleteTasks:"🗑️ Remover Tarefas",toggleTheme:"🌓 Alternar Tema",deleteTaskConfirm:e=>`Excluir tarefa "${e}" 🗑️`,deleteAllTasksConfirm:e=>`Excluir todas as tarefas (${e}) 🔄🗑️`,changeLanguage:"🌐 Mudar Idioma",toggleLanguage:"🌐 Mudar Idioma! Português, English e Español"},filters:{status:{all:"Todos 📋",completed:"Concluídas ✅",pending:"Pendentes ⏳"},priority:{all:"Todos 📋",low:"Baixa 🔵",medium:"Média 🟠",high:"Alta 🔴"}},taskDetails:{created:e=>`⏱️ Criada: ${e}`,completed:e=>`⏱️ Concluída: ${e}`,timeSpent:e=>`⏱️ Tempo: ${e}`},labels:{taskList:"📋 Lista de Tarefas",delete:"Excluir 🗑️"}},"en-us":{app:{title:"📋 Task List",modalLang:{title:"Choose a new language."},modalDeleteTasks:{title:"Are you sure you want to remove all tasks?"},"pt-br":"Portuguese 🇧🇷","en-us":"English 🇺🇸","es-es":"Spanish 🇪🇸"},notifications:{appStarted:"🚀 Application started successfully!",startError:e=>`❌ An error occurred while starting the application. ${e}`,themeToggled:e=>`🌓 Toggle Theme to ${e}`,themeChanged:e=>`Theme changed to ${e} 🌓`,priorityUpdated:e=>`🔄 Priority updated to ${e}`,tasksAdded:"✅ Task(s) added successfully!",filtersApplied:"🎯 Filters applied successfully!",taskStatusChanged:e=>`Task "${e.title}" ${e.completed?"completed":"pending"}!`,taskNotFound:"⚠️ Task not found!",taskDeleted:e=>`🗑️ Task "${e.title}" deleted successfully!`,allTasksDeleted:"🗑️ All tasks deleted successfully!",storageUsage:e=>`🗂️ ~${e} / ~10 MB`,summary:(e,t,a)=>`Total: ${e} | Pending: ${t} | Completed: ${a} 📊`,languageChanged:e=>`Language changed to ${e} 🌐`},placeholders:{taskInput:"📝 Enter your tasks (one per line)"},priorities:{low:"Low 🔵",medium:"Medium 🟠",high:"High 🔴"},actions:{addTasks:"➕ Add Tasks",deleteTasks:"🗑️ Remove Tasks",toggleTheme:"🌓 Toggle Theme",deleteTaskConfirm:e=>`Delete task "${e}" 🗑️`,deleteAllTasksConfirm:e=>`Delete all tasks (${e}) 🔄🗑️`,changeLanguage:"🌐 Change Language"},filters:{status:{all:"All 📋",completed:"Completed ✅",pending:"Pending ⏳"},priority:{all:"All 📋",low:"Low 🔵",medium:"Medium 🟠",high:"High 🔴"}},taskDetails:{created:e=>`⏱️ Created: ${e}`,completed:e=>`⏱️ Completed: ${e}`,timeSpent:e=>`⏱️ Time: ${e}`},labels:{taskList:"📋 Task List",delete:"Delete 🗑️"}},"es-es":{app:{title:"📋 Lista de Tareas",modalLang:{title:"Elige un nuevo idioma."},modalDeleteTasks:{title:"¿Estás seguro de querer eliminar todas las tareas?"},"pt-br":"Portugués 🇧🇷","en-us":"Inglés 🇺🇸","es-es":"Español 🇪🇸"},notifications:{appStarted:"🚀 ¡Aplicación iniciada con éxito!",startError:e=>`❌ Ocurrió un error al iniciar la aplicación. ${e}`,themeToggled:e=>`🌓 Cambiar Tema a ${e}`,themeChanged:e=>`Tema cambiado a ${e} 🌓`,priorityUpdated:e=>`🔄 Prioridad cambiada a ${e}`,tasksAdded:"✅ ¡Tarea(s) añadida(s) con éxito!",filtersApplied:"🎯 ¡Filtros aplicados con éxito!",taskStatusChanged:e=>`Tarea "${e.title}" ${e.completed?"completada":"pendiente"}!`,taskNotFound:"⚠️ ¡Tarea no encontrada!",taskDeleted:e=>`🗑️ Tarea "${e.title}" eliminada con éxito!`,allTasksDeleted:"🗑️ ¡Todas las tareas eliminadas con éxito!",storageUsage:e=>`🗂️ ~${e} / ~10 MB`,summary:(e,t,a)=>`Total: ${e} | Pendientes: ${t} | Completadas: ${a} 📊`,languageChanged:e=>`Idioma cambiado a ${e} 🌐`},placeholders:{taskInput:"📝 Escribe tus tareas (una por línea)"},priorities:{low:"Baja 🔵",medium:"Media 🟠",high:"Alta 🔴"},actions:{addTasks:"➕ Añadir Tareas",deleteTasks:"🗑️ Eliminar Tareas",toggleTheme:"🌓 Cambiar Tema",deleteTaskConfirm:e=>`Eliminar tarea "${e}" 🗑️`,deleteAllTasksConfirm:e=>`Eliminar todas las tareas (${e}) 🔄🗑️`,changeLanguage:"🌐 Cambiar Idioma"},filters:{status:{all:"Todas 📋",completed:"Completadas ✅",pending:"Pendientes ⏳"},priority:{all:"Todas 📋",low:"Baja 🔵",medium:"Media 🟠",high:"Alta 🔴"}},taskDetails:{created:e=>`⏱️ Creada: ${e}`,completed:e=>`⏱️ Completada: ${e}`,timeSpent:e=>`⏱️ Tiempo: ${e}`},labels:{taskList:"📋 Lista de Tareas",delete:"Eliminar 🗑️"}}},i=(e,t,...a)=>{try{if(!e||!t)throw new Error("Idioma e caminho são obrigatórios");if(!N[e])return`Idioma "${e}" não disponível`;const s=t.split(".").reduce((o,n)=>{if(typeof o=="string"||typeof o=="function")throw new Error(`Caminho inválido: "${t}"`);if(!o[n])throw new Error(`Chave "${n}" não encontrada`);return o[n]},N[e]);if(typeof s=="function")return s(...a);if(typeof s=="string"||typeof s=="object")return s;throw new Error("Valor encontrado não é um texto ou função")}catch(s){return console.warn("Erro ao obter texto:",s.message,{lang:e,path:t,args:a}),`Texto não encontrado para "${t}" no idioma "${e}"`}};let M="";const ie=()=>{if(M.trim()==="")throw new Error("Prefix must be set using setAppPrefix before performing any operations.")},le=e=>{if(typeof e!="string"||e.trim()==="")throw new Error("Key must be a non-empty string.")},K=(e,t)=>(ie(),le(e),t(M+e)),ce=e=>{if(typeof e!="string"||e.trim()==="")throw new Error("Prefix should be a non-empty string.");M=e.trim()+"_"},de=(e,t)=>{K(e,a=>{const s=typeof t=="object"?JSON.stringify(t):t;localStorage.setItem(a,s)})},pe=e=>K(e,t=>{const a=localStorage.getItem(t);if(!a)return null;try{return a.startsWith("{")||a.startsWith("[")||a==="null"||a==="true"||a==="false"||!isNaN(+a)?JSON.parse(a):a}catch(s){return console.warn(`Erro ao processar valor para a chave "${t}"`,s),a}}),k={setAppPrefix:ce,setItem:de,getItem:pe};k.setAppPrefix("todoApp");const m=k.getItem("tasks")||[],ue=k.getItem("theme")||"light",me=k.getItem("language"),ge=e=>typeof e!="string"||e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1),R=e=>{if(e==null)return"0 bytes";const t=JSON.stringify(e),a=new Blob([t]).size;return a<1024?`${a.toLocaleString()} bytes`:a<1024*1024?`${(a/1024).toFixed(2)} KB`:`${(a/1048576).toFixed(2)} MB`},c=(e,...t)=>({type:e,props:{children:[...t]}}),f=e=>({type:null,props:{nodeValue:e}}),b=e=>c("span",f(e)),J=(e,t=!1)=>{const a=e.length||0,s=e.filter(d=>d.completed).length,o=a-s,n=document.querySelector("div #stats"),l=i(r(),"notifications.summary",a,o,s);if(!t)return l;n&&(n.innerHTML=l)},D=e=>{const t=document.querySelector("div #sizeInfo");t&&(t.innerHTML=i(r(),"notifications.storageUsage",R(e)))},L=e=>{k.setItem("tasks",e),J(e,!0)},j=e=>new Date(e).toLocaleString(r()),V=(e,t)=>{const a=t-e,s=Math.floor(a/(1e3*60)),o=Math.floor(s/60),n=Math.floor(o/24);return n>0?`${n} dia(s)`:o>0?`${o} hora(s)`:`${s} minuto(s)`},r=()=>(me||navigator.language||"pt-br").toLowerCase(),T=(e,t,a,s="",o="")=>{const n={type:"button",props:{children:[c("span",f(e))]}};return t&&(n.props.onClick=t),s&&(n.props.class=s),o&&(n.props.title=o),n},fe=e=>{const t=document.querySelector("select#statusFilter"),a=t?t==null?void 0:t.value:"all",s=document.querySelector("select#priorityFilter"),o=s?s==null?void 0:s.value:"all";return e.filter(n=>{const l=a==="all"||a==="completed"&&n.completed||a==="pending"&&!n.completed,d=o==="all"||n.priority===o;return l&&d})},he=e=>fe(e).map(a=>{const{id:s,title:o,priority:n,completed:l,createdAt:d,completedAt:y}=a,u=c("span",f(ge(i(r(),"priorities")[n])));u.props.class=`task-priority priority-${n}`;const p=c("span",f(o));p.props.class="task-title";const h=c("input");h.props.class="task-checkbox",h.props.type="checkbox",h.props.id=`task-${s}`,l&&(h.props.checked=""),h.props.onchange=()=>$e(s,e);const B=c("div",h,p,u);B.props.class="task-header";const $=c("div");$.props.children.push(b(i(r(),"taskDetails.created",j(d)))),l&&$.props.children.push(b(i(r(),"taskDetails.completed",j(y)))),$.props.children.push(b(i(r(),"taskDetails.timeSpent",l?V(+new Date(d),+new Date(y)):V(+new Date(d),+new Date)))),$.props.class="task-dates";const q=c("label",B,$);q.props.class="task-wrapper";const re=T(i(r(),"labels.delete"),()=>Le(s,e),"","delete-button",i(r(),"actions.deleteTaskConfirm",o)),z=c("div",re);z.props.class="task-actions";const U=c("div",q,z);return U.props.class=`task-card ${l?"task-completed":""}`,U}),v=e=>{const t=document.querySelector(".btn-remove-all");t&&(t.classList.toggle("hidden",e.length===0),t.title=i(r(),"actions.deleteAllTasksConfirm",e.length));const a=he(e),s=document.querySelector("#taskList");s&&(A.cleanup(s),s.innerHTML="",a.forEach(o=>{E(o,!0,s)}))},Te=(e,t="show")=>({type:"div",props:{id:"snackbar",children:[f(e)],class:t}}),w=new Set,ke=(e,t)=>{let a=document.querySelector(".snackbar-container");if(!a){const l=c("div");l.props.class="snackbar-container";const d=E(l,!0);d instanceof HTMLElement&&(a=d)}const s=`snackbar-${Date.now()}`,o=Te(e);o.props.id="snackbar",o.props["data-id"]=s,w.add(s);const n=E(o,!0,a);setTimeout(()=>{n.remove(),w.delete(s),w.size===0&&a&&a.remove()},t)},g=(e,t=3e3)=>{ke(e,t)},ye=(e,t)=>{const a=T("OK",t,"","","Confirmar"),s=T("Cancelar",I,"","","Fechar");s.props&&(s.props.formmethod="dialog");const o=c("form",a,s);o.props&&(o.props.method="dialog");const n=T("X",I,"","close","Fechar");return e.props&&(e.props.class="modal-content"),c("dialog",n,e,o)},be=e=>{if(!(e.target instanceof HTMLElement))return;const t=e.target.closest("button");if(!t)return;const s=document.documentElement.getAttribute("data-theme")==="light"?"dark":"light";t.title=i(r(),"notifications.themeToggled",s),document.documentElement.setAttribute("data-theme",s),k.setItem("theme",s),g(i(r(),"notifications.themeChanged",s))},Ee=e=>{if(!(e.target instanceof HTMLElement))return;const t=e.target.querySelector("option:checked");if(t){const a=t==null?void 0:t.textContent;g(i(r(),"notifications.priorityUpdated",a))}},ve=e=>{e.preventDefault();const t=document.querySelector("#taskInput"),a=document.querySelector("select#prioritySelect"),s=a?a.value:"low";((t==null?void 0:t.value.trim().split(` +`))||[]).forEach(n=>{if(n.trim()){const l=new Date,d={id:+(Date.now()+Math.random()),title:n.trim(),priority:s,completed:!1,createdAt:l,completedAt:l};m.push(d)}}),L(m),t&&(t.value=""),v(m),D(m),g(i(r(),"notifications.tasksAdded"))},W=()=>{v(m),g(i(r(),"notifications.filtersApplied"))},$e=(e,t)=>{const a=t.find(s=>s.id===e);if(a){a.completed=!a.completed,a.completedAt=a.completed?new Date:a.createdAt,L(t),v(t),g(i(r(),"notifications.taskStatusChanged",a));return}g(i(r(),"notifications.taskNotFound"))},Le=(e,t)=>{const a=t.find(o=>o.id===e),s=t.filter(o=>o.id!==e);L(s),v(s),D(s),g(i(r(),"notifications.taskDeleted",a))},we=()=>{m.length=0,L(m),v(m),D(m),g(i(r(),"notifications.allTasksDeleted"))},C=e=>{if(e.preventDefault(),!(e.target instanceof HTMLElement))return;const t=e.target.closest("dialog");if(!t)return;const a=t.querySelector('input[name="language"]:checked');a instanceof HTMLInputElement&&g(i(r(),"notifications.languageSelected",a.value))},G=(e,t)=>{const a=E(ye(e,t),!0);a instanceof HTMLDialogElement&&a.showModal()},I=e=>{if(e.preventDefault(),!(e.target instanceof HTMLElement))return;const t=e.target.closest("dialog");t instanceof HTMLDialogElement&&(t.close(),t.remove())},Ce=e=>{if(e.preventDefault(),!(e.target instanceof HTMLElement))return;const t=e.target.closest("dialog");if(!t)return;const a=t.querySelector('input[name="language"]:checked');a instanceof HTMLInputElement&&k.setItem("language",a.value),I(e),window.location.reload()},S=(e,t,a,s=!1,o="",n="",l=null)=>{const d=c("input");d.props.type="radio",d.props.name=e,d.props.value=t,s&&(d.props.checked="checked"),n&&(d.props.id=n),l&&(d.props.onChange=l);const y=c("label",b(a),d);return o&&(y.props.class=o),n&&(y.props.for=n),y},Se=ue==="light"?"dark":"light",Ae=c("div",c("h3",f(i(r(),"app.modalLang.title"))),c("fieldset",c("legend",f(i(r(),"actions.changeLanguage"))),S("language","pt-br",i(r(),"app.pt-br"),!0,"","",C),S("language","en-us",i(r(),"app.en-us"),!1,"","",C),S("language","es-es",i(r(),"app.es-es"),!1,"","",C))),Ie=c("h1",f(i(r(),"app.title"))),Me=T(i(r(),"actions.toggleTheme"),be,"","theme-toggle",i(r(),"notifications.themeToggled",Se)),De=T(i(r(),"actions.changeLanguage"),()=>{G(Ae,Ce)},"","lang-modal-button",i(r(),"actions.toggleLanguage")),X=c("div",Me,De);X.props.class="header-actions";const _=c("header",Ie,X);_.props.class="header";const xe=c("div",c("h3",f(i(r(),"app.modalDeleteTasks.title")))),Pe=T(i(r(),"actions.deleteTasks"),()=>{G(xe,we)},"","btn-remove-all"),He=c("footer",Pe),Q=b(J(m)||"");Q.props.id="stats";const Y=b(i(r(),"notifications.storageUsage",R(m)));Y.props.id="sizeInfo";const Z=c("div",Q,Y);Z.props.class="infos";const x=c("textarea");x.props.id="taskInput";x.props.placeholder=i(r(),"placeholders.taskInput");const P=(e,t)=>{const a=Object.entries(t).map(([o,n])=>{const l=c("option",f(n));return l.props.value=o,l}),s=c("select",...a);return s.props.id=e,s},ee=P("prioritySelect",i(r(),"priorities"));ee.props.onChange=Ee;const Fe=T(i(r(),"actions.addTasks"),ve,"","",i(r(),"actions.addTasks")),te=c("div",ee,Fe);te.props.class="input-group-actions";const ae=c("div",x,te);ae.props.class="input-group";const se=c("div",ae);se.props.class="input-section";const H=P("statusFilter",i(r(),"filters.status"));H.props.id="statusFilter";H.props.onChange=W;const F=P("priorityFilter",i(r(),"filters.priority"));F.props.id="priorityFilter";F.props.onChange=W;const oe=c("div",H,F);oe.props.class="filters";const O=c("div");O.props.id="taskList";O.props.class="task-list";const ne=c("div",_,Z,se,oe,O,He);ne.props.class="container";const Oe=()=>{try{const e=document.getElementById("app"),t=k.getItem("theme")||"light";if(document.documentElement.setAttribute("data-theme",t),!e)throw new Error('Elemento com o ID "app" não encontrado.');E(ne,!0,e),v(m),g(i(r(),"notifications.appStarted"))}catch(e){console.error(e),g(i(r(),"notifications.startError",e.message))}};document.addEventListener("DOMContentLoaded",Oe); diff --git a/assets/index-CylDIjDE.css b/assets/index-CylDIjDE.css new file mode 100644 index 0000000..6aad426 --- /dev/null +++ b/assets/index-CylDIjDE.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css?family=Noto+Sans+Buginese:400,700";html{box-sizing:border-box;margin:0 auto}html::-webkit-scrollbar{width:.5rem}html::-webkit-scrollbar-track{box-shadow:inset 0 0 .375rem var(--text-tertiary);border-radius:.625rem}html::-webkit-scrollbar-thumb{box-shadow:inset 0 0 .375rem var(--text-secondary);border-radius:.625rem}*{scroll-behavior:smooth;outline:none;border:none;margin:0;padding:0;transition:background-color var(--animation-duration),color var(--animation-duration)}*,*:before,*:after{box-sizing:border-box}body,h1,h2,h3,h4,h5,h6,p,ol,ul,a,img{margin:0;padding:0}ol,ul{list-style:none}img{max-width:100%;height:auto}a:link,a:visited{color:#fff;text-decoration:none}body{background-color:var(--bg-primary);color:var(--text-primary);line-height:1.6;padding:var(--spacing-g)}body{font-family:Noto Sans Buginese,sans-serif;font-weight:400}h1,h2,h3,h4,h5{font-family:Noto Sans Buginese,sans-serif;font-weight:700}html{font-size:100%}h1{font-size:4.21rem}h2{font-size:3.158rem}h3{font-size:2.369rem}h4{font-size:1.777rem}h5{font-size:1.333rem}small{font-size:.75rem}@media (max-width: 600px){html{font-size:75%}}button{padding:var(--spacing-pp) var(--spacing-p);border:none;border-radius:var(--border-radius);cursor:pointer;background:var(--accent);color:#fff;transition:var(--animation-duration);transition:background-color var(--animation-duration) ease,color var(--animation-duration) ease}button:hover{opacity:.9}button.theme-toggle{background:var(--bg-secondary);border:1px solid var(--border);color:var(--text-primary)}button.theme-toggle:hover{background:var(--accent);color:#fff}dialog{width:300px;max-width:90%;border-radius:var(--border-radius);padding:var(--spacing);background-color:var(--bg-primary);color:var(--text-primary);position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}dialog::backdrop{background:#000000b3;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.close{background:none;border:none;color:var(--text-secondary);font-size:16px;position:absolute;padding:var(--spacing-p);top:0;right:0;cursor:pointer;transition:color .2s ease}.close:hover{color:var(--text-primary)}dialog form button{background-color:var(--bg-secondary);color:var(--text-primary);border:1px solid var(--border);border-radius:var(--border-radius);padding:var(--spacing-pp) var(--spacing);margin:var(--spacing-p) var(--spacing-xp)}dialog form button:hover{background-color:var(--accent);color:var(--bg-primary)}dialog form{display:flex;justify-content:flex-end}dialog span{display:inline-block;padding:0 var(--spacing-xp)}.snackbar-container{height:fit-content;width:80%;max-width:500px;position:fixed;z-index:1;left:0;right:0;margin:auto;bottom:var(--spacing-g);display:flex;flex-direction:column-reverse;align-items:center;gap:var(--spacing-pp)}#snackbar{visibility:hidden;min-width:250px;width:max-content;background:var(--border);border:1px solid var(--accent);color:var(--text-secondary);box-shadow:0 2px 4px var(--shadow);text-align:center;border-radius:var(--border-radius);padding:var(--spacing)}#snackbar.show{visibility:visible;-webkit-animation:slide-in-blurred-top cubic-bezier(.23,1,.32,1) .5s,slide-out-blurred-bottom cubic-bezier(.755,.05,.855,.06) .5s 2.6s;animation:slide-in-blurred-top cubic-bezier(.23,1,.32,1) .5s,slide-out-blurred-bottom cubic-bezier(.755,.05,.855,.06) .5s 2.6s}@-webkit-keyframes slide-in-blurred-top{0%{-webkit-transform:translateY(-1000px) scaleY(2.5) scaleX(.2);transform:translateY(-1000px) scaleY(2.5) scaleX(.2);-webkit-transform-origin:50% 0%;transform-origin:50% 0%;-webkit-filter:blur(40px);filter:blur(40px);opacity:0}to{-webkit-transform:translateY(0) scaleY(1) scaleX(1);transform:translateY(0) scaleY(1) scaleX(1);-webkit-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-filter:blur(0);filter:blur(0);opacity:1}}@keyframes slide-in-blurred-top{0%{-webkit-transform:translateY(-1000px) scaleY(2.5) scaleX(.2);transform:translateY(-1000px) scaleY(2.5) scaleX(.2);-webkit-transform-origin:50% 0%;transform-origin:50% 0%;-webkit-filter:blur(40px);filter:blur(40px);opacity:0}to{-webkit-transform:translateY(0) scaleY(1) scaleX(1);transform:translateY(0) scaleY(1) scaleX(1);-webkit-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-filter:blur(0);filter:blur(0);opacity:1}}@-webkit-keyframes slide-out-blurred-bottom{0%{-webkit-transform:translateY(0) scaleY(1) scaleX(1);transform:translateY(0) scaleY(1) scaleX(1);-webkit-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-filter:blur(0);filter:blur(0);opacity:1}to{-webkit-transform:translateY(1000px) scaleY(2) scaleX(.2);transform:translateY(1000px) scaleY(2) scaleX(.2);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;-webkit-filter:blur(40px);filter:blur(40px);opacity:0}}@keyframes slide-out-blurred-bottom{0%{-webkit-transform:translateY(0) scaleY(1) scaleX(1);transform:translateY(0) scaleY(1) scaleX(1);-webkit-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-filter:blur(0);filter:blur(0);opacity:1}to{-webkit-transform:translateY(1000px) scaleY(2) scaleX(.2);transform:translateY(1000px) scaleY(2) scaleX(.2);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;-webkit-filter:blur(40px);filter:blur(40px);opacity:0}}textarea{width:100%;padding:var(--spacing-p);border:1px solid var(--border);border-radius:var(--border-radius);background:var(--bg-secondary);color:var(--text-primary);min-height:var(--spacing-gg);resize:vertical;transition:var(--animation-duration)}textarea::-webkit-scrollbar{width:.5rem}textarea::-webkit-scrollbar-track{box-shadow:inset 0 0 .375rem var(--text-tertiary);border-radius:.625rem}textarea::-webkit-scrollbar-thumb{box-shadow:inset 0 0 .375rem var(--text-secondary);border-radius:.625rem}textarea:focus{outline:none;border-color:var(--accent);min-height:100px}select{padding:var(--spacing-pp) var(--spacing-p);border:1px solid var(--border);border-radius:var(--border-radius);background:var(--bg-secondary);color:var(--text-primary);width:auto;min-width:90px}.container{max-width:800px;margin:0 auto}header{display:flex;justify-content:space-between;align-items:center;margin-bottom:var(--spacing-g);padding-bottom:var(--spacing-p);border-bottom:2px solid var(--border)}header .header-actions{display:flex;flex-flow:column wrap;align-items:center;gap:var(--spacing-g)}.modal-content{padding:var(--spacing-g);color:var(--text-primary);text-align:center}.modal-content h3{font-size:1.25em;color:var(--text-primary);margin-bottom:var(--spacing)}.modal-content fieldset{border:1px solid var(--border);border-radius:var(--border-radius);padding:var(--spacing-pp);text-align:left}.modal-content legend{font-weight:700;color:var(--text-secondary);padding:0 var(--spacing-xp)}.modal-content label{display:flex;align-items:center;gap:var(--spacing-pp);padding:var(--spacing-pp);border-radius:var(--border-radius);transition:background-color .2s ease;cursor:pointer}.modal-content label:hover{background-color:var(--bg-secondary)}.modal-content label span{color:var(--text-primary);font-size:.95em}.modal-content input[type=radio]{accent-color:var(--accent);cursor:pointer}.infos{font-size:.9em;color:var(--text-secondary);margin-bottom:var(--spacing);display:flex;flex-flow:row wrap;justify-content:space-between}.task-card{background:var(--card-bg);padding:var(--spacing) var(--spacing-gg);border-radius:var(--border-radius);box-shadow:0 2px 4px var(--shadow);display:flex;flex-direction:column;gap:var(--spacing-p)}.task-header{display:flex;align-items:center;gap:var(--spacing-p)}.task-wrapper input[type=checkbox]{width:var(--spacing);height:var(--spacing);cursor:pointer}.task-title{flex:1;font-size:1.728rem;font-weight:500;color:var(--text-primary)}.task-completed .task-title{text-decoration:line-through;color:var(--text-tertiary)}.task-priority{padding:var(--spacing-xp) var(--spacing-pp);border-radius:var(--border-radius);font-size:.8em}.task-dates{font-size:.85em;color:var(--text-tertiary);line-height:1.4;display:flex;flex-direction:column}footer{display:flex;margin-top:20px;justify-content:flex-end}.input-section{margin-bottom:var(--spacing-gg)}.input-group{display:flex;flex-wrap:wrap;gap:var(--spacing-p);margin-bottom:var(--spacing-p);align-items:flex-start}.input-group-actions{display:flex;gap:var(--spacing-p)}.filters{display:flex;gap:var(--spacing-p);margin-bottom:var(--spacing-p)}.task-list{display:flex;flex-direction:column;gap:var(--spacing-p)}@media (max-width: 600px){.filters{flex-wrap:wrap}}:root{--bg-primary: #ffffff;--bg-secondary: #f5f5f5;--text-primary: #333333;--text-secondary: #666666;--text-tertiary: #999999;--accent: #4a90e2;--border: #e0e0e0;--success: #4caf50;--warning: #ff9800;--danger: #f44336;--card-bg: #ffffff;--shadow: rgba(0, 0, 0, .1);--spacing-xp: calc(var(--spacing) / 4 * 1);--spacing-pp: calc(var(--spacing) / 4 * 2);--spacing-p: calc(var(--spacing) / 4 * 3);--spacing: 1rem;--spacing-g: calc(var(--spacing) * 4 / 3);--spacing-gg: calc(var(--spacing) * 4 / 2);--spacing-xg: calc(var(--spacing) * 4 / 1);--border-radius: .3125rem;--animation-duration: .2s}@media (max-width: 600px){:root{--spacing: .65rem}}.priority-high{background:var(--danger);color:#fff}.priority-medium{background:var(--warning);color:#fff}.priority-low{background:var(--success);color:#fff}.hidden{display:none}@media print{body{min-width:none;padding:5%}form{display:none}details{display:none}details[open]{display:flex}select{border:1px solid #000}.destaque,tr.destaque{background-color:#ccc;color:#000;border:1px solid #000;opacity:1}.container,.principal{width:fit-content;height:fit-content}}[data-theme=dark]{--bg-primary: #1a1a1a;--bg-secondary: #2d2d2d;--text-primary: #ffffff;--text-secondary: #b3b3b3;--text-tertiary: #808080;--accent: #64b5f6;--border: #404040;--success: #81c784;--warning: #ffb74d;--danger: #e57373;--card-bg: #2d2d2d;--shadow: rgba(0, 0, 0, .3)} diff --git a/index.html b/index.html new file mode 100644 index 0000000..2ab16d1 --- /dev/null +++ b/index.html @@ -0,0 +1,17 @@ + + + + + + + + + + Todo App + + + + +
+ +