style: 修改移入动画.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-drawer v-model:visible="visible"
|
<a-drawer v-model:visible="visible"
|
||||||
:width="368"
|
:width="388"
|
||||||
:footer="false">
|
:footer="false">
|
||||||
<!-- 表头 -->
|
<!-- 表头 -->
|
||||||
<template #title>
|
<template #title>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<div class="snippet-header-container">
|
<div class="snippet-header-container">
|
||||||
<!-- 头部操作 -->
|
<!-- 头部操作 -->
|
||||||
<div class="snippet-header">
|
<div class="snippet-header">
|
||||||
<a-button>新建</a-button>
|
<a-button @click="toggle">新建</a-button>
|
||||||
<a-button>搜索</a-button>
|
<a-button>搜索</a-button>
|
||||||
</div>
|
</div>
|
||||||
<!-- 提示 -->
|
<!-- 提示 -->
|
||||||
@@ -43,9 +43,9 @@
|
|||||||
<div>
|
<div>
|
||||||
<div v-for="item in snippet.snippets"
|
<div v-for="item in snippet.snippets"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
class="snippet-item-wrapper">
|
class="snippet-item-wrapper"
|
||||||
|
:class="[loading&&item.id===3 ? 'snippet-item-wrapper-expand' : '']">
|
||||||
<div class="snippet-item">
|
<div class="snippet-item">
|
||||||
|
|
||||||
<span class="snippet-item-title">
|
<span class="snippet-item-title">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</span>
|
</span>
|
||||||
@@ -89,8 +89,10 @@
|
|||||||
import { useTipsStore } from '@/store';
|
import { useTipsStore } from '@/store';
|
||||||
import useVisible from '@/hooks/visible';
|
import useVisible from '@/hooks/visible';
|
||||||
import { snippetTipsKey } from '../../types/terminal.const';
|
import { snippetTipsKey } from '../../types/terminal.const';
|
||||||
|
import useLoading from '@/hooks/loading';
|
||||||
|
|
||||||
const { isNotTipped, setTipped } = useTipsStore();
|
const { isNotTipped, setTipped } = useTipsStore();
|
||||||
|
const { loading, toggle } = useLoading();
|
||||||
const { visible, setVisible } = useVisible(true);
|
const { visible, setVisible } = useVisible(true);
|
||||||
const snippet = ref<SnippetGroupResponse>({
|
const snippet = ref<SnippetGroupResponse>({
|
||||||
groups: [{
|
groups: [{
|
||||||
@@ -105,27 +107,27 @@
|
|||||||
snippets: [{
|
snippets: [{
|
||||||
id: 1,
|
id: 1,
|
||||||
name: 'command1command1command1command1command1command1command1command1command1command1command1command1command1command1command1',
|
name: 'command1command1command1command1command1command1command1command1command1command1command1command1command1command1command1',
|
||||||
command: 'echo 123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123123'
|
command: 'echo Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad adipisci aliquid, atque cupiditate doloribus eligendi enim fugiat itaque iusto laborum magnam maiores natus nemo, neque quae, reprehenderit sed ullam voluptatem?'
|
||||||
}, {
|
}, {
|
||||||
id: 2,
|
id: 2,
|
||||||
name: 'command2',
|
name: 'command2',
|
||||||
command: 'echo 123123123123123123123123123123123123123123'
|
command: 'echo Lorem'
|
||||||
}, {
|
}, {
|
||||||
id: 3,
|
id: 3,
|
||||||
name: 'command3',
|
name: 'command3',
|
||||||
command: 'echo 123123123123123123123123123123123123123123'
|
command: 'echo Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad adipisci aliquid, atque cupiditate doloribus eligendi enim fugiat itaque iusto laborum magnam maiores natus nemo, neque quae, reprehenderit sed ullam voluptatem?'
|
||||||
}, {
|
}, {
|
||||||
id: 4,
|
id: 4,
|
||||||
name: 'command4',
|
name: 'command4',
|
||||||
command: 'echo 123123123123123123123123123123123123123123'
|
command: 'echo Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad adipisci aliquid, atque cupiditate doloribus eligendi enim fugiat itaque iusto laborum magnam maiores natus nemo, neque quae, reprehenderit sed ullam voluptatem?'
|
||||||
}, {
|
}, {
|
||||||
id: 5,
|
id: 5,
|
||||||
name: 'command5',
|
name: 'command5',
|
||||||
command: 'echo 123123123123123123123123123123123123123123'
|
command: 'echo Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad adipisci aliquid, atque cupiditate doloribus eligendi enim fugiat itaque iusto laborum magnam maiores natus nemo, neque quae, reprehenderit sed ullam voluptatem?'
|
||||||
}, {
|
}, {
|
||||||
id: 6,
|
id: 6,
|
||||||
name: 'command6',
|
name: 'command6',
|
||||||
command: 'echo 123123123123123123123123123123123123123123'
|
command: 'echo Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad adipisci aliquid, atque cupiditate doloribus eligendi enim fugiat itaque iusto laborum magnam maiores natus nemo, neque quae, reprehenderit sed ullam voluptatem?'
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -144,13 +146,24 @@
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
@transform-x: 8px;
|
||||||
|
@drawer-width: 388px;
|
||||||
|
@item-wrapper-p-y: 4px;
|
||||||
|
@item-wrapper-p-x: 12px;
|
||||||
|
@item-p: 8px;
|
||||||
|
@item-width: @drawer-width - @item-wrapper-p-x * 2;
|
||||||
|
@item-width-transform: @item-width + @transform-x;
|
||||||
|
@item-inline-width: @item-width - @item-p * 2;
|
||||||
|
|
||||||
.snippet-drawer-title {
|
.snippet-drawer-title {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.snippet-container {
|
.snippet-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
background: var(--color-bg-2);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.snippet-header-container {
|
.snippet-header-container {
|
||||||
@@ -173,21 +186,43 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.snippet-item-wrapper {
|
.snippet-item-wrapper {
|
||||||
padding: 4px 12px;
|
padding: @item-wrapper-p-y 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
&-expand {
|
||||||
|
|
||||||
|
.snippet-item {
|
||||||
|
width: @item-width-transform !important;
|
||||||
|
background: var(--color-fill-3) !important;
|
||||||
|
|
||||||
|
:hover {
|
||||||
|
}
|
||||||
|
|
||||||
|
.snippet-item-command {
|
||||||
|
color: var(--color-text-1);
|
||||||
|
text-overflow: unset;
|
||||||
|
word-break: break-all;
|
||||||
|
white-space: unset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.snippet-item {
|
.snippet-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 8px;
|
padding: @item-p;
|
||||||
background: var(--color-fill-1);
|
background: var(--color-fill-2);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: transform 0.3s ease;
|
transition: all 0.2s;
|
||||||
will-change: transform;
|
width: @item-width;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
transform: scale(1.02);
|
width: @item-width-transform;
|
||||||
background: var(--color-fill-2);
|
background: var(--color-fill-3);
|
||||||
}
|
}
|
||||||
|
|
||||||
&-title {
|
&-title {
|
||||||
@@ -195,6 +230,7 @@
|
|||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
width: @item-inline-width;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-command {
|
&-command {
|
||||||
@@ -203,9 +239,8 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
word-break: break-all;
|
width: @item-inline-width;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user