mirror of
https://github.com/aurora-dot/pastel.codes.git
synced 2024-11-22 00:02:24 +00:00
Contact page fixed on my machine
This commit is contained in:
parent
02ae139566
commit
6a328f5307
@ -160,13 +160,26 @@ footer {
|
|||||||
.h-captcha {
|
.h-captcha {
|
||||||
margin-bottom: 0.5vh; }
|
margin-bottom: 0.5vh; }
|
||||||
|
|
||||||
.btn-primary {
|
.button-c {
|
||||||
font-family: "Apercu Mono";
|
display: inline-block;
|
||||||
background-color: #CC7A98;
|
font-weight: 400;
|
||||||
color: #002234;
|
color: #212529;
|
||||||
border-color: #002234; }
|
text-align: center;
|
||||||
|
vertical-align: middle;
|
||||||
|
cursor: pointer;
|
||||||
|
user-select: none;
|
||||||
|
border: 1px solid #002234;
|
||||||
|
padding: 0.375rem 0.75rem;
|
||||||
|
font-size: 1rem;
|
||||||
|
line-height: 1.5;
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
||||||
|
font-family: "Apercu Mono"; }
|
||||||
|
|
||||||
.btn-primary:hover {
|
.button-c {
|
||||||
|
background-color: #CC7A98; }
|
||||||
|
|
||||||
|
.button-c:hover {
|
||||||
background-color: #002234;
|
background-color: #002234;
|
||||||
color: #CC7A98;
|
color: #CC7A98;
|
||||||
border-color: #CC7A98; }
|
border-color: #CC7A98; }
|
||||||
|
@ -178,13 +178,26 @@ footer
|
|||||||
.h-captcha
|
.h-captcha
|
||||||
margin-bottom: 0.5vh
|
margin-bottom: 0.5vh
|
||||||
|
|
||||||
.btn-primary
|
.button-c
|
||||||
|
display: inline-block
|
||||||
|
font-weight: 400
|
||||||
|
color: #212529
|
||||||
|
text-align: center
|
||||||
|
vertical-align: middle
|
||||||
|
cursor: pointer
|
||||||
|
user-select: none
|
||||||
|
border: 1px solid $black
|
||||||
|
padding: 0.375rem 0.75rem
|
||||||
|
font-size: 1rem
|
||||||
|
line-height: 1.5
|
||||||
|
border-radius: 0.25rem
|
||||||
|
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out
|
||||||
font-family: "Apercu Mono"
|
font-family: "Apercu Mono"
|
||||||
background-color: $pink
|
|
||||||
color: $black
|
|
||||||
border-color: $black
|
|
||||||
|
|
||||||
.btn-primary:hover
|
.button-c
|
||||||
|
background-color: $pink
|
||||||
|
|
||||||
|
.button-c:hover
|
||||||
background-color: $black
|
background-color: $black
|
||||||
color: $pink
|
color: $pink
|
||||||
border-color: $pink
|
border-color: $pink
|
||||||
|
@ -22,10 +22,8 @@ const contact_rate_limit = rate_limit({
|
|||||||
|
|
||||||
// POST route from contact form
|
// POST route from contact form
|
||||||
router.post('/', contact_rate_limit, (req, res) => {
|
router.post('/', contact_rate_limit, (req, res) => {
|
||||||
const TO_GMAIL_USER = process.env.TO_GMAIL_USER
|
const TO_MAIL_USER = process.env.TO_MAIL_USER
|
||||||
const FROM_GMAIL_USER = process.env.FROM_GMAIL_USER
|
const FROM_MAIL_USER = process.env.FROM_MAIL_USER
|
||||||
const GMAIL_PASS = process.env.GMAIL_PASS
|
|
||||||
console.log(GMAIL_PASS)
|
|
||||||
const HCAPTCHA_KEY = process.env.HCAPTCHA_KEY
|
const HCAPTCHA_KEY = process.env.HCAPTCHA_KEY
|
||||||
const token = req.body["g-recaptcha-response"];
|
const token = req.body["g-recaptcha-response"];
|
||||||
const ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
|
const ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
|
||||||
@ -34,8 +32,8 @@ router.post('/', contact_rate_limit, (req, res) => {
|
|||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (data.success === true) {
|
if (data.success === true) {
|
||||||
const msg = {
|
const msg = {
|
||||||
to: TO_GMAIL_USER,
|
to: TO_MAIL_USER,
|
||||||
from: FROM_GMAIL_USER,
|
from: FROM_MAIL_USER,
|
||||||
subject: 'New message from contact form at pastel.codes',
|
subject: 'New message from contact form at pastel.codes',
|
||||||
text: `${req.body.firstname} ${req.body.lastname} (${req.body.email})\nsays: ${req.body.message}\n\nip: ${ip}`
|
text: `${req.body.firstname} ${req.body.lastname} (${req.body.email})\nsays: ${req.body.message}\n\nip: ${ip}`
|
||||||
};
|
};
|
||||||
@ -46,7 +44,7 @@ router.post('/', contact_rate_limit, (req, res) => {
|
|||||||
res.render('contact', {
|
res.render('contact', {
|
||||||
message: "I will get back to you soon!",
|
message: "I will get back to you soon!",
|
||||||
success: "Make sure the email is from ",
|
success: "Make sure the email is from ",
|
||||||
email: TO_GMAIL_USER
|
email: TO_MAIL_USER
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
@ -48,7 +48,7 @@ block content
|
|||||||
textarea#message(name='message' class="form-control" placeholder='Enter your message here' rows='3' required='true')
|
textarea#message(name='message' class="form-control" placeholder='Enter your message here' rows='3' required='true')
|
||||||
.form-group(style="margin-bottom: 0.5rem")
|
.form-group(style="margin-bottom: 0.5rem")
|
||||||
.h-captcha(data-sitekey='49abba50-1813-4ab3-acbf-2a8bfff1f7c3')
|
.h-captcha(data-sitekey='49abba50-1813-4ab3-acbf-2a8bfff1f7c3')
|
||||||
button(type='submit' class="btn btn-primary") Submit
|
button(type='submit' class="button-c") Submit
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.col
|
.col
|
||||||
|
Loading…
Reference in New Issue
Block a user