388 lines
13 KiB
HTML
388 lines
13 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Form Elements</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 25%, #4a90e2 50%, #7bb3f0 75%, #a8d0f0 100%);
|
|
min-height: 100vh;
|
|
padding: 40px 20px;
|
|
position: relative;
|
|
}
|
|
|
|
body::before {
|
|
content: '';
|
|
position: fixed;
|
|
top: -50%;
|
|
left: -50%;
|
|
width: 200%;
|
|
height: 200%;
|
|
background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
|
|
radial-gradient(circle at 70% 80%, rgba(173,216,230,0.2) 0%, transparent 50%),
|
|
radial-gradient(circle at 20% 70%, rgba(135,206,235,0.15) 0%, transparent 50%);
|
|
animation: aurora 20s ease-in-out infinite;
|
|
pointer-events: none;
|
|
z-index: -1;
|
|
}
|
|
|
|
@keyframes aurora {
|
|
0%, 100% { transform: rotate(0deg) scale(1); }
|
|
33% { transform: rotate(120deg) scale(1.1); }
|
|
66% { transform: rotate(240deg) scale(0.9); }
|
|
}
|
|
|
|
.container {
|
|
max-width: 800px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
h1 {
|
|
text-align: center;
|
|
color: #ffffff;
|
|
font-size: 2.5rem;
|
|
margin-bottom: 40px;
|
|
text-shadow: 0 0 20px rgba(255,255,255,0.3);
|
|
font-weight: 300;
|
|
}
|
|
|
|
.form-container {
|
|
background: linear-gradient(135deg,
|
|
rgba(255,255,255,0.15) 0%,
|
|
rgba(255,255,255,0.08) 50%,
|
|
rgba(255,255,255,0.05) 100%);
|
|
border: 1px solid rgba(255,255,255,0.2);
|
|
border-radius: 8px;
|
|
padding: 40px;
|
|
backdrop-filter: blur(20px);
|
|
box-shadow: 0 8px 32px rgba(0,0,0,0.3),
|
|
inset 0 1px 0 rgba(255,255,255,0.4);
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 25px;
|
|
}
|
|
|
|
.form-label {
|
|
display: block;
|
|
color: #ffffff;
|
|
font-size: 14px;
|
|
margin-bottom: 8px;
|
|
text-shadow: 0 1px 2px rgba(0,0,0,0.3);
|
|
font-weight: 400;
|
|
}
|
|
|
|
.input {
|
|
background: linear-gradient(180deg,
|
|
rgba(255,255,255,0.8) 0%,
|
|
rgba(255,255,255,0.9) 100%);
|
|
border: 1px solid rgba(255,255,255,0.5);
|
|
border-radius: 3px;
|
|
padding: 12px 16px;
|
|
font-size: 14px;
|
|
color: #333;
|
|
box-shadow: inset 0 2px 4px rgba(0,0,0,0.1),
|
|
0 1px 0 rgba(255,255,255,0.5);
|
|
transition: all 0.2s ease;
|
|
font-family: 'Segoe UI', sans-serif;
|
|
width: 100%;
|
|
}
|
|
|
|
.input:focus {
|
|
outline: none;
|
|
border-color: rgba(74,144,226,0.8);
|
|
box-shadow: inset 0 2px 4px rgba(0,0,0,0.1),
|
|
0 0 8px rgba(74,144,226,0.3);
|
|
}
|
|
|
|
.textarea {
|
|
background: linear-gradient(180deg,
|
|
rgba(255,255,255,0.8) 0%,
|
|
rgba(255,255,255,0.9) 100%);
|
|
border: 1px solid rgba(255,255,255,0.5);
|
|
border-radius: 3px;
|
|
padding: 12px 16px;
|
|
font-size: 14px;
|
|
color: #333;
|
|
box-shadow: inset 0 2px 4px rgba(0,0,0,0.1),
|
|
0 1px 0 rgba(255,255,255,0.5);
|
|
transition: all 0.2s ease;
|
|
font-family: 'Segoe UI', sans-serif;
|
|
width: 100%;
|
|
min-height: 120px;
|
|
resize: vertical;
|
|
}
|
|
|
|
.textarea:focus {
|
|
outline: none;
|
|
border-color: rgba(74,144,226,0.8);
|
|
box-shadow: inset 0 2px 4px rgba(0,0,0,0.1),
|
|
0 0 8px rgba(74,144,226,0.3);
|
|
}
|
|
|
|
.select {
|
|
background: linear-gradient(180deg,
|
|
rgba(255,255,255,0.8) 0%,
|
|
rgba(255,255,255,0.9) 100%);
|
|
border: 1px solid rgba(255,255,255,0.5);
|
|
border-radius: 3px;
|
|
padding: 12px 16px;
|
|
font-size: 14px;
|
|
color: #333;
|
|
box-shadow: inset 0 2px 4px rgba(0,0,0,0.1),
|
|
0 1px 0 rgba(255,255,255,0.5);
|
|
transition: all 0.2s ease;
|
|
font-family: 'Segoe UI', sans-serif;
|
|
width: 100%;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.select:focus {
|
|
outline: none;
|
|
border-color: rgba(74,144,226,0.8);
|
|
box-shadow: inset 0 2px 4px rgba(0,0,0,0.1),
|
|
0 0 8px rgba(74,144,226,0.3);
|
|
}
|
|
|
|
.progress {
|
|
background: linear-gradient(180deg,
|
|
rgba(255,255,255,0.1) 0%,
|
|
rgba(255,255,255,0.05) 100%);
|
|
border: 1px solid rgba(255,255,255,0.2);
|
|
border-radius: 3px;
|
|
height: 22px;
|
|
overflow: hidden;
|
|
box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
|
|
margin-bottom: 25px;
|
|
}
|
|
|
|
.progress-fill {
|
|
height: 100%;
|
|
background: linear-gradient(180deg,
|
|
rgba(120,220,120,0.9) 0%,
|
|
rgba(80,180,80,0.95) 50%,
|
|
rgba(60,140,60,1) 100%);
|
|
border-radius: 2px;
|
|
transition: width 0.5s ease;
|
|
position: relative;
|
|
box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
|
|
}
|
|
|
|
.progress-fill::after {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: linear-gradient(90deg,
|
|
transparent 0%,
|
|
rgba(255,255,255,0.3) 50%,
|
|
transparent 100%);
|
|
animation: progress-shine 2s ease-in-out infinite;
|
|
}
|
|
|
|
@keyframes progress-shine {
|
|
0% { transform: translateX(-100%); }
|
|
100% { transform: translateX(100%); }
|
|
}
|
|
|
|
.btn {
|
|
background: linear-gradient(180deg,
|
|
rgba(255,255,255,0.3) 0%,
|
|
rgba(255,255,255,0.1) 50%,
|
|
rgba(255,255,255,0.05) 100%);
|
|
border: 1px solid rgba(255,255,255,0.4);
|
|
color: #ffffff;
|
|
padding: 12px 24px;
|
|
font-size: 14px;
|
|
border-radius: 3px;
|
|
cursor: pointer;
|
|
box-shadow: 0 2px 8px rgba(0,0,0,0.3),
|
|
inset 0 1px 0 rgba(255,255,255,0.5);
|
|
transition: all 0.2s ease;
|
|
position: relative;
|
|
overflow: hidden;
|
|
text-shadow: 0 1px 2px rgba(0,0,0,0.3);
|
|
font-family: 'Segoe UI', sans-serif;
|
|
font-weight: 400;
|
|
margin-right: 10px;
|
|
}
|
|
|
|
.btn::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 50%;
|
|
background: linear-gradient(180deg, rgba(255,255,255,0.2), transparent);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.btn:hover {
|
|
background: linear-gradient(180deg,
|
|
rgba(255,255,255,0.4) 0%,
|
|
rgba(255,255,255,0.15) 50%,
|
|
rgba(255,255,255,0.08) 100%);
|
|
box-shadow: 0 2px 12px rgba(0,0,0,0.4),
|
|
inset 0 1px 0 rgba(255,255,255,0.6);
|
|
}
|
|
|
|
.btn.primary {
|
|
background: linear-gradient(180deg,
|
|
rgba(74,144,226,0.8) 0%,
|
|
rgba(58,115,180,0.9) 50%,
|
|
rgba(42,82,138,0.95) 100%);
|
|
border: 1px solid rgba(74,144,226,0.6);
|
|
}
|
|
|
|
.btn.primary:hover {
|
|
background: linear-gradient(180deg,
|
|
rgba(74,144,226,0.9) 0%,
|
|
rgba(58,115,180,0.95) 50%,
|
|
rgba(42,82,138,1) 100%);
|
|
}
|
|
|
|
.checkbox-group {
|
|
display: flex;
|
|
align-items: center;
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.checkbox {
|
|
width: 16px;
|
|
height: 16px;
|
|
margin-right: 10px;
|
|
accent-color: #4a90e2;
|
|
}
|
|
|
|
.checkbox-label {
|
|
color: #ffffff;
|
|
font-size: 14px;
|
|
text-shadow: 0 1px 2px rgba(0,0,0,0.3);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.form-actions {
|
|
margin-top: 30px;
|
|
text-align: center;
|
|
}
|
|
|
|
.progress-info {
|
|
color: #ffffff;
|
|
font-size: 14px;
|
|
margin-bottom: 10px;
|
|
text-shadow: 0 1px 2px rgba(0,0,0,0.3);
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>Form</h1>
|
|
|
|
<div class="form-container">
|
|
<form>
|
|
<div class="form-group">
|
|
<label class="form-label" for="name">Discord Username</label>
|
|
<input type="text" id="name" class="input" placeholder="Enter your Discord username">
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="form-label" for="email">Roblox username</label>
|
|
<input class="input" placeholder="Enter your Roblox username">
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="form-label" for="country">Issue</label>
|
|
<select id="country" class="select">
|
|
<option value="">Select</option>
|
|
<option value="us">Issue?</option>
|
|
<option value="uk">Issue?</option>
|
|
<option value="ca">Issue?</option>
|
|
<option value="au">Issue?</option>
|
|
<option value="de">Issue?</option>
|
|
<option value="fr">Issue?</option>
|
|
<option value="jp">Issue?</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="form-label" for="message">More detail</label>
|
|
<textarea id="message" class="textarea" placeholder="Enter your message"></textarea>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="checkbox-group">
|
|
<input type="checkbox" id="newsletter" class="checkbox">
|
|
<label class="checkbox-label" for="newsletter">Check mark</label>
|
|
</div>
|
|
<div class="checkbox-group">
|
|
<input type="checkbox" id="terms" class="checkbox">
|
|
<label class="checkbox-label" for="terms">TOS maybe?</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="progress-info">Form completion progress:</div>
|
|
<div class="progress">
|
|
<div class="progress-fill" id="progressBar" style="width: 0%;"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-actions">
|
|
<button type="button" class="btn" onclick="clearForm()">Clear</button>
|
|
<button type="submit" class="btn primary">Submit</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function updateProgress() {
|
|
const form = document.querySelector('form');
|
|
const inputs = form.querySelectorAll('input, textarea, select');
|
|
let filledCount = 0;
|
|
|
|
inputs.forEach(input => {
|
|
if (input.type === 'checkbox') {
|
|
if (input.checked) filledCount++;
|
|
} else if (input.value.trim() !== '') {
|
|
filledCount++;
|
|
}
|
|
});
|
|
|
|
const progress = (filledCount / inputs.length) * 100;
|
|
document.getElementById('progressBar').style.width = progress + '%';
|
|
}
|
|
|
|
function clearForm() {
|
|
document.querySelector('form').reset();
|
|
updateProgress();
|
|
}
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const form = document.querySelector('form');
|
|
const inputs = form.querySelectorAll('input, textarea, select');
|
|
|
|
inputs.forEach(input => {
|
|
input.addEventListener('input', updateProgress);
|
|
input.addEventListener('change', updateProgress);
|
|
});
|
|
|
|
form.addEventListener('submit', function(e) {
|
|
e.preventDefault();
|
|
alert('Good job!!');
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |