Skip to content

Commit

Permalink
Merge pull request #75 from cloud-native-nordics/slack-invite-link
Browse files Browse the repository at this point in the history
Change slack invitation to be a link instead of a form
  • Loading branch information
rhjensen79 authored Apr 10, 2024
2 parents a13d16f + b3bfa4a commit 5c7a48a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 34 deletions.
21 changes: 21 additions & 0 deletions assets/scss/custom/_style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,25 @@ footer {
.google {
max-width: 2.6rem;
}
}

.slack {
a:link {
color: $blue;
text-decoration: underline;
}

a:visited {
color: $pink;
text-decoration: underline;
}

a:hover {
color: $grey;
text-decoration: underline;
}
a:active {
color: $blue;
text-decoration: underline;
}
}
38 changes: 4 additions & 34 deletions layouts/partials/slack.html
Original file line number Diff line number Diff line change
@@ -1,39 +1,9 @@
<section class="bg-purple py-4">
<section class="bg-purple py-4 slack">
<div class="container">
<div class="row">
<div class="col-sm-12 col-lg-6 align-self-center">
<h3>Join our Slack community</h3>
</div>
<div class="col-sm-12 col-lg-6">
<form action="https://slack.cloudnativenordics.com/invite" method="get" class="mb-0">
<div class="input-group mb-3">
<input type="email" name="email" id="email" class="form-control form-control-lg"
placeholder="Enter email..." />
<div class="input-group-append">
<button type="submit" class="btn btn-secondary" type="button">Invite</button>
</div>
</div>
<div class="cf-turnstile" data-sitekey="0x4AAAAAAAQkG-a3pcOC8Ic1"></div>
</form>
<p id="status"></p>
<div class="col-sm-12 col-lg-12 align-self-center">
<h3>Join our Slack community by following <a href="https://join.slack.com/t/cloud-native-nordics/shared_invite/zt-2ge0c6cmo-SDDeFUDeEU~TUkZTDcis8w">this link</a></h3>
</div>
</div>
</div>
</section>
<script>
(() => {
const form = document.querySelector('form');
const formResponse = document.getElementById('status');
const inputEmail = document.getElementById("email")
form.onsubmit = e => {
e.preventDefault();
var xhr = new XMLHttpRequest();
xhr.open(form.method, form.action + "?email=" + inputEmail.value, true);
xhr.send(null);
xhr.onloadend = response => {
form.reset();
formResponse.innerHTML = response.target.responseText;
};
};
})();
</script>
</section>

0 comments on commit 5c7a48a

Please sign in to comment.