05-04-2025, 04:47 PM
KODLAR:
HTML KODLARI:
Kod:
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Kayıt Olma Ekranı</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<form id="signupForm">
<h2>Kayıt Ol</h2>
<div class="input-group">
<label for="username">Kullanıcı Adı</label>
<input type="text" id="username" name="username" placeholder="Kullanıcı Adı" required>
</div>
<div class="input-group">
<label for="email">E-posta</label>
<input type="email" id="email" name="email" placeholder="E-posta" required>
</div>
<div class="input-group">
<label for="password">Şifre</label>
<input type="password" id="password" name="password" placeholder="Şifre" required>
</div>
<button type="submit" id="submitBtn">Kayıt Ol</button>
</form>
</div>
<script src="script.js"></script>
</body>
</html>CSS KODLARI:
Kod:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
background-color: #121212;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.container {
background-color: #1a1a1a;
padding: 40px;
border-radius: 8px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
width: 100%;
max-width: 400px;
text-align: center;
}
h2 {
margin-bottom: 20px;
font-size: 24px;
color: #fff;
}
.input-group {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 8px;
font-size: 14px;
color: #ddd;
}
input {
width: 100%;
padding: 10px;
border: 2px solid #333;
border-radius: 5px;
background-color: #222;
color: #fff;
font-size: 14px;
}
input:focus {
border-color: #4caf50;
outline: none;
}
button {
background-color: #4caf50;
color: white;
padding: 12px;
width: 100%;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #45a049;
}
button:disabled {
background-color: #888;
cursor: not-allowed;
}
button:focus {
outline: none;
}JS KODLARI:
Kod:
document.getElementById('signupForm').addEventListener('submit', function(event) {
event.preventDefault();
// Form alanlarını al
const username = document.getElementById('username').value;
const email = document.getElementById('email').value;
const password = document.getElementById('password').value;
// Eksik alan var mı kontrol et
if (!username || !email || !password) {
document.getElementById('submitBtn').disabled = true;
setTimeout(() => {
document.getElementById('submitBtn').disabled = false;
}, 500);
alert('Lütfen tüm alanları doldurduğunuzdan emin olun!');
return;
}
alert('Kayıt başarıyla tamamlandı!');
});NOT:
Lütfen izinsiz paylaşmayınız ve ticari amaçla kullanmayınız.
femo sunar...

