-
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.
Merge pull request #18 from hirasso/feat/document-mirroring
feat: mirror html elements with the `:root`'s scroll position
- Loading branch information
Showing
17 changed files
with
277 additions
and
307 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 |
---|---|---|
@@ -1,6 +1,2 @@ | ||
--- | ||
--- | ||
|
||
<script> | ||
import "../js/global.js"; | ||
</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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,24 +0,0 @@ | ||
import ScrollMirror from "../../../src/index.js"; | ||
|
||
const $ = document.querySelector.bind(document); | ||
const $$ = document.querySelectorAll.bind(document); | ||
|
||
/** Vertical mirroring */ | ||
new ScrollMirror($$(".scroller.--vertical")); | ||
/** Horizontal mirroring */ | ||
new ScrollMirror($$(".scroller.--horizontal")); | ||
/** Mirroring in both directions */ | ||
new ScrollMirror($$(".scroller.--both")); | ||
|
||
/** Mirroring with the window */ | ||
new ScrollMirror([window, $<HTMLElement>(".scroller.--sidebar")]); | ||
|
||
/** | ||
* The UI for the window example | ||
*/ | ||
function windowExampleUI() { | ||
$('[data-action=toggle-sidebar]')?.addEventListener("click", () => { | ||
$('.scroller.--sidebar')?.classList.toggle('--show'); | ||
}); | ||
} | ||
windowExampleUI(); | ||
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,2 @@ | ||
export const $ = document.querySelector.bind(document); | ||
export const $$ = document.querySelectorAll.bind(document); |
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
Oops, something went wrong.