-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add header and background image * Add footer and change the primary color * Refactor UI
- Loading branch information
1 parent
c113203
commit c5d1a9b
Showing
13 changed files
with
148 additions
and
21 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import Image from 'next/image' | ||
import clsx from 'clsx' | ||
|
||
import backgroundImage from '@/images/background.jpg' | ||
|
||
export function BackgroundImage({ | ||
className, | ||
position = 'left', | ||
}: { | ||
className?: string | ||
position?: 'left' | 'right' | ||
}) { | ||
return ( | ||
<div | ||
className={clsx( | ||
'absolute inset-0 overflow-hidden bg-indigo-50', | ||
className | ||
)} | ||
> | ||
<Image | ||
className={clsx( | ||
'absolute top-0', | ||
position === 'left' && | ||
'left-0 translate-x-[-55%] translate-y-[-10%] -scale-x-100 sm:left-1/2 sm:translate-x-[-98%] sm:translate-y-[-6%] lg:translate-x-[-106%] xl:translate-x-[-122%]', | ||
position === 'right' && | ||
'left-full -translate-x-1/2 sm:left-1/2 sm:translate-x-[-20%] sm:translate-y-[-15%] md:translate-x-0 lg:translate-x-[5%] lg:translate-y-[4%] xl:translate-x-[27%] xl:translate-y-[-8%]' | ||
)} | ||
src={backgroundImage} | ||
alt='' | ||
width={918} | ||
height={1495} | ||
priority | ||
unoptimized | ||
/> | ||
<div className='absolute inset-x-0 top-0 h-40 bg-gradient-to-b from-white' /> | ||
<div className='absolute inset-x-0 bottom-0 h-40 bg-gradient-to-t from-white' /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export function Footer() { | ||
return ( | ||
<footer className='flex-none bg-white py-2'> | ||
<div className='flex items-center justify-end'> | ||
<p className='z-40 mr-4 text-base text-gray-light'> | ||
Copyright © {new Date().getFullYear()} Andreas Bauer. All rights | ||
reserved. | ||
</p> | ||
</div> | ||
</footer> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import Image from 'next/image' | ||
import { ArrowRightIcon } from '@heroicons/react/24/outline' | ||
import logo from '@/images/robot-logo128.png' | ||
|
||
export function Header() { | ||
return ( | ||
<header className='relative z-50 flex-none pt-4'> | ||
<div className='mx-auto flex max-w-7xl items-center justify-center px-8'> | ||
<div className='hidden grow basis-0 sm:flex'> | ||
<Image src={logo} alt='logo' width={64} height={64} unoptimized /> | ||
</div> | ||
|
||
<div className='mx-auto flex items-center border-b border-blue-600/10'> | ||
<p className='font-mono text-2xl text-blue-600'>CREDIT Maker</p> | ||
</div> | ||
|
||
<div className='hidden grow basis-0 justify-end sm:flex'> | ||
<a | ||
href='https://github.com/andreas-bauer/credit-maker' | ||
target='_blank' | ||
className='inline-flex items-center gap-x-1.5 font-medium text-blue-600 hover:underline dark:text-blue-500' | ||
> | ||
GitHub | ||
<ArrowRightIcon className='-ml-0.5 h-5 w-5' /> | ||
</a> | ||
</div> | ||
</div> | ||
</header> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react' | ||
import Link from 'next/link' | ||
import clsx from 'clsx' | ||
|
||
type ButtonProps = | ||
| React.ComponentPropsWithoutRef<typeof Link> | ||
| (React.ComponentPropsWithoutRef<'button'> & { href?: undefined }) | ||
|
||
export function PrimaryButton({ className, ...props }: ButtonProps) { | ||
className = clsx( | ||
'inline-flex justify-center items-center rounded-md bg-primary gap-x-1.5 py-2 px-3 text-sm font-semibold text-white hover:bg-primary-hover focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 active:text-white/70', | ||
className | ||
) | ||
|
||
return typeof props.href === 'undefined' ? ( | ||
<button className={className} {...props} /> | ||
) : ( | ||
<Link className={className} {...props} /> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react' | ||
import Link from 'next/link' | ||
import clsx from 'clsx' | ||
|
||
type ButtonProps = | ||
| React.ComponentPropsWithoutRef<typeof Link> | ||
| (React.ComponentPropsWithoutRef<'button'> & { href?: undefined }) | ||
|
||
export function SecondaryButton({ className, ...props }: ButtonProps) { | ||
className = clsx( | ||
'inline-flex justify-center items-center rounded-md bg-white gap-x-1.5 py-2 px-3 text-sm font-semibold text-gray-dark hover:bg-gray-100 focus:outline-none ring-1 ring-inset ring-gray-300 shadow-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500 active:text-white/70', | ||
className | ||
) | ||
|
||
return typeof props.href === 'undefined' ? ( | ||
<button className={className} {...props} /> | ||
) : ( | ||
<Link className={className} {...props} /> | ||
) | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters