Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
feat: make emailbr only appear when form appears
Browse files Browse the repository at this point in the history
  • Loading branch information
taciturnaxolotl committed Dec 20, 2023
1 parent 5d7aa0a commit 8152093
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import "../styles/index.css";
</div>
</div>
<EmailForm />
<span class="emailbr"></span>
<span class="emailbr" id="emailbr"></span>
<button class="chevron-button" id="chevron-button"></button>
<div class="home-features">
<div class="home-container1">
Expand Down Expand Up @@ -144,6 +144,7 @@ import "../styles/index.css";
const buttons = document.querySelectorAll("[form-button]");
const scroll = document.getElementById("chevron-button");
const form = document.getElementById("email-form");
const emailbr = document.getElementById("emailbr");

form.style.visibility = "hidden";

Expand All @@ -155,9 +156,11 @@ import "../styles/index.css";
if (form.style.visibility == "hidden") {
form.style.visibility = "visible";
scroll.style.visibility = "hidden";
emailbr.classList.add("show");
} else {
form.style.visibility = "hidden";
scroll.style.visibility = "visible";
emailbr.classList.remove("show");
}
}
scroll.addEventListener("click", () => {
Expand All @@ -171,6 +174,11 @@ import "../styles/index.css";
</script>

<style>
.emailbr {
display: block;
margin: 0px 0;
}

@media (max-width: 825px) {
.home-container {
display: flex;
Expand Down Expand Up @@ -213,7 +221,8 @@ import "../styles/index.css";
width: 100%;
height: 100%;
}
.emailbr {

.emailbr.show {
display: block;
margin: 140px 0;
}
Expand Down

0 comments on commit 8152093

Please sign in to comment.