-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collect email address from home page (#174)
- Loading branch information
Showing
18 changed files
with
694 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM ruby | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY . . | ||
RUN bundle install | ||
|
||
CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<div id="demo-modal" class="modal"> | ||
<p>Enter your name and email address to try out Kùzu!</p> | ||
<p class="demo-modal-error-wrapper" id="demo-modal-error-name"> | ||
<span> | ||
<i class="fa-solid fa-circle-exclamation"></i> | ||
</span> | ||
Please enter your name. | ||
</p> | ||
<p class="demo-modal-error-wrapper" id="demo-modal-error-email"> | ||
<span> | ||
<i class="fa-solid fa-circle-exclamation"></i> | ||
</span> | ||
Please enter a valid email address. | ||
</p> | ||
<input type="text" name="name" id="demo-name" placeholder="Name" class="demo-input" /> | ||
<input type="email" name="email" id="demo-email" placeholder="Email Address" class="demo-input" /> | ||
<div class="demo-modal-buttons"> | ||
<button class="button primary" id="demo-modal-submit"> | ||
Try Kùzu | ||
</button> | ||
| ||
<button class="button primary demo-modal-close"> | ||
Close | ||
</button> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<section id="newsletter" class="main newsletter special"> | ||
<h1>Subscribe to Our Newsletter</h1> | ||
<input type="email" name="email" id="newsletter-email" placeholder="Email Address" /> | ||
<p class="newsletter-message" id="newsletter-error"> | ||
<span> | ||
<i class="fa-solid fa-circle-exclamation"></i> | ||
</span> | ||
Please enter a valid email address. | ||
</p> | ||
<p class="newsletter-message" id="newsletter-success"> | ||
<span> | ||
<i class="fa-solid fa-circle-check"></i> | ||
</span> | ||
Thank you for subscribing! | ||
</p> | ||
<button id="newsletter-submit"> | ||
Submit | ||
</button> | ||
|
||
</section> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
const demoModal = $('#demo-modal'); | ||
const demoModalOpenButtons = $('.demo-modal-open'); | ||
const demoModalCloseButton = $('.demo-modal-close'); | ||
const demoModalSubmitButton = $('#demo-modal-submit'); | ||
const demoErrorName = $('#demo-modal-error-name'); | ||
const demoErrorEmail = $('#demo-modal-error-email'); | ||
const demoNameInput = $('#demo-name'); | ||
const demoEmailInput = $('#demo-email'); | ||
|
||
const resetErrors = () => { | ||
demoErrorName.hide(); | ||
demoErrorEmail.hide(); | ||
}; | ||
|
||
const resetDemoModal = () => { | ||
resetErrors(); | ||
demoNameInput.val(''); | ||
demoEmailInput.val(''); | ||
loadDemoInfo(); | ||
}; | ||
|
||
const closeDemoModal = () => { | ||
$.modal.close(); | ||
}; | ||
|
||
const loadDemoInfo = () => { | ||
const name = window.localStorage.getItem('demoName'); | ||
const email = window.localStorage.getItem('demoEmail'); | ||
const retrieved = {}; | ||
if (name) { | ||
retrieved.name = name; | ||
demoNameInput.val(name); | ||
} | ||
if (email) { | ||
retrieved.email = email; | ||
demoEmailInput.val(email); | ||
} | ||
return retrieved; | ||
}; | ||
|
||
demoModalOpenButtons.on('click', e => { | ||
e.preventDefault(); | ||
const retrieved = loadDemoInfo(); | ||
if (retrieved.name && retrieved.email) { | ||
window.open('//demo.kuzudb.com', '_blank'); | ||
return; | ||
} | ||
resetDemoModal(); | ||
demoModal.modal(); | ||
}); | ||
|
||
demoModalCloseButton.on('click', e => { | ||
e.preventDefault(); | ||
closeDemoModal(); | ||
}); | ||
|
||
demoModalSubmitButton.on('click', e => { | ||
e.preventDefault(); | ||
resetErrors(); | ||
const name = demoNameInput.val(); | ||
const email = demoEmailInput.val(); | ||
let valid = true; | ||
if (name === '') { | ||
demoErrorName.show(); | ||
valid = false; | ||
window.localStorage.removeItem('demoName'); | ||
} else { | ||
window.localStorage.setItem('demoName', name); | ||
} | ||
if (email === '' || !window.validateEmail(email)) { | ||
demoErrorEmail.show(); | ||
valid = false; | ||
window.localStorage.removeItem('demoEmail'); | ||
} else { | ||
window.localStorage.setItem('demoEmail', email); | ||
} | ||
if (!valid) { | ||
return; | ||
} | ||
$.ajax({ | ||
url: 'https://track.kuzudb.com', | ||
type: 'POST', | ||
data: JSON.stringify({ | ||
name, | ||
email, | ||
origin: 'TRY_KUZU', | ||
}), | ||
contentType: 'application/json', | ||
success: () => { | ||
console.log('Demo request sent'); | ||
}, | ||
error: function (error) { | ||
console.log(error); | ||
}, | ||
}); | ||
window.open('//demo.kuzudb.com', '_blank'); | ||
closeDemoModal(); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const submitButton = $('#newsletter-submit'); | ||
const emailInput = $('#newsletter-email'); | ||
const newsletterError = $('#newsletter-error'); | ||
const newsletterSuccess = $('#newsletter-success'); | ||
|
||
submitButton.on('click', (e) => { | ||
e.preventDefault(); | ||
const email = emailInput.val(); | ||
if (email === '' || !window.validateEmail(email)) { | ||
newsletterError.show(); | ||
newsletterSuccess.hide(); | ||
return; | ||
} | ||
newsletterError.hide(); | ||
newsletterSuccess.show(); | ||
|
||
$.ajax({ | ||
url: 'https://track.kuzudb.com', | ||
type: 'POST', | ||
data: JSON.stringify({ | ||
email, | ||
origin: 'NEWSLETTER', | ||
}), | ||
contentType: 'application/json', | ||
success: () => { | ||
console.log('Subscribed to newsletter'); | ||
}, | ||
error: function (error) { | ||
console.log(error); | ||
}, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
window.validateEmail = (email) => { | ||
return String(email) | ||
.toLowerCase() | ||
.match( | ||
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
services: | ||
jeykll: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
expose: | ||
- "4000" | ||
ports: | ||
- "4000:4000" |
Oops, something went wrong.