nagasurendra commited on
Commit
8966364
·
verified ·
1 Parent(s): a9b028b

Update templates/cart.html

Browse files
Files changed (1) hide show
  1. templates/cart.html +141 -55
templates/cart.html CHANGED
@@ -20,51 +20,157 @@
20
  background-color: #f3f4f6;
21
  color: #333;
22
  }
23
- .cart-container {
24
- max-width: 768px;
25
- margin: 30px auto;
26
- padding: 20px;
27
- background-color: #fff;
28
- border-radius: 12px;
29
- box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
30
- transition: box-shadow 0.3s ease-in-out;
31
- }
32
- .cart-container:hover {
33
- box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
34
- }
35
-
36
- .cart-item {
 
 
37
  display: flex;
38
  align-items: flex-start;
39
  justify-content: space-between;
40
- border: 1px solid transparent; /* Set the border to transparent */
41
- padding: 15px; /* Padding for the content */
42
  box-sizing: border-box;
43
  min-height: 100px;
44
- position: relative; /* Make the cart item a reference for the absolute positioning of the remove icon */
45
- }set corner radius 10px, background color stroke
46
-
47
-
48
 
49
  .cart-item-actions {
50
  display: flex;
51
- align-items: center; /* Align items vertically in the center */
52
- justify-content: flex-end; /* Align content to the right */
53
- width: 100%; /* Ensure the container takes up the full width */
54
  }
55
 
56
  .remove-btn {
57
- border: none; /* Remove the border around the button */
58
- background-color: transparent; /* Transparent background */
59
- cursor: pointer; /* Change cursor to pointer */
60
- font-size: 1.5rem; /* Adjust the size of the trash icon */
61
- margin-bottom: 10px; /* Add space below the delete icon */
62
- transition: color 0.3s ease; /* Smooth transition for icon color */
63
- position: relative; /* Make it relative for movement */
64
- top: -40px; /* Move the button 10px upwards */
65
- left: 50px; /* Move the button 30px to the right */
 
 
 
 
 
 
 
 
 
 
 
 
66
  }
67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  /* Hover effect */
69
  .remove-btn:hover {
70
  color: black; /* Change the icon color to black on hover */
@@ -77,31 +183,14 @@
77
  background-color: transparent; /* Keep background transparent after clicking */
78
  }
79
 
80
- .text-primary {
81
- color: #000 !important; /* Ensure the price is black */
82
- text-align: right; /* Center-align the price */
83
- white-space: nowrap; /* Prevent price text from wrapping */
84
- }
85
 
86
 
87
 
88
 
89
 
90
 
91
- .image-wrapper {
92
- width: 80px; /* Width of the image container */
93
- height: 140px !important; /* Height of the image container */
94
- display: flex; /* Flex container for image */
95
- align-items: flex-start; /* Align the image at the top */
96
- justify-content: center; /* Center image horizontally if it has space */
97
- }
98
- .cart-item img {
99
- width: 100%; /* Fill the image container */
100
- height: auto !important; /* Maintain aspect ratio */
101
- object-fit: contain; /* Ensure the full image is visible */
102
- border-radius: 8px; /* Optional: rounded corners */
103
- transition: transform 0.3s;
104
- }
105
  .cart-item img:hover {
106
  transform: scale(1.05);
107
  }
@@ -140,10 +229,7 @@
140
  color: #0FAA39;
141
  }
142
 
143
- .cart-item-details {
144
- flex: 1;
145
- margin-left: 15px;
146
- }
147
 
148
  .cart-item-quantity {
149
  display: flex;
 
20
  background-color: #f3f4f6;
21
  color: #333;
22
  }
23
+ /* General Styles */
24
+ .cart-container {
25
+ border-radius: 10px;
26
+ border: 2px solid #ccc;
27
+ background-color: #f9f9f9;
28
+ padding: 15px;
29
+ box-sizing: border-box;
30
+ width: 100%; /* Make the container take full width */
31
+ max-width: 100%; /* Ensure the container does not exceed screen size */
32
+ margin: 30px auto; /* Centering container */
33
+ background-color: #fff;
34
+ box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
35
+ transition: box-shadow 0.3s ease-in-out;
36
+ }
37
+
38
+ .cart-item {
39
  display: flex;
40
  align-items: flex-start;
41
  justify-content: space-between;
42
+ border: 1px solid transparent;
43
+ padding: 15px;
44
  box-sizing: border-box;
45
  min-height: 100px;
46
+ position: relative;
47
+ }
 
 
48
 
