Skip to content

Commit d4f9073

Browse files
committed
feat: tweak ui
1 parent 0eb12f4 commit d4f9073

3 files changed

Lines changed: 21 additions & 16 deletions

File tree

‎packages/hub-ui-onboard/src/client/index.ts‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import type { OnboardingBranding, OnboardingStatus } from '../types'
22
import css from './.generated/css'
33
import { DEVFRAME_LOGO } from './logo'
44

5+
// @unocss-include
6+
57
/**
68
* The stand-in floating button, served at `<base>embedded.js`. It asks
79
* `__onboard/status` what to show, offers Install / Disable, and once the
@@ -74,7 +76,10 @@ function mount(initial: OnboardingStatus): void {
7476
const style = document.createElement('style')
7577
style.textContent = css
7678
const scheme = document.createElement('div')
77-
scheme.className = isDark() ? 'dark' : 'light'
79+
scheme.className = [
80+
isDark() ? 'dark' : 'light',
81+
'devframes-onboard-root',
82+
].join(' ')
7883
scheme.style.display = 'contents'
7984
root.append(style, scheme)
8085
if (initial.branding.primaryColor)
@@ -90,7 +95,7 @@ function mount(initial: OnboardingStatus): void {
9095
pill.setAttribute('aria-expanded', 'false')
9196
const glow = document.createElement('span')
9297
glow.className = 'devframes-onboard-glow'
93-
pill.append(glow, mark(branding, 'w-4 h-4'))
98+
pill.append(mark(branding, 'w-3 h-3'))
9499

95100
const panel = document.createElement('div')
96101
panel.className = 'devframes-onboard-panel'
@@ -116,20 +121,20 @@ function mount(initial: OnboardingStatus): void {
116121
note.hidden = true
117122

118123
const install = button('btn-primary text-sm justify-center', messages.install, () => void startInstall())
119-
const hide = button('btn-text text-sm color-muted', messages.hide, () => {
124+
const hide = button('btn-action justify-center text-sm color-muted', messages.hide, () => {
120125
sessionStorage.setItem(HIDDEN_KEY, '1')
121126
host.remove()
122127
})
123-
const disable = button('btn-text text-sm color-muted', messages.disable, () => void disableDevtools())
128+
const disable = button('btn-action justify-center text-sm color-muted', messages.disable, () => void disableDevtools())
124129
const secondary = document.createElement('div')
125-
secondary.className = 'flex items-center gap-1 -ml-2'
130+
secondary.className = 'grid grid-cols-2 gap-1'
126131
secondary.append(hide, disable)
127132
const actions = document.createElement('div')
128-
actions.className = 'flex flex-col gap-1'
129-
actions.append(install, secondary)
133+
actions.className = 'flex flex-col gap-2'
134+
actions.append(secondary, install)
130135

131136
panel.append(heading, description, command, note, actions)
132-
scheme.append(pill, panel)
137+
scheme.append(glow, pill, panel)
133138

134139
let open = false
135140
const setOpen = (value: boolean) => {

‎packages/hub-ui-onboard/src/client/style.css‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
* page. Class names are prefixed anyway so the generated stylesheet reads
44
* clearly next to the utilities.
55
*/
6+
.devframes-onboard-root:hover .devframes-onboard-glow {
7+
--uno: opacity-60;
8+
}
9+
610
.devframes-onboard-pill {
7-
--uno: fixed bottom-4 left-4 z-floating-anchor w-8 h-8 rounded-full border border-base bg-dock-glass shadow;
11+
--uno: fixed bottom-4 left-4 z-floating-anchor w-6 h-6 rounded-full border border-base bg-dock-glass shadow;
812
--uno: flex items-center justify-center cursor-pointer select-none p-0 outline-none;
913
--uno: op25 hover:op100 focus-visible:op100 focus-visible:ring-2 ring-primary-400;
1014
--uno: transition-all duration-200 hover:scale-105;
@@ -16,7 +20,7 @@
1620
}
1721

1822
.devframes-onboard-glow {
19-
--uno: absolute left-1/2 top-1/2 w-40 h-40 rounded-full opacity-0 pointer-events-none -z-1;
23+
--uno: absolute left--4 bottom--26 w-40 h-40 rounded-full opacity-0 pointer-events-none -z-1;
2024
--uno: transition-opacity duration-1000 ease-out;
2125
transform: translate(-50%, -50%);
2226
filter: blur(60px);
@@ -29,12 +33,8 @@
2933
);
3034
}
3135

32-
.devframes-onboard-pill:hover .devframes-onboard-glow {
33-
--uno: opacity-60;
34-
}
35-
3636
.devframes-onboard-panel {
37-
--uno: fixed bottom-16 left-4 z-floating-anchor w-80 max-w-[calc(100vw-2rem)] rounded-lg border border-base bg-base color-base shadow-lg;
37+
--uno: fixed bottom-12 left-4 z-floating-anchor w-80 max-w-[calc(100vw-2rem)] rounded-lg border border-base bg-base color-base shadow-lg;
3838
--uno: p-4 flex flex-col gap-3 font-sans text-sm leading-normal;
3939
--uno: transition-all duration-200 origin-bottom-left;
4040
}

‎packages/hub-ui-onboard/src/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function clientFile(): string {
3636
function defaultMessages(productName: string): OnboardingMessages {
3737
return {
3838
title: productName,
39-
description: `${productName} is not installed in this project yet. Install it to open the panel.`,
39+
description: `${productName} enables development features in your project. Install it with:`,
4040
install: `Install ${productName}`,
4141
hide: 'Hide for now',
4242
disable: 'Disable entirely',

0 commit comments

Comments
 (0)