-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd.html
More file actions
148 lines (126 loc) · 4.11 KB
/
Copy pathadd.html
File metadata and controls
148 lines (126 loc) · 4.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Add Reminder</title>
<style>
body {
margin: 0;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-family: Arial, sans-serif;
position: relative;
overflow: hidden;
background: #0d0d0d;
}
body::before {
content: "";
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: linear-gradient(45deg, red, orange, yellow, green, cyan, blue, violet, red);
animation: bgMove 15s linear infinite;
z-index: -2;
}
@keyframes bgMove {
0% {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
100% {
transform: rotate(360deg);
}
}
.add-box {
position: relative;
width: 400px;
padding: 40px;
background: rgba(255, 255, 255, 0.05);
border-radius: 20px;
text-align: center;
border: 4px solid;
border-image: linear-gradient(45deg, red, orange, yellow, green, cyan, blue, violet, red) 1;
box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
color: white;
}
.add-box input,
.add-box button,
.add-box h2 {
position: relative;
z-index: 2;
margin: 10px 0;
width: 90%;
padding: 10px;
border-radius: 12px;
border: none;
background: rgba(17, 17, 17, 0.7);
color: white;
}
.add-box button {
cursor: pointer;
box-shadow: 0 0 15px red, 0 0 20px blue;
animation: rainbowGlow 4s linear infinite;
}
@keyframes rainbowGlow {
0% {
box-shadow: 0 0 15px red, 0 0 20px orange;
}
25% {
box-shadow: 0 0 15px yellow, 0 0 20px green;
}
50% {
box-shadow: 0 0 15px cyan, 0 0 20px blue;
}
75% {
box-shadow: 0 0 15px violet, 0 0 20px red;
}
100% {
box-shadow: 0 0 15px red, 0 0 20px orange;
}
}
</style>
</head>
<body>
<div class="add-box">
<h2>Add / Edit Reminder</h2>
<input type="text" id="name" placeholder="Customer Name">
<input type="number" id="mobile" placeholder="Mobile Number">
<input type="text" id="vehicle" placeholder="Vehicle Number">
<input type="date" id="expiry" placeholder="Expiry Date">
<button onclick="saveReminder()">Save Reminder</button>
<button onclick="window.location.href='dashboard.html'">Back to Dashboard</button>
</div>
<script>
if (sessionStorage.getItem("loggedIn") !== "true") { window.location.href = "login.html"; }
let editIndex = localStorage.getItem("editIndex");
if (editIndex !== null) {
let reminders = JSON.parse(localStorage.getItem("reminders") || "[]");
if (reminders[editIndex]) {
document.getElementById("name").value = reminders[editIndex].name;
document.getElementById("mobile").value = reminders[editIndex].mobile;
document.getElementById("vehicle").value = reminders[editIndex].vehicle;
document.getElementById("expiry").value = reminders[editIndex].expiry;
}
}
function saveReminder() {
let name = document.getElementById("name").value.trim();
let mobile = document.getElementById("mobile").value.trim();
let vehicle = document.getElementById("vehicle").value.trim();
let expiry = document.getElementById("expiry").value;
if (!name || !mobile || !vehicle || !expiry) { alert("Fill all fields"); return; }
let reminders = JSON.parse(localStorage.getItem("reminders") || "[]");
if (editIndex !== null) { reminders[editIndex] = { name, mobile, vehicle, expiry }; localStorage.removeItem("editIndex"); }
else { reminders.push({ name, mobile, vehicle, expiry }); }
localStorage.setItem("reminders", JSON.stringify(reminders));
window.location.href = "list.html";
}
</script>
</body>
</html>