2
2
import twopoint5d from ' ../images/twopoint5d-logo.svg?url' ;
3
3
import CloseDialogIcon from ' ./icons/CloseDialogIcon.astro' ;
4
4
import CodeIcon from ' ./icons/CodeIcon.astro' ;
5
+ import GitHubInvertocatIcon from ' ./icons/GitHubInvertocatIcon.astro' ;
5
6
import HomeIcon from ' ./icons/HomeIcon.astro' ;
6
7
---
7
8
@@ -10,33 +11,56 @@ import HomeIcon from './icons/HomeIcon.astro';
10
11
<header
11
12
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
13
>
13
- <a href ={ import .meta .env .BASE_URL } >
14
- <img class =" primary" src ={ twopoint5d } alt =" twopoint5d" />
15
- </a >
16
14
<a href ={ import .meta .env .BASE_URL } class =" interactive-action rotate-90" >
17
15
<HomeIcon />
18
16
</a >
17
+ <button class =" interactive-action open-show-source-dialog-action" >
18
+ <img class =" primary" src ={ twopoint5d } alt =" twopoint5d" />
19
+ </button >
19
20
<button class =" interactive-action open-show-source-dialog-action rotate-90" >
20
21
<CodeIcon />
21
22
</button >
22
23
</header >
23
24
</div >
24
25
</div >
25
26
26
- <dialog class =" show-source-dialog p-4 rounded-md backdrop-blur-sm" >
27
- <header class =" flex flex-col items-end mb-2" >
27
+ <dialog class =" show-source-dialog px-6 py-4 rounded-md backdrop-blur-sm" >
28
+ <header class =" flex flex-row items-center justify-between mb-4" >
29
+ <figure class =" flex items-center justify-start text-slate-300" >
30
+ <figcaption >a</figcaption >
31
+ <a href ={ import .meta .env .BASE_URL } >
32
+ <img class =" h-8" src ={ twopoint5d } alt =" twopoint5d" />
33
+ </a >
34
+ <figcaption >demo</figcaption >
35
+ </figure >
28
36
<button autofocus >
29
37
<CloseDialogIcon />
30
38
</button >
31
39
</header >
32
- <p class =" text-xl" >This modal dialog has a groovy backdrop!</p >
40
+ <section >
41
+ <h2 class =" text-2xl" >Explore Source Code</h2 >
42
+ <p class =" text-sm" >Want to see how it is done?</p >
43
+ <ul class =" mt-4 mb-6" >
44
+ <li class =" ring-1 ring-white rounded-md hover:bg-slate-800" >
45
+ <a class =" flex flex-row justify-center items-center text-sm py-2 gap-2" href =" " >
46
+ <GitHubInvertocatIcon class =" h-10" />
47
+ <span >Show source on GitHub</span >
48
+ </a >
49
+ </li >
50
+ </ul >
51
+ <a class =" block mb-1 text-xs text-center text-slate-400 underline" href =" https://github.com/spearwolf/twopoint5d"
52
+ >Just take me to the project repository</a
53
+ >
54
+ <a class =" block mb-1 text-xs text-center text-slate-400 underline" href ={ import .meta .env .BASE_URL } >Explore LookBook</a >
55
+ </section >
33
56
</dialog >
34
57
35
58
<style >
36
59
.show-source-dialog {
60
+ min-width: 320px;
37
61
background-color: rgba(18 22 25 / 75%);
38
62
color: #fff;
39
- outline: 1px solid #ffe ;
63
+ outline: 1px solid #e5e500 ;
40
64
box-shadow: 0 0 2px 3px rgba(0 0 0 / 20%);
41
65
}
42
66
@@ -51,6 +75,7 @@ import HomeIcon from './icons/HomeIcon.astro';
51
75
rgba(0, 35, 97, 0.66) 86%,
52
76
rgba(0, 2, 102, 0.66) 100%
53
77
);
78
+ backdrop-filter: blur(2px);
54
79
}
55
80
56
81
.container {
@@ -67,8 +92,6 @@ import HomeIcon from './icons/HomeIcon.astro';
67
92
68
93
.demo-navbar img.primary {
69
94
max-height: 32px;
70
- margin-left: 0.75rem;
71
- margin-right: 0.75rem;
72
95
}
73
96
74
97
.interactive-action:hover {
@@ -85,11 +108,13 @@ import HomeIcon from './icons/HomeIcon.astro';
85
108
<script >
86
109
const dialog = document.querySelector('dialog.show-source-dialog') as HTMLDialogElement;
87
110
const closeButton = dialog.querySelector('button');
88
- const showButton = document.querySelector ('button.open-show-source-dialog-action');
111
+ const showButtons = document.querySelectorAll ('button.open-show-source-dialog-action');
89
112
90
- showButton.addEventListener('click', () => {
91
- dialog.showModal();
92
- });
113
+ for (const showButton of showButtons) {
114
+ showButton.addEventListener('click', () => {
115
+ dialog.showModal();
116
+ });
117
+ }
93
118
94
119
closeButton.addEventListener('click', () => {
95
120
dialog.close();
0 commit comments