generated from MLH-Fellowship/pod-3.1.2-portfolio
-
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.
Merge pull request #46 from oorjitchowdhary/contact
Contact form
- Loading branch information
Showing
7 changed files
with
85 additions
and
2 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 |
---|---|---|
|
@@ -3,4 +3,6 @@ _site | |
.jekyll-cache | ||
.jekyll-metadata | ||
vendor | ||
.bundle | ||
.bundle | ||
node_modules | ||
.vscode |
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 @@ | ||
<h2 id="contact" class="section-heading">Contact</h2> | ||
<div class="container"> | ||
<form | ||
id="contactform" | ||
action="https://formspree.io/f/YOUR_FORM_ID" | ||
method="POST" | ||
onsubmit="showToast()" | ||
> | ||
<div class="form-group"> | ||
<input type="text" placeholder="Your name" name="name" required /> | ||
<input type="email" placeholder="Your email" name="_replyto" required /> | ||
</div> | ||
<div class="form-group"> | ||
<textarea name="message" placeholder="Your message" required></textarea> | ||
</div> | ||
<div class="button-group"> | ||
<button type="submit" class="btn btn-warning">Submit</button> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
<script> | ||
const notyf = new Notyf({ position: { x: "right", y: "top" } }); | ||
const contactForm = document.getElementById("contactform"); | ||
|
||
const showToast = () => { | ||
notyf.success("Message sent successfully!"); | ||
contactform.reset(); | ||
}; | ||
|
||
contactForm.addEventListener("submit", (e) => e.preventDefault()); | ||
</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
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,40 @@ | ||
.container { | ||
max-width: var(--max-width); | ||
margin: 0 auto; | ||
text-align: center; | ||
} | ||
|
||
.form-group { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
align-items: center; | ||
margin: 0 16%; | ||
} | ||
|
||
.form-group input { | ||
width: 48%; | ||
border: 1px solid #eee; | ||
border-radius: 4px; | ||
padding: 6px 10px; | ||
margin: 0 auto; | ||
} | ||
|
||
textarea { | ||
width: 100%; | ||
height: 20vh; | ||
margin: 1vh; | ||
border: 1px solid #eee; | ||
border-radius: 4px; | ||
padding: 6px 10px; | ||
resize: none; | ||
} | ||
|
||
.button-group { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
align-items: left; | ||
margin: 0 16%; | ||
padding: 6px 10px; | ||
} |
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