diff --git a/index.html b/index.html index 9d0fd94..1398fcd 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,8 @@

Password Generator

password

+ +
diff --git a/script.js b/script.js index f3cb8d8..9357427 100644 --- a/script.js +++ b/script.js @@ -4,6 +4,7 @@ const includeUppercaseElement = document.getElementById('includeUppercase') const includeNumbersElement = document.getElementById('includeNumbers') const includeSymbolsElement = document.getElementById('includeSymbols') const form = document.getElementById('passwordGeneratorForm') +const copyBtn = document.getElementById('copy-btn') const passwordDisplay = document.getElementById('passwordDisplay') const UPPERCASE_CHAR_CODES = arrayFromLowToHigh(65, 90) @@ -56,4 +57,9 @@ function syncCharacterAmount(e) { const value = e.target.value characterAmountNumber.value = value characterAmountRange.value = value -} \ No newline at end of file +} + +// copy btn +copyBtn.addEventListener('click', () => { + navigator.clipboard.writeText(passwordDisplay.innerText) +}) \ No newline at end of file diff --git a/styles.css b/styles.css index 2cae6e1..82e51bb 100644 --- a/styles.css +++ b/styles.css @@ -6,14 +6,13 @@ body { display: flex; justify-content: center; align-items: center; - font-family: Georgia, 'Times New Roman', Times, serif; + font-family: sans-serif; } .container { - background-color: #006699; + background-color: #0073ad; padding: 3rem; border-radius: 1rem; - border: 2px solid black; display: flex; justify-content: center; align-items: center; @@ -32,10 +31,12 @@ body { .title { margin: 0; text-align: center; + opacity: 0.92; } label { font-weight: bold; + opacity: 0.92; } .character-amount-container { @@ -48,7 +49,7 @@ label { } .password-display { - background-color: white; + background-color: rgba(255,255,255,0.6); color: black; padding: 1rem; border: 1px solid #333;