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

Commit

Permalink
Merge pull request #26 from thepurplebubble/email-form-update
Browse files Browse the repository at this point in the history
prevent form scroll overlap
  • Loading branch information
vcc3v authored Dec 21, 2023
2 parents ca69e89 + 8152093 commit 0dc44db
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/components/Email-Form.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="email-form">
<div id="email-form" class="emailform">
<div class="signup-container">
<div class="signup-container1">
<div class="signup-container2">
Expand Down Expand Up @@ -67,20 +67,19 @@
</div>

<style>
@media (max-width: 600px) {
form {
width: 100%;
position: static;
transform: none;
}
}

#email-form {
.emailform {
transform: translateY(33em);
visibility: hidden;
position: absolute;
}

@media (max-width: 825px) {
.emailform {
position: absolute;
transform: translateY(-7em);
}
}

form {
display: flex;
flex-direction: column;
Expand All @@ -95,6 +94,12 @@
border: 1px solid var(--dl-color-gray-white); /* added white border */
}

@media (max-width: 825px) {
form {
width: 95%;
}
}

input[type="text"],
input[type="email"] {
width: 100%;
Expand Down
60 changes: 60 additions & 0 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import "../styles/index.css";
</div>
</div>
<EmailForm />
<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 @@ -143,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 @@ -154,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 @@ -168,3 +172,59 @@ import "../styles/index.css";
});
});
</script>

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

@media (max-width: 825px) {
.home-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.home-container1 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.home-container2 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.home-btn-group {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.home-text1 {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.home-features {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.home-lottie-node {
align-items: center;
width: 100%;
height: 100%;
}

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

0 comments on commit 0dc44db

Please sign in to comment.