|
29 | 29 | <body style="background: #f8f9fa;"> |
30 | 30 | <script src="https://cdn.jsdelivr.net/gh/zuramai/mazer@docs/demo/assets/static/js/initTheme.js"></script> |
31 | 31 |
|
32 | | - <style> |
33 | | - /* Modern form styling */ |
34 | | - .form-control:focus { |
35 | | - border-color: #667eea; |
36 | | - box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25); |
37 | | - } |
38 | | - |
39 | | - .form-floating > .form-control:focus ~ label, |
40 | | - .form-floating > .form-control:not(:placeholder-shown) ~ label { |
41 | | - opacity: 0.65; |
42 | | - transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem); |
43 | | - color: #667eea; |
44 | | - } |
45 | | - |
46 | | - /* Button animations */ |
47 | | - .btn { |
48 | | - transition: all 0.3s ease; |
49 | | - transform: translateY(0); |
50 | | - } |
51 | | - |
52 | | - .btn:hover { |
53 | | - transform: translateY(-2px); |
54 | | - box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15); |
55 | | - } |
56 | | - |
57 | | - .btn:active { |
58 | | - transform: translateY(0); |
59 | | - } |
60 | | - |
61 | | - /* Card animations */ |
62 | | - .auth-card { |
63 | | - animation: fadeInUp 0.6s ease-out; |
64 | | - } |
65 | | - |
66 | | - @keyframes fadeInUp { |
67 | | - from { |
68 | | - opacity: 0; |
69 | | - transform: translateY(30px); |
70 | | - } |
71 | | - to { |
72 | | - opacity: 1; |
73 | | - transform: translateY(0); |
74 | | - } |
75 | | - } |
76 | | - |
77 | | - /* Background patterns */ |
78 | | - .pattern-bg { |
79 | | - background-image: |
80 | | - radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%), |
81 | | - radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 50%); |
82 | | - } |
83 | | - |
84 | | - /* Loading states */ |
85 | | - .btn.loading { |
86 | | - pointer-events: none; |
87 | | - opacity: 0.7; |
88 | | - } |
89 | | - |
90 | | - .btn.loading::after { |
91 | | - content: ""; |
92 | | - display: inline-block; |
93 | | - width: 16px; |
94 | | - height: 16px; |
95 | | - margin-left: 10px; |
96 | | - border: 2px solid transparent; |
97 | | - border-top-color: currentColor; |
98 | | - border-radius: 50%; |
99 | | - animation: spin 1s linear infinite; |
100 | | - } |
101 | | - |
102 | | - @keyframes spin { |
103 | | - 0% { transform: rotate(0deg); } |
104 | | - 100% { transform: rotate(360deg); } |
105 | | - } |
106 | | - |
107 | | - /* Alert animations */ |
108 | | - .alert { |
109 | | - animation: slideInRight 0.5s ease-out; |
110 | | - } |
111 | | - |
112 | | - @keyframes slideInRight { |
113 | | - from { |
114 | | - opacity: 0; |
115 | | - transform: translateX(100%); |
116 | | - } |
117 | | - to { |
118 | | - opacity: 1; |
119 | | - transform: translateX(0); |
120 | | - } |
121 | | - } |
122 | | - |
123 | | - /* Form validation styling */ |
124 | | - .form-control.is-invalid { |
125 | | - border-color: #dc3545; |
126 | | - box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25); |
127 | | - } |
128 | | - |
129 | | - .form-control.is-valid { |
130 | | - border-color: #198754; |
131 | | - box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25); |
132 | | - } |
133 | | - |
134 | | - /* Responsive adjustments */ |
135 | | - @media (max-width: 991.98px) { |
136 | | - .auth-card { |
137 | | - margin: 2rem 1rem; |
138 | | - } |
139 | | - } |
140 | | - </style> |
141 | | - |
142 | 32 | <!-- Start content here --> |
143 | 33 | <%= yield %> |
144 | 34 | <!-- End content --> |
|
151 | 41 | <!-- Need: Apexcharts --> |
152 | 42 | <script src="https://cdn.jsdelivr.net/gh/zuramai/mazer@docs/demo/assets/extensions/apexcharts/apexcharts.min.js"></script> |
153 | 43 | <script src="https://cdn.jsdelivr.net/gh/zuramai/mazer@docs/demo/assets/static/js/pages/dashboard.js"></script> |
154 | | - |
| 44 | + |
155 | 45 | <script> |
156 | | - // Form validation |
157 | | - (function() { |
158 | | - 'use strict'; |
159 | | - window.addEventListener('load', function() { |
160 | | - var forms = document.getElementsByClassName('needs-validation'); |
161 | | - var validation = Array.prototype.filter.call(forms, function(form) { |
162 | | - form.addEventListener('submit', function(event) { |
163 | | - if (form.checkValidity() === false) { |
164 | | - event.preventDefault(); |
165 | | - event.stopPropagation(); |
166 | | - } else { |
167 | | - // Add loading state to submit button |
168 | | - const submitBtn = form.querySelector('input[type="submit"], button[type="submit"]'); |
169 | | - if (submitBtn) { |
170 | | - submitBtn.classList.add('loading'); |
171 | | - submitBtn.disabled = true; |
172 | | - } |
173 | | - } |
174 | | - form.classList.add('was-validated'); |
175 | | - }, false); |
176 | | - }); |
177 | | - }, false); |
178 | | - })(); |
179 | | - |
180 | | - // Auto-dismiss alerts after 5 seconds |
181 | | - setTimeout(function() { |
182 | | - const alerts = document.querySelectorAll('.alert'); |
183 | | - alerts.forEach(alert => { |
184 | | - const bsAlert = new bootstrap.Alert(alert); |
185 | | - bsAlert.close(); |
186 | | - }); |
187 | | - }, 5000); |
188 | | - |
189 | 46 | // Enhanced form interactions |
190 | 47 | document.addEventListener('DOMContentLoaded', function() { |
191 | | - // Add focus effects to form controls |
192 | | - const formControls = document.querySelectorAll('.form-control'); |
193 | | - formControls.forEach(control => { |
194 | | - control.addEventListener('focus', function() { |
195 | | - this.parentElement.classList.add('focused'); |
196 | | - }); |
197 | | - |
198 | | - control.addEventListener('blur', function() { |
199 | | - this.parentElement.classList.remove('focused'); |
200 | | - }); |
201 | | - }); |
202 | | - |
203 | 48 | // Password visibility toggle (if needed) |
204 | 49 | const passwordFields = document.querySelectorAll('input[type="password"]'); |
205 | 50 | passwordFields.forEach(field => { |
|
210 | 55 | toggleBtn.style.zIndex = '10'; |
211 | 56 | toggleBtn.style.border = 'none'; |
212 | 57 | toggleBtn.style.background = 'none'; |
213 | | - |
| 58 | + |
214 | 59 | field.parentElement.style.position = 'relative'; |
215 | 60 | field.parentElement.appendChild(toggleBtn); |
216 | | - |
| 61 | + |
217 | 62 | toggleBtn.addEventListener('click', function() { |
218 | 63 | const type = field.getAttribute('type') === 'password' ? 'text' : 'password'; |
219 | 64 | field.setAttribute('type', type); |
|
0 commit comments