From 668906dc8555ddc538ca0e1e895e49fd18e5e984 Mon Sep 17 00:00:00 2001 From: bega Date: Mon, 21 Oct 2024 10:22:46 +0800 Subject: [PATCH 1/4] made hero image more whiter --- src/assets/hero-bg.svg | 388 +++++++++++++++--------------- src/sections/hero/HeroSection.tsx | 3 +- 2 files changed, 195 insertions(+), 196 deletions(-) diff --git a/src/assets/hero-bg.svg b/src/assets/hero-bg.svg index fa9d955..a396476 100644 --- a/src/assets/hero-bg.svg +++ b/src/assets/hero-bg.svg @@ -1,4 +1,4 @@ - + @@ -7,793 +7,793 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/sections/hero/HeroSection.tsx b/src/sections/hero/HeroSection.tsx index feb3c5f..ca92605 100644 --- a/src/sections/hero/HeroSection.tsx +++ b/src/sections/hero/HeroSection.tsx @@ -8,8 +8,7 @@ const HeroSection: FC = () => { return (
From d3fa8d39e5438263a11a808eb11e01b3cd956709 Mon Sep 17 00:00:00 2001 From: bega Date: Mon, 28 Oct 2024 16:13:18 +0800 Subject: [PATCH 2/4] added env variables from github secrets --- .env | 4 ---- .github/workflows/nextjs.yml | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index 6c4c713..0000000 --- a/.env +++ /dev/null @@ -1,4 +0,0 @@ -NODE_ENV=production -NEXT_PUBLIC_EMAIL_PUBLIC_KEY=y7H4b2dj7x0qS6en7 -NEXT_PUBLIC_EMAIL_SERVICE_ID=service_kiivr3u -NEXT_PUBLIC_EMAIL_TEMPLATE_ID=template_se1r1vu \ No newline at end of file diff --git a/.github/workflows/nextjs.yml b/.github/workflows/nextjs.yml index 2ff567c..6d487c6 100644 --- a/.github/workflows/nextjs.yml +++ b/.github/workflows/nextjs.yml @@ -28,6 +28,10 @@ jobs: # Build job build: runs-on: ubuntu-latest + env: + NEXT_PUBLIC_EMAIL_PUBLIC_KEY: ${{ secrets.NEXT_PUBLIC_EMAIL_PUBLIC_KEY }} + NEXT_PUBLIC_EMAIL_SERVICE_ID: ${{ secrets.NEXT_PUBLIC_EMAIL_SERVICE_ID }} + NEXT_PUBLIC_EMAIL_TEMPLATE_ID: ${{ secrets.NEXT_PUBLIC_EMAIL_TEMPLATE_ID }} steps: - name: Checkout uses: actions/checkout@v4 From e94f32d6f60ffb19f626130406934033b042a2b1 Mon Sep 17 00:00:00 2001 From: bega Date: Tue, 29 Oct 2024 11:52:23 +0800 Subject: [PATCH 3/4] added basic protection for bots --- .gitignore | 1 + src/components/footer/index.tsx | 2 +- src/sections/form/FormSection.tsx | 35 +++++++++++++++++++++++++++++-- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index fd3dbb5..8585166 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts +.env diff --git a/src/components/footer/index.tsx b/src/components/footer/index.tsx index f6095d9..b0dd04c 100644 --- a/src/components/footer/index.tsx +++ b/src/components/footer/index.tsx @@ -12,7 +12,7 @@ const Footer = () => { }; return ( -
+
© Copyright Low-Ops. All rights Reserved diff --git a/src/sections/form/FormSection.tsx b/src/sections/form/FormSection.tsx index d45d757..518b175 100644 --- a/src/sections/form/FormSection.tsx +++ b/src/sections/form/FormSection.tsx @@ -11,7 +11,13 @@ import email from '@emailjs/browser'; import { Loader } from 'lucide-react'; import React, { ChangeEvent, FormEvent, useEffect, useState } from 'react'; -const initialData = { name: '', email: '', message: '' }; +const initialData = { + name: '', + email: '', + message: '', + username: '', + gender: '', +}; const FormSection: React.FC = () => { // States @@ -57,7 +63,15 @@ const FormSection: React.FC = () => { const serviceId = process.env.NEXT_PUBLIC_EMAIL_SERVICE_ID; const templateId = process.env.NEXT_PUBLIC_EMAIL_TEMPLATE_ID; - if (!serviceId || !templateId) return; + if (!serviceId || !templateId) { + console.log(`serviceId or templateId is undefined`); + return; + } + + if (!!data.username || !!data.gender) { + console.log('Unvisible fields are not empty'); + return; + } setLoading(true); @@ -124,6 +138,23 @@ const FormSection: React.FC = () => { />
+
+ + +
+