mirror of
https://github.com/AmanTahiliani/Portfolio.git
synced 2026-08-07 19:56:16 -04:00
Compare commits
8 Commits
contact-me
...
dark-mode-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7c331d5e9 | ||
|
|
a4925d5944 | ||
|
|
c21eda8c6b | ||
|
|
0ffd128e69 | ||
|
|
d6e5d1f184 | ||
|
|
c3df99e6c9 | ||
|
|
f3a115e610 | ||
|
|
0422ef27d2 |
45
src/App.css
45
src/App.css
@@ -1,13 +1,29 @@
|
||||
.App {
|
||||
text-align: center;
|
||||
background-color: black;
|
||||
background-color: var(--background-primary);
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
left: 0px;
|
||||
font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
|
||||
color: azure;
|
||||
overflow: hidden;
|
||||
color: var(--text-primary);
|
||||
overflow-x: hidden;
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
section {
|
||||
opacity: 0;
|
||||
transform: translateY(20px);
|
||||
transition: opacity 0.6s ease-out, transform 0.6s ease-out;
|
||||
}
|
||||
|
||||
section.visible {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.App-logo {
|
||||
@@ -22,18 +38,18 @@
|
||||
}
|
||||
|
||||
.App-header {
|
||||
background-color: black;
|
||||
background-color: var(--background-primary);
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: calc(10px + 2vmin);
|
||||
color: white;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.App-link {
|
||||
color: #61dafb;
|
||||
color: var(--accent-primary);
|
||||
}
|
||||
|
||||
@keyframes App-logo-spin {
|
||||
@@ -58,11 +74,22 @@ hr {
|
||||
width: 70%;
|
||||
margin-left: 15% !important;
|
||||
margin-right: 15% !important;
|
||||
border: 10px solid aquamarine;
|
||||
border: 10px solid var(--hr-color);
|
||||
}
|
||||
|
||||
.publications {
|
||||
margin-top: 230px;
|
||||
.publications, .Experience, .DevTools, .Contact {
|
||||
margin-top: 100px;
|
||||
padding: 40px 0;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
margin-bottom: 40px;
|
||||
transform: translateY(0);
|
||||
transition: transform 0.4s ease-out;
|
||||
}
|
||||
|
||||
section:hover .section-title {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
|
||||
.slick-dots button:before {
|
||||
|
||||
101
src/App.js
101
src/App.js
@@ -5,6 +5,9 @@ import {
|
||||
Routes,
|
||||
useLocation,
|
||||
} from "react-router-dom";
|
||||
import { ThemeProvider, useTheme } from './context/ThemeContext';
|
||||
import './css/theme.css';
|
||||
import ThemeToggle from './components/ThemeToggle';
|
||||
import { CSSTransition, TransitionGroup } from "react-transition-group";
|
||||
import "./App.css";
|
||||
import "./css/home.css";
|
||||
@@ -17,46 +20,66 @@ import DevToolsComponent from "./components/devtools";
|
||||
import SocialMedia from "./components/SocialMedia";
|
||||
|
||||
function Portfolio() {
|
||||
const { isDarkMode } = useTheme();
|
||||
|
||||
useEffect(() => {
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.classList.add('visible');
|
||||
}
|
||||
});
|
||||
}, { threshold: 0.1 });
|
||||
|
||||
document.querySelectorAll('section').forEach((section) => {
|
||||
observer.observe(section);
|
||||
});
|
||||
|
||||
return () => observer.disconnect();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="App">
|
||||
<meta name="Aman Tahiliani's Portfolio"></meta>
|
||||
<ThemeToggle />
|
||||
<nav>
|
||||
<Header />
|
||||
</nav>
|
||||
<hr></hr>
|
||||
<main>
|
||||
<section>
|
||||
<About className="About" id="About" />
|
||||
<div className="publications" id="Publications">
|
||||
<h2 style={{ color: "salmon", fontSize: "50px" }}>
|
||||
</section>
|
||||
<section className="publications" id="Publications">
|
||||
<h2 className="section-title" style={{ color: "salmon", fontSize: "50px" }}>
|
||||
<b>Publications</b>
|
||||
</h2>
|
||||
<SimpleSlider />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div className="Experience" id="Experience">
|
||||
<h2 style={{ color: "salmon", fontSize: "50px", marginTop: "110px" }}>
|
||||
<section className="Experience" id="Experience">
|
||||
<h2 className="section-title" style={{ color: "salmon", fontSize: "50px" }}>
|
||||
<b>Experience</b>
|
||||
</h2>
|
||||
<Experience />
|
||||
</div>
|
||||
<div className="DevTools" id="DevTools" style={{ marginBottom: "100px" }}>
|
||||
<h2 style={{ color: "salmon", fontSize: "50px" }}>
|
||||
</section>
|
||||
<section className="DevTools" id="DevTools">
|
||||
<h2 className="section-title" style={{ color: "salmon", fontSize: "50px" }}>
|
||||
<b>Dev Tools</b>
|
||||
</h2>
|
||||
<DevToolsComponent />
|
||||
</div>
|
||||
<hr />
|
||||
<div className="Contact" id="Contact" style={{ marginTop: "100px" }}>
|
||||
<h2 style={{ color: "cyan", fontSize: "50px" }}>
|
||||
<b>Contact Me!</b>
|
||||
</section>
|
||||
<section className="Contact" id="Contact">
|
||||
<h2 className="section-title" style={{ color: "cyan", fontSize: "50px" }}>
|
||||
<b>Social Links</b>
|
||||
</h2>
|
||||
<SocialMedia
|
||||
style={{ color: "white" }}
|
||||
useColorIcons={false}
|
||||
whiteIcons={true}
|
||||
/>
|
||||
</div>
|
||||
{/* <div className="Contact" id="Contact">
|
||||
<h2 style={{color:"salmon", fontSize:"50px", marginTop:"60px"}}><b>Contact Me!</b></h2>
|
||||
<Contact/>
|
||||
</div> */}
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -71,8 +94,11 @@ function Books() {
|
||||
}
|
||||
|
||||
function Home() {
|
||||
const { isDarkMode } = useTheme();
|
||||
|
||||
return (
|
||||
<div className="home">
|
||||
<ThemeToggle />
|
||||
<div className="content">
|
||||
<div className="intro">
|
||||
<h1>Welcome to Aman Tahiliani's Space</h1>
|
||||
@@ -82,9 +108,9 @@ function Home() {
|
||||
<li>
|
||||
<a href="/portfolio">Developer Portfolio</a>
|
||||
</li>
|
||||
<li>
|
||||
{/* <li>
|
||||
<a href="/reviews">Book, TV and Movie Reviews</a>
|
||||
</li>
|
||||
</li> */}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
@@ -92,32 +118,29 @@ function Home() {
|
||||
<div className="footer">
|
||||
<SocialMedia />
|
||||
</div>
|
||||
{/* <div className="Contact" id="Contact">
|
||||
<h2 style={{color:"salmon", fontSize:"50px", marginTop:"60px"}}><b>Contact Me!</b></h2>
|
||||
<Contact/>
|
||||
</div> */}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AnimatedRoutes() {
|
||||
const location = useLocation();
|
||||
return (
|
||||
<TransitionGroup>
|
||||
<CSSTransition key={location.key} classNames="fade" timeout={300}>
|
||||
<Routes location={location}>
|
||||
<Route path="/portfolio" element={<Portfolio />} />
|
||||
<Route path="/" element={<Portfolio />} />
|
||||
<Route path="/books" element={<Books />} />
|
||||
{/* <Route path="/" element={<Home />} /> */}
|
||||
</Routes>
|
||||
</CSSTransition>
|
||||
</TransitionGroup>
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<Router>
|
||||
<AnimatedRoutes />
|
||||
</Router>
|
||||
<ThemeProvider>
|
||||
<Router>
|
||||
<div>
|
||||
<Routes>
|
||||
<Route path="/" element={<Home />} />
|
||||
<Route path="/portfolio" element={<Portfolio />} />
|
||||
<Route path="/reviews" element={<Books />} />
|
||||
</Routes>
|
||||
</div>
|
||||
</Router>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
||||
@@ -19,7 +19,7 @@ class Header extends Component {
|
||||
<a href="#About">About</a>
|
||||
</Col>
|
||||
<Col>
|
||||
<a href="#Publications">Publications</a>
|
||||
<a href="#Experience">Experience</a>
|
||||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
@@ -28,17 +28,18 @@ class Header extends Component {
|
||||
</Col>
|
||||
<Col xs={12} md={5}>
|
||||
<Row className="navRow nonNameCol">
|
||||
<Col>
|
||||
<a href="#Experience">Experience</a>
|
||||
</Col>
|
||||
|
||||
<Col>
|
||||
<a href="#DevTools">Devtools</a>
|
||||
</Col>
|
||||
<Col>
|
||||
<a href="#Publications">Publications</a>
|
||||
</Col>
|
||||
<Col>
|
||||
<a
|
||||
href="#Contact"
|
||||
>
|
||||
Contact Me!
|
||||
Social Links
|
||||
</a>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
19
src/components/ThemeToggle.js
Normal file
19
src/components/ThemeToggle.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import React from 'react';
|
||||
import { useTheme } from '../context/ThemeContext';
|
||||
import '../css/ThemeToggle.css';
|
||||
|
||||
const ThemeToggle = () => {
|
||||
const { isDarkMode, toggleTheme } = useTheme();
|
||||
|
||||
return (
|
||||
<button
|
||||
className="theme-toggle"
|
||||
onClick={toggleTheme}
|
||||
aria-label="Toggle theme"
|
||||
>
|
||||
{isDarkMode ? '☀️' : '🌙'}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
export default ThemeToggle;
|
||||
@@ -1,70 +1,52 @@
|
||||
import React, { Component, useState } from "react";
|
||||
import React from "react";
|
||||
import "bootstrap/dist/css/bootstrap.css";
|
||||
// import { Row, Col, TabContainer } from "react-bootstrap";
|
||||
import { FaGithub, FaLinkedin, FaInstagram, FaEnvelope } from "react-icons/fa";
|
||||
import "../css/contact.css";
|
||||
|
||||
function Contact() {
|
||||
const [name, setName] = useState("");
|
||||
const [organization, setOrganization] = useState("");
|
||||
const [message, setMessage] = useState("");
|
||||
const [popup, setPopup] = useState("");
|
||||
|
||||
let handleSubmit = async (e) => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
let res = await fetch("http://localhost:8000/sendMail", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
name: name,
|
||||
organization: organization,
|
||||
message: message,
|
||||
}),
|
||||
});
|
||||
// let resJson = await res.json();
|
||||
console.log(res.status);
|
||||
if (res.status === 200) {
|
||||
setName("");
|
||||
setOrganization("");
|
||||
setMessage("");
|
||||
setPopup("Message sent successfully");
|
||||
} else {
|
||||
setPopup("Some error occured");
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<input
|
||||
type="text"
|
||||
value={name}
|
||||
placeholder="Name"
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
required="true"
|
||||
/>
|
||||
<br />
|
||||
<input
|
||||
type="text"
|
||||
value={organization}
|
||||
placeholder="Organization"
|
||||
onChange={(e) => setOrganization(e.target.value)}
|
||||
/>
|
||||
<br />
|
||||
<textarea
|
||||
className="MessageBox"
|
||||
type="textarea"
|
||||
value={message}
|
||||
placeholder="Message"
|
||||
onChange={(e) => setMessage(e.target.value)}
|
||||
required="true"
|
||||
/>
|
||||
<br />
|
||||
<button type="submit">Send!</button>
|
||||
<div className="social-links">
|
||||
<a
|
||||
href="https://github.com/yourusername"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="social-link"
|
||||
aria-label="GitHub Profile"
|
||||
>
|
||||
<FaGithub className="social-icon" />
|
||||
<span className="social-text">GitHub</span>
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="https://linkedin.com/in/yourusername"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="social-link"
|
||||
aria-label="LinkedIn Profile"
|
||||
>
|
||||
<FaLinkedin className="social-icon" />
|
||||
<span className="social-text">LinkedIn</span>
|
||||
</a>
|
||||
|
||||
<div className="popup">{popup ? <p>{popup}</p> : null}</div>
|
||||
</form>
|
||||
<a
|
||||
href="https://instagram.com/yourusername"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="social-link"
|
||||
aria-label="Instagram Profile"
|
||||
>
|
||||
<FaInstagram className="social-icon" />
|
||||
<span className="social-text">Instagram</span>
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="mailto:your.email@example.com"
|
||||
className="social-link"
|
||||
aria-label="Email Contact"
|
||||
>
|
||||
<FaEnvelope className="social-icon" />
|
||||
<span className="social-text">Email</span>
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
26
src/context/ThemeContext.js
Normal file
26
src/context/ThemeContext.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import React, { createContext, useState, useContext } from 'react';
|
||||
|
||||
const ThemeContext = createContext();
|
||||
|
||||
export const ThemeProvider = ({ children }) => {
|
||||
const [isDarkMode, setIsDarkMode] = useState(true);
|
||||
|
||||
const toggleTheme = () => {
|
||||
setIsDarkMode(!isDarkMode);
|
||||
document.documentElement.setAttribute('data-theme', !isDarkMode ? 'dark' : 'light');
|
||||
};
|
||||
|
||||
return (
|
||||
<ThemeContext.Provider value={{ isDarkMode, toggleTheme }}>
|
||||
{children}
|
||||
</ThemeContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export const useTheme = () => {
|
||||
const context = useContext(ThemeContext);
|
||||
if (context === undefined) {
|
||||
throw new Error('useTheme must be used within a ThemeProvider');
|
||||
}
|
||||
return context;
|
||||
};
|
||||
30
src/css/ThemeToggle.css
Normal file
30
src/css/ThemeToggle.css
Normal file
@@ -0,0 +1,30 @@
|
||||
.theme-toggle {
|
||||
position: fixed;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
z-index: 1000;
|
||||
background: none;
|
||||
border: 2px solid var(--accent-primary);
|
||||
color: var(--text-primary);
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
font-size: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.3s ease;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.theme-toggle:hover {
|
||||
transform: scale(1.1);
|
||||
background-color: var(--accent-primary);
|
||||
color: var(--background-primary);
|
||||
}
|
||||
|
||||
.theme-toggle:focus {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 2px var(--accent-secondary);
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
min-height: 100vh;
|
||||
background-color: #f0f0f0;
|
||||
background-color: var(--background-primary);
|
||||
}
|
||||
|
||||
.content {
|
||||
@@ -22,13 +22,13 @@
|
||||
|
||||
.intro h1 {
|
||||
font-size: 3em;
|
||||
color: #333;
|
||||
color: var(--text-primary);
|
||||
animation: slideIn 1s ease-in-out;
|
||||
}
|
||||
|
||||
.intro p {
|
||||
font-size: 1.5em;
|
||||
color: #666;
|
||||
color: var(--text-secondary);
|
||||
animation: slideIn 1s ease-in-out;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
.intro nav ul li a {
|
||||
text-decoration: none;
|
||||
color: #3498db;
|
||||
color: var(--link-color);
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,6 @@
|
||||
.footer {
|
||||
width: 100%;
|
||||
padding: 20px 0;
|
||||
background-color: #f0f0f0;
|
||||
background-color: var(--background-primary);
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
30
src/css/theme.css
Normal file
30
src/css/theme.css
Normal file
@@ -0,0 +1,30 @@
|
||||
:root[data-theme='light'] {
|
||||
--background-primary: #f0f0f0;
|
||||
--background-secondary: #ffffff;
|
||||
--text-primary: #333333;
|
||||
--text-secondary: #666666;
|
||||
--accent-primary: #3498db;
|
||||
--accent-secondary: #2980b9;
|
||||
--border-color: #dddddd;
|
||||
--section-title: #e74c3c;
|
||||
--link-color: #3498db;
|
||||
--hr-color: #2ecc71;
|
||||
}
|
||||
|
||||
:root[data-theme='dark'] {
|
||||
--background-primary: #000000;
|
||||
--background-secondary: #1a1a1a;
|
||||
--text-primary: #ffffff;
|
||||
--text-secondary: #cccccc;
|
||||
--accent-primary: #61dafb;
|
||||
--accent-secondary: #4fa3d1;
|
||||
--border-color: #333333;
|
||||
--section-title: #ff6b6b;
|
||||
--link-color: #61dafb;
|
||||
--hr-color: #00ffbf;
|
||||
}
|
||||
|
||||
/* Theme transition */
|
||||
* {
|
||||
transition: background-color 0.3s ease, color 0.3s ease;
|
||||
}
|
||||
Reference in New Issue
Block a user