-
Notifications
You must be signed in to change notification settings - Fork 2
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 #10 from rick-liruixin/feature/1.0.3.1
add type="module" add vanilla-js examples
- Loading branch information
Showing
8 changed files
with
860 additions
and
21 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 |
---|---|---|
|
@@ -8,8 +8,6 @@ pnpm-debug.log* | |
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
lib | ||
dist-ssr | ||
*.local | ||
|
||
|
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,333 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Document</title> | ||
<style> | ||
.dialog { | ||
display: none; | ||
width: 70%; | ||
height: 70%; | ||
position: fixed; | ||
top: 15%; | ||
left: 15%; | ||
overflow-y: auto; | ||
z-index: 10; | ||
color: #000; | ||
background-color: #fff; | ||
} | ||
.mask { | ||
display: none; | ||
width: 100%; | ||
height: 100%; | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
background-color: #0000005e; | ||
z-index: 9; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<button id="open">open dialog</button> | ||
<div class="dialog body-scroll-lock-ignore"> | ||
<br /> | ||
<button id="close">close dialog</button> | ||
<br /> | ||
<br /> | ||
<p class="read-the-docs"> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
</p> | ||
</div> | ||
<div class="mask"></div> | ||
|
||
<p class="read-the-docs"> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
Click on the Vite and React logos to learn more | ||
<br /> | ||
</p> | ||
|
||
<script type="module"> | ||
import { | ||
clearAllBodyScrollLocks, | ||
disableBodyScroll, | ||
enableBodyScroll, | ||
} from "../../lib/index.esm.js"; | ||
const open = () => { | ||
document.querySelector(".dialog").style.display = "block"; | ||
document.querySelector(".mask").style.display = "block"; | ||
const targetElement = document.querySelector(".dialog"); | ||
disableBodyScroll(targetElement); | ||
}; | ||
const close = () => { | ||
document.querySelector(".dialog").style.display = "none"; | ||
document.querySelector(".mask").style.display = "none"; | ||
const targetElement = document.querySelector(".dialog"); | ||
enableBodyScroll(targetElement); | ||
}; | ||
document.getElementById("open").addEventListener("click", open); | ||
document.getElementById("close").addEventListener("click", close); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.