-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.html
More file actions
74 lines (69 loc) · 2.2 KB
/
dev.html
File metadata and controls
74 lines (69 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/png" href="https://depay.com/favicon.png"/>
<title>Development</title>
<script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
<script crossorigin src="https://cdn.jsdelivr.net/npm/@depay/react-dialog@14.1.1"></script>
<script src="tmp/index.demo.js"></script>
<script src="tmp/index.dev.js"></script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
}
#app {
align-items: center;
bottom: 0;
display: flex;
height: 100vh;
justify-content: center;
left: 0;
right: 0;
top: 0;
width: 100vw;
}
.Dialog {
background: white;
display: flex;
justify-content: center;
align-items: middle;
border-radius: 12px;
box-shadow: 0 0 12px rgba(0,0,0,0.4);
width: 400px;
height: 300px;
}
</style>
<script>
const setNavigator = (navigator)=>{
window.dialogNavigator = navigator
}
let root
window.updateStack = function(open, stacked) {
if(typeof root == 'undefined') { root = ReactDOM.createRoot(document.getElementById('dialog')) }
root.render(
React.createElement(window.DemoStack.DemoStack, { setNavigator, stacked, open: open, close: ()=>updateStack(false)}),
);
}
window.updateAnotherStack = function(open, stacked) {
if(typeof root == 'undefined') { root = ReactDOM.createRoot(document.getElementById('dialog')) }
root.render(
React.createElement(window.DemoStack.DemoStack2, { setNavigator, stacked, open: open, close: ()=>updateAnotherStack(false)}),
);
}
</script>
</head>
<body>
<div id="app">
<button onClick='updateStack(true)'>Open Dialog Stack</button>
</div>
<div id="dialog"/>
</body>
</html>