-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move subscribe form out of the global footer (#9)
- Loading branch information
Showing
10 changed files
with
131 additions
and
116 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 |
---|---|---|
@@ -1,62 +1,4 @@ | ||
.mailing-list-container { | ||
.global-footer { | ||
background: var(--code-bg); | ||
border-top: 1px solid var(--content); | ||
} | ||
|
||
form.mailing-list { | ||
padding: 10px; | ||
text-align: center; | ||
max-width: calc(var(--nav-width) + var(--gap) * 2); | ||
margin-inline-start: auto; | ||
margin-inline-end: auto; | ||
} | ||
|
||
form.mailing-list label { | ||
display: block; | ||
font-weight: bold; | ||
} | ||
|
||
form.mailing-list input[type="email"] { | ||
background: var(--theme); | ||
border-radius: 4px; | ||
color: var(--primary); | ||
margin: 8px; | ||
padding: 4px; | ||
min-width: 50%; | ||
} | ||
|
||
form.mailing-list button { | ||
background: var(--primary); | ||
border-radius: 18px; | ||
color: var(--theme); | ||
font-size: 16px; | ||
padding: 0 16px; | ||
} | ||
|
||
.mailing-list-container .footer { | ||
padding-bottom: 10px; | ||
padding-top: 0; | ||
} | ||
|
||
.mailing-list-link { | ||
background: var(--tertiary); | ||
color: var(--primary); | ||
font-size: 14px; | ||
border-radius: 2px; | ||
padding: 6px; | ||
visibility: hidden; | ||
position: fixed; | ||
top: 5px; | ||
right: 10px; | ||
z-index: 99; | ||
transition: visibility 0.5s, opacity 0.8s linear; | ||
} | ||
|
||
.mailing-list-link:hover { | ||
background: var(--primary); | ||
color: var(--theme); | ||
} | ||
|
||
.mailing-list-link:focus { | ||
outline: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
.mailing-list-container { | ||
background: var(--code-bg); | ||
border: 2px solid var(--content); | ||
border-radius: 5px; | ||
margin-top: 20px; | ||
} | ||
|
||
form.mailing-list { | ||
text-align: center; | ||
max-width: calc(var(--nav-width) + var(--gap) * 2); | ||
margin-inline-start: auto; | ||
margin-inline-end: auto; | ||
} | ||
|
||
form.mailing-list label { | ||
display: block; | ||
font-weight: bold; | ||
padding-top: 5px; | ||
} | ||
|
||
form.mailing-list input[type="email"] { | ||
background: var(--theme); | ||
border-radius: 4px; | ||
color: var(--primary); | ||
margin: 8px; | ||
padding: 4px; | ||
min-width: 80%; | ||
} | ||
|
||
form.mailing-list button { | ||
background: var(--primary); | ||
border-radius: 18px; | ||
color: var(--theme); | ||
font-size: 16px; | ||
padding: 0 16px; | ||
} | ||
|
||
.mailing-list-container .footer { | ||
padding-bottom: 10px; | ||
padding-top: 0; | ||
} | ||
|
||
.mailing-list-link { | ||
background: var(--tertiary); | ||
color: var(--primary); | ||
font-size: 14px; | ||
border-radius: 2px; | ||
padding: 6px; | ||
visibility: hidden; | ||
position: fixed; | ||
top: 5px; | ||
right: 10px; | ||
z-index: 99; | ||
transition: visibility 0.5s, opacity 0.8s linear; | ||
} | ||
|
||
.mailing-list-link:hover { | ||
background: var(--primary); | ||
color: var(--theme); | ||
} | ||
|
||
.mailing-list-link:focus { | ||
outline: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ Feel free to contact me about topics discussed on this website, potential work, | |
* [Connect on LinkedIn](https://www.linkedin.com/in/yanirseroussi) | ||
* [Email me](mailto:[email protected]) | ||
|
||
## Subscribe to the mailing list | ||
## Subscribe to my mailing list | ||
|
||
To get new posts delivered to your mailbox, scroll to the bottom of this page, enter your email address, and tap Subscribe. You may unsubscribe at any time. | ||
To get new posts delivered to your mailbox, enter your email address below and tap Subscribe. You may unsubscribe at any time. | ||
|
||
{{<subscribe_form>}} |
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,34 @@ | ||
{{- /* An embeddable subscribe form. Annoyingly also includes ConvertKit's script, but this will be sorted later. */}} | ||
|
||
<div class="mailing-list-container"> | ||
<script src="https://f.convertkit.com/ckjs/ck.5.js"></script> | ||
<form | ||
class="mailing-list seva-form formkit-form" | ||
action="https://app.convertkit.com/forms/6549537/subscriptions" | ||
method="post" | ||
data-sv-form="6549537" | ||
data-uid="9157759fce" | ||
data-format="inline" | ||
data-version="5" | ||
data-options="{"settings":{"after_subscribe":{"action":"message","success_message":"Success! Now check your email to confirm your subscription.","redirect_url":""},"analytics":{"google":null,"fathom":null,"facebook":null,"segment":null,"pinterest":null,"sparkloop":null,"googletagmanager":null},"modal":{"trigger":"timer","scroll_percentage":null,"timer":5,"devices":"all","show_once_every":15},"powered_by":{"show":true,"url":"https://convertkit.com/features/forms?utm_campaign=poweredby&utm_content=form&utm_medium=referral&utm_source=dynamic"},"recaptcha":{"enabled":false},"return_visitor":{"action":"show","custom_content":""},"slide_in":{"display_in":"bottom_right","trigger":"timer","scroll_percentage":null,"timer":5,"devices":"all","show_once_every":15},"sticky_bar":{"display_in":"top","trigger":"timer","scroll_percentage":null,"timer":5,"devices":"all","show_once_every":15}},"version":"5"}" | ||
> | ||
<div data-style="clean"> | ||
<ul class="formkit-alert formkit-alert-error" data-element="errors" data-group="alert"></ul> | ||
<div data-element="fields" data-stacked="false"> | ||
<label for="mailing-list-email">Get weekly posts in your mailbox</label> | ||
<input | ||
id="mailing-list-email" | ||
name="email_address" | ||
aria-label="Email address" | ||
placeholder="Email address" | ||
required="" | ||
type="email" | ||
> | ||
<button data-element="submit">Subscribe</button> | ||
</div> | ||
</div> | ||
</form> | ||
<div class="footer"> | ||
Alternatively, <a href="https://yanirseroussi.com/index.xml">subscribe to RSS feed</a>. | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{- /* A subscribe button that fades in as users scroll down the page. */}} | ||
|
||
<a href="/contact/#mailing-list-email" target="_blank" aria-label="subscribe to mailing list" class="mailing-list-link" id="mailing-list-link"> | ||
Subscribe | ||
</a> | ||
|
||
<script> | ||
// Show / hide mailing list link when scrolling (adapted from top-link functionality). | ||
const mailingListButton = document.getElementById("mailing-list-link"); | ||
window.onscroll = function () { | ||
if (document.body.scrollTop > 800 || document.documentElement.scrollTop > 800) { | ||
mailingListButton.style.visibility = "visible"; | ||
mailingListButton.style.opacity = "1"; | ||
} else { | ||
mailingListButton.style.visibility = "hidden"; | ||
mailingListButton.style.opacity = "0"; | ||
} | ||
}; | ||
</script> |
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 @@ | ||
{{- partial "subscribe_form.html" . }} |