Compare commits

...

4 Commits

Author SHA1 Message Date
Muthu Kumar d1d76a48c5
chore(blog): specific transitions to improve perf 3 years ago
Muthu Kumar 15b271cb13
fix(blog): aside animation stuttering 3 years ago
Muthu Kumar 78c3069295
feat(blog): make everything darker 3 years ago
Muthu Kumar dc41bf4f67
chore: minor formatting 3 years ago
  1. 56
      src/pages/blog/Home.tsx
  2. 1
      src/pages/blog/components/BlogContent.tsx
  3. 35
      src/pages/main/Exp.tsx

56
src/pages/blog/Home.tsx

@ -76,7 +76,7 @@ const BlogHome: React.FC = () => {
{ "article-open": isArticleOpen, "aside-closed": isAsideClosed }, { "article-open": isArticleOpen, "aside-closed": isAsideClosed },
css` css`
display: flex; display: flex;
background: #1d1d1d; background: #1a1a1a;
height: 100%; height: 100%;
width: 100vw; width: 100vw;
overflow: hidden; overflow: hidden;
@ -100,17 +100,21 @@ const BlogHome: React.FC = () => {
} }
} }
& > aside { & > aside,
transition: all 350ms; & > aside .blog-list {
transition: transform 300ms, min-width 300ms, max-width 300ms;
} }
&:is(.aside-closed) { &:is(.aside-closed) {
aside { & aside {
overflow: hidden; overflow: hidden;
transform: translateX(-500%);
min-width: 0; min-width: 0;
max-width: 0; max-width: 0;
} }
& aside .blog-list {
transform: translateX(-1000%);
}
} }
`, `,
)}> )}>
@ -126,7 +130,7 @@ const BlogHome: React.FC = () => {
min-width: 3.6rem; min-width: 3.6rem;
max-width: 3.6rem; max-width: 3.6rem;
transition: background-color 100ms; transition: background-color 100ms;
background-color: #262626; background-color: #151515;
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -134,7 +138,7 @@ const BlogHome: React.FC = () => {
z-index: 1000; z-index: 1000;
&:hover { &:hover {
background-color: #323232; background-color: #0c0c0c;
} }
`, `,
!isArticleOpen && !isArticleOpen &&
@ -163,23 +167,25 @@ const BlogHome: React.FC = () => {
width: 100%; width: 100%;
flex: 2; flex: 2;
max-width: 45rem; max-width: 45rem;
overflow-y: auto;
`}> `}>
<div <div
className={css` className={classNames(
height: 100%; "blog-list",
width: 100%; css`
overflow-y: auto; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1rem; gap: 1rem;
padding: 8vw; padding: 8vw;
min-width: min(30rem, 100vw); min-width: min(30rem, 100vw);
@media screen and (max-width: 50rem) { @media screen and (max-width: 50rem) {
padding-block-start: 4rem; padding-block-start: 4rem;
padding-block-end: 6rem; padding-block-end: 6rem;
} }
`}> `,
)}>
<Header /> <Header />
<Spacer y={2} /> <Spacer y={2} />
{articles.map(article => { {articles.map(article => {
@ -196,10 +202,10 @@ const BlogHome: React.FC = () => {
gap: 0.25rem; gap: 0.25rem;
padding: 1rem; padding: 1rem;
border-radius: 0.5rem; border-radius: 0.5rem;
transition: all 300ms; transition: background 300ms;
&:hover { &:hover {
background: #262626; background: #111111;
} }
& h3 { & h3 {
@ -242,9 +248,9 @@ const BlogHome: React.FC = () => {
key="blog-content" key="blog-content"
className={classNames( className={classNames(
css` css`
background-color: #262626; background: #111111;
position: absolute; position: absolute;
transition: all 300ms; transition: transform 300ms;
transform: translateX(100%); transform: translateX(100%);
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;

1
src/pages/blog/components/BlogContent.tsx

@ -172,6 +172,7 @@ export const BlogPost: React.FC = () => {
className={css` className={css`
max-width: 100%; max-width: 100%;
height: 100%; height: 100%;
border-radius: 0.5rem;
`} `}
src={"/blog/assets/" + article["featured-img"]} src={"/blog/assets/" + article["featured-img"]}
alt="Featured" alt="Featured"

35
src/pages/main/Exp.tsx

@ -3,27 +3,47 @@ import { css } from "@emotion/css";
import Container from "../../components/Container"; import Container from "../../components/Container";
const exp = [ const exp = [
{ title: "BlueCube", location: "Chennai", position: "Architectural Intern", year: "2015" }, {
{ title: "Zoho", location: "Chennai", position: "Technical Content Writer", year: "2017" }, title: "BlueCube",
location: "Chennai",
position: "Architectural Intern",
year: "2015",
},
{
title: "Zoho",
location: "Chennai",
position: "Technical Content Writer",
year: "2017",
},
{ {
title: "Manoj Exports", title: "Manoj Exports",
location: "Chennai", location: "Chennai",
position: "Designer & web developer", position: "Designer & web developer",
year: "2017", year: "2017",
}, },
{ title: "Klenty", location: "Chennai", position: "Full stack developer", year: "2018" }, {
title: "Klenty",
location: "Chennai",
position: "Full stack developer",
year: "2018",
},
{ {
title: "Hugo's Way", title: "Hugo's Way",
location: "Remote", location: "Remote",
position: "Full stack developer", position: "Full stack developer",
year: "2018-19", year: "2018-19",
}, },
{ title: "Feathers Studio", location: "Chennai", position: "Founder", year: "2019-present" },
{ {
title: "Navana Tech", title: "Navana Tech",
location: "Remote", location: "Remote",
position: "Lead web dev", position: "Lead web dev / architect",
year: "2021-present", year: "2021-22",
},
{
title: "Feathers Studio",
location: "Chennai",
position: "Founder",
year: "2019-present",
}, },
]; ];
@ -90,7 +110,8 @@ const getAge = (date: string) => {
var birthDate = new Date(date); var birthDate = new Date(date);
var age = today.getFullYear() - birthDate.getFullYear(); var age = today.getFullYear() - birthDate.getFullYear();
var m = today.getMonth() - birthDate.getMonth(); var m = today.getMonth() - birthDate.getMonth();
if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) return age - 1; if (m < 0) return age - 1;
if (m === 0 && today.getDate() < birthDate.getDate()) return age - 1;
return age; return age;
}; };

Loading…
Cancel
Save