Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Akhlak/contact form addition #11

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
24 changes: 24 additions & 0 deletions app/actions/email.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"use server";

import sgMail from "@sendgrid/mail";

sgMail.setApiKey(process.env.SENDGRID_API_KEY);

export async function sendEmail({ name, businessEmail, companyName, message }) {
try {
const msg = {
to: "[email protected]", // Email to receive the form submission
from: "[email protected]", // Verified sender email
subject: "New Contact for MantleWorks: " + name, // Subject of the email
text: `You have received a new message from ${name} (${businessEmail}) of ${companyName}.\n\nMessage:\n${message}`, // Plain text version
html: `<strong>You have received a new message from ${name} (${businessEmail}) of ${companyName}</strong><br><br><p>Message: ${message}</p>`, // HTML version
cc: businessEmail, // Send a copy to the user’s email
};

await sgMail.send(msg);
return { success: true, message: "Email sent successfully" };
} catch (error) {
console.error("SendGrid Error:", error.response?.body || error.message);
return { success: false, message: "Email failed to send" };
}
}
4 changes: 2 additions & 2 deletions app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import Footer from "@/components/layout/Footer";
import Header from "@/components/layout/Header";
import SlideIndicator from "@/components/SlideIndicator";
import Assetization from "@/views/Assetization";
import Contact from "@/views/Contact";
import Containerisation from "@/views/Containerisation";
import Hero from "@/views/Hero";
import MobileGetInTouch from "@/views/MobileGetInTouch";
import OurPractice from "@/views/OurPractice";
import Problems from "@/views/Problems";
import WhatWeDo from "@/views/WhatWeDo";
Expand Down Expand Up @@ -35,7 +35,7 @@ export default function Home() {
<Containerisation isViewing={Position === 3} />
<Assetization />
<OurPractice />
<MobileGetInTouch />
<Contact />
{/* <OurPartners /> */}
</main>
<SlideIndicator indicator={Position} />
Expand Down
66 changes: 66 additions & 0 deletions components/DividerGradient.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import React from "react";

export default function DividerGradient() {
return (
<svg
style={{
height: "100%",
width: "100%",
objectFit: "fill",
objectPosition: "center",
}}
viewBox="0 0 4 585"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g opacity="0.5">
<line
y1="-1.5"
x2="293.511"
y2="-1.5"
transform="matrix(-0.00340697 -0.999994 1 0 4 293.51)"
stroke="url(#paint0_linear_1407_275)"
strokeWidth="3"
/>
<line
y1="-1.5"
x2="293.511"
y2="-1.5"
transform="matrix(-0.00340697 0.999994 1 0 4 291.49)"
stroke="url(#paint1_linear_1407_275)"
strokeWidth="3"
/>
</g>
<defs>
<linearGradient
id="paint0_linear_1407_275"
x1="286.593"
y1="0.5"
x2="-5.01729"
y2="0.50516"
gradientUnits="userSpaceOnUse"
>
<stop offset="0.165" stopColor="#0000FF" stopOpacity="0" />
<stop offset="0.56" stopColor="#0000FF" />
<stop offset="0.74" stopColor="#00FF00" />
<stop offset="0.86" stopColor="#FF930F" />
<stop offset="1" stopColor="#FF0000" />
</linearGradient>
<linearGradient
id="paint1_linear_1407_275"
x1="286.593"
y1="0.5"
x2="-5.01729"
y2="0.50516"
gradientUnits="userSpaceOnUse"
>
<stop offset="0.165" stopColor="#0000FF" stopOpacity="0" />
<stop offset="0.56" stopColor="#0000FF" />
<stop offset="0.74" stopColor="#00FF00" />
<stop offset="0.86" stopColor="#FF930F" />
<stop offset="1" stopColor="#FF0000" />
</linearGradient>
</defs>
</svg>
);
}
10 changes: 5 additions & 5 deletions components/PartnersSVG.js

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

6 changes: 3 additions & 3 deletions components/SlideIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export default function SlideIndicator({ indicator }) {
{
style: { "--indicator-bg": "var(--blue)" },
},
// {
// style: { "--indicator-bg": "var(--green)" },
// },
{
style: { "--indicator-bg": "var(--green)" },
},
];

return (
Expand Down
216 changes: 216 additions & 0 deletions config/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1513,6 +1513,222 @@ section {
}
}
}
&-contacts {
padding-top: var(--header-height);
padding-bottom: var(--footer-height);
overflow: hidden;
& > svg {
width: 100%;
z-index: -1;
height: auto;
position: absolute;
left: 0;
bottom: 0;
object-fit: contain;
object-position: center;
@media (max-width: 1020px) {
width: 120%;
bottom: 24px;
}
@media (max-width: 820px) {
width: 130%;
bottom: 48px;
}
@media (max-width: 670px) {
z-index: -1;
width: 150%;
bottom: var(--footer-height);
}
}
& > .container {
max-height: 100%;
width: min(1240px, 100%);
margin: 0 auto;
& > .content {
margin-left: auto;
width: 70%;
@media (max-width: 780px) {
width: 75%;
}
@media (max-width: 670px) {
width: 100%;
}
& > .grid {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 24px;
@media (max-width: 670px) {
grid-template-columns: 100%;
}
& > .form-container {
position: relative;
// bg-transparent border-2 border-[var(--am-tll-purple)] rounded-xl p-8
grid-column: 1 / span 3;
background-color: transparent;
padding: calc(4px * 8);
@media (max-width: 670px) {
grid-column: 1 / span 1;
}
& > .form {
// space-y-6
margin-block: calc(4px * 6) initial;
& > .two-col {
// grid grid-cols-1 sm:grid-cols-2 gap-6
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: calc(4px * 6);
// grid-template-columns: 100%;
margin: calc(4px * 4) 0;
& > * {
margin: 0 !important;
}
}
& > .element,
& > .two-col > .element {
position: relative;
margin: calc(4px * 4) 0;
& > label {
// block text-sm font-medium mb-2 text-[var(--am-tll-orange)]
display: block;
font-size: 0.85rem;
font-weight: 500;
margin-bottom: 2;
color: var(--gray);
}
& > input {
// w-full rounded-lg bg-transparent border-2 border-[var(--am-tll-purple)] p-3 text-[var(--am-tll-purple)] focus:ring-2 focus:ring-[var(--am-tll-orange)] focus:border-transparent transition-all
width: 100%;
border-radius: 6px;
background-color: transparent;
border: 1px solid var(--gray-dark);
padding: calc(4px * 3);
color: var(--am-theme);
transition: all 300ms ease-in-out;
&:focus {
box-shadow: 0 0 0 2px var(--am-theme);
border-color: transparent !important;
outline-color: var(--am-theme);
}
}
& > textarea {
// w-full rounded-lg bg-transparent border-2 border-[var(--am-tll-purple)] p-3 text-[var(--am-tll-purple)] focus:ring-2 focus:ring-[var(--am-tll-orange)] focus:border-transparent transition-all resize-none
width: 100%;
border-radius: 6px;
background-color: transparent;
border: 1px solid var(--gray-dark);
padding: calc(4px * 3);
color: var(--am-theme);
transition: all 300ms ease-in-out;
resize: none;
&:focus {
box-shadow: 0 0 0 2px var(--am-theme);
border-color: transparent !important;
outline-color: var(--am-theme);
}
}
}
& > button {
// w-full bg-[var(--am-tll-orange)] hover:bg-[var(--am-tll-orange)] py-3 px-6 rounded-lg font-semibold transition-colors text-[var(--am-tll-cream)]
border: none;
outline: none;
padding: 2px;
display: flex;
margin: 0 auto;
&.disabled {
opacity: 0.7;
}
& > span {
background-color: var(--bg-white);
color: var(--primary-dark);
padding: 6px 24px;
}
}
}
& > .divider {
position: absolute;
height: 100%;
width: 3px;
inset: 0;
left: initial;
}
}
& > .socials {
grid-column: 4 / span 2;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 2rem;
@media (max-width: 670px) {
display: none;
}
& > .email {
& > a {
display: flex;
align-items: center;
justify-content: center;
color: var(--black);
font-size: 1rem;
gap: 8px;
text-decoration: none;
& > .icon {
font-size: 1.25rem;
}
}
}
& > .social-media {
display: flex;
align-items: center;
justify-content: center;
gap: 12px;
& > .icon {
width: 28px;
display: flex;
aspect-ratio: 1/1;
margin-right: auto;
@media (max-width: 767px) {
width: 16px;
margin-left: auto;
}
&.md {
width: 32px;
@media (max-width: 767px) {
width: 20px;
}
}
& > img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
}
}
}
}
& > * > * > .title {
font-size: 1.125rem;
font-weight: 400;
color: var(--gray);
text-transform: uppercase;
text-align: center;
margin-bottom: 52px;
@media (max-width: 800px) {
margin-bottom: 40px;
}
@media (max-width: 670px) {
margin-bottom: 24px;
}
&.small {
margin-bottom: 24px;
}
&.mb-none {
margin-bottom: 0;
}
}
}
}
}
&-footer {
z-index: 999;
&-line {
Expand Down
Loading