Portfoliothreejs / contact.html
simran40's picture
Upload 5 files
17e4170 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Contact Me</title>
<style>
/* --- CSS STYLES --- */
body {
margin: 0;
background-color: #0d0d0d;
font-family: 'Segoe UI', sans-serif;
color: white;
overflow-x: hidden;
}
/* 3D Canvas Background */
canvas {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
/* Navigation */
nav {
padding: 2rem 4rem;
display: flex;
justify-content: space-between;
align-items: center;
z-index: 10;
position: relative;
}
.logo { font-weight: bold; font-size: 1.5rem; letter-spacing: 2px; }
.nav-links a {
color: #aaa;
text-decoration: none;
margin-left: 20px;
transition: 0.3s;
}
.nav-links a:hover { color: #00f260; }
.active-link { color: white !important; border-bottom: 2px solid #00f260; }
/* Main Grid Layout */
.container {
display: flex;
justify-content: center;
align-items: center;
min-height: 85vh;
max-width: 1200px;
margin: 0 auto;
padding: 20px;
gap: 50px;
}
/* Left Side: Contact Info */
.contact-info {
flex: 1;
padding-right: 50px;
}
h1 { font-size: 3.5rem; margin-bottom: 10px; line-height: 1.1; }
.highlight { color: #00f260; }
.contact-details { margin-top: 40px; }
.detail-item {
display: flex;
align-items: center;
margin-bottom: 25px;
font-size: 1.1rem;
color: #ccc;
}
/* Simulated Icons */
.icon {
width: 40px;
height: 40px;
background: rgba(255,255,255,0.1);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 15px;
color: #00f260;
font-weight: bold;
}
/* Right Side: The Form */
.form-wrapper {
flex: 1;
background: rgba(255, 255, 255, 0.03);
backdrop-filter: blur(10px); /* Glass Effect */
padding: 40px;
border-radius: 20px;
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 0 40px rgba(0,0,0,0.5);
}
.input-group {
position: relative;
margin-bottom: 30px;
}
input, textarea {
width: 100%;
padding: 10px 0;
font-size: 1rem;
color: white;
border: none;
border-bottom: 1px solid #555;
outline: none;
background: transparent;
transition: 0.3s;
}
input:focus, textarea:focus {
border-bottom: 1px solid #00f260;
}
label {
position: absolute;
top: 10px;
left: 0;
color: #777;
pointer-events: none;
transition: 0.3s;
}
/* Label moves up when input has focus or text */
input:focus ~ label, input:valid ~ label,
textarea:focus ~ label, textarea:valid ~ label {
top: -20px;
font-size: 0.8rem;
color: #00f260;
}
button {
width: 100%;
padding: 15px;
background: #00f260;
border: none;
border-radius: 5px;
font-weight: bold;
font-size: 1rem;
cursor: pointer;
transition: 0.3s;
text-transform: uppercase;
letter-spacing: 1px;
}
button:hover {
background: white;
color: black;
box-shadow: 0 0 20px rgba(0, 242, 96, 0.5);
}
/* Mobile */
@media screen and (max-width: 768px) {
.container { flex-direction: column; padding-top: 50px; }
.contact-info { padding-right: 0; text-align: center; }
.detail-item { justify-content: center; }
.form-wrapper { width: 90%; }
}
</style>
</head>
<body>
<nav>
<div class="logo">PORTFOLIO</div>
<div class="nav-links">
<a href="new 1.html">Home</a>
<a href="projects.html">Projects</a>
<a href="work.html">Work</a>
<a href="about.html">About</a>
<a href="contact.html" class="active-link">Contact</a>
</div>
</nav>
<canvas id="contact-canvas"></canvas>
<div class="container">
<div class="contact-info">
<h1>Let's work <br> <span class="highlight">Together.</span></h1>
<p style="color: #888; margin-bottom: 30px;">
Have a project in mind? Looking for a developer?
Or just want to say hi? I'd love to hear from you.
</p>
<div class="contact-details">
<div class="detail-item">
<div class="icon">@</div>
<span>spreetkaur937@gmail.com</span>
</div>
<div class="detail-item">
<div class="icon">#</div>
<span>+91 7986950675</span>
</div>
<div class="detail-item">
<div class="icon">📍</div>
<span>Punjab, India</span>
</div>
</div>
</div>
<div class="form-wrapper">
<form action="https://formsubmit.co/spreetkaur0418@gmail.com" method="POST">
<input type="hidden" name="_subject" value="New Portfolio Contact!">
<input type="hidden" name="_captcha" value="false">
<input type="hidden" name="_template" value="table">
<div class="input-group">
<input type="text" name="name" required>
<label>Your Name</label>
</div>
<div class="input-group">
<input type="email" name="email" required>
<label>Your Email</label>
</div>
<div class="input-group">
<textarea name="message" rows="4" required></textarea>
<label>Your Message</label>
</div>
<button type="submit">Send Message</button>
</form>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script>
// --- 3D ROTATING GLOBE SETUP ---
const canvas = document.getElementById('contact-canvas');
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
const renderer = new THREE.WebGLRenderer({ canvas: canvas, alpha: true, antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(window.devicePixelRatio);
// 1. Create the Sphere of Particles
const geometry = new THREE.SphereGeometry(15, 64, 64);
// Convert geometry to points
const material = new THREE.PointsMaterial({
size: 0.1,
color: 0x00f260,
transparent: true,
opacity: 0.8
});
const sphere = new THREE.Points(geometry, material);
scene.add(sphere);
// 2. Add an Outer Wireframe for depth
const outerGeo = new THREE.SphereGeometry(15.2, 16, 16);
const outerMat = new THREE.MeshBasicMaterial({
color: 0xffffff,
wireframe: true,
transparent: true,
opacity: 0.05
});
const outerSphere = new THREE.Mesh(outerGeo, outerMat);
scene.add(outerSphere);
// Position the globe
sphere.position.set(0, 0, -10);
outerSphere.position.set(0, 0, -10);
camera.position.z = 20;
// Interaction
let mouseX = 0;
let mouseY = 0;
document.addEventListener('mousemove', (event) => {
mouseX = event.clientX - window.innerWidth / 2;
mouseY = event.clientY - window.innerHeight / 2;
});
// Animation Loop
const clock = new THREE.Clock();
function animate() {
const time = clock.getElapsedTime();
// Rotate Globe
sphere.rotation.y = time * 0.1;
outerSphere.rotation.y = time * 0.1;
// Mouse Interaction (Tilt)
sphere.rotation.x = mouseY * 0.0005;
sphere.rotation.y += mouseX * 0.0005;
outerSphere.rotation.x = mouseY * 0.0005;
renderer.render(scene, camera);
requestAnimationFrame(animate);
}
animate();
// Resize
window.addEventListener('resize', () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
});
</script>
</body>
</html>