-
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.
Merge pull request #24 from nix6839/not-ready-modal
- Loading branch information
Showing
7 changed files
with
385 additions
and
12 deletions.
There are no files selected for viewing
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,90 @@ | ||
--- | ||
import Button from './Button.astro'; | ||
import ProcessBuilding from './svgs/ProcessBuilding.astro'; | ||
import XIcon from './svgs/icons/XIcon.astro'; | ||
interface Props { | ||
class?: string; | ||
} | ||
const { class: className } = Astro.props; | ||
--- | ||
|
||
<not-ready-dialog-button> | ||
<button | ||
type="button" | ||
data-open-button | ||
class:list={[ | ||
'block cursor-pointer border-0 bg-transparent text-start leading-[inherit]', | ||
className, | ||
]} | ||
> | ||
<slot /> | ||
</button> | ||
|
||
<dialog | ||
class="mx-auto mb-auto mt-16 max-h-none max-w-none bg-transparent backdrop:bg-backdrop" | ||
> | ||
<div class="relative rounded-lg bg-primary p-12"> | ||
<Button | ||
data-close-button | ||
aria-label="모달 닫기" | ||
class="absolute right-3 top-3" | ||
> | ||
<XIcon width="2rem" height="2rem" /> | ||
</Button> | ||
<div class="flex flex-col items-center gap-8"> | ||
<ProcessBuilding | ||
width="12.3125rem" | ||
height="11.1875rem" | ||
aria-hidden="true" | ||
class="h-auto w-full max-w-[12.3125rem] text-icon-brand" | ||
/> | ||
|
||
<p | ||
class="text-center text-[1.5rem] font-bold text-primary break-keep break-overflow-anywhere" | ||
> | ||
아직 준비되지 않은 콘텐츠입니다! | ||
</p> | ||
</div> | ||
</div> | ||
</dialog> | ||
</not-ready-dialog-button> | ||
|
||
<script> | ||
class NotReadyDialogButton extends HTMLElement { | ||
constructor() { | ||
super(); | ||
|
||
const SELF_NAME = 'NotReadyDialogButton'; | ||
|
||
const dialogEl = this.querySelector('dialog'); | ||
if (!(dialogEl instanceof HTMLDialogElement)) { | ||
throw new Error(`Can not find dialogEl in ${SELF_NAME}`); | ||
} | ||
dialogEl.addEventListener('click', (e) => { | ||
if (e.target === e.currentTarget) { | ||
dialogEl.close(); | ||
} | ||
}); | ||
|
||
const openButtonEl = this.querySelector('button[data-open-button]'); | ||
if (!(openButtonEl instanceof HTMLButtonElement)) { | ||
throw new Error(`Can not find openButtonEl in ${SELF_NAME}`); | ||
} | ||
openButtonEl.addEventListener('click', () => { | ||
dialogEl.showModal(); | ||
}); | ||
|
||
const closeButtonEl = this.querySelector('button[data-close-button]'); | ||
if (!(closeButtonEl instanceof HTMLButtonElement)) { | ||
throw new Error(`Can not find closeButtonEl in ${SELF_NAME}`); | ||
} | ||
closeButtonEl.addEventListener('click', () => { | ||
dialogEl.close(); | ||
}); | ||
} | ||
} | ||
|
||
customElements.define('not-ready-dialog-button', NotReadyDialogButton); | ||
</script> |
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
--- | ||
import EnvelopeSimpleIcon from '../../svgs/icons/EnvelopeSimpleIcon.astro'; | ||
import GitHubIcon from '../../svgs/icons/GitHubIcon.astro'; | ||
import PencilSimpleLineIcon from '../../svgs/icons/PencilSimpleLineIcon.astro'; | ||
import type { IconProps } from '../../svgs/types.js'; | ||
|
@@ -28,11 +27,12 @@ const contacts: Contact[] = [ | |
name: 'Email', | ||
href: 'mailto:[email protected]', | ||
}, | ||
{ | ||
icon: PencilSimpleLineIcon, | ||
name: 'Blog', | ||
href: 'https://blog.yeongwoo.dev', | ||
}, | ||
// TODO: Uncomment | ||
// { | ||
// icon: PencilSimpleLineIcon, | ||
// name: 'Blog', | ||
// href: 'https://blog.yeongwoo.dev', | ||
// }, | ||
]; | ||
--- | ||
|
||
|
Oops, something went wrong.