1
1
---
2
2
import twopoint5d from ' ../images/twopoint5d-logo.svg?url' ;
3
+ import CloseDialogIcon from ' ./icons/CloseDialogIcon.astro' ;
4
+ import CodeIcon from ' ./icons/CodeIcon.astro' ;
5
+ import HomeIcon from ' ./icons/HomeIcon.astro' ;
3
6
---
4
7
5
8
<div class =" absolute bottom-0 z-50 -rotate-90 origin-bottom-left transform-gpu container pointer-events-none" >
6
9
<div class =" flex justify-center" >
7
- <header class =" demo-navbar flex justify-start items-center px-1.5 lg:pe-5 lg:ps-4 h-10 backdrop-blur-sm pointer-events-auto" >
10
+ <header
11
+ class =" demo-navbar gap-2 flex justify-start items-center px-1.5 lg:pe-5 lg:ps-4 h-10 backdrop-blur-sm pointer-events-auto"
12
+ >
8
13
<a href ={ import .meta .env .BASE_URL } >
9
14
<img class =" primary" src ={ twopoint5d } alt =" twopoint5d" />
10
15
</a >
16
+ <a href ={ import .meta .env .BASE_URL } class =" interactive-action rotate-90" >
17
+ <HomeIcon />
18
+ </a >
19
+ <button class =" interactive-action open-show-source-dialog-action rotate-90" >
20
+ <CodeIcon />
21
+ </button >
11
22
</header >
12
23
</div >
13
24
</div >
14
25
26
+ <dialog class =" show-source-dialog p-4 rounded-md backdrop-blur-sm" >
27
+ <header class =" flex flex-col items-end mb-2" >
28
+ <button autofocus >
29
+ <CloseDialogIcon />
30
+ </button >
31
+ </header >
32
+ <p class =" text-xl" >This modal dialog has a groovy backdrop!</p >
33
+ </dialog >
34
+
15
35
<style >
36
+ .show-source-dialog {
37
+ background-color: rgba(18 22 25 / 75%);
38
+ color: #fff;
39
+ outline: 1px solid #ffe;
40
+ box-shadow: 0 0 2px 3px rgba(0 0 0 / 20%);
41
+ }
42
+
43
+ .show-source-dialog::backdrop {
44
+ background: rgb(187, 0, 51);
45
+ background: linear-gradient(
46
+ 22deg,
47
+ rgba(187, 0, 51, 0.66) 0%,
48
+ rgba(143, 0, 132, 0.66) 13%,
49
+ rgba(8, 101, 92, 0.66) 61%,
50
+ rgba(0, 96, 102, 0.66) 64%,
51
+ rgba(0, 35, 97, 0.66) 86%,
52
+ rgba(0, 2, 102, 0.66) 100%
53
+ );
54
+ }
55
+
16
56
.container {
17
57
width: 100vh;
18
58
height: 0;
@@ -22,10 +62,36 @@ import twopoint5d from '../images/twopoint5d-logo.svg?url';
22
62
.demo-navbar {
23
63
--bg-col: var(--color-demo-navbar-background, rgba(18 22 25 / 75%));
24
64
background-color: var(--bg-col);
65
+ color: #ddd;
25
66
}
26
67
27
68
.demo-navbar img.primary {
28
69
max-height: 32px;
29
70
margin-left: 0.75rem;
71
+ margin-right: 0.75rem;
72
+ }
73
+
74
+ .interactive-action:hover {
75
+ color: #fff;
76
+ background-color: #333;
77
+ border-radius: 2px;
78
+ }
79
+
80
+ .interactive-action:focus-visible {
81
+ outline: 0;
30
82
}
31
83
</style >
84
+
85
+ <script >
86
+ const dialog = document.querySelector('dialog.show-source-dialog') as HTMLDialogElement;
87
+ const closeButton = dialog.querySelector('button');
88
+ const showButton = document.querySelector('button.open-show-source-dialog-action');
89
+
90
+ showButton.addEventListener('click', () => {
91
+ dialog.showModal();
92
+ });
93
+
94
+ closeButton.addEventListener('click', () => {
95
+ dialog.close();
96
+ });
97
+ </script >
0 commit comments