Skip to content

Commit ce77d03

Browse files
committed
Update: Remove custom cursor and implement contact form with Google Sheets integration
1 parent ad67db0 commit ce77d03

3 files changed

Lines changed: 94 additions & 72 deletions

File tree

index.html

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
99
</head>
1010
<body>
11-
<!-- Custom Cursor -->
12-
<div class="cursor"></div>
13-
<div class="cursor-follower"></div>
14-
1511
<!-- Loading Screen -->
1612
<div class="loading-screen">
1713
<div class="counter">0%</div>
@@ -288,10 +284,10 @@ <h3>Web3 Innovation</h3>
288284
<!-- Contact Section -->
289285
<section id="contact" class="contact">
290286
<h2>Get In Touch</h2>
291-
<form id="contact-form">
292-
<input type="text" placeholder="Name" required>
293-
<input type="email" placeholder="Email" required>
294-
<textarea placeholder="Tell me about your project" required></textarea>
287+
<form id="contact-form" method="POST">
288+
<input type="text" name="name" placeholder="Name" required>
289+
<input type="email" name="email" placeholder="Email" required>
290+
<textarea name="message" placeholder="Tell me about your project" required></textarea>
295291
<button type="submit" class="submit-btn">Send Message</button>
296292
</form>
297293
</section>

script.js

Lines changed: 58 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@ const menuBtn = document.querySelector('.menu-btn');
88
const navContent = document.querySelector('.nav-content');
99
const logoText = document.querySelector('.logo-text');
1010

