-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaddress.html
More file actions
157 lines (130 loc) · 5.97 KB
/
Copy pathaddress.html
File metadata and controls
157 lines (130 loc) · 5.97 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
149
150
151
152
153
154
155
156
157
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Add Address | Fawaz Fragrance</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Baskervville:ital@0;1&display=swap" rel="stylesheet">
<script src="https://unpkg.com/lenis@1.0.45/dist/lenis.min.js"></script>
<style>
:root {
--bg-cream: #F8F5F0; --text-dark-brown: #3E2B26; --bar-brown: #A68B6C;
--box-beige: #F4EFE6; --btn-text: #FFFFFF;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: var(--bg-cream); color: var(--text-dark-brown); font-family: 'Cambria', serif; padding-bottom: 40px; }
/* HEADER */
.header { display: flex; align-items: center; padding: 20px 25px; margin-bottom: 20px; }
.back-btn { font-size: 24px; text-decoration: none; color: var(--text-dark-brown); margin-right: 15px; }
.page-title { font-family: 'Baskervville', serif; font-size: 24px; font-weight: 600; }
/* FORM CONTAINER */
.form-container { max-width: 600px; margin: 0 auto; padding: 0 25px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text-dark-brown); opacity: 0.8; }
.form-input {
width: 100%; padding: 15px; border-radius: 12px; border: 1px solid #ddd;
background-color: #fff; font-family: 'Cambria', serif; font-size: 16px; outline: none;
transition: border 0.3s;
}
.form-input:focus { border-color: var(--bar-brown); }
.form-row { display: flex; gap: 15px; }
.form-row .form-group { flex: 1; }
/* SAVE BUTTON */
.save-btn {
width: 100%; padding: 16px; border-radius: 30px; border: none;
background-color: var(--bar-brown); color: white; font-weight: 600;
font-family: 'Baskervville', serif; font-size: 18px; cursor: pointer;
margin-top: 20px; box-shadow: 0 4px 10px rgba(166, 139, 108, 0.3);
}
.save-btn:hover { opacity: 0.9; }
html.lenis, html.lenis body {
height: auto;
}
.lenis.lenis-smooth {
scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
overscroll-behavior: contain;
}
.lenis.lenis-stopped {
overflow: hidden;
}
.lenis.lenis-scrolling iframe {
pointer-events: none;
}
</style>
</head>
<body>
<div class="header">
<a class='back-btn' href='checkout.html'>←</a>
<div class="page-title">Add Address</div>
</div>
<div class="form-container">
<form id="addressForm">
<div class="form-group">
<label class="form-label">Full Name</label>
<input type="text" id="fullName" class="form-input" placeholder="e.g. Fawaz Khan" required>
</div>
<div class="form-group">
<label class="form-label">Email Address (For Order Receipt)</label>
<input type="email" id="email" class="form-input" placeholder="name@gmail.com" required>
</div>
<div class="form-group">
<label class="form-label">Phone Number</label>
<input type="tel" id="phone" class="form-input" placeholder="+91 00000 00000" required>
</div>
<div class="form-row">
<div class="form-group">
<label class="form-label">Pincode</label>
<input type="text" id="pincode" class="form-input" placeholder="400050" required>
</div>
<div class="form-group">
<label class="form-label">City</label>
<input type="text" id="city" class="form-input" placeholder="Mumbai" required>
</div>
</div>
<div class="form-group">
<label class="form-label">Flat / House No. / Building</label>
<input type="text" id="addressLine1" class="form-input" placeholder="Flat 101, Galaxy Apts" required>
</div>
<div class="form-group">
<label class="form-label">Area / Street / Sector</label>
<input type="text" id="addressLine2" class="form-input" placeholder="Bandra West" required>
</div>
<button type="submit" class="save-btn">Save Address</button>
</form>
</div>
<script>
document.getElementById('addressForm').addEventListener('submit', function(e) {
e.preventDefault(); // Stop page reload
// 1. Gather Data
const addressData = {
name: document.getElementById('fullName').value,
email: document.getElementById('email').value, // Capture Email
phone: document.getElementById('phone').value,
pincode: document.getElementById('pincode').value,
city: document.getElementById('city').value,
line1: document.getElementById('addressLine1').value,
line2: document.getElementById('addressLine2').value
};
// 2. Save to LocalStorage
localStorage.setItem('fawazAddress', JSON.stringify(addressData));
// 3. Redirect back to Checkout
window.location.href = 'checkout.html';
});
// Initialize Lenis
const lenis = new Lenis({
duration: 2, // Higher number = slower/smoother scroll (default is 1)
easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)),
smooth: true
});
function raf(time) {
lenis.raf(time);
requestAnimationFrame(raf);
}
requestAnimationFrame(raf);
</script>
</body>
</html>