Skip to content

Commit

Permalink
fix bug, fix performance issue, improve SEO, delete tailwindcss and i…
Browse files Browse the repository at this point in the history
…ts dependency
  • Loading branch information
retr00exe committed Jan 27, 2021
1 parent 9d3f905 commit 91aff31
Show file tree
Hide file tree
Showing 16 changed files with 269 additions and 536 deletions.
55 changes: 32 additions & 23 deletions components/About.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,43 @@ class AboutContent extends Component {
render() {
return (
<AboutWrapper>
<Terminal
color="white"
backgroundColor="#172A45"
barColor="black"
style={{ width: '800px', fontSize: '1em' }}
commands={{
about: this.about,
education: this.education,
skills: this.skills,
contact: this.contact,
}}
description={{
about: 'about Me',
education: 'my Education',
skills: 'my Skills',
contact: 'get in touch with me ;)',
}}
msg="Welcome to about page - Type 'help' for a list of supported commands :)"
/>
<div class="container">
<Terminal
color="white"
backgroundColor="#172A45"
barColor="black"
style={{ maxWidth: '800px', fontSize: '1em' }}
commands={{
about: this.about,
education: this.education,
skills: this.skills,
contact: this.contact,
}}
descriptions={{
about: 'about Me',
education: 'my Education',
skills: 'my Skills',
contact: 'get in touch with me ;)',
}}
msg="Welcome to about page - Type 'help' for a list of supported commands :)"
/>
</div>
</AboutWrapper>
);
}
}