11+
// CTA Button click handler
12+
const ctaButton = document.querySelector('.cta-button');
13+
if (ctaButton) {
14+
ctaButton.addEventListener('click', () => {
15+
const projectsSection = document.querySelector('#projects');
16+
if (projectsSection) {
17+
const headerOffset = header.offsetHeight;
18+
const targetPosition = projectsSection.getBoundingClientRect().top + window.pageYOffset - headerOffset;
19+
20+
gsap.to(window, {
21+
duration: 1,
22+
scrollTo: targetPosition,
23+
ease: "power2.inOut"
24+
});
25+
}
26+
});
27+
}
28+
1129
// Header Scroll Effect
1230
window.addEventListener('scroll', () => {
1331
if (window.scrollY > 50) {
@@ -67,38 +85,6 @@ gsap.to(logoText, {
6785
ease: "power1.inOut"
6886
});
6987

70-
// Custom Cursor
71-
const cursor = document.querySelector('.cursor');
72-
const cursorFollower = document.querySelector('.cursor-follower');
73-
74-
document.addEventListener('mousemove', (e) => {
75-
gsap.to(cursor, {
76-
x: e.clientX,
77-
y: e.clientY,
78-
duration: 0
79-
});
80-
81-
gsap.to(cursorFollower, {
82-
x: e.clientX - 20,
83-
y: e.clientY - 20,
84-
duration: 0.1
85-
});
86-
});
87-
88-
// Hover effect on links and buttons
89-
const links = document.querySelectorAll('a, button');
90-
links.forEach(link => {
91-
link.addEventListener('mouseenter', () => {
92-
cursorFollower.style.transform = 'scale(1.5)';
93-
cursor.style.opacity = '0';
94-
});
95-
96-
link.addEventListener('mouseleave', () => {
97-
cursorFollower.style.transform = 'scale(1)';
98-
cursor.style.opacity = '1';
99-
});
100-
});
101-
10288
// Loading Animation
10389
window.addEventListener('load', () => {
10490
const counter = document.querySelector('.counter');
@@ -349,3 +335,43 @@ document.querySelector('.email-link').addEventListener('click', function(e) {
349335
// Remove tooltip after animation
350336
setTimeout(() => tooltip.remove(), 2000);
351337
});
338+
339+
// Contact Form Handler
340+
const contactForm = document.getElementById('contact-form');
341+
if (contactForm) {
342+
contactForm.addEventListener('submit', async (e) => {
343+
e.preventDefault();
344+
345+
const submitBtn = contactForm.querySelector('.submit-btn');
346+
const originalBtnText = submitBtn.textContent;
347+
submitBtn.textContent = 'Sending...';
348+
submitBtn.disabled = true;
349+
350+
try {
351+
const formData = new FormData(contactForm);
352+
const searchParams = new URLSearchParams();
353+
354+
// Convert FormData to URLSearchParams
355+
for (const [key, value] of formData) {
356+
searchParams.append(key, value);
357+
}
358+
359+
const response = await fetch('https://script.google.com/macros/s/AKfycbxRqoplK1yceUaNj3OIvEu4ynm4c37YNyCoNDBrUAn6VvKThLVVzyWG5A53L1F34Zce/exec', {
360+
method: 'POST',
361+
body: searchParams,
362+
mode: 'no-cors'
363+
});
364+
365+
// Show success message
366+
alert('Thank you! Your message has been sent successfully.');
367+
contactForm.reset();
368+
369+
} catch (error) {
370+
console.error('Error:', error);
371+
alert('Sorry, there was an error sending your message. Please try again or contact me directly via email.');
372+
} finally {
373+
submitBtn.textContent = originalBtnText;
374+
submitBtn.disabled = false;
375+
}
376+
});
377+
}

styles.css

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ body {
1010
background: #0a0a0a;
1111
color: #fff;
1212
overflow-x: hidden;
13-
cursor: none;
13+
}
14+
15+
/* Add normal cursor for interactive elements */
16+
a, button, .nav-link, .logo, .menu-btn,
17+
[role="button"], [type="button"], [type="submit"] {
18+
cursor: pointer;
1419
}
1520

1621
/* Header Styles */
@@ -196,28 +201,6 @@ body {
196201
}
197202
}
198203

199-
/* Custom Cursor */
200-
.cursor {
201-
width: 8px;
202-
height: 8px;
203-
background: #fff;
204-
border-radius: 50%;
205-
position: fixed;
206-
pointer-events: none;
207-
z-index: 9999;
208-
}
209-
210-
.cursor-follower {
211-
width: 40px;
212-
height: 40px;
213-
border: 2px solid #fff;
214-
border-radius: 50%;
215-
position: fixed;
216-
pointer-events: none;
217-
z-index: 9999;
218-
transition: transform 0.1s;
219-
}
220-
221204
/* Loading Screen */
222205
.loading-screen {
223206
position: fixed;
@@ -518,18 +501,35 @@ h2 {
518501
gap: 2rem;
519502
}
520503

521-
.cta-primary, .cta-secondary {
522-
padding: 1rem 2.5rem;
523-
border-radius: 8px;
524-
font-weight: 500;
504+
.cta-button {
505+
background: linear-gradient(45deg, #00fffc, #00a8a6);
506+
color: #fff;
507+
border: none;
508+
padding: 1rem 2rem;
525509
font-size: 1.1rem;
510+
border-radius: 30px;
511+
cursor: pointer;
512+
margin-top: 2rem;
526513
transition: all 0.3s ease;
527-
text-decoration: none;
514+
box-shadow: 0 4px 15px rgba(0, 255, 252, 0.2);
515+
position: relative;
516+
overflow: hidden;
528517
}
529518

530-
.cta-primary {
531-
background: #00fffc;
532-
color: #000;
519+
.cta-button:hover {
520+
transform: translateY(-2px);
521+
box-shadow: 0 6px 20px rgba(0, 255, 252, 0.3);
522+
}
523+
524+
.cta-button:active {
525+
transform: translateY(0);
526+
}
527+
528+
@media (max-width: 768px) {
529+
.cta-button {
530+
padding: 0.8rem 1.6rem;
531+
font-size: 1rem;
532+
}
533533
}
534534

535535
.cta-secondary {
@@ -538,7 +538,7 @@ h2 {
538538
color: #00fffc;
539539
}
540540

541-
.cta-primary:hover, .cta-secondary:hover {
541+
.cta-secondary:hover {
542542
transform: translateY(-3px);
543543
box-shadow: 0 5px 15px rgba(0, 255, 252, 0.2);
544544
}

0 commit comments

Comments
 (0)