From 9a0be1df7dd745ece56ce03b9b7fa64ab8f647e0 Mon Sep 17 00:00:00 2001
From: Tchi <86352901+LucasVbr@users.noreply.github.com>
Date: Mon, 19 Jul 2021 16:58:24 +0200
Subject: [PATCH] Init
---
index.html | 69 ++++++++++++++++++++++++++++++++++++++++++++++++
scripts/main.js | 26 ++++++++++++++++++
styles/style.css | 38 ++++++++++++++++++++++++++
3 files changed, 133 insertions(+)
create mode 100644 index.html
create mode 100644 scripts/main.js
create mode 100644 styles/style.css
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..629c38f
--- /dev/null
+++ b/index.html
@@ -0,0 +1,69 @@
+
+
+
+
+
+ Générateur de MDP
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/scripts/main.js b/scripts/main.js
new file mode 100644
index 0000000..4ca56f8
--- /dev/null
+++ b/scripts/main.js
@@ -0,0 +1,26 @@
+function generatePassword(nbDigits, caps, numbers, specials) {
+ var resultat = ""
+
+ for (let i = 0; i < nbDigits ; i++) {
+ resultat += generateCharacter(caps, numbers, specials)
+ }
+
+ return resultat
+}
+
+function generateCharacter(caps, numbers, specials) {
+ var LETTERS_TABLE = "abcdefghijklmnopqrstuvwxyz"
+ var CAPS_TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ var NUMBERS_TABLE = "0123456789"
+ var SPECIALS_TABLE = "!#$%&'()*+,-./:;=?@[]^_`{|}~";
+
+ var resultat = LETTERS_TABLE
+
+ if (caps) resultat += CAPS_TABLE
+ if (numbers) resultat += NUMBERS_TABLE
+ if (specials) resultat += SPECIALS_TABLE
+
+ var randomNumber = Math.floor(Math.random() * resultat.length)
+
+ return resultat.charAt(randomNumber)
+}
\ No newline at end of file
diff --git a/styles/style.css b/styles/style.css
new file mode 100644
index 0000000..e7eebfb
--- /dev/null
+++ b/styles/style.css
@@ -0,0 +1,38 @@
+body {
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ height: 100vh;
+
+ background-color: #2c3e50;
+ color: #ecf0f1;
+}
+
+.container {
+ text-align: center;
+ height: 100%;
+ display: grid;
+}
+
+.card {
+ width: 500px;
+ height: 700px;
+
+ margin: auto;
+ padding: 25px;
+
+ background-color: #34495e;
+ border-radius: 10px;
+}
+
+#password {
+ background-color: #2c3e50;
+ padding: 0 10px;
+ font-size: 2em;
+ border-radius: 10px;
+ font-family : consolas
+}
+
+fieldset div {
+ text-align: left;
+}
\ No newline at end of file