-
Notifications
You must be signed in to change notification settings - Fork 4
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 #22 from OneBusAway/components
Couple small improvements
- Loading branch information
Showing
4 changed files
with
59 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<script> | ||
import { fly } from 'svelte/transition'; | ||
import { FontAwesomeIcon } from '@fortawesome/svelte-fontawesome'; | ||
import { faX } from '@fortawesome/free-solid-svg-icons'; | ||
import { keybinding } from '$lib/keybinding'; | ||
import { createEventDispatcher } from 'svelte'; | ||
const dispatch = createEventDispatcher(); | ||
function closePane() { | ||
dispatch('close'); | ||
} | ||
</script> | ||
|
||
<div class="modal-pane" in:fly={{ y: 200, duration: 500 }} out:fly={{ y: 200, duration: 500 }}> | ||
<div class="py-1 text-right"> | ||
<button | ||
type="button" | ||
on:click={closePane} | ||
use:keybinding={{ code: 'Escape' }} | ||
class="close-button" | ||
> | ||
<FontAwesomeIcon icon={faX} class="font-black text-black dark:text-white" /> | ||
<span class="sr-only">Close</span> | ||
</button> | ||
</div> | ||
|
||
<slot></slot> | ||
</div> | ||
|
||
<style lang="postcss"> | ||
.modal-pane { | ||
@apply absolute bottom-0 left-0 z-40 w-full bg-transparent px-2 shadow-lg md:max-w-prose; | ||
@apply rounded-lg bg-[#F3F2F8] dark:bg-black; | ||
} | ||
.close-button { | ||
@apply rounded px-4 py-2; | ||
@apply transition duration-300 ease-in-out hover:bg-neutral-200 dark:hover:bg-neutral-200/50; | ||
} | ||
</style> |
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