To do list
How do I make an to do list?
What is a to do list? How do you make a to do list? This script and codes were developed by Patrick Walburg on 22 November 2022, Tuesday.
To do list - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>To do list</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <section id="component" aria-labelledby="todos-label"> <h1 id="todos-label">My Todo List</h1> <ul> <li v-for="(todo, index) in todos"> <input type="checkbox" :id="`todo-${index}`" v-model="todo.done" class="vh"> <label :for="`todo-${index}`"> <span class="tick"></span> <span class="text">{{todo.name}}</span> </label> <button @click="remove(index, todo.name)" :aria-label="`delete ${todo.name}`"> </button> </li> </ul> <div class="empty-state" v-if="!todos.length"> <p>Either you've done everything already or there are still things to add to your list. Add your first todo↓</p> </div> <form> <input type="text" aria-label="Write a new todo item" placeholder="E.g. Adopt an owl"> <button type="submit" disabled>Add</button> </form> <div role="status" aria-live="polite" class="vh"> <!-- add content to hear it spoken --> </div>
</section> <script src='https://cdnjs.cloudflare.com/ajax/libs/vue/2.2.4/vue.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
To do list - Script Codes CSS Codes
@import url('https://fonts.googleapis.com/css?family=Asap');
* { font-size: inherit; font-family: inherit;
}
html { font-size: calc(1em + 1vw); font-family: Asap, sans-serif;
}
body { max-width: 20rem; margin: 0; padding: 1rem;
}
h1 { margin-top: 0; font-size: 1.25rem;
}
.empty-state,
ul:empty { display: none;
}
ul:empty + .empty-state { display: block;
}
li { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; -webkit-box-align: center; -ms-flex-align: center; align-items: center;
}
.tick { display: inline-block; width: 0.66rem; height: 0.66rem; border: 0.125rem solid; margin-right: 0.25rem; border-radius: 0.125rem;
}
::-webkit-input-placeholder { color: #444; font-style: italic;
}
::-moz-placeholder { color: #444; font-style: italic;
}
:-ms-input-placeholder { color: #444; font-style: italic;
}
:-moz-placeholder { color: #444; font-style: italic;
}
.vh { position: absolute !important; clip: rect(1px, 1px, 1px, 1px); padding:0 !important; border:0 !important; height: 1px !important; width: 1px !important; overflow: hidden;
}
To do list - Script Codes JS Codes
var todoName = document.querySelector('[type="text"]').value;
function addedFeedback(todoName) { let liveRegion = document.querySelector('[role="status"]'); liveRegion.textContent = `${todoName} added.`;
}
// example usage
addedFeedback(todoName);
var app = new Vue({ el: '#component', data: { todos: [ { name: 'Pick up kids from school', done: true }, { name: 'Learn Haskell', done: false }, { name: 'Sleep', done: false } ], workingName: '', feedback: '' }, methods: { add(e) { e.preventDefault(); this.todos.push({ name: this.workingName, done: false }); this.feedback = `${this.workingName} added`; this.workingName = ''; }, remove(index, name) { this.todos.splice(index, 1); document.getElementById('todos-label').focus(); this.feedback = `${name} deleted`; } }, computed: { validity() { return this.workingName.trim() === ''; } }
});
Developer | Patrick Walburg |
Username | tripack |
Uploaded | November 22, 2022 |
Rating | 3 |
Size | 2,908 Kb |
Views | 14,168 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Hamburger css | 1,976 Kb |
Responvise design with sticky menu | 3,238 Kb |
Cofee and sugar | 2,094 Kb |
Voorbeeldcode | 2,841 Kb |
Study in Knockout.js | 1,826 Kb |
Banner-demo | 4,285 Kb |
Rollovers with transitions. | 2,079 Kb |
A Pen by Patrick Walburg | 2,255 Kb |
Animation study | 2,507 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Fluid Grid 12 | Alexoliverwd | 2,309 Kb |
Donut Chart example - MorrisJS | Capelo | 2,385 Kb |
Rainbow Drops | Csbarnes | 2,365 Kb |
Update CSS Variables with JS | Wesbos | 2,335 Kb |
Disable JavaScript execution from console | Ludviglindblom | 2,534 Kb |
Sassy Buttons | Elyseholladay | 2,299 Kb |
Adding Items | Valhead | 4,008 Kb |
Particle Motion trajectories | Sniejadlik | 5,899 Kb |
Console fun | Dviate | 1,500 Kb |
Clock Face Idea | Chrisburnell | 3,196 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!