-
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.
Merge pull request #8 from danrusu/grid-layout
Grid layout
- Loading branch information
Showing
5 changed files
with
120 additions
and
106 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
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 |
---|---|---|
|
@@ -38,8 +38,6 @@ <h3>JS4Testers Workshop</h3> | |
</address> | ||
</footer> | ||
|
||
<script> | ||
</script> | ||
</body> | ||
|
||
</html> |
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,53 @@ | ||
:root { | ||
font-size: 20px; | ||
font-family: "Libre Franklin", sans-serif; | ||
} | ||
|
||
.grid-container { | ||
min-height: 100vh; | ||
display: grid; | ||
grid-template-columns: 1fr; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
h1 { | ||
font-size: 2rem; | ||
text-align: center; | ||
} | ||
|
||
h2 { | ||
margin-top: 1rem; | ||
font-size: 1rem; | ||
text-align: center; | ||
} | ||
|
||
#form { | ||
font-size: 1rem; | ||
margin-top: 1.5rem; | ||
} | ||
|
||
button, | ||
textarea, | ||
#notification { | ||
margin: auto; | ||
display: block; | ||
} | ||
|
||
button { | ||
margin-top: 1.5rem; | ||
} | ||
|
||
a { | ||
text-decoration: none; | ||
color: orange; | ||
} | ||
|
||
#notification { | ||
margin-top: 1.5rem; | ||
text-align: center; | ||
} | ||
|
||
textarea:valid { | ||
border: 2px solid orange; | ||
} |
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,31 @@ | ||
const BACKEND = 'https://testutils-4abbd3f39c31.herokuapp.com'; | ||
// const BACKEND = 'http://localhost:1111'; | ||
|
||
const feedbackElement = document.querySelector('#question'); | ||
feedbackElement.value = ''; | ||
|
||
async function submitFeedback() { | ||
const notificationElement = document.querySelector('#notification'); | ||
if (feedbackElement.value.length < 10) { | ||
alert(`Questions must have at least 10 characters!`); | ||
} else { | ||
const response = await fetch(`${BACKEND}/feedback`, { | ||
method: 'POST', | ||
headers: { | ||
'content-type': 'application/json', | ||
}, | ||
body: JSON.stringify({ feedback: feedbackElement.value }), | ||
}); | ||
if (response.status === 200) { | ||
feedbackElement.value = ''; | ||
notificationElement.innerText = 'Feedback submitted!'; | ||
notificationElement.style.color = 'green'; | ||
} else { | ||
notification.innerText = 'Failed to submit Feedback. Try again.'; | ||
notification.style.color = 'red'; | ||
} | ||
setTimeout(() => { | ||
notificationElement.innerText = ''; | ||
}, 3000); | ||
} | ||
} |
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