Skip to content

Commit 47567f9

Browse files
committed
more polishing on homepage
1 parent b3ccea9 commit 47567f9

18 files changed

+887
-785
lines changed

packages/dev-ui/src/components/layout/HeaderBar.vue

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import ThemeToggle from './ThemeToggle.vue';
2323
<style scoped>
2424
#header-bar {
2525
grid-area: header;
26-
background: black;
2726
color: white;
2827
padding: 6px 8px;
2928
background: #2a2a2a;
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,106 @@
11
---
2-
import DIcon from '@/components/DIcon.astro';
2+
import DIcon from "@/components/DIcon.astro";
3+
import TileButton from "@/components/TileButton.vue";
4+
35
interface Props {
46
text?: string;
57
href?: string;
68
command?: string;
79
}
810
911
const { text, href, command } = Astro.props as Props;
10-
1112
---
1213

1314
<div class="cta-block">
14-
{ href && text &&
15-
<a href={href} class="button">{text}</a>
16-
}
17-
{command &&
18-
<div class="install-command">
19-
<DIcon name="console" />
20-
<div>{command}</div>
21-
<DIcon name={['copy', 'check']} class="install-command__copy" />
22-
</div>
15+
{href && text && <TileButton href={href}>{text}</TileButton>}
16+
{
17+
command && (
18+
<div class="install-command">
19+
<DIcon name="console" />
20+
<div>{command}</div>
21+
<DIcon name={["copy", "check"]} class="install-command__copy" />
22+
</div>
23+
)
2324
}
2425
</div>
2526

2627
<style lang="less">
28+
@property --spin-angle {
29+
syntax: "<angle>";
30+
initial-value: 0deg;
31+
inherits: true;
32+
}
33+
@keyframes spin {
34+
0% {
35+
--spin-angle: 0deg;
36+
}
37+
100% {
38+
--spin-angle: 360deg;
39+
}
40+
}
41+
2742
.cta-block {
2843
display: flex;
2944
flex-wrap: wrap;
3045
// flex-direction: column;
3146
justify-content: center;
3247
gap: 1rem;
3348

34-
3549
@media (min-width: 50rem) {
3650
flex-direction: row;
3751
gap: 2rem;
3852
}
39-
40-
}
41-
42-
a.button {
43-
44-
@property --spin {
45-
syntax: '<angle>';
46-
initial-value: 35deg;
47-
inherits: false;
48-
}
49-
50-
background: linear-gradient(var(--spin), var(--brand-purple) 0%, var(--brand-red) 100%);
51-
color: var(--brand-white);
52-
53-
font-size: 18px;
54-
height: 48px;
55-
border-radius: 50px;
56-
padding: 0px 2rem;
57-
align-content: center;
58-
font-weight: bold;
59-
text-wrap: nowrap;
60-
text-decoration: none;
61-
text-align: center;
62-
display: flex;
63-
align-items: center;
64-
justify-content: center;
65-
;
66-
&:hover {
67-
background: linear-gradient(var(--spin), var(--brand-pink) 0%, var(--brand-pink) 100%);
68-
background: var(--brand-pink);
69-
70-
}
71-
&:hover {
72-
transform: translate3d(-2px, -2px, 0);
73-
background: var(--brand-pink);
74-
box-shadow: 2px 2px 0 var(--tile-drop-shadow);
75-
}
76-
&:focus {
77-
outline: 1px solid var(--brand-pink);
78-
}
79-
&:active {
80-
transform: translate3d(0, 0, 0);
81-
box-shadow: none;
82-
}
8353
}
84-
8554

8655
.install-command {
8756
display: flex;
8857
font-size: 18px;
8958
height: 48px;
90-
border: 2px solid var(--brand-pink);
59+
border: 1px solid var(--brand-pink);
60+
9161
align-items: center;
9262
padding-right: 64px;
9363
font-weight: bold;
9464
background: black;
9565
position: relative;
96-
html[data-theme='light'] & {
97-
background: rgba(0,0,0,.2);
98-
background: var(--brand-cyan--t2);
99-
color: black;
100-
}
101-
10266
font-family: var(--code-font);
10367
text-wrap: nowrap;
10468

105-
--border-gradient-color-1: var(--brand-green);
106-
--border-gradient-color-2: var(--brand-cyan);
107-
border: 2px solid var(--border-gradient-color-1);
108-
border-image-source: linear-gradient(90deg, var(--border-gradient-color-1), var(--border-gradient-color-2));
69+
--glow-color: var(--brand-yellow);
70+
animation: spin 5s linear infinite;
71+
html[data-theme="light"] & {
72+
// background: rgba(0, 0, 0, 0.2);
73+
background: color-mix(in oklab, var(--brand-cyan) 10%, white);
74+
color: black;
75+
--glow-color: var(--brand-cyan);
76+
}
77+
78+
border: 1px solid var(--brand-green);
79+
border-image-source: conic-gradient(
80+
from calc(var(--spin-angle) + 180deg),
81+
var(--glow-color) 0deg,
82+
var(--brand-green) 45deg,
83+
var(--brand-green) 315deg,
84+
var(--glow-color) 360deg
85+
);
10986
border-image-slice: 1;
110-
87+
88+
// glow
89+
&:before {
90+
content: "";
91+
inset: 0;
92+
position: absolute;
93+
background: red;
94+
z-index: -1;
95+
filter: blur(3px);
96+
background: conic-gradient(
97+
from var(--spin-angle),
98+
var(--glow-color) 0deg,
99+
transparent 45deg,
100+
transparent 315deg,
101+
var(--glow-color) 360deg
102+
);
103+
}
111104

112105
:global(.d-icon) {
113106
height: 44px;
@@ -119,7 +112,7 @@ const { text, href, command } = Astro.props as Props;
119112
width: 36px;
120113
padding: 8px;
121114
}
122-
115+
123116
// copy icon
124117
&:last-child {
125118
position: absolute;
@@ -134,23 +127,26 @@ const { text, href, command } = Astro.props as Props;
134127
}
135128
.install-command__copy.--success {
136129
color: var(--brand-green) !important;
137-
:global(svg:nth-child(1)) { display: none; }
138-
:global(svg:nth-child(2)) { display: block; }
130+
:global(svg:nth-child(1)) {
131+
display: none;
132+
}
133+
:global(svg:nth-child(2)) {
134+
display: block;
135+
}
139136
}
140-
141-
142137
}
143138
</style>
144139

145140
<script>
146-
document.querySelector('.install-command__copy')?.addEventListener('click', async (e) => {
147-
await navigator.clipboard.writeText('npx dmno init');
148-
if (e.target instanceof Element) {
149-
e.target.classList.add('--success');
150-
setTimeout(() => {
151-
(e.target as Element).classList.remove('--success');
152-
}, 2000);
153-
}
154-
});
141+
document
142+
.querySelector(".install-command__copy")
143+
?.addEventListener("click", async (e) => {
144+
await navigator.clipboard.writeText("npx dmno init");
145+
if (e.target instanceof Element) {
146+
e.target.classList.add("--success");
147+
setTimeout(() => {
148+
(e.target as Element).classList.remove("--success");
149+
}, 2000);
150+
}
151+
});
155152
</script>
156-

packages/docs-site/src/components/CustomStarlightHeader.astro

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const shouldRenderSearch = !isTopLevel;
4444
<span class="logo-font logo-dmno-text"> DMNO </span>
4545
</a>
4646
</div>
47-
47+
4848
<HeaderNav />
4949
<!-- {isTopLevel ?
5050
<HeaderNavMarketing
@@ -53,7 +53,7 @@ const shouldRenderSearch = !isTopLevel;
5353
<HeaderNav />
5454
} -->
5555

56-
{shouldRenderSearch ? <Search {...Astro.props} /> : <div/>}
56+
{shouldRenderSearch ? <Search {...Astro.props} /> : <div />}
5757
<div class="sl-hidden md:sl-flex right-group">
5858
<SocialIcons />
5959
<ThemeSelect client:load />
@@ -156,7 +156,7 @@ const shouldRenderSearch = !isTopLevel;
156156
}
157157

158158
.right-group {
159-
justify-content: right ;
159+
justify-content: right;
160160
}
161161
.header :global(.social-icons::after) {
162162
content: "";

0 commit comments

Comments
 (0)