-
Notifications
You must be signed in to change notification settings - Fork 691
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* utilities: update docs for effects helpers.
- Loading branch information
Showing
9 changed files
with
339 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,123 @@ | ||
# Filter函数 | ||
|
||
## 效果展示 | ||
|
||
### 高斯模糊 | ||
|
||
通过`blur-*`给图片添加高斯模糊样式。 | ||
|
||
<Example class="flex flex-wrap gap-3"> | ||
<div v-for="item in blurJson"> | ||
<img src="/favicon.svg" :class="item.includes('原始') ? '' : item" class="w-16 h-16"> | ||
<div class="text-center">{{item}}</div> | ||
# CSS 滤镜 | ||
|
||
## 高斯模糊 | ||
|
||
通过 `blur-*` 给图片添加高斯模糊样式。 | ||
|
||
<Example class="flex flex-wrap gap-6 p-6"> | ||
<div v-for="item in blurList" :key="item"> | ||
<StyleTile | ||
:tileClass="['w-16 h-16', item]" | ||
:name="item" | ||
:labelClass="['text-center', item ? 'font-mono text-sm' : '']" | ||
:label="item || '原始'" | ||
> | ||
<img src="/favicon.svg"> | ||
</StyleTile> | ||
</div> | ||
</Example> | ||
|
||
### 灰度和反色 | ||
## 灰度和反色 | ||
|
||
通过`grascale`将图像转为灰度图像;通过`invert`将图像设置为反色。 | ||
通过 `grayscale` 将图像转为灰度图像;通过 `invert` 将图像设置为反色。 | ||
|
||
<Example class="flex flex-wrap gap-3"> | ||
<div v-for = "item in grasJson"> | ||
<img src="/favicon.svg" :class="item.includes('原始') ? '' : item" class="w-16 h-16"> | ||
<div class="text-center">{{item}}</div> | ||
<Example class="flex flex-wrap gap-6 p-6"> | ||
<div v-for="item in grayList" :key="item"> | ||
<StyleTile | ||
:tileClass="['w-16 h-16', item]" | ||
:name="item" | ||
:labelClass="['text-center', item ? 'font-mono text-sm' : '']" | ||
:label="item || '原始'" | ||
> | ||
<img src="/favicon.svg"> | ||
</StyleTile> | ||
</div> | ||
</Example> | ||
|
||
## 形状阴影 | ||
|
||
通过 `drop-shadow-*` 给元素设置形状阴影效果,通常用在图片上。 | ||
|
||
### 图像阴影 | ||
|
||
通过`dsd-*`给图像设置阴影效果。 | ||
|
||
<Example class="flex flex-wrap gap-3"> | ||
<div v-for = "item in dsdJson"> | ||
<img src="/favicon.svg" :class="item.includes('原始') ? '' : item" class="w-16 h-16"> | ||
<div class="text-center mt-2">{{item}}</div> | ||
<Example class="flex flex-wrap gap-6 p-6"> | ||
<div v-for="item in dropShadowList" :key="item"> | ||
<StyleTile | ||
:tileClass="['w-32 h-16', item]" | ||
:name="item" | ||
:labelClass="['text-center', item ? 'font-mono text-sm' : '']" | ||
:label="item || '原始'" | ||
> | ||
<img :class="['w-16', item]" src="/favicon.svg"> | ||
</StyleTile> | ||
</div> | ||
</Example> | ||
|
||
```html | ||
<img class="dsd-sm" ... > | ||
``` | ||
## 背景模糊 | ||
|
||
通过 `backdrop-blur-*` 添加覆盖区域模糊样式。 | ||
|
||
<Example class="flex flex-wrap gap-6 p-6"> | ||
<div v-for="item in bgBlurList" :key="item"> | ||
<StyleTile | ||
:tileClass="['w-32 h-32 bg-contain', item]" | ||
:name="item" | ||
:labelClass="['text-center', item ? 'font-mono text-sm' : '']" | ||
:label="item || '原始'" | ||
:tileStyle="{backgroundImage: 'url(/favicon.svg)'}" | ||
> | ||
<div :class="['w-16 h-16 bg-white bg-opacity-30', item]"></div> | ||
</StyleTile> | ||
</div> | ||
</Example> | ||
|
||
### 覆盖区域模糊 | ||
## 禁用滤镜 | ||
|
||
通过`bg-blur-*`添加覆盖区域模糊样式。 | ||
通过 `filter-none` 来禁用之前添加的滤镜效果。 | ||
|
||
<Example class="flex flex-wrap gap-3 w-full h-full"> | ||
<div v-for = "item in bgBlurJson" class="relative w-24 h-24"> | ||
<img src="/favicon.svg" class="w-full h-16 absolute"> | ||
<div :class="item.includes('原始') ? '' : item" class="z-10 w-full h-16 absolute bg-transparent"> | ||
<div class="text-center -text-2xl text-canvas mt-4">ZUI3</div> | ||
</div> | ||
<div class="text-center z-10 w-full h-6 absolute bottom-0">{{item}}</div> | ||
</div> | ||
<Example class="flex flex-wrap gap-6 p-6"> | ||
<StyleTile | ||
:tileClass="['w-16 h-16', 'filter-none']" | ||
:name="'filter-none'" | ||
:labelClass="['text-center', 'filter-none' ? 'font-mono text-sm' : '']" | ||
:label="'filter-none' || '原始'" | ||
> | ||
<img src="/favicon.svg"> | ||
</StyleTile> | ||
</Example> | ||
```html | ||
<div class="relative w-24 h-16"> | ||
<img class="absolute w-full h-full src=..." > | ||
<div class="absolute w-full h-full bg-blur-sm"> | ||
ZUI3 | ||
</div> | ||
</div> | ||
``` | ||
|
||
<script setup> | ||
const blurJson = [ | ||
'原始', | ||
'blur-none', | ||
'blur-sm', | ||
'blur', | ||
'blur-md', | ||
'blur-lg', | ||
'blur-xl', | ||
]; | ||
const grasJson = [ | ||
'原始', | ||
'grayscale', | ||
'invert' | ||
]; | ||
const dsdJson = [ | ||
'原始', | ||
'dsd-none', | ||
'dsd-sm', | ||
'dsd', | ||
'dsd-md', | ||
'dsd-lg', | ||
'dsd-xl', | ||
'dsd-2xl', | ||
]; | ||
const bgBlurJson = [ | ||
'原始', | ||
'bg-blur-none', | ||
'bg-blur-sm', | ||
'bg-blur', | ||
'bg-blur-md', | ||
'bg-blur-lg', | ||
'bg-blur-xl', | ||
'bg-blur-2xl', | ||
'bg-blur-3xl', | ||
] | ||
const blurList = [ | ||
'', | ||
'blur-none', | ||
'blur-sm', | ||
'blur', | ||
'blur-md', | ||
'blur-lg', | ||
'blur-xl', | ||
]; | ||
const grayList = [ | ||
'', | ||
'grayscale', | ||
'invert' | ||
]; | ||
const dropShadowList = [ | ||
'', | ||
'drop-shadow-none', | ||
'drop-shadow-sm', | ||
'drop-shadow', | ||
'drop-shadow-md', | ||
'drop-shadow-lg', | ||
'drop-shadow-xl', | ||
'drop-shadow-2xl', | ||
]; | ||
const bgBlurList = [ | ||
'', | ||
'backdrop-blur-none', | ||
'backdrop-blur-sm', | ||
'backdrop-blur', | ||
'backdrop-blur-md', | ||
'backdrop-blur-lg', | ||
'backdrop-blur-xl', | ||
'backdrop-blur-2xl', | ||
'backdrop-blur-3xl', | ||
]; | ||
</script> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.