mirror of
https://github.com/harivansh-afk/React-Portfolio.git
synced 2026-04-20 07:04:38 +00:00
chore: project page edits etc
This commit is contained in:
parent
7bacec764b
commit
1b599490ae
6 changed files with 248 additions and 118 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import React from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import "./style.css";
|
||||
import { Helmet, HelmetProvider } from "react-helmet-async";
|
||||
import Typewriter from "typewriter-effect";
|
||||
|
|
@ -6,6 +6,36 @@ import { introdata, meta } from "../../content_option";
|
|||
import { Link } from "react-router-dom";
|
||||
|
||||
export const Home = () => {
|
||||
const [needsScroll, setNeedsScroll] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const checkOverflow = () => {
|
||||
const body = document.body;
|
||||
const html = document.documentElement;
|
||||
const documentHeight = Math.max(
|
||||
body.scrollHeight,
|
||||
body.offsetHeight,
|
||||
html.clientHeight,
|
||||
html.scrollHeight,
|
||||
html.offsetHeight
|
||||
);
|
||||
const windowHeight = window.innerHeight;
|
||||
setNeedsScroll(documentHeight > windowHeight);
|
||||
};
|
||||
|
||||
// Initial check
|
||||
checkOverflow();
|
||||
|
||||
// Add resize listener
|
||||
window.addEventListener('resize', checkOverflow);
|
||||
|
||||
// Cleanup
|
||||
return () => window.removeEventListener('resize', checkOverflow);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
document.body.style.overflowY = needsScroll ? 'auto' : 'hidden';
|
||||
}, [needsScroll]);
|
||||
return (
|
||||
<HelmetProvider>
|
||||
<section id="home" className="home">
|
||||
|
|
|
|||
|
|
@ -34,13 +34,64 @@ section {
|
|||
height: calc(100vh - 60px);
|
||||
min-height: 700px;
|
||||
height: 100vh;
|
||||
margin-top: -60px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
/* Mobile-first responsive styles */
|
||||
@media (max-width: 991.98px) {
|
||||
.intro_sec {
|
||||
display: block;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: auto !important;
|
||||
padding: 20px 0;
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.intro_sec .text,
|
||||
.intro_sec .h_bg-image {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.intro_sec .text h1 {
|
||||
font-size: 24px;
|
||||
margin-bottom: 20px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.intro_sec .text h3 {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.intro_sec > .h_bg-image {
|
||||
min-height: 400px;
|
||||
margin-top: 10px !important;
|
||||
margin-bottom: 30px !important;
|
||||
}
|
||||
|
||||
.ac_btn {
|
||||
padding: 12px 24px;
|
||||
margin: 10px 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
/* Extra small devices (phones, 600px and down) */
|
||||
@media (max-width: 600px) {
|
||||
.intro_sec .text h1 {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.intro_sec .h_bg-image {
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.btn-portfolio,
|
||||
.btn-about {
|
||||
font-size: 14px;
|
||||
padding: 10px 20px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
.project_items_ho {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
justify-content: flex-start;
|
||||
gap: 2rem;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 0 2rem;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
.project_item {
|
||||
|
|
@ -10,16 +14,25 @@
|
|||
text-align: center;
|
||||
margin: 0.5rem;
|
||||
position: relative;
|
||||
background: var(--image-container-bg);
|
||||
padding: 6px;
|
||||
border: 1px solid var(--image-container-bg);
|
||||
transition: 0.3s ease;
|
||||
background: var(--card-bg, var(--background));
|
||||
padding: 1rem;
|
||||
border: 0.5px solid var(--card-border, var(--foreground));
|
||||
border-radius: 8px;
|
||||
outline: 3px solid var(--card-outline-color, var(--primary));
|
||||
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
||||
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
font-size: 0;
|
||||
min-height: 300px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.project_item:hover {
|
||||
transform: translateY(-2px);
|
||||
border-color: var(--card-outline-hover, var(--primary));
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
|
|
@ -50,10 +63,11 @@
|
|||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: var(--overlay-color);
|
||||
background: var(--overlay-bg, rgba(var(--background-rgb), 0.9));
|
||||
backdrop-filter: blur(4px);
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease-in-out;
|
||||
padding: 10px;
|
||||
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
padding: 1.5rem;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
|
@ -62,21 +76,29 @@
|
|||
}
|
||||
|
||||
.project_item .content p {
|
||||
color: var(--text-color);
|
||||
font-size: 1rem;
|
||||
margin-bottom: 10px;
|
||||
color: var(--foreground);
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.25rem;
|
||||
margin-bottom: 1rem;
|
||||
text-align: center;
|
||||
max-width: 90%;
|
||||
}
|
||||
|
||||
.project_item .content a {
|
||||
background: var(--bg-color);
|
||||
border: solid 1px var(--text-color);
|
||||
padding: 4px 8px;
|
||||
background: var(--button-bg, var(--background));
|
||||
border: 1px solid var(--button-border, var(--border));
|
||||
border-radius: 6px;
|
||||
padding: 0.5rem 1rem;
|
||||
text-align: center;
|
||||
font-size: 1rem;
|
||||
color: var(--text-color);
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: var(--foreground);
|
||||
text-decoration: none;
|
||||
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
.project_item .content a:hover {
|
||||
text-decoration: none;
|
||||
background: var(--button-hover-bg, var(--muted));
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue