feat: add license plugin

This commit is contained in:
vben
2024-06-23 19:45:40 +08:00
parent 24aab5b4bb
commit 16ed5a05ba
16 changed files with 156 additions and 74 deletions

View File

@@ -43,6 +43,7 @@ function handleMouseenter(menu: MenuRecordRaw) {
is(theme, true),
is('rounded', rounded),
]"
class="relative"
>
<template v-for="menu in menus" :key="menu.path">
<li
@@ -66,9 +67,7 @@ function handleMouseenter(menu: MenuRecordRaw) {
--menu-item-padding-x: 0px;
--menu-item-radius: 0px;
--menu-dark-background: 0deg 0% 100% / 10%;
// --menu-light-background: 240deg 5% 96%;
position: relative;
height: calc(100% - 4px);
@include is('rounded') {

View File

@@ -8,27 +8,11 @@
--tabs-active-background: hsl(var(--primary) / 100%);
--tabs-active: hsl(var(--primary-foreground));
position: relative;
width: 100%;
height: 100%;
padding-top: 4px;
background-color: var(--tabs-background);
@include e('content') {
position: relative;
height: 32px;
overflow: hidden;
}
}
@include b('chrome-tab') {
position: absolute;
display: flex;
align-items: center;
height: 100%;
color: hsl(var(--muted-foreground));
cursor: pointer;
user-select: none;
@include is('active') {
z-index: 2;
@@ -57,7 +41,6 @@
position: absolute;
right: 0;
left: 0;
// z-index: 1;
display: flex;
align-items: center;
height: 100%;
@@ -174,59 +157,37 @@
}
@include b('chrome-tab-background') {
position: absolute;
width: 100%;
height: 100%;
padding: 0 calc(var(--tabs-gap) + 0px);
@include e('divider') {
position: absolute;
left: 0;
width: calc(100% - 14px);
height: 100%;
margin: 0 7px;
&::before {
position: absolute;
top: 20%;
right: 100%;
width: 1px;
height: 60%;
content: '';
background-color: var(--tabs-divider);
}
&::after {
position: absolute;
top: 20%;
left: calc(100% - 1px);
width: 1px;
height: 60%;
content: '';
background-color: var(--tabs-divider);
}
}
@include e('content') {
height: 100%;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
transition: background 0.15s ease;
}
@include e('before') {
position: absolute;
bottom: -1px;
left: -3px;
fill: transparent;
transition: 0.15s;
}
@include e('after') {
position: absolute;
right: -3px;
bottom: -1px;
fill: transparent;
transition: 0.15s;
}
}

View File

@@ -9,13 +9,26 @@ const { b, e } = useNamespace('chrome-tab-background');
</script>
<template>
<div :class="b()">
<div :class="e('divider')"></div>
<div :class="e('content')"></div>
<svg :class="e('before')" height="10" width="10">
<div :class="b()" class="absolute size-full">
<div
:class="e('divider')"
class="absolute left-0 h-full before:absolute before:right-[100%] before:top-[15%] before:h-[60%] before:w-[1px] before:content-[''] after:absolute after:top-[15%] after:h-[60%] after:w-[1px] after:content-['']"
></div>
<div :class="e('content')" class="h-full"></div>
<svg
:class="e('before')"
class="absolute fill-transparent"
height="10"
width="10"
>
<path d="M 0 10 A 10 10 0 0 0 10 0 L 10 10 Z" />
</svg>
<svg :class="e('after')" height="10" width="10">
<svg
:class="e('after')"
class="absolute fill-transparent"
height="10"
width="10"
>
<path d="M 0 0 A 10 10 0 0 0 10 10 L 0 10 Z" />
</svg>
</div>

View File

@@ -38,7 +38,10 @@ function handleUnPushPin() {
</script>
<template>
<div :class="[b()]">
<div
:class="[b()]"
class="absolute flex h-full cursor-pointer select-none items-center"
>
<VbenContextMenu :handler-data="tab" :menus="menus" item-class="pr-4">
<div class="h-full">
<TabBackground />

View File

@@ -83,8 +83,12 @@ function handleUnPushPin(tab: TabItem) {
</script>
<template>
<div :class="b()">
<div ref="contentRef" :class="e('content')">
<div :class="b()" class="relative size-full pt-1">
<div
ref="contentRef"
:class="e('content')"
class="relative h-8 overflow-hidden"
>
<TransitionGroup name="slide-down">
<Tab
v-for="(tab, i) in tabsView"