const AboutWrapper = styled.div.attrs({
className: 'mx-auto py-20 lg:flex lg:flex-col lg:h-auto',
})`
width: 800px;
const AboutWrapper = styled.div`
background-color: rgba(243, 244, 246, 1);
.container {
margin: 0 auto;
padding: 5rem 0;
}
@media (min-width: 1024px) {
height: auto;
display: flex;
flex-direction: column;
}
`;

export default AboutContent;
122 changes: 93 additions & 29 deletions components/Cards.tsx
Original file line number Diff line number Diff line change
@@ -1,44 +1,108 @@
import Image from 'next/image';
import styled from 'styled-components';
import { sliceText } from '../utils/card';

const Cards = ({ post }) => {
console.log(post);
return (
<div className="px-8 py-4">
<div className="mx-auto lg:w-3/5 lg:flex lg:flex-row lg:h-auto shadow-sm">
<img
<CardWrapper>
<div className="card-container">
<Image
src={post.cover.url}
alt=""
className="rounded-tr-md rounded-tl-md h-48 w-full lg:h-auto lg:w-2/5 lg:rounded-bl-md lg:rounded-tr-none"
style={{ objectFit: 'cover' }}
alt="Hello"
width={500}
height={400}
className="cover-image"
/>
<div className="bg-white p-6 rounded-bl-md rounded-br-md flex flex-col justify-between lg:rounded-bl-none lg:rounded-tr-md">
<div>
<h2 className="text-gray-700 font-semibold text-xl">
{post.title}
</h2>
<p className="text-sm text-gray-600 mt-4">
{sliceText(post.content, 120)}
</p>
<div className="card-content">
<div className="content-header">
<h2>{post.title}</h2>
<p>{sliceText(post.content, 120)}</p>
</div>
<div className="flex items-center mt-4">
<div className="flex items-center">
<img
src="https://avatars.githubusercontent.com/u/55347344?s=460&u=f5b39bf3ba4461a448a4ea15d6bd28fc6b7b4337&v=4"
alt=""
className="h-10 w-10 rounded-full"
/>
<div className="ml-4">
<p className="text-gray-800 text-sm font-semibold">
Mekel Ilyasa
</p>
<p className="text-gray-600 text-sm">28 Jun 2020</p>
</div>
<div className="content-footer">
<Image
src="https://avatars.githubusercontent.com/u/55347344?s=460&u=f5b39bf3ba4461a448a4ea15d6bd28fc6b7b4337&v=4"
alt=""
width={50}
height={50}
className="profile-image"
/>
<div className="content-profile">
<p id="author">Mekel Ilyasa</p>
<p id="date">28 Jun 2020</p>
</div>
</div>
</div>
</div>
</div>
</CardWrapper>
);
};

const CardWrapper = styled.div`
padding: 1rem 2rem;
.card-container {
margin: 0 auto;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06);
border-radius: 0.75rem;
@media (min-width: 1024px) {
width: 60%;
height: auto;
display: flex;
flex-direction: row;
}
.cover-image {
object-fit: cover;
border-radius: 0.75rem 0 0 0.75rem;
}
.card-content {
background: #fff;
padding: 1.5rem;
display: flex;
flex-direction: column;
justify-content: space-between;
border-radius: 0 0.75rem 0.75rem 0;
@media (min-width: 1024px) {
border-radius: 0 0.75rem 0.75rem 0;
}
.content-header {
h2 {
color: rgba(55, 65, 81, 1);
font-weight: 600;
font-size: 1.25rem;
line-height: 1.75rem;
}
p {
margin-top: 1rem;
color: rgba(75, 85, 99, 1);
font-size: 0.875rem;
line-height: 1.25rem;
}
}
.content-footer {
display: flex;
align-items: center;
.profile-image {
border-radius: 999px;
}
.content-profile {
margin-left: 1rem;
#author {
color: rgba(31, 41, 55, 1);
font-size: 0.875rem;
line-height: 1.25rem;
font-weight: 600;
margin: 0;
}
#date {
color: rgba(75, 85, 99, 1);
font-size: 0.875rem;
line-height: 1.25rem;
margin: 0;
}
}
}
}
}
`;

export default Cards;
20 changes: 17 additions & 3 deletions components/Contact.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
import styled from 'styled-components';

const Contact = () => {
return (
<div className="py-16 bg-gray-100">
<h1>Hello</h1>
</div>
<ContactWrapper>
<div className="container">
<h1>Contact</h1>
</div>
</ContactWrapper>
);
};

const ContactWrapper = styled.div`
padding: 4rem 0;
background-color: rgba(243, 244, 246, 1);
.container {
width: 800px;
margin: 0 auto;
padding: 5rem 0;
}
`;

export default Contact;
25 changes: 10 additions & 15 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@ import styled from 'styled-components';
const Footer = () => {
return (
<FooterWrapper>
<div className="footer-container">
<p>
Made with ❤️ using{' '}
<a href="https://nextjs.org/" target="_blank">
Next.js
</a>{' '}
&{' '}
<a href="https://strapi.io/" target="_blank">
Strapi
</a>
</p>
</div>
<p>
Made with ❤️ using{' '}
<a href="https://nextjs.org/" target="_blank" rel="noopener">
Next.js
</a>{' '}
&{' '}
<a href="https://strapi.io/" target="_blank" rel="noopener">
Strapi
</a>
</p>
</FooterWrapper>
);
};
Expand All @@ -28,9 +26,6 @@ const FooterWrapper = styled.footer`
font-size: 0.75rem;
text-align: center;
background-color: #fff;
.footer-container {
padding: 0.5rem;
}
p {
a {
text-decoration: underline;
Expand Down
39 changes: 23 additions & 16 deletions components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import styled from 'styled-components';
const Navbar = () => {
return (
<NavbarItems>
<div className="flex mx-auto justify-between lg:w-3/5 lg:mx-auto">
<div className="nav-container">
<div className="nav-logo">
<Link href="/">
<a>MKL.</a>
</Link>
</div>
<div className="nav-links">
<div>
<div className="nav-link">
<Link href="/">
<a>Home</a>
Expand Down Expand Up @@ -41,6 +41,16 @@ const NavbarItems = styled.nav`
background-color: #fff;
display: flex;
align-items: center;
z-index: 999;
.nav-container {
display: flex;
justify-content: space-between;
margin: 0 auto;
@media (min-width: 1024px) {
width: 60%;
}
}
.nav-logo {
display: flex;
Expand All @@ -58,20 +68,17 @@ const NavbarItems = styled.nav`
}
}
.nav-links {
display: flex;
.nav-link {
display: inline-block;
font-size: 0.9rem;
padding: 1rem;
font-weight: 400;
&:nth-child(1) {
color: magenta;
font-weight: 600;
}
&:hover {
color: magenta;
}
.nav-link {
display: inline-block;
font-size: 0.9rem;
padding: 1rem;
font-weight: 400;
&:nth-child(1) {
color: #673ab7;
font-weight: 600;
}
&:hover {
color: #673ab7;
}
}
`;
Expand Down
5 changes: 5 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
images: {
domains: ['res.cloudinary.com', 'avatars.githubusercontent.com'],
},
};
Loading

1 comment on commit 91aff31

@vercel
Copy link

@vercel vercel bot commented on 91aff31 Jan 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.