Skip to content

Commit 0c37f44

Browse files
authored
Merge pull request #3 from dygufa/master
Adding email form
2 parents 98e2f35 + bb5045f commit 0c37f44

File tree

2 files changed

+73
-36
lines changed

2 files changed

+73
-36
lines changed

assets/style.css

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ body {
44
Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
55
margin: 0;
66
}
7+
78
.container {
89
display: flex;
910
justify-content: center;
@@ -12,6 +13,11 @@ body {
1213
width: 100vw;
1314
height: 100vh;
1415
}
16+
17+
#logo-image {
18+
margin-bottom: 30px;
19+
}
20+
1521
.github-link {
1622
display: block;
1723
background: url(github.svg) no-repeat;
@@ -20,40 +26,30 @@ body {
2026
height: 30px;
2127
overflow: hidden;
2228
line-height: 200px;
23-
margin-top: 60px;
29+
margin-top: 20px;
2430
}
25-
@keyframes rotating {
26-
from {
27-
transform: rotate(0deg);
28-
-o-transform: rotate(0deg);
29-
-ms-transform: rotate(0deg);
30-
-moz-transform: rotate(0deg);
31-
-webkit-transform: rotate(0deg);
32-
}
33-
34-
to {
35-
transform: rotate(360deg);
36-
-o-transform: rotate(360deg);
37-
-ms-transform: rotate(360deg);
38-
-moz-transform: rotate(360deg);
39-
-webkit-transform: rotate(360deg);
40-
}
31+
32+
#meetup-notification-form {
33+
color: #fff;
34+
margin: 20px 0;
35+
text-align: center;
4136
}
42-
@-webkit-keyframes rotating {
43-
from {
44-
transform: rotate(0deg);
45-
-webkit-transform: rotate(0deg);
37+
38+
#meetup-notification-form input {
39+
border-radius: 5px;
40+
padding: 10px;
41+
font-size: 20px;
42+
width: 400px;
43+
text-align: center;
44+
}
45+
46+
@media screen and (max-width: 500px) {
47+
#logo-image, #logo-text, #meetup-notification-form {
48+
width: 80%;
4649
}
47-
to {
48-
transform: rotate(360deg);
49-
-webkit-transform: rotate(360deg);
50+
51+
#meetup-notification-form input {
52+
width: calc(100% - 20px);
53+
font-size: 15px;
5054
}
51-
}
52-
.rotating {
53-
margin-bottom: 2rem;
54-
-webkit-animation: rotating 10s linear infinite;
55-
-moz-animation: rotating 10s linear infinite;
56-
-ms-animation: rotating 10s linear infinite;
57-
-o-animation: rotating 10s linear infinite;
58-
animation: rotating 10s linear infinite;
59-
}
55+
}

index.html

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!DOCTYPE html>
22
<html lang="en">
3+
34
<head>
45
<meta charset="UTF-8">
56
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -9,11 +10,51 @@
910
<link rel="stylesheet" href="assets/style.css">
1011
<link rel="icon" sizes="192x192" href="assets/reactssa.png">
1112
</head>
13+
1214
<body>
1315
<div class="container">
14-
<img src="assets/react-logo-fitas.png" alt="Logo do React Salvador composto por fitas do Senhor do Bomfim" class="rotating">
15-
<img src="assets/react-ssa-text.png" alt="Logo do React Salvador composto por fitas do Senhor do Bomfim">
16+
<img id="logo-image" src="assets/react-logo-fitas.png" alt="Logo do React Salvador composto por fitas do Senhor do Bomfim">
17+
<img id="logo-text" src="assets/react-ssa-text.png" alt="Logo do React Salvador composto por fitas do Senhor do Bomfim">
18+
19+
<form id="meetup-notification-form">
20+
<h2>Quer ser avisado sobre os próximos encontros?</h2>
21+
<input type="email" id="email" placeholder="Digite seu email e pressione enter" />
22+
</form>
23+
1624
<a href="https://github.com/ReactSSA" class="github-link">ReactSSA</a>
1725
</div>
26+
27+
<script src="https://www.gstatic.com/firebasejs/5.4.2/firebase-app.js"></script>
28+
<script src="https://www.gstatic.com/firebasejs/5.4.2/firebase-database.js"></script>
29+
30+
<script>
31+
var config = {
32+
apiKey: "AIzaSyDthLRn1-FtkR9duSYmGO5vcxv27Mw6zfY",
33+
authDomain: "reactssa-d6ce0.firebaseapp.com",
34+
databaseURL: "https://reactssa-d6ce0.firebaseio.com",
35+
projectId: "reactssa-d6ce0",
36+
storageBucket: "reactssa-d6ce0.appspot.com",
37+
messagingSenderId: "146802970530"
38+
};
39+
firebase.initializeApp(config);
40+
41+
var emailsStore = firebase.database().ref("emails");
42+
43+
document.getElementById("meetup-notification-form").addEventListener("submit", function(e) {
44+
e.preventDefault();
45+
46+
var emailInputEl = document.getElementById("email");
47+
emailsStore.push({
48+
email: emailInputEl.value
49+
}).then(function() {
50+
emailInputEl.value = "Pronto, anotado!";
51+
emailInputEl.disabled = true;
52+
emailInputEl.style.color = "#229400";
53+
}).catch(function() {
54+
emailInputEl.value = "Erro, nos avise lá no github!";
55+
});
56+
})
57+
</script>
1858
</body>
19-
</html>
59+
60+
</html>

0 commit comments

Comments
 (0)