Skip to content

Commit

Permalink
Updated and modified js scripts and styles
Browse files Browse the repository at this point in the history
  • Loading branch information
SouzaSantosK committed Nov 22, 2023
2 parents f363a41 + b38b583 commit 3746e82
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 7 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<nav>
<a href="" id="first-link" class="selected">Home</a>
<a href="./src/pages/games/games.html">Games</a>
<a href="../animes/animes.html">Animes</a>
<a href="../src/pages/animes/animes.html">Animes</a>
<a href="#">Sobre</a>
<span id="box"></span>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion src/js/email.js → src/js/animesEmailSender.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ button.addEventListener("click", (e) => {
emailjs
.send(
"service_l0s9372",
"template_n3aufxj",
"template_1imfn8o",
{ name: name.value, email: email.value },
"Xts0UwNohpeU1f3pZ"
)
Expand Down
37 changes: 37 additions & 0 deletions src/js/gamesEmailSender.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const button = document.querySelector('button[value="SEND"]');

button.addEventListener("click", (e) => {
e.preventDefault();

const name = document.getElementById("name");
const email = document.getElementById("email");

if (name.value && email.value) {
emailjs
.send(
"service_l0s9372",
"template_n3aufxj",
{ name: name.value, email: email.value },
"Xts0UwNohpeU1f3pZ"
)
.then(
function () {
console.log("SUCCESS!");
},
function (error) {
console.log("FAILED...", error);
}
);
name.value = "";
email.value = "";

const form = document.querySelector("form");
if (document.querySelector(".thanks")) {
document.querySelector(".thanks").remove();
}
form.insertAdjacentHTML(
"afterend",
'<p class="thanks">Thank you for subscribing to our newsletter!</p>'
);
}
});
2 changes: 1 addition & 1 deletion src/pages/animes/animes.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h4>Receive news and information in the palm of your hand.</h4>
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/@emailjs/browser@3/dist/email.min.js"
></script>
<script src="../../js/email.js"></script>
<script src="../../js/animesEmailSender.js"></script>
<script src="../../../navbar.js"></script>
</body>
</html>
4 changes: 3 additions & 1 deletion src/pages/games/games.css
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,9 @@ section.grid .col-2 {
}
.newsletter .bottom .form-container .thanks {
position: absolute;
bottom: 40px;
bottom: 20px;
font-size: 18px;
font-weight: 500;
}
.newsletter .bottom .form-container .label {
font-size: 18px;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/games/games.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/pages/games/games.html
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ <h4>Receive news and information in the palm of your hand.</h4>
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/@emailjs/browser@3/dist/email.min.js"
></script>
<script src="../../js/email.js"></script>
<script src="../../js/gamesEmailSender.js"></script>
<script src="../../../navbar.js"></script>
</body>
</html>
4 changes: 3 additions & 1 deletion src/pages/games/games.scss
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,9 @@ section.grid {

.thanks {
position: absolute;
bottom: 40px;
bottom: 20px;
font-size: 18px;
font-weight: 500;
}

.label {
Expand Down

0 comments on commit 3746e82

Please sign in to comment.