49
  .cart-item-actions {
50
  display: flex;
51
+ align-items: center;
52
+ justify-content: flex-end;
53
+ width: 100%;
54
  }
55
 
56
  .remove-btn {
57
+ border: none;
58
+ background-color: transparent;
59
+ cursor: pointer;
60
+ font-size: 1.5rem;
61
+ margin-left: 10px; /* Adjust space between price and icon */
62
+ transition: color 0.3s ease;
63
+ }
64
+
65
+ .text-primary {
66
+ color: #000 !important;
67
+ text-align: right;
68
+ white-space: nowrap;
69
+ }
70
+
71
+ /* Flexbox for images */
72
+ .image-wrapper {
73
+ width: 80px;
74
+ height: auto; /* Removed fixed height to allow flexibility */
75
+ display: flex;
76
+ align-items: flex-start;
77
+ justify-content: center;
78
  }
79
 
80
+ /* Ensure image scales correctly */
81
+ .cart-item img {
82
+ width: 100%;
83
+ height: auto;
84
+ object-fit: contain;
85
+ border-radius: 8px;
86
+ transition: transform 0.3s;
87
+ }
88
+
89
+ /* Make the cart item responsive */
90
+ .cart-item-details {
91
+ flex: 1;
92
+ margin-left: 15px;
93
+ }
94
+
95
+ /* Mobile Responsive Fix */
96
+ @media (max-width: 768px) {
97
+ /* Cart container */
98
+ .cart-container {
99
+ padding: 10px; /* Adjust padding on smaller screens */
100
+ margin: 10px; /* Reduced margin for smaller screens */
101
+ }
102
+
103
+ /* Cart item layout */
104
+ .cart-item {
105
+ flex-direction: column; /* Stack items vertically on mobile */
106
+ align-items: flex-start; /* Align items to the left */
107
+ }
108
+
109
+ /* Adjust the image size for mobile */
110
+ .image-wrapper {
111
+ width: 60px; /* Smaller image container */
112
+ height: 100px; /* Adjust height for mobile */
113
+ }
114
+
115
+ .cart-item img {
116
+ width: 100%;
117
+ height: auto;
118
+ }
119
+
120
+ /* Cart item actions (delete icon and price) */
121
+ .cart-item-actions {
122
+ flex-direction: row; /* Align icon and price horizontally */
123
+ justify-content: space-between;
124
+ width: 100%;
125
+ margin-top: 10px; /* Space between cart item details and actions */
126
+ }
127
+
128
+ /* Adjust button size and spacing for mobile */
129
+ .remove-btn {
130
+ font-size: 1.2rem; /* Smaller icon size */
131
+ }
132
+
133
+ .text-primary {
134
+ font-size: 1rem; /* Adjust price font size */
135
+ }
136
+
137
+ .cart-item-quantity button {
138
+ width: 30px; /* Adjust button size */
139
+ height: 30px;
140
+ }
141
+
142
+ .cart-item-quantity input {
143
+ width: 35px; /* Adjust input field */
144
+ font-size: 0.9rem;
145
+ }
146
+ }
147
+
148
+ /* For smaller mobile screens */
149
+ @media (max-width: 480px) {
150
+ .cart-item img {
151
+ width: 50px; /* Further reduce image size */
152
+ }
153
+
154
+ .cart-item-quantity button {
155
+ width: 28px;
156
+ height: 28px;
157
+ }
158
+
159
+ .cart-item-quantity input {
160
+ width: 30px;
161
+ }
162
+ }
163
+
164
+
165
+ .cart-container:hover {
166
+ box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
167
+ }
168
+
169
+
170
+
171
+
172
+
173
+
174
  /* Hover effect */
175
  .remove-btn:hover {
176
  color: black; /* Change the icon color to black on hover */
 
183
  background-color: transparent; /* Keep background transparent after clicking */
184
  }
185
 
 
 
 
 
 
186
 
187
 
188
 
189
 
190
 
191
 
192
+
193
+
 
 
 
 
 
 
 
 
 
 
 
 
194
  .cart-item img:hover {
195
  transform: scale(1.05);
196
  }
 
229
  color: #0FAA39;
230
  }
231
 
232
+
 
 
 
233
 
234
  .cart-item-quantity {
235
  display: flex;