-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved search bar to header and made toggle (#8)
* moved search bar to header and made toggle * search modal moved to another file
- Loading branch information
1 parent
38a98d3
commit a48a37b
Showing
7 changed files
with
200 additions
and
56 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
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,62 @@ | ||
<script lang="ts"> | ||
import { createEventDispatcher } from 'svelte' | ||
import PageFindSearch from './PageFindSearch.svelte' | ||
const dispatch = createEventDispatcher() | ||
function closeModal() { | ||
// Reset the search query parameter | ||
const url = new URL(window.location.href) | ||
url.searchParams.delete('q') | ||
history.pushState(null, '', url) | ||
dispatch('close') | ||
} | ||
</script> | ||
|
||
<div class="modal-backdrop" on:click={closeModal}> | ||
<div class="modal-content" on:click|stopPropagation> | ||
<PageFindSearch /> | ||
</div> | ||
</div> | ||
|
||
<style> | ||
.modal-backdrop { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-color: var(--surface-3); | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
z-index: var(--layer-important); | ||
} | ||
.modal-content { | ||
background-color: var(--surface-1); | ||
color: var(--text-1); | ||
padding: var(--size-5); | ||
border-radius: var(--radius-3); | ||
max-width: 90%; | ||
max-height: 90%; | ||
overflow-y: auto; | ||
position: relative; | ||
box-shadow: var(--shadow-3); | ||
} | ||
/* .modal-content.dark { | ||
background-color: var(--surface-2); | ||
} */ | ||
/* @media (prefers-color-scheme: dark) { | ||
.modal-backdrop { | ||
background-color: var(--surface-3); | ||
} | ||
.modal-content { | ||
background-color: var(--surface-2); | ||
} | ||
} */ | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import PageFindSearch from './PageFindSearch.svelte' | ||
import SearchModal from './SearchModal.svelte' | ||
|
||
export { PageFindSearch } | ||
export { SearchModal, PageFindSearch } |
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