0% found this document useful (0 votes)
5 views3 pages

Prac2Code

The document contains code for a basic To-Do List web application using HTML, CSS, and Python with Flask. It includes an HTML file for the user interface, a YAML configuration for deployment, and a Python script to run the Flask app. The To-Do List allows users to add tasks, mark them as done, and delete them.

Uploaded by

kishoriwaikar901
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

Prac2Code

The document contains code for a basic To-Do List web application using HTML, CSS, and Python with Flask. It includes an HTML file for the user interface, a YAML configuration for deployment, and a Python script to run the Flask app. The To-Do List allows users to add tasks, mark them as done, and delete them.

Uploaded by

kishoriwaikar901
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Name –Swapnil Dilip Navale

Roll – 307B037
Class – TE B

Code -

index.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Basic To-Do List</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 40px;
}
h1 {
color: #333;
}
input[type="text"] {
padding: 8px;
width: 300px;
margin-right: 10px;
}
button {
padding: 8px 12px;
}
ul {
list-style: none;
padding: 0;
}
li {
margin: 8px 0;
}
li.done {
text-decoration: line-through;
color: gray;
}
</style>
</head>
<body>
📝
<h1> To-Do List</h1>
<input type="text" id="taskInput" placeholder="Enter a new task">
<button onclick="addTask()">Add</button>

<ul id="taskList"></ul>

<script>
function addTask() {
const input = document.getElementById("taskInput");
const taskText = input.value.trim();
if (taskText === "") return;

const li = document.createElement("li");
li.textContent = taskText;
li.onclick = () => li.classList.toggle("done");


const deleteBtn = document.createElement("button");
deleteBtn.textContent = " ";
deleteBtn.style.marginLeft = "10px";
deleteBtn.onclick = (e) => {
e.stopPropagation();
li.remove();
};

li.appendChild(deleteBtn);
document.getElementById("taskList").appendChild(li);

input.value = "";
}
</script>
</body>
</html>

app.yaml

runtime: python310

entrypoint: gunicorn -b :$PORT main:app

instance_class: F1
automatic_scaling:
target_cpu_utilization: 0.65
min_instances: 1
max_instances: 2

handlers:
- url: /.*
script: auto

main.py

from flask import Flask, render_template

app = Flask(__name__)

@app.route('/')
def home():
return render_template('index.html')

if __name__ == '__main__':
app.run(host='0.0.0.0', port=8082)

You might also like