To do list

Size
2,908 Kb
Views
14,168

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 Previews

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&#x2193;</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() === ''; } }
});
To do list - Script Codes
To do list - Script Codes
Home Page Home
Developer Patrick Walburg
Username tripack
Uploaded November 22, 2022
Rating 3
Size 2,908 Kb
Views 14,168
Do you need developer help for To do list?

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!

Patrick Walburg (tripack) Script Codes
Create amazing blog posts with AI!

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!