-
Notifications
You must be signed in to change notification settings - Fork 0
/
crypte.html
116 lines (94 loc) · 2.88 KB
/
crypte.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
<!DOCTYPE html>
<html>
<head>
<title>exemple</title>
<style>
*{
box-sizing: border-box;
margin: 0%;
padding: 0%;
}
img{
width: 100%;
margin: auto;
height: 583px;
filter: blur(4px);
}
.FORM{
background-color: rgba(56, 107, 218, 0.404);
padding: 10px;
border-radius: 10%;
border-style:none;
position: absolute;
z-index: 9999999999999;
margin-top: -30%;
margin-left: 35%;
width: 30%;
height: 140px;
}
button{
border: solid 1px black ;
background-color: white;
border-radius: 12px ;
padding: 5px;
align-items: center;
font-family: monospace;
}
button:hover{
background: linear-gradient(rgb(9, 9, 255), rgba(253, 250, 250, 0.616));
border-radius: 12px 4px;
}
#mot1, #mot2{
border-radius: 10px;
height: 20px;
padding: 8px;
border-style: none;
}
@media (max-width: 768px) and (max-width: 701px) {
.FORM{
background-color: rgba(56, 107, 218, 0.404);
padding: 10px;
border-radius: 10%;
border-style:none;
position: absolute;
z-index: 9999999999999;
margin-top: -70%;
margin-left: 20%;
width: 60%;
height: 140px;
}
}
</style>
<script>
function crypter(mot) {
let alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
var mocry="";
for(i=0; i < mot.length ; i++) {
indice=alphabet.indexOf(mot[i]);
indice += 2;
indice = indice % 26;
mocry += alphabet[indice];
}
return mocry;
}
function affiche() {
var mot1 = document.getElementById('mot1').value;
var mot2 = crypter(mot1);
document.getElementById('mot2').value = mot2;
}
</script>
</head>
<body>
<div class="bd">
<img src="cryptage_chiffrement.png"></div>
<div class="FORM">
<form>
<label>Mot1 :</label>
<input type="text" id="mot1"><BR></BR>
<label>Mot2 :</label>
<input type="text" id="mot2"><BR></BR>
<button type="button" onclick="affiche();">Crypter</button>
</form>
</div>
</body>
</html>