|
| 1 | +import Head from 'next/head'; |
| 2 | +import Image from 'next/image'; |
| 3 | +import Link from 'next/link'; |
| 4 | +import { AiFillLinkedin } from 'react-icons/ai'; |
| 5 | +import { |
| 6 | + BsFillMoonStarsFill, |
| 7 | + BsFillSunFill, |
| 8 | + BsChevronDoubleDown, |
| 9 | +} from 'react-icons/bs'; |
| 10 | +import { useEffect, useState } from 'react'; |
| 11 | +import myself from '../public/myself.jpg'; |
| 12 | +import logo from '../public/da-logo.png'; |
| 13 | +import YearInWords from '../utils/yearInWords'; |
| 14 | +import HandleDownload from '../utils/handleDownload'; |
| 15 | +import ReactFlagsSelect from 'react-flags-select'; |
| 16 | + |
| 17 | +export default function Home(props) { |
| 18 | + const [darkMode, setDarkMode] = useState(true); |
| 19 | + useEffect(() => setDarkMode(true), []); |
| 20 | + const icon = darkMode ? <BsFillSunFill /> : <BsFillMoonStarsFill />; |
| 21 | + |
| 22 | + const handleChangeLanguage = (countryCode) => { |
| 23 | + const locale = Object.keys(props.countryCodes).find( |
| 24 | + (key) => props.countryCodes[key] === countryCode |
| 25 | + ); |
| 26 | + props.push('/', undefined, { locale }); |
| 27 | + }; |
| 28 | + |
| 29 | + const translation = props.translation[props.locale]; |
| 30 | + |
| 31 | + return ( |
| 32 | + <div className={`flex flex-col min-h-screen ${darkMode ? 'dark' : ''}`}> |
| 33 | + <Head> |
| 34 | + <title>Diego Arndt Portfolio</title> |
| 35 | + <meta name='description' content='Generated by create next app' /> |
| 36 | + <link rel='icon' href='/favicon.ico' /> |
| 37 | + </Head> |
| 38 | + <nav className='py-10 px-20 flex justify-between sticky top-0 z-20 bg-gray-200 dark:bg-black dark:text-white'> |
| 39 | + <a href='#' className='relative sm:h-16 sm:w-16'> |
| 40 | + <Image |
| 41 | + src={logo} |
| 42 | + alt='profile-picture' |
| 43 | + layout='fill' |
| 44 | + objectFit='cover' |
| 45 | + className='border-t-8-4 border-green-600' |
| 46 | + /> |
| 47 | + </a> |
| 48 | + <ul className='flex items-center'> |
| 49 | + <li> |
| 50 | + <ReactFlagsSelect |
| 51 | + countries={Object.values(props.countryCodes)} |
| 52 | + customLabels={props.customLabels} |
| 53 | + selected={props.countryCodes[props.locale]} |
| 54 | + onSelect={handleChangeLanguage} |
| 55 | + showSelectedLabel={false} |
| 56 | + showSecondarySelectedLabel={false} |
| 57 | + fullWidth={false} |
| 58 | + placeholder='Language' |
| 59 | + className='react-flags-select px-4 py-2' |
| 60 | + /> |
| 61 | + </li> |
| 62 | + <li> |
| 63 | + <div className='transform hover:scale-110 px-4 py-2'> |
| 64 | + <span |
| 65 | + onClick={() => setDarkMode(!darkMode)} |
| 66 | + className='cursor-pointer text-2xl hover:text-blue-600 dark:hover:text-yellow-400' |
| 67 | + > |
| 68 | + {icon} |
| 69 | + </span> |
| 70 | + </div> |
| 71 | + </li> |
| 72 | + <li> |
| 73 | + <div className='pl-4 py-2'> |
| 74 | + <a |
| 75 | + className='cursor-pointer bg-gradient-to-r from-red-600 to-orange-600 hover:from-orange-600 hover:to-red-600 text-white px-4 py-2 border-none rounded-md' |
| 76 | + onClick={HandleDownload} |
| 77 | + tooltip='Download resume' |
| 78 | + > |
| 79 | + {translation.resume} |
| 80 | + </a> |
| 81 | + </div> |
| 82 | + </li> |
| 83 | + </ul> |
| 84 | + </nav> |
| 85 | + |
| 86 | + <main className='bg-gray-200 px-10 dark:bg-black md:px-20 lg:px-20'> |
| 87 | + <section |
| 88 | + className='min-h-screen' |
| 89 | + id='landing-page' |
| 90 | + style={{ minHeight: 'calc(100vh - 9rem)' }} |
| 91 | + > |
| 92 | + <div className='text-center bg-blue-500 p-10 py-10 absolute inset-0 flex flex-col items-center justify-center'> |
| 93 | + <h2 className='relative py-3 font-bold text-4xl md:text-6xl lg:text-8xl group cursor-default mx-auto w-1/2 lg:w-1/2 max-w-lg'> |
| 94 | + <span className='relative z-10 px-3 text-orange-500 dark:text-black group-hover:text-black dark:group-hover:text-orange-500 pointer-events-none'> |
| 95 | + DIEGO ARNDT |
| 96 | + </span> |
| 97 | + <span className='absolute inset-0 w-full skew-x-12 transition duration-300 ease-in-out origin-right bg-gray-300 dark:bg-orange-500 group-hover:bg-orange-500 dark:group-hover:bg-gray-300'></span> |
| 98 | + </h2> |
| 99 | + <h3 className='text-lg py-2 dark:text-gray-300 lg:text-xl tracking-widest'> |
| 100 | + {translation.jobTitle} |
| 101 | + </h3> |
| 102 | + </div> |
| 103 | + </section> |
| 104 | + |
| 105 | + <section |
| 106 | + className='min-h-screen pt-36 bg-red-600' |
| 107 | + id='about-page' |
| 108 | + style={{ minHeight: 'calc(100vh - 9rem)' }} |
| 109 | + > |
| 110 | + <div className='mx-auto mt-20 lg:mt-16 border-2 border-orange-500 rounded-full relative overflow-hidden h-80 w-80 lg:h-96 lg:w-96'> |
| 111 | + <Image |
| 112 | + src={myself} |
| 113 | + alt='profile-picture' |
| 114 | + layout='fill' |
| 115 | + objectFit='cover' |
| 116 | + priority={true} |
| 117 | + className='border-t-8-4 border-black pointer-events-none' |
| 118 | + /> |
| 119 | + </div> |
| 120 | + <h3 className='mx-auto text-3xl py-20 lg:py-16 font-bold text-orange-500 dark:text-white max-w-2xl lg:text-4xl'> |
| 121 | + {translation.summary} |
| 122 | + </h3> |
| 123 | + <button className='text-gray-600 hover:text-gray-500 transition duration-500 transform hover:translate-y-1'> |
| 124 | + <BsChevronDoubleDown className='inline-block mr-2' /> |
| 125 | + {translation.scrollDown} |
| 126 | + </button> |
| 127 | + </section> |
| 128 | + |
| 129 | + <section |
| 130 | + className='min-h-screen bg-green-600' |
| 131 | + id='skills-page' |
| 132 | + style={{ minHeight: 'calc(100vh - 9rem)' }} |
| 133 | + > |
| 134 | + <h2>test skills</h2> |
| 135 | + </section> |
| 136 | + </main> |
| 137 | + |
| 138 | + <footer className='mt-auto border-t-2 border-orange-600 text-center py-10 text-gray-600 bg-gray-200 dark:bg-black dark:text-gray-400'> |
| 139 | + <div className='mx-auto max-w-3xl'> |
| 140 | + <blockquote className='text-lg text-gray-600 italic my-1 mx-6 pl-4 px-4 border-l-4 border-orange-500'> |
| 141 | + "{translation.quote}" – Cory House |
| 142 | + </blockquote> |
| 143 | + </div> |
| 144 | + <div className='text-5xl py-5 flex justify-center gap-16 text-gray-600 dark:text-gray-400'> |
| 145 | + <Link href='https://www.linkedin.com/in/diegoarndt/' passHref={true}> |
| 146 | + <a |
| 147 | + target='_blank' |
| 148 | + rel='noopener noreferrer' |
| 149 | + className='hover:scale-110 hover:text-blue-600' |
| 150 | + > |
| 151 | + <AiFillLinkedin /> |
| 152 | + </a> |
| 153 | + </Link> |
| 154 | + </div> |
| 155 | + <p> |
| 156 | + {translation.handcrafted} © |
| 157 | + <span> |
| 158 | + <YearInWords language={props.locale} /> |
| 159 | + </span> |
| 160 | + </p> |
| 161 | + </footer> |
| 162 | + </div> |
| 163 | + ); |
| 164 | +} |
0 commit comments