From 7c2c897655a7eb456924623773b0f4a01bcc546b Mon Sep 17 00:00:00 2001
From: bhumishap <2022.bhumisha.parchani@ves.ac.in>
Date: Fri, 5 Sep 2025 02:50:54 +0530
Subject: [PATCH 1/4] Updated ToDo List
---
TODO-LIST/src/App.css | 343 +++++++++++++++++++++++-------
TODO-LIST/src/components/Todo.jsx | 73 +++++--
TODO-LIST/src/pages/Home.jsx | 224 ++++++++++++++-----
3 files changed, 493 insertions(+), 147 deletions(-)
diff --git a/TODO-LIST/src/App.css b/TODO-LIST/src/App.css
index 85771d2..f916268 100644
--- a/TODO-LIST/src/App.css
+++ b/TODO-LIST/src/App.css
@@ -1,121 +1,310 @@
-.home {
- min-height: 100vh;
- background-color: white;
+/* Reset and Base */
+*, *::after, *::before {
+ box-sizing: border-box;
+ margin: 0;
+ padding: 0;
}
+body {
+ margin: 0;
+ font-family: 'Open Sans', sans-serif;
+ background-color: #f0f6ff; /* light blue background */
+ color: #222;
+}
+
+/* Container */
.container {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- text-align: center;
- padding: 15px;
+ max-width: 600px;
+ margin: 40px auto;
+ padding: 0 15px;
}
+/* Form */
.todo-form {
display: flex;
- align-items: center;
- justify-content: space-between;
- width: 300px;
+ gap: 10px;
+ margin-bottom: 20px;
+ justify-content: center;
+ flex-wrap: wrap;
+}
+
+.todo-form input[type="text"],
+.todo-form textarea {
+ flex: 1;
padding: 10px;
- background-color: #E1F0F7;
+ border: 1px solid #1DA1F2;
border-radius: 6px;
- gap: 5px;
+ font-size: 1rem;
+ outline: none;
+ transition: border 0.2s ease;
}
-input{
- padding: 7px;
- width: 98%;
+.todo-form input[type="text"]:focus,
+.todo-form textarea:focus {
+ border-color: #0d8ddb;
+ box-shadow: 0 0 0 3px rgba(29,161,242,0.2);
+}
+
+.todo-form textarea {
+ resize: none;
+ min-height: 40px;
+}
+
+.todo-form .btn-addTodo {
+ padding: 10px 18px;
+ background: #1DA1F2;
border: none;
border-radius: 6px;
- outline: none;
+ color: white;
+ font-weight: 600;
+ cursor: pointer;
+ transition: background 0.2s ease, transform 0.1s ease;
}
-input:focus{
- box-shadow: 0 0 0 2px #2cb0ee;
+
+.todo-form .btn-addTodo:hover {
+ background: #0d8ddb;
}
-.btn-addTodo{
- padding: 6px;
- border: none;
- border-radius: 4px;
- outline: none;
- background-color: #1DA1F2;
+
+.todo-form .btn-addTodo:active {
+ transform: scale(0.95);
+}
+
+/* Filter Buttons */
+.filters {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ gap: 8px;
+ margin-bottom: 20px;
+ flex-wrap: wrap;
+}
+
+.filters button {
+ padding: 6px 14px;
+ background: #fff;
+ border: 1px solid #1DA1F2;
+ border-radius: 6px;
+ color: #1DA1F2;
+ font-weight: 600;
cursor: pointer;
- color: white;
- font-weight: 700;
- font-size: 14px;
- width: 70px;
+ transition: all 0.2s ease;
}
-.todo {
- width: 300px;
- padding: 10px;
- background-color: #E1F0F7;
+.filters button:hover {
+ background: #1DA1F2;
+ color: #fff;
+}
+
+.filters button.active {
+ background: #1DA1F2;
+ color: #fff;
+ box-shadow: 0 0 6px rgba(29,161,242,0.4);
+}
+
+/* Date input for custom filter */
+.filters input[type="date"] {
+ padding: 6px 10px;
+ border: 1px solid #1DA1F2;
border-radius: 6px;
- margin-top: 10px;
+ font-size: 0.9rem;
+ cursor: pointer;
+ outline: none;
+ transition: border 0.2s ease;
+}
+
+.filters input[type="date"]:focus {
+ border-color: #0d8ddb;
+ box-shadow: 0 0 0 3px rgba(29,161,242,0.2);
+}
+
+/* Todo Card */
+.todo {
+ background: #fff;
+ border: 1px solid #d6e9ff;
+ border-radius: 8px;
+ padding: 15px;
+ margin-bottom: 15px;
+ box-shadow: 0 2px 6px rgba(0,0,0,0.05);
+ transition: transform 0.2s ease, box-shadow 0.2s ease;
+}
+
+.todo:hover {
+ transform: translateY(-2px);
+ box-shadow: 0 4px 12px rgba(0,0,0,0.08);
+}
+
+/* Completed Task */
+.todo.completed h3,
+.todo.completed .desc {
+ text-decoration: line-through;
+ color: #777;
+}
+
+/* Task Layout */
+.task-main {
display: flex;
- align-items: center;
justify-content: space-between;
+ align-items: flex-start;
}
-.text {
- font-size: 16px;
- font-weight: 700;
- margin-right: auto;
- overflow: hidden;
- overflow-wrap: break-word;
+/* Todo Title */
+.todo h3 {
+ font-size: 1.1rem;
+ color: #1DA1F2;
+ margin-bottom: 6px;
+}
+
+/* Task Description */
+.todo .desc {
+ font-size: 0.9rem;
+ color: #444;
+ background: #f7fbff;
+ border-left: 3px solid #1DA1F2;
+ padding: 6px 10px;
+ border-radius: 4px;
+ margin-bottom: 10px;
+ line-height: 1.4;
}
-.utils{
+/* Timestamp */
+.todo small {
+ display: block;
+ font-size: 0.8rem;
+ color: #777;
+ margin-bottom: 6px;
+}
+
+/* Task Actions (right side buttons) */
+.task-actions {
display: flex;
+ gap: 12px;
align-items: center;
- gap: 8px;
+ font-size: 1.2rem;
}
-.go-up {
- width: 0;
- height: 0;
- border-left: 6px solid transparent;
- border-right: 6px solid transparent;
- border-bottom: 6px solid #1DA1F2;
+/* Tick (Complete) */
+.task-actions .tick {
+ color: green;
+ font-size: 1.3rem;
cursor: pointer;
+ transition: transform 0.2s ease;
}
-.go-down{
- width: 0;
- height: 0;
- border-left: 6px solid transparent;
- border-right: 6px solid transparent;
- border-top: 6px solid #1DA1F2;
+.task-actions .tick:hover {
+ transform: scale(1.2);
+}
+
+/* Edit button */
+.task-actions .edit {
cursor: pointer;
+ font-size: 1.2rem;
+ color: #f39c12;
+ transition: transform 0.2s ease;
+}
+
+.task-actions .edit:hover {
+ transform: scale(1.2);
}
-.remove{
+/* Remove button */
+.task-actions .remove {
+ width: 18px;
+ height: 18px;
+ border: 2px solid #e63946;
+ border-radius: 50%;
position: relative;
- width: 20px;
- height: 20px;
cursor: pointer;
+ transition: transform 0.2s ease;
+}
+
+.task-actions .remove:hover {
+ transform: scale(1.2);
}
-.remove::after {
+.task-actions .remove::before,
+.task-actions .remove::after {
+ content: "";
position: absolute;
- content:'';
- width: 100%;
+ top: 50%;
+ left: 50%;
+ width: 10px;
height: 2px;
- background-color: black;
- top:0;
- left:0;
- border-radius: 999px;
- transform: translateY(10px) rotate(-45deg);
+ background: #e63946;
+ transform: translate(-50%, -50%) rotate(45deg);
}
-.remove::before {
- position: absolute;
- content:'';
+.task-actions .remove::after {
+ transform: translate(-50%, -50%) rotate(-45deg);
+}
+
+/* Edit Mode */
+.edit-mode {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+}
+
+.edit-mode input,
+.edit-mode textarea {
width: 100%;
- height: 2px;
- background-color: black;
- top:100%;
- left:0;
- border-radius: 999px;
- transform: translateY(-10px) rotate(45deg);
-}
\ No newline at end of file
+ padding: 8px 10px;
+ border: 1px solid #1DA1F2;
+ border-radius: 6px;
+ font-size: 0.95rem;
+ outline: none;
+}
+
+.edit-mode input:focus,
+.edit-mode textarea:focus {
+ border-color: #0d8ddb;
+ box-shadow: 0 0 0 3px rgba(29,161,242,0.2);
+}
+
+.edit-mode textarea {
+ min-height: 60px;
+ resize: vertical;
+}
+
+.edit-actions {
+ display: flex;
+ gap: 10px;
+}
+
+.edit-actions button {
+ padding: 8px 12px;
+ border: none;
+ border-radius: 6px;
+ background: #1DA1F2;
+ color: #fff;
+ font-size: 0.9rem;
+ font-weight: 600;
+ cursor: pointer;
+ transition: background 0.2s ease, transform 0.1s ease;
+}
+
+.edit-actions button:hover {
+ background: #0d8ddb;
+}
+
+.edit-actions button:active {
+ transform: scale(0.96);
+}
+
+.edit-actions button:last-child {
+ background: #ccc;
+ color: #333;
+}
+
+.edit-actions button:last-child:hover {
+ background: #999;
+ color: #fff;
+}
+
+/* No tasks text */
+.no-tasks {
+ text-align: center;
+ margin-top: 20px;
+ font-weight: bold;
+ font-size: 1rem;
+ color: #555;
+}
diff --git a/TODO-LIST/src/components/Todo.jsx b/TODO-LIST/src/components/Todo.jsx
index a1bee9e..484375c 100644
--- a/TODO-LIST/src/components/Todo.jsx
+++ b/TODO-LIST/src/components/Todo.jsx
@@ -1,17 +1,66 @@
-import React from 'react'
+import React, { useState } from 'react'
-const Todo = ({ todo,deleteTodo,moveUp,moveDown,total,index}) => {
-
- return (
-
-
{todo.text}
-
-
moveUp(todo.id)}>
-
moveDown(todo.id)}>
-
deleteTodo(todo.id)}>
-
+const Todo = ({ todo, deleteTodo, editTodo, moveUp, moveDown, total, index }) => {
+ const [isEditing, setIsEditing] = useState(false)
+ const [newTitle, setNewTitle] = useState(todo.title)
+ const [newDesc, setNewDesc] = useState(todo.desc)
+
+ const handleSave = () => {
+ if (newTitle.trim()) {
+ editTodo(todo.id, newTitle, newDesc)
+ setIsEditing(false)
+ }
+ }
+
+ return (
+
+ {isEditing ? (
+
+ setNewTitle(e.target.value)}
+ placeholder="Edit title"
+ />
+
- )
+ ) : (
+ <>
+
{todo.title}
+ {todo.desc &&
{todo.desc}
}
+
+
moveUp(todo.id)}
+ >
+
moveDown(todo.id)}
+ >
+
deleteTodo(todo.id)}
+ >
+
setIsEditing(true)}
+ style={{ cursor: 'pointer', marginLeft: '10px', color: '#1DA1F2' }}
+ >
+ ✏️
+
+
+ >
+ )}
+
+ )
}
export default Todo
diff --git a/TODO-LIST/src/pages/Home.jsx b/TODO-LIST/src/pages/Home.jsx
index 74b9c24..b7a4433 100644
--- a/TODO-LIST/src/pages/Home.jsx
+++ b/TODO-LIST/src/pages/Home.jsx
@@ -1,75 +1,183 @@
-import React,{useState,useEffect} from 'react'
-import {nanoid} from 'nanoid'
-import Todo from '../components/Todo'
+import React, { useState, useEffect } from "react";
+import { nanoid } from "nanoid";
+import Todo from "../components/Todo";
const getTodos = () => {
- let todos = localStorage.getItem('todos')
- if (todos) {
- return JSON.parse(todos)
- }
- return []
-}
+ let todos = localStorage.getItem("todos");
+ if (todos) {
+ return JSON.parse(todos);
+ }
+ return [];
+};
const Home = () => {
- const [todos, setTodos] = useState(getTodos())
- const [todo, setTodo] = useState('')
+ const [todos, setTodos] = useState(getTodos());
+ const [title, setTitle] = useState("");
+ const [desc, setDesc] = useState("");
+ const [filter, setFilter] = useState("all");
+ const [customDate, setCustomDate] = useState("");
- const addTodo = (e) => {
- e.preventDefault()
- if (todo && todos.findIndex(t => t.text === todo) === -1) {
- setTodos(prev => [...prev, {id:nanoid(),text:todo}])
- setTodo('')
- }
+ const addTodo = (e) => {
+ e.preventDefault();
+ if (title && todos.findIndex((t) => t.title === title) === -1) {
+ setTodos((prev) => [
+ ...prev,
+ {
+ id: nanoid(),
+ title,
+ desc,
+ createdAt: new Date().toISOString(),
+ completed: false,
+ },
+ ]);
+ setTitle("");
+ setDesc("");
}
+ };
+
+ const deleteTodo = (id) => {
+ setTodos((prev) => prev.filter((t) => t.id !== id));
+ };
+
+ const editTodo = (id, newTitle, newDesc) => {
+ setTodos((prev) =>
+ prev.map((t) =>
+ t.id === id ? { ...t, title: newTitle, desc: newDesc } : t
+ )
+ );
+ };
- const deleteTodo = (id) => {
- setTodos(prev => prev.filter(t => t.id !== id))
+ const toggleComplete = (id) => {
+ setTodos((prev) =>
+ prev.map((t) =>
+ t.id === id ? { ...t, completed: !t.completed } : t
+ )
+ );
+ };
+
+ const moveUp = (id) => {
+ let index = todos.findIndex((t) => t.id === id);
+ if (index > 0) {
+ let temp = todos[index];
+ todos[index] = todos[index - 1];
+ todos[index - 1] = temp;
+ setTodos([...todos]);
}
+ };
- const moveUp = (id) => {
- let index = todos.findIndex(t => t.id === id)
- if (index > 0) {
- let temp = todos[index]
- todos[index] = todos[index - 1]
- todos[index - 1] = temp
- setTodos([...todos])
- }
+ const moveDown = (id) => {
+ let index = todos.findIndex((t) => t.id === id);
+ if (index < todos.length - 1) {
+ let temp = todos[index];
+ todos[index] = todos[index + 1];
+ todos[index + 1] = temp;
+ setTodos([...todos]);
}
+ };
+
+ // Filtering
+ const filteredTodos = todos.filter((t) => {
+ if (!t.createdAt) return true;
+ const now = new Date();
+ const created = new Date(t.createdAt);
- const moveDown = (id) => {
- let index = todos.findIndex(t => t.id === id)
- if (index < todos.length - 1) {
- let temp = todos[index]
- todos[index] = todos[index + 1]
- todos[index + 1] = temp
- setTodos([...todos])
- }
+ if (filter === "today") {
+ return created.toDateString() === now.toDateString();
}
- useEffect(() => {
- localStorage.setItem('todos', JSON.stringify(todos))
- },[todos])
+ if (filter === "week") {
+ const oneWeekAgo = new Date();
+ oneWeekAgo.setDate(now.getDate() - 7);
+ return created >= oneWeekAgo;
+ }
+ if (filter === "custom" && customDate) {
+ return created.toDateString() === new Date(customDate).toDateString();
+ }
+ return true;
+ });
+
+ useEffect(() => {
+ localStorage.setItem("todos", JSON.stringify(todos));
+ }, [todos]);
+
+ return (
+
+
+ {/* Add Todo */}
+
- return (
-
-
-
- {
- todos.length? (
-
- {
- todos.map((todo,index) => {
- return
- })
- }
-
) :
No todo...
+ {/* Filter Buttons */}
+
+
+
+
+
+ {filter === "custom" && (
+ setCustomDate(e.target.value)}
+ />
+ )}
+
- }
+ {/* Todo List */}
+ {filteredTodos.length ? (
+
+ {filteredTodos.map((todo, index) => (
+
+ ))}
+
+ ) : (
+
No tasks...
+ )}
- )
-}
+ );
+};
-export default Home
\ No newline at end of file
+export default Home;
From 592a84c1396f788b392eb0ae9bcf5ca0314b921b Mon Sep 17 00:00:00 2001
From: bhumishap <2022.bhumisha.parchani@ves.ac.in>
Date: Fri, 5 Sep 2025 09:41:28 +0530
Subject: [PATCH 2/4] calci updated
---
Calculator/cal.css | 205 ++++++++++++++++++++++++++++++++------------
Calculator/cal.html | 108 +++++++++++++----------
Calculator/cal.js | 134 +++++++++++++++++++++--------
3 files changed, 310 insertions(+), 137 deletions(-)
diff --git a/Calculator/cal.css b/Calculator/cal.css
index 25bad49..42733f1 100644
--- a/Calculator/cal.css
+++ b/Calculator/cal.css
@@ -1,64 +1,161 @@
-body{
- background-image: url(c10.jpg);
- background-repeat: no-repeat;
- height: 100%;
- width: 100%;
- overflow: hidden;
- background-position: center;
- background-size: cover;
+/* General body */
+body {
+ font-family: "Segoe UI", Arial, sans-serif;
+ background: #f5f5f5;
+ color: #333;
+ display: flex;
+ justify-content: center;
+ align-items: flex-start;
+ height: 100vh;
+ margin: 0;
+ transition: background 0.3s, color 0.3s;
}
-button{
- width: 200px;
- height: 50px;
- margin: 2px 2px;
- background-color: blue;
- color: #fff4a7;
+
+/* Container */
+#outside {
+ background: #ffffff;
+ padding: 30px;
border-radius: 20px;
- font-weight: bolder;
- font-style: italic;
- font-size: larger;
+ text-align: center;
+ box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
+ width: 420px;
+ margin-top: 40px;
+ transition: background 0.3s, box-shadow 0.3s;
+}
+
+/* Header */
+.header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
}
-#outside{
- color: white;
- border-radius: 5px;
- margin: auto;
- margin-top: 100px;
- width: 1000px;
- height: 600px;
- padding: 5px;
+
+/* Heading */
+#heading {
+ font-size: 2rem;
+ color: #ff9800;
}
-#heading{
- margin: auto;
- width: 412px;
- font-size: xxx-large;
+
+/* Theme toggle */
+.switch {
+ position: relative;
+ display: inline-block;
+ width: 50px;
+ height: 26px;
}
-#btn{
- margin: auto;
- margin-top: 20px;
- width: 815px;
+.switch input { opacity: 0; width: 0; height: 0; }
+.slider {
+ position: absolute;
+ cursor: pointer;
+ top: 0; left: 0; right: 0; bottom: 0;
+ background-color: #ccc;
+ border-radius: 26px;
+ transition: 0.4s;
}
-.btn-inside{
- width: 900px;
+.slider:before {
+ position: absolute;
+ content: "";
+ height: 20px; width: 20px;
+ left: 3px; bottom: 3px;
+ background-color: white;
+ border-radius: 50%;
+ transition: 0.4s;
}
-#val{
- /* border: 2px solid red; */
- height: 55px;
- width: 783px;
- margin-left: 100px;
- color: white;
- padding-left: 37px;
- padding-top: 20px;
- font-weight: bolder;
+input:checked + .slider { background-color: #2196f3; }
+input:checked + .slider:before { transform: translateX(24px); }
+
+/* Display */
+#val {
+ width: 100%;
+ height: 70px;
+ font-size: 1.8rem;
+ text-align: right;
+ margin-bottom: 10px;
+ padding: 12px;
+ border-radius: 12px;
+ border: 1px solid #ccc;
+ background: #fff;
+ color: #000;
+ box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
+ transition: background 0.3s, color 0.3s;
}
-#res{
- /* border: 2px solid red; */
- height: 50px;
- width: 783px;
- margin-left: 100px;
- color: white;
- padding-left: 37px;
- padding-top: 25px;
- font-weight: bolder;
- font-size: x-large;
+
+#res {
+ font-size: 1.3rem;
+ margin-bottom: 20px;
+ text-align: right;
+ color: #ff5722;
+ min-height: 20px;
+ transition: color 0.3s;
+}
+
+/* Buttons grid */
+#btn { display: grid; grid-gap: 12px; }
+.btn-inside { display: flex; justify-content: center; gap: 12px; }
+
+/* Buttons - adaptive color */
+button {
+ flex: 1;
+ padding: 18px;
+ font-size: 1.3rem;
+ font-weight: bold;
+ border: none;
+ border-radius: 12px;
+ cursor: pointer;
+ background: #1976d2;
+ color: #fff;
+ box-shadow: 0 4px 8px rgba(0,0,0,0.2);
+ transition: 0.2s all;
+}
+button:hover { background: #1565c0; transform: scale(1.05); }
+button:active { transform: scale(0.95); }
+
+/* History side panel */
+.history-panel {
+ position: fixed;
+ top: 0; right: -250px;
+ width: 250px;
+ height: 100%;
+ background: #ffffff;
+ border-left: 1px solid #ccc;
+ box-shadow: -4px 0 12px rgba(0,0,0,0.2);
+ padding: 20px;
+ transition: right 0.3s;
+ overflow-y: auto;
+ z-index: 100;
+}
+.history-panel h3 { margin-top: 0; }
+.history-panel ul { padding-left: 0; list-style: none; }
+.history-panel li {
+ padding: 8px 5px;
+ border-bottom: 1px solid #eee;
+ cursor: pointer;
+}
+.history-panel li:hover { background: #f0f0f0; }
+
+/* History button */
+.history-btn {
+ position: fixed;
+ top: 20px; right: 20px;
+ padding: 10px 15px;
+ font-size: 1.2rem;
+ background: #ff9800;
+ color: #fff;
+ border: none;
+ border-radius: 8px;
+ cursor: pointer;
+ box-shadow: 0 4px 8px rgba(0,0,0,0.2);
+ z-index: 101;
+ transition: 0.2s all;
}
+.history-btn:hover { background: #fb8c00; }
+/* Dark mode */
+body.dark { background: #1e1e2f; color: #fff; }
+body.dark #outside { background: #2b2b3c; box-shadow: 0 12px 30px rgba(0,0,0,0.6); }
+body.dark #val { background: #1e1e2f; color: #fff; }
+body.dark #res { color: #b3e5fc; }
+body.dark button { background: #64b5f6; color: #000; }
+body.dark button:hover { background: #42a5f5; }
+body.dark .history-panel { background: #2b2b3c; color: #fff; border-left: 1px solid #555; }
+body.dark .history-panel li:hover { background: #3a3a4d; }
diff --git a/Calculator/cal.html b/Calculator/cal.html
index 84a65f1..c69dd9e 100644
--- a/Calculator/cal.html
+++ b/Calculator/cal.html
@@ -1,54 +1,68 @@
-
-
-
-
-
-
Calculator
+
+
+
Calculator
+
-
-
-
🖩CALCULATOR🖩
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+