Skip to content

Commit

Permalink
dark mode 🌙
Browse files Browse the repository at this point in the history
  • Loading branch information
karimhossenbux committed Mar 20, 2021
1 parent 3df44d4 commit a5a5b02
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 11 deletions.
4 changes: 2 additions & 2 deletions components/About.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ const About = (props) => {
<h1 className="text-lg md:text-3xl font-extrabold tracking-tight">
{info.name}
</h1>
<h2 className="text-xs uppercase font-medium text-gray-500">
<h2 className="text-xs uppercase font-bold text-green-500">
{info.label}
</h2>
</div>

<img className="my-2 mx-4 w-16 rounded-full ring-4 ring-green-400 ring-offset-2" src={info.image} alt={`Picture of ${info.name}`} />

<div className="m-2 text-xs text-gray-600">
<div className="m-2 text-xs text-gray-500">
<div>
{info.email}
</div>
Expand Down
20 changes: 18 additions & 2 deletions components/DarkMode.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
import {useTheme} from 'next-themes'

const DarkMode = () => {

const {theme, setTheme} = useTheme()

return (
<svg class="absolute cursor-pointer top-2 right-2 w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"></path>
<svg
onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}
className="absolute cursor-pointer top-2 right-2 w-6 h-6"
fill="none" stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg">
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
fill="#fff"
d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"
></path>
</svg>
)
}
Expand Down
2 changes: 1 addition & 1 deletion components/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Title from './Title'

const Item = (props) => {
return (
<div className="mb-4 pl-4 border-l-4 border-gray-200">
<div className="mb-4 pl-4 border-l-4 border-gray-200 dark:border-gray-600">
<div className="tracking-tight flex items-baseline justify-between">
<div>
<span className="font-extrabold mr-1">{props.title}</span>
Expand Down
5 changes: 4 additions & 1 deletion components/Skills.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ const Skills = (props) => {
{item.name}
</h3>
{item.keywords.map((keyword, kindex) =>
<span className="inline-flex mr-2 text-xs font-semibold text-opacity-70 text-black border rounded border-purple-100 px-1 bg-purple-50" key={kindex}>
<span
className="inline-flex mr-2 text-xs font-semibold text-opacity-70 text-black border px-1 rounded border-purple-100 bg-purple-50 dark:border-gray-900 dark:bg-gray-600"
key={kindex}
>
{keyword}
</span>
)}
Expand Down
4 changes: 2 additions & 2 deletions data/resume.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"basics": {
"name": "Karim Hossenbux",
"label": "Developer",
"label": "Developer / semi-designer",
"image": "https://pbs.twimg.com/profile_images/841284898803470336/7MtFNRui_400x400.jpg",
"email": "[email protected]",
"phone": "+34 620 588 797",
Expand Down Expand Up @@ -31,7 +31,7 @@
"highlights": [],
"position": "Full-Stack Developer",
"startDate": "2018/03",
"summary": null,
"summary": "",
"website": "https://www.ef.com"
},
{
Expand Down
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"dependencies": {
"next": "10.0.9",
"next-themes": "^0.0.14",
"react": "17.0.1",
"react-dom": "17.0.1"
},
Expand Down
7 changes: 6 additions & 1 deletion pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { ThemeProvider } from 'next-themes'
import '../styles/globals.css'

function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
return (
<ThemeProvider attribute="class">
<Component {...pageProps} />
</ThemeProvider>
)
}

export default MyApp
2 changes: 1 addition & 1 deletion pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class MyDocument extends Document {

render() {
return (
<Html className="">
<Html>
<Head />
<body className="dark:bg-gray-900">
<Main />
Expand Down
1 change: 0 additions & 1 deletion pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { getResume } from '../utils/resume'

export default function Home() {
const resume = getResume()
console.log(resume)

return (
<div className="relative">
Expand Down

0 comments on commit a5a5b02

Please sign in to comment.