Skip to content

Commit 1df872b

Browse files
committed
style improvement on submission box
1 parent 32e9e0c commit 1df872b

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

css/index.scss

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,6 @@
169169

170170
.subscription-message {
171171
margin-bottom: 15px;
172-
line-height: 1.5;
173-
color: #555;
174-
font-size: 16px;
175172
}
176173

177174
.subscription-form {
@@ -184,7 +181,7 @@
184181
flex-grow: 1;
185182
padding: 10px 12px;
186183
font-size: 16px;
187-
border: 2px solid #555;
184+
border: 2px solid #e8e8e8;
188185
border-radius: 5px;
189186
width: 100%;
190187
box-sizing: border-box;
@@ -213,7 +210,7 @@
213210
.send-icon {
214211
width: 24px;
215212
height: 24px;
216-
fill: #555;
213+
fill: rgba(0, 0, 0, 0.7);
217214
}
218215

219216
.message {

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ <h1 class="title">
9898
</div>
9999
<div class="subscription-container">
100100
<p class="subscription-message">
101-
Stay up-to-date with my research. I will only send an e-mail every 6 months or so. You can opt-out anytime.
101+
Stay up-to-date with my research. I will only send an e-mail every 6 months or so, promised. You can opt-out anytime.
102102
</p>
103103
<div class="subscription-form">
104104
<input type="email" id="emailInput" class="input-email" placeholder="[email protected]">

js/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,20 @@ document.addEventListener('DOMContentLoaded', () => {
6262
}
6363
});
6464

65+
// submission box
6566
document.addEventListener('DOMContentLoaded', function() {
66-
// Add event listener to the submit button
6767
const submitButton = document.getElementById('submitButton');
6868
submitButton.addEventListener('click', submitEmail);
6969
emailInput.addEventListener('keydown', function(event) {
7070
if (event.key === 'Enter') {
71-
event.preventDefault(); // Prevent form submission
72-
submitButton.click(); // Trigger click event on submit button
71+
event.preventDefault();
72+
submitButton.click();
7373
}
7474
});
7575
});
7676

7777
function validateEmail(email) {
78-
const re = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
78+
const re = /^.+@.+\..+$/;
7979
return re.test(email.toLowerCase());
8080
}
8181

@@ -130,6 +130,7 @@ function submitEmail() {
130130
})
131131
})
132132
.then(response => {
133+
console.log(response)
133134
// With no-cors mode, we can't read the response, so we assume success
134135
showMessage("You'll stay up-to-date with my research!");
135136
emailInput.value = '';

0 commit comments

Comments
 (0)