-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdev.html
More file actions
102 lines (92 loc) · 3.58 KB
/
dev.html
File metadata and controls
102 lines (92 loc) · 3.58 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!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 type="importmap">
{
"imports": {
"react": "https://esm.sh/react@19?dev",
"react-dom": "https://esm.sh/react-dom@19?dev",
"react-dom/client": "https://esm.sh/react-dom@19/client?dev"
}
}
</script>
<script type="module">
import React from "react";
window.React = React;
import ReactDOM from "react-dom";
window.ReactDOM = ReactDOM;
import { createRoot } from "react-dom/client";
window.createRoot = createRoot;
import { ReactDialog } from "./tmp/index.dev.js";
window.ReactDialog = ReactDialog;
</script>
<link rel="stylesheet" href="https://unpkg.com/bootstrap@5/dist/css/bootstrap.css">
<style>
.btn-primary {
color: #fff;
background-color: #ea357a !important;
border: 1px solid #ea357a !important;
padding: 0.35rem 1.2rem !important;
box-shadow: none;
outline: none;
}
.btn-primary:hover {
background-color: #db3071 !important;
}
</style>
</head>
<body style="background-color: #FAFAFA;">
<div class="container py-4">
<div class="py-2 pb-3 text-center">
<a href="https://depay.com" target="_blank">
<img alt="DePay" class="navbar-logo shadow-sm" src="https://depay.com/logo.svg" style="height: 50px; width: 50px; border-radius: 999px;"/>
</a>
</div>
<div class="row px-2">
<div class="d-block d-md-inline-block p-2 col-12 col-md-4 m-auto text-center">
<div class="px-0 py-4 rounded-lg bg-white border">
<div class="col px-0">
<div class="overflow-auto" style="height: 140px;">
<h5 class="px-4">Dialog</h5>
<div class="px-4">
<div class="text-secondary ">Click to open a dialog.</div>
</div>
</div>
<div class="px-4 pt-3">
<button class='btn btn-primary' onClick='openDialog(true)'>Try it</button>
<button class='btn btn-primary' onClick='openDialog(false)'>Try it (without animation)</button>
<script>
let root
var renderDialog = function(open, animate) {
if (typeof root == 'undefined') { root = createRoot(document.getElementById('dialog')) }
const time = new Date().getTime()
root.render(
React.createElement(
ReactDialog,
{ close: closeDialog, open: open, animate, background: 'rgba(230,230,230,0.8)' },
React.createElement('div', { style: { background: 'white', padding: '10px' }, className: 'ReactDialogAnimation' },
React.createElement('h1', {}, `I am a dialog! ${ time }`)
)
)
)
}
window.closeDialog = function(animate = true){
renderDialog(false, animate);
}
window.openDialog = function(animate = true){
renderDialog(true, animate);
}
</script>
</div>
</div>
</div>
</div>
<div id="dialog"/>
</div>
</div>
</body>
</html>