Skip to content

Commit 349275d

Browse files
committed
remove email signup; edit pictures
1 parent 73c4d5c commit 349275d

File tree

3 files changed

+81
-82
lines changed

3 files changed

+81
-82
lines changed

images/agnathax_before.png

-67.3 KB
Loading

index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,19 @@ <h1 class="title">
102102
</div>
103103
</div>
104104
</div>
105-
<div class="subscription-container">
105+
<!-- <div class="subscription-container">
106106
<p class="subscription-message">
107107
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.
108108
</p>
109109
<div class="subscription-form">
110110
<input type="email" id="emailInput" class="input-email" placeholder="[email protected]">
111111
<button id="submitButton" class="submit-btn" aria-label="Subscribe">
112-
<!-- Flaticon Send Arrow Icon (ID: 736161) -->
113112
<svg class="send-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
114113
<path d="M476.59,227.75l-.16-.07L49.35,49.84A23.56,23.56,0,0,0,27.14,52.6,24.65,24.65,0,0,0,16,73.44L16,185.36a24.57,24.57,0,0,0,23.16,24.43l164.34,12q7.21.54,12.12,6.24a19.35,19.35,0,0,1,5.46,14L217.77,284a19.13,19.13,0,0,1-5.46,14c-4.91,5.7-10.56,6.33-17.77,7l-164,12A24.58,24.58,0,0,0,16,341.74L16,438.51A24.63,24.63,0,0,0,39.34,464a23.28,23.28,0,0,0,10-2.19l427.25-178a25,25,0,0,0,0-46Z"/>
115114
</svg>
116115
</button>
117116
</div>
118-
<div id="message" class="message" style="display: none;"></div>
117+
<div id="message" class="message" style="display: none;"></div> -->
119118
</div>
120119
</section>
121120

js/index.js

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -95,85 +95,85 @@ document.addEventListener('DOMContentLoaded', () => {
9595
});
9696

9797
// submission box
98-
document.addEventListener('DOMContentLoaded', function() {
99-
const submitButton = document.getElementById('submitButton');
100-
if (submitButton) {
101-
submitButton.addEventListener('click', submitEmail);
102-
emailInput.addEventListener('keydown', function (event) {
103-
if (event.key === 'Enter') {
104-
event.preventDefault();
105-
submitButton.click();
106-
}
107-
});
108-
};
109-
});
110-
111-
function validateEmail(email) {
112-
const re = /^.+@.+\..+$/;
113-
return re.test(email.toLowerCase());
114-
}
115-
116-
function showMessage(text, isError = false) {
117-
const messageDiv = document.getElementById('message');
118-
messageDiv.textContent = text;
119-
messageDiv.style.display = 'block';
120-
messageDiv.className = `message ${isError ? 'error' : 'success'}`;
121-
}
122-
123-
function submitEmail() {
124-
const emailInput = document.getElementById('emailInput');
125-
const submitButton = document.getElementById('submitButton');
126-
const email = emailInput.value.trim();
127-
128-
if (!validateEmail(email)) {
129-
showMessage('Please enter a valid email address', true);
130-
return;
131-
}
132-
133-
submitButton.disabled = true;
98+
// document.addEventListener('DOMContentLoaded', function() {
99+
// const submitButton = document.getElementById('submitButton');
100+
// if (submitButton) {
101+
// submitButton.addEventListener('click', submitEmail);
102+
// emailInput.addEventListener('keydown', function (event) {
103+
// if (event.key === 'Enter') {
104+
// event.preventDefault();
105+
// submitButton.click();
106+
// }
107+
// });
108+
// };
109+
// });
110+
111+
// function validateEmail(email) {
112+
// const re = /^.+@.+\..+$/;
113+
// return re.test(email.toLowerCase());
114+
// }
115+
116+
// function showMessage(text, isError = false) {
117+
// const messageDiv = document.getElementById('message');
118+
// messageDiv.textContent = text;
119+
// messageDiv.style.display = 'block';
120+
// messageDiv.className = `message ${isError ? 'error' : 'success'}`;
121+
// }
122+
123+
// function submitEmail() {
124+
// const emailInput = document.getElementById('emailInput');
125+
// const submitButton = document.getElementById('submitButton');
126+
// const email = emailInput.value.trim();
127+
128+
// if (!validateEmail(email)) {
129+
// showMessage('Please enter a valid email address', true);
130+
// return;
131+
// }
132+
133+
// submitButton.disabled = true;
134134

135-
// Replace this URL with your Google Apps Script web app URL
136-
const googleAppScriptUrl = 'https://script.google.com/macros/s/AKfycbwiGxv02KdERUK68Gaf80V0BUlMGNyyrhVJPHTj72HRXxkAKoRUw7D8zS7Wr4mTlivn/exec';
135+
// // Replace this URL with your Google Apps Script web app URL
136+
// const googleAppScriptUrl = 'https://script.google.com/macros/s/AKfycbwiGxv02KdERUK68Gaf80V0BUlMGNyyrhVJPHTj72HRXxkAKoRUw7D8zS7Wr4mTlivn/exec';
137137

138-
// Security check: ensure scriptUrl and hostname pair is valid to make sure other deployments do not use the same url
139-
const currentHostname = window.location.hostname;
140-
const isLocalhost = currentHostname === 'localhost' || currentHostname === '127.0.0.1';
141-
const isOriginalSite = currentHostname === 'oliver.hausdoerfer.de';
142-
const originalScriptUrl = 'https://script.google.com/macros/s/AKfycbwiGxv02KdERUK68Gaf80V0BUlMGNyyrhVJPHTj72HRXxkAKoRUw7D8zS7Wr4mTlivn/exec'
143-
144-
const isValidConfig = isLocalhost ||
145-
(isOriginalSite && googleAppScriptUrl === originalScriptUrl) ||
146-
(!isOriginalSite && googleAppScriptUrl !== originalScriptUrl);
138+
// // Security check: ensure scriptUrl and hostname pair is valid to make sure other deployments do not use the same url
139+
// const currentHostname = window.location.hostname;
140+
// const isLocalhost = currentHostname === 'localhost' || currentHostname === '127.0.0.1';
141+
// const isOriginalSite = currentHostname === 'oliver.hausdoerfer.de';
142+
// const originalScriptUrl = 'https://script.google.com/macros/s/AKfycbwiGxv02KdERUK68Gaf80V0BUlMGNyyrhVJPHTj72HRXxkAKoRUw7D8zS7Wr4mTlivn/exec'
143+
144+
// const isValidConfig = isLocalhost ||
145+
// (isOriginalSite && googleAppScriptUrl === originalScriptUrl) ||
146+
// (!isOriginalSite && googleAppScriptUrl !== originalScriptUrl);
147147

148-
if (!isValidConfig) {
149-
console.log('Invalid scriptUrl. Please update the scriptUrl in this js file.');
150-
showMessage('An error occurred. Please try again later.', true);
151-
submitButton.disabled = false;
152-
return;
153-
}
154-
155-
fetch(googleAppScriptUrl, {
156-
method: 'POST',
157-
mode: 'no-cors', // This is critical for avoiding CORS issues with Google Apps Script
158-
headers: {
159-
'Content-Type': 'application/json',
160-
},
161-
body: JSON.stringify({
162-
email: email,
163-
origin: window.location.origin
164-
})
165-
})
166-
.then(response => {
167-
console.log(response)
168-
// With no-cors mode, we can't read the response, so we assume success
169-
showMessage("You'll stay up-to-date with my research!");
170-
emailInput.value = '';
171-
})
172-
.catch(error => {
173-
showMessage('An error occurred. Please try again later.', true);
174-
console.error('Error:', error);
175-
})
176-
.finally(() => {
177-
submitButton.disabled = false;
178-
});
179-
}
148+
// if (!isValidConfig) {
149+
// console.log('Invalid scriptUrl. Please update the scriptUrl in this js file.');
150+
// showMessage('An error occurred. Please try again later.', true);
151+
// submitButton.disabled = false;
152+
// return;
153+
// }
154+
155+
// fetch(googleAppScriptUrl, {
156+
// method: 'POST',
157+
// mode: 'no-cors', // This is critical for avoiding CORS issues with Google Apps Script
158+
// headers: {
159+
// 'Content-Type': 'application/json',
160+
// },
161+
// body: JSON.stringify({
162+
// email: email,
163+
// origin: window.location.origin
164+
// })
165+
// })
166+
// .then(response => {
167+
// console.log(response)
168+
// // With no-cors mode, we can't read the response, so we assume success
169+
// showMessage("You'll stay up-to-date with my research!");
170+
// emailInput.value = '';
171+
// })
172+
// .catch(error => {
173+
// showMessage('An error occurred. Please try again later.', true);
174+
// console.error('Error:', error);
175+
// })
176+
// .finally(() => {
177+
// submitButton.disabled = false;
178+
// });
179+
// }

0 commit comments

Comments
 (0)