@shijiu/jsview-vue-samples 1.9.747
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AnimPicture/App.vue +207 -0
- package/AnimPicture/assets/animated_webp.webp +0 -0
- package/AnimPicture/assets/ball_3.webp +0 -0
- package/AnimPicture/assets/girl_run.gif +0 -0
- package/AnimPicture/assets/quan.webp +0 -0
- package/Basic/App.vue +134 -0
- package/Basic/assets/border.png +0 -0
- package/Basic/assets/border2.png +0 -0
- package/Basic/assets/icon.png +0 -0
- package/Basic/assets/test.jpg +0 -0
- package/Basic/components/ContentBlock.vue +38 -0
- package/Basic/components/FontStyle.css +16 -0
- package/Basic/components/anim/AnimGroup.vue +66 -0
- package/Basic/components/anim/AnimKeyframeBasic.vue +119 -0
- package/Basic/components/anim/AnimKeyframeComposite.vue +52 -0
- package/Basic/components/anim/AnimTransition.vue +157 -0
- package/Basic/components/div/DivBackground.vue +44 -0
- package/Basic/components/div/DivClip.vue +159 -0
- package/Basic/components/div/DivCssScoped.vue +20 -0
- package/Basic/components/div/DivCssVar.vue +53 -0
- package/Basic/components/div/DivGroup1.vue +47 -0
- package/Basic/components/div/DivGroup2.vue +65 -0
- package/Basic/components/div/DivLayout.vue +70 -0
- package/Basic/components/div/DivRadius.vue +65 -0
- package/Basic/components/div/DivTransform.vue +32 -0
- package/Basic/components/img/ImageGroup.vue +31 -0
- package/Basic/components/img/ImgLayout.vue +41 -0
- package/Basic/components/panel/Panel1.vue +55 -0
- package/Basic/components/panel/Panel2.vue +31 -0
- package/Basic/components/panel/TitleBar.vue +29 -0
- package/Basic/components/text/TextAlign.vue +66 -0
- package/Basic/components/text/TextEmoji.vue +26 -0
- package/Basic/components/text/TextFontStyle.vue +89 -0
- package/Basic/components/text/TextGroup1.vue +49 -0
- package/Basic/components/text/TextGroup2.vue +28 -0
- package/Basic/components/text/TextOverflow.vue +110 -0
- package/BasicFocusControl/App.vue +104 -0
- package/BasicFocusControl/components/BaseBlock.vue +50 -0
- package/BasicFocusControl/components/MainArea.vue +83 -0
- package/BasicFocusControl/components/MainAreaLeftBlock.vue +17 -0
- package/BasicFocusControl/components/MainAreaRightBlock.vue +27 -0
- package/BasicFocusControl/components/SideBar.vue +58 -0
- package/BasicFocusControl/components/SideBarBlock.vue +27 -0
- package/Collision/App.vue +452 -0
- package/ColorSpace/App.vue +126 -0
- package/ColorSpace/bmpDemo.bmp +0 -0
- package/ColorSpace/jpegDemo.jpeg +0 -0
- package/ColorSpace/pngDemo.png +0 -0
- package/ColorSpace/pngNoAlphaDemo.png +0 -0
- package/DemoHomepage/App.vue +27 -0
- package/DemoHomepage/components/BodyFrame.vue +95 -0
- package/DemoHomepage/components/Dialog.vue +94 -0
- package/DemoHomepage/components/Item.vue +77 -0
- package/DemoHomepage/components/TabFrame.vue +85 -0
- package/DemoHomepage/router.js +196 -0
- package/DemoHomepage/views/Homepage.vue +195 -0
- package/FilterDemo/AnimatePic.vue +58 -0
- package/FilterDemo/App.vue +159 -0
- package/FilterDemo/VideoLayer.vue +62 -0
- package/FilterDemo/jpegDemo.jpeg +0 -0
- package/FilterDemo/webpDemo.webp +0 -0
- package/FlipCard/App.vue +71 -0
- package/FlipCard/FlipCard.vue +118 -0
- package/FlipCard/assets/blue_egg.png +0 -0
- package/FlipCard/assets/red_egg.png +0 -0
- package/FlipCard/data.js +13 -0
- package/GridDemo/App.vue +215 -0
- package/GridDemo/ButtonBlock.vue +112 -0
- package/GridDemo/FocusItem.vue +37 -0
- package/GridDemo/Item.vue +93 -0
- package/HashHistory/App.vue +115 -0
- package/HashHistory/components/HorizontalButtonList.vue +91 -0
- package/HashHistory/components/Item.vue +60 -0
- package/HashHistory/router.js +41 -0
- package/HashHistory/views/MainPage.vue +57 -0
- package/HashHistory/views/SubPage.vue +66 -0
- package/ImpactStop/App.vue +435 -0
- package/Input/App.vue +164 -0
- package/Input/FullKeyboard.vue +87 -0
- package/Input/InputPanel.vue +131 -0
- package/Input/KeyboardItem.vue +58 -0
- package/LongImage/App.vue +80 -0
- package/LongImage/Button.vue +58 -0
- package/LongImage/ButtonItem.vue +44 -0
- package/LongImage/LongImageScroll.vue +92 -0
- package/LongImage/Scroll.vue +14 -0
- package/LongImage/assets/1280x7200.jpg +0 -0
- package/LongText/App.vue +96 -0
- package/LongText/Button.vue +51 -0
- package/LongText/ButtonItem.vue +44 -0
- package/LongText/LongTextScroll.vue +192 -0
- package/LongText/Scroll.vue +14 -0
- package/Marquee/App.vue +247 -0
- package/Marquee/longText.js +14 -0
- package/MaskClip/App.vue +122 -0
- package/MaskClip/images/mask-025/config.json +29 -0
- package/MaskClip/images/mask-025/res/1.png +0 -0
- package/MaskClip/images/mask-025/res/2.png +0 -0
- package/MaskClip/images/mask-025/res/3.png +0 -0
- package/MaskClip/images/mask-025/res/4.png +0 -0
- package/MaskClip/images/mask-025/res/icon.png +0 -0
- package/MaskClip/images/mask-025/res/stroke.png +0 -0
- package/MaskClip/images/php.jpg +0 -0
- package/MetroWidgetDemos/Advanced/App.vue +46 -0
- package/MetroWidgetDemos/Advanced/ButtonItem.vue +90 -0
- package/MetroWidgetDemos/Advanced/Buttons.vue +70 -0
- package/MetroWidgetDemos/Advanced/Mixed.vue +77 -0
- package/MetroWidgetDemos/Advanced/widgets/Item.vue +83 -0
- package/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +89 -0
- package/MetroWidgetDemos/Advanced/widgets/Widgets.vue +116 -0
- package/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
- package/MetroWidgetDemos/Item.vue +85 -0
- package/MetroWidgetDemos/PerformanceTest/App.vue +210 -0
- package/MetroWidgetDemos/PerformanceTest/Item.vue +90 -0
- package/MetroWidgetDemos/PerformanceTest/assets/bg.jpg +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/coupon_content.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/coupon_left.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/coupon_mid.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/coupon_right.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/focus_border.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/holder_logo.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/jrbm.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/line_left.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/line_mid.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/line_right.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/loading.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/logo.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/mcjx.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/tao.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/assets/tmall.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/border.png +0 -0
- package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +386 -0
- package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +129 -0
- package/MetroWidgetDemos/PerformanceTest/data.js +45 -0
- package/MetroWidgetDemos/PingPong/App.vue +135 -0
- package/MetroWidgetDemos/PingPong/AppPage.vue +73 -0
- package/MetroWidgetDemos/PingPong/AppTab.vue +62 -0
- package/MetroWidgetDemos/PingPong/TabItem.vue +84 -0
- package/MetroWidgetDemos/PingPong/ViewSwiper.vue +214 -0
- package/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +75 -0
- package/MetroWidgetDemos/Simple/App.vue +45 -0
- package/MetroWidgetDemos/Simple/RelativeTemplate.vue +111 -0
- package/MetroWidgetDemos/WidgetItem.vue +89 -0
- package/MetroWidgetDemos/data.js +205 -0
- package/NinePatchDemo/App.vue +145 -0
- package/NinePatchDemo/Item.vue +69 -0
- package/NinePatchDemo/assets/border.png +0 -0
- package/Preload/App.vue +135 -0
- package/Preload/Item.vue +32 -0
- package/Preload/data.js +23 -0
- package/Preload/images/awesomeface.png +0 -0
- package/Preload/images/cat.jpg +0 -0
- package/Preload/images/rank.png +0 -0
- package/Preload/images/rank_focus.png +0 -0
- package/Preload/images/rule.png +0 -0
- package/Preload/images/rule_focus.png +0 -0
- package/Preload/images/start.png +0 -0
- package/Preload/images/start_focus.png +0 -0
- package/QrcodeDemo/App.vue +68 -0
- package/ScaleDownNeon/App.vue +107 -0
- package/SoundPool/App.vue +134 -0
- package/SoundPool/bgmusic.mp3 +0 -0
- package/SoundPool/coin.mp3 +0 -0
- package/SoundPool/jump.mp3 +0 -0
- package/SoundPool/lose.mp3 +0 -0
- package/SoundPool/run.mp3 +0 -0
- package/SprayView/App.vue +272 -0
- package/SprayView/assets/snow.png +0 -0
- package/SpriteImage/App.vue +173 -0
- package/SpriteImage/images/cat_run.png +0 -0
- package/SpriteImage/images/egg_break.json +116 -0
- package/SpriteImage/images/egg_break.png +0 -0
- package/SpriteImage/images/sprite.png +0 -0
- package/TextBox/App.vue +91 -0
- package/TextBox/RenderCenter.vue +133 -0
- package/TextBox/RenderLeft.vue +138 -0
- package/TextBox/RenderOneLine.vue +101 -0
- package/TextBox/RenderRight.vue +131 -0
- package/TextShadowDemo/App.vue +91 -0
- package/TextureAnimation/App.vue +336 -0
- package/TextureAnimation/App2.vue +111 -0
- package/TextureAnimation/assets/blackWhiteGrid.png +0 -0
- package/TextureAnimation/assets/light.png +0 -0
- package/TextureAnimation/assets/light2.png +0 -0
- package/TextureAnimation/assets/mask.png +0 -0
- package/TextureAnimation/assets/php.jpg +0 -0
- package/TextureAnimation/assets/php2.png +0 -0
- package/TextureAnimation/assets/swipLight.png +0 -0
- package/TextureSize/App.vue +132 -0
- package/TextureSize/bmpDemo.bmp +0 -0
- package/TextureSize/jpegDemo.jpeg +0 -0
- package/TextureSize/jpgDemo.jpg +0 -0
- package/TextureSize/pngDemo.png +0 -0
- package/TextureSize/pngNoAlphaDemo.png +0 -0
- package/ThrowMoveDemo/AccelerateDemo.vue +116 -0
- package/ThrowMoveDemo/App.vue +114 -0
- package/ThrowMoveDemo/LRParabolicDemo.vue +115 -0
- package/ThrowMoveDemo/TargetDemo.vue +116 -0
- package/ThrowMoveDemo/UDParabolicDemo.vue +121 -0
- package/TouchSample/App.vue +136 -0
- package/TouchSample/Item.vue +103 -0
- package/TouchSample/MetroWidgetHorizontal.vue +144 -0
- package/TouchSample/MetroWidgetVertical.vue +144 -0
- package/TouchSample/TouchContainerHorizontal.vue +160 -0
- package/TouchSample/TouchContainerVertical.vue +160 -0
- package/TouchSample/data.js +81 -0
- package/TransitPage/App.vue +29 -0
- package/VideoDemo/App.vue +121 -0
- package/VideoDemo/components/Button.vue +58 -0
- package/VideoDemo/components/Controllor.vue +197 -0
- package/VideoDemo/components/VideoFrame.vue +140 -0
- package/VisibleSensorDemo/App.vue +234 -0
- package/package.json +17 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactive, onMounted, onBeforeUnmount } from "vue";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
timeCount: Number,
|
|
5
|
+
});
|
|
6
|
+
const titleStyle = {
|
|
7
|
+
width: 100,
|
|
8
|
+
height: 20,
|
|
9
|
+
textAlign: "left",
|
|
10
|
+
lineHeight: 20,
|
|
11
|
+
};
|
|
12
|
+
const itemStyle = {
|
|
13
|
+
top: 20,
|
|
14
|
+
width: 50,
|
|
15
|
+
height: 50,
|
|
16
|
+
whiteSpace: "pre-wrap",
|
|
17
|
+
backgroundColor: "rgba(255, 0, 0, 1)",
|
|
18
|
+
};
|
|
19
|
+
let timerId = -1;
|
|
20
|
+
const state = reactive({
|
|
21
|
+
transform: null,
|
|
22
|
+
transformOrigin: null,
|
|
23
|
+
transformTranslate: null,
|
|
24
|
+
transformRotate: null,
|
|
25
|
+
transformScale: null,
|
|
26
|
+
});
|
|
27
|
+
const changeState = () => {
|
|
28
|
+
setTimeout(() => {
|
|
29
|
+
// 状态变更
|
|
30
|
+
state.transform =
|
|
31
|
+
"translate3d(80px,0px,0) scale3d(2,2,1.0) rotate3d(0, 0, 1, 360deg)";
|
|
32
|
+
state.transformOrigin = "center center";
|
|
33
|
+
state.transformScale = "scale3d(0.2,0.2,1.0)";
|
|
34
|
+
state.transformRotate = "rotate3d(0, 0, 1.0, 360deg)";
|
|
35
|
+
state.transformTranslate = "translate3d(180px,0px,0)";
|
|
36
|
+
// 状态变更
|
|
37
|
+
setTimeout(() => {
|
|
38
|
+
state.transform =
|
|
39
|
+
"translate3d(30px,0px,0) scale3d(0.2,0.2,1.0) rotate3d(0, 0, 1, -360deg)";
|
|
40
|
+
state.transformOrigin = "center center";
|
|
41
|
+
state.transformScale = "scale3d(1.2,1.2,1.0)";
|
|
42
|
+
state.transformRotate = "rotate3d(0, 0, 1.0, -360deg)";
|
|
43
|
+
state.transformTranslate = "translate3d(-80px,0px,0)";
|
|
44
|
+
}, 3000);
|
|
45
|
+
}, 3000);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
onMounted(() => {
|
|
49
|
+
changeState();
|
|
50
|
+
timerId = setInterval(() => {
|
|
51
|
+
changeState();
|
|
52
|
+
}, 6000);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
onBeforeUnmount(() => {
|
|
56
|
+
if (timerId >= 0) {
|
|
57
|
+
clearInterval(timerId);
|
|
58
|
+
}
|
|
59
|
+
timerId = -1;
|
|
60
|
+
});
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<template>
|
|
64
|
+
<div id="layout-root">
|
|
65
|
+
<div>
|
|
66
|
+
<div class="content-font" :style="{ ...titleStyle }">坐标变化</div>
|
|
67
|
+
<div
|
|
68
|
+
class="content-font"
|
|
69
|
+
:style="{
|
|
70
|
+
...itemStyle,
|
|
71
|
+
left: (timeCount * 10) % 200,
|
|
72
|
+
transition: 'left 1s linear',
|
|
73
|
+
}"
|
|
74
|
+
/>
|
|
75
|
+
</div>
|
|
76
|
+
<div :style="{ top: 70 }">
|
|
77
|
+
<div class="content-font" :style="{ ...titleStyle }">坐标和尺寸变化</div>
|
|
78
|
+
<div
|
|
79
|
+
class="content-font"
|
|
80
|
+
:style="{
|
|
81
|
+
...itemStyle,
|
|
82
|
+
left: (timeCount * 10) % 200,
|
|
83
|
+
width: ((timeCount * 10) % 100) + 10,
|
|
84
|
+
transition: 'left 0.5s linear, width 1s linear 1s',
|
|
85
|
+
}"
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<div
|
|
90
|
+
:style="{
|
|
91
|
+
top: 140,
|
|
92
|
+
width: 240,
|
|
93
|
+
height: 160,
|
|
94
|
+
backgroundColor: 'rgba(0, 0, 255, 0.5)',
|
|
95
|
+
}"
|
|
96
|
+
>
|
|
97
|
+
<div :style="{ ...titleStyle }">transform</div>
|
|
98
|
+
<div
|
|
99
|
+
class="content-font"
|
|
100
|
+
:style="{
|
|
101
|
+
...itemStyle,
|
|
102
|
+
top: 20,
|
|
103
|
+
transition: 'transform 2.5s linear 0.5s',
|
|
104
|
+
transform: state.transform,
|
|
105
|
+
transformOrigin: state.transformOrigin,
|
|
106
|
+
}"
|
|
107
|
+
>
|
|
108
|
+
移动缩放旋转
|
|
109
|
+
</div>
|
|
110
|
+
<div
|
|
111
|
+
class="content-font"
|
|
112
|
+
:style="{
|
|
113
|
+
...itemStyle,
|
|
114
|
+
top: 100,
|
|
115
|
+
transition: 'transform 2.5s linear 0.5s',
|
|
116
|
+
transformOrigin: 'center center',
|
|
117
|
+
transform: state.transformTranslate,
|
|
118
|
+
}"
|
|
119
|
+
>
|
|
120
|
+
移动
|
|
121
|
+
</div>
|
|
122
|
+
<div
|
|
123
|
+
class="content-font"
|
|
124
|
+
:style="{
|
|
125
|
+
...itemStyle,
|
|
126
|
+
left: 140,
|
|
127
|
+
top: 20,
|
|
128
|
+
transition: 'transform 2.5s linear 0.5s',
|
|
129
|
+
transformOrigin: 'center center',
|
|
130
|
+
transform: state.transformScale,
|
|
131
|
+
}"
|
|
132
|
+
>
|
|
133
|
+
缩放
|
|
134
|
+
</div>
|
|
135
|
+
<div
|
|
136
|
+
class="content-font"
|
|
137
|
+
:style="{
|
|
138
|
+
...itemStyle,
|
|
139
|
+
top: 75,
|
|
140
|
+
left: 140,
|
|
141
|
+
transition: 'transform 2.5s linear 0.5s',
|
|
142
|
+
transformOrigin: 'center center',
|
|
143
|
+
transform: state.transformRotate,
|
|
144
|
+
}"
|
|
145
|
+
>
|
|
146
|
+
旋转
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</template>
|
|
151
|
+
|
|
152
|
+
<style>
|
|
153
|
+
@import "../FontStyle.css";
|
|
154
|
+
</style>
|
|
155
|
+
|
|
156
|
+
<style>
|
|
157
|
+
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import iconImgPath from "../../assets/icon.png";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<div id="layout-root">
|
|
7
|
+
<div
|
|
8
|
+
class="content-font"
|
|
9
|
+
:style="{
|
|
10
|
+
width: 180,
|
|
11
|
+
height: 40,
|
|
12
|
+
backgroundColor: 'rgba(255, 255, 0, 1)',
|
|
13
|
+
}"
|
|
14
|
+
>
|
|
15
|
+
style.backgroundColor
|
|
16
|
+
</div>
|
|
17
|
+
<div
|
|
18
|
+
class="content-font"
|
|
19
|
+
:style="{
|
|
20
|
+
top: 50,
|
|
21
|
+
width: 180,
|
|
22
|
+
height: 40,
|
|
23
|
+
backgroundImage: `url(${iconImgPath})`,
|
|
24
|
+
}"
|
|
25
|
+
>
|
|
26
|
+
style.backgroundImage(url)
|
|
27
|
+
</div>
|
|
28
|
+
<div
|
|
29
|
+
class="content-font"
|
|
30
|
+
:style="{
|
|
31
|
+
top: 100,
|
|
32
|
+
width: 180,
|
|
33
|
+
height: 40,
|
|
34
|
+
backgroundImage: 'linear-gradient(#FF0000, #00FF00)',
|
|
35
|
+
}"
|
|
36
|
+
>
|
|
37
|
+
style.backgroundImage(gradient)
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<style>
|
|
43
|
+
@import "../FontStyle.css";
|
|
44
|
+
</style>
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import testImgPath from "../../assets/test.jpg";
|
|
3
|
+
|
|
4
|
+
const titleHeight = 16;
|
|
5
|
+
const imageSize = {
|
|
6
|
+
width: 80,
|
|
7
|
+
height: 64,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const clipSize = {
|
|
11
|
+
width: 50,
|
|
12
|
+
height: 40,
|
|
13
|
+
};
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<div id="layout-root">
|
|
18
|
+
<div
|
|
19
|
+
style="
|
|
20
|
+
{
|
|
21
|
+
top: 0;
|
|
22
|
+
}
|
|
23
|
+
"
|
|
24
|
+
>
|
|
25
|
+
<div class="content-font" :style="{ width: 50, height: titleHeight }">
|
|
26
|
+
原图
|
|
27
|
+
</div>
|
|
28
|
+
<div
|
|
29
|
+
:style="{
|
|
30
|
+
top: titleHeight,
|
|
31
|
+
width: imageSize.width + 4,
|
|
32
|
+
height: imageSize.height + 4,
|
|
33
|
+
backgroundColor: 'rgba(0, 255, 0, 1)',
|
|
34
|
+
}"
|
|
35
|
+
>
|
|
36
|
+
<div
|
|
37
|
+
:style="{
|
|
38
|
+
left: 2,
|
|
39
|
+
top: 2,
|
|
40
|
+
width: imageSize.width,
|
|
41
|
+
height: imageSize.height,
|
|
42
|
+
backgroundImage: `url(${testImgPath})`,
|
|
43
|
+
}"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<div :style="{ top: imageSize.height + titleHeight + 4 }">
|
|
49
|
+
<div class="content-font" :style="{ width: 120, height: titleHeight }">
|
|
50
|
+
左上Overflow
|
|
51
|
+
</div>
|
|
52
|
+
<div
|
|
53
|
+
:style="{
|
|
54
|
+
top: titleHeight,
|
|
55
|
+
width: imageSize.width + 4,
|
|
56
|
+
height: imageSize.height + 4,
|
|
57
|
+
backgroundColor: 'rgba(0, 255, 0, 1)',
|
|
58
|
+
}"
|
|
59
|
+
>
|
|
60
|
+
<div
|
|
61
|
+
key="clipArea"
|
|
62
|
+
:style="{
|
|
63
|
+
left: 2,
|
|
64
|
+
top: 2,
|
|
65
|
+
width: clipSize.width,
|
|
66
|
+
height: clipSize.height,
|
|
67
|
+
overflow: 'hidden',
|
|
68
|
+
}"
|
|
69
|
+
>
|
|
70
|
+
<div
|
|
71
|
+
:style="{
|
|
72
|
+
width: imageSize.width,
|
|
73
|
+
height: imageSize.height,
|
|
74
|
+
backgroundImage: `url(${testImgPath})`,
|
|
75
|
+
}"
|
|
76
|
+
/>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div :style="{ top: (imageSize.height + titleHeight + 4) * 2 }">
|
|
82
|
+
<div class="content-font" :style="{ width: 120, height: titleHeight }">
|
|
83
|
+
右下Overflow
|
|
84
|
+
</div>
|
|
85
|
+
<div
|
|
86
|
+
:style="{
|
|
87
|
+
top: titleHeight,
|
|
88
|
+
width: imageSize.width + 4,
|
|
89
|
+
height: imageSize.height + 4,
|
|
90
|
+
backgroundColor: 'rgba(0, 255, 0, 1)',
|
|
91
|
+
}"
|
|
92
|
+
>
|
|
93
|
+
<div
|
|
94
|
+
key="clipArea"
|
|
95
|
+
:style="{
|
|
96
|
+
top: 2 + (imageSize.height - clipSize.height),
|
|
97
|
+
left: 2 + (imageSize.width - clipSize.width),
|
|
98
|
+
width: clipSize.width,
|
|
99
|
+
height: clipSize.height,
|
|
100
|
+
overflow: 'hidden',
|
|
101
|
+
}"
|
|
102
|
+
>
|
|
103
|
+
<div
|
|
104
|
+
:style="{
|
|
105
|
+
top: -(imageSize.height - clipSize.height),
|
|
106
|
+
left: -(imageSize.width - clipSize.width),
|
|
107
|
+
width: imageSize.width,
|
|
108
|
+
height: imageSize.height,
|
|
109
|
+
backgroundImage: `url(${testImgPath})`,
|
|
110
|
+
}"
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
<div
|
|
117
|
+
:style="{
|
|
118
|
+
top: imageSize.height + titleHeight + 4,
|
|
119
|
+
left: imageSize.width + 16,
|
|
120
|
+
}"
|
|
121
|
+
>
|
|
122
|
+
<div class="content-font" :style="{ width: 100, height: titleHeight }">
|
|
123
|
+
ClipPath
|
|
124
|
+
</div>
|
|
125
|
+
<div
|
|
126
|
+
:style="{
|
|
127
|
+
top: titleHeight,
|
|
128
|
+
width: imageSize.width + 4,
|
|
129
|
+
height: imageSize.height + 4,
|
|
130
|
+
backgroundColor: 'rgba(0, 255, 0, 1)',
|
|
131
|
+
}"
|
|
132
|
+
>
|
|
133
|
+
<div
|
|
134
|
+
key="clipArea"
|
|
135
|
+
:style="{
|
|
136
|
+
left: 2,
|
|
137
|
+
top: 2,
|
|
138
|
+
width: imageSize.width,
|
|
139
|
+
height: imageSize.height,
|
|
140
|
+
clipPath:
|
|
141
|
+
'inset(5px 10px 15px 20px)' /* margin of top, right, bottom, left */,
|
|
142
|
+
}"
|
|
143
|
+
>
|
|
144
|
+
<div
|
|
145
|
+
:style="{
|
|
146
|
+
width: imageSize.width,
|
|
147
|
+
height: imageSize.height,
|
|
148
|
+
backgroundImage: `url(${testImgPath})`,
|
|
149
|
+
}"
|
|
150
|
+
/>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</template>
|
|
156
|
+
|
|
157
|
+
<style>
|
|
158
|
+
@import "../FontStyle.css";
|
|
159
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
jsvclass: String,
|
|
4
|
+
});
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<div>
|
|
9
|
+
<div>
|
|
10
|
+
<div :class="jsvclass" jsv-inherit-class="2">
|
|
11
|
+
Scoped CSS穿透, 此处的属性是Container设进来的.
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
<style scoped>
|
|
20
|
+
</style>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactive, onMounted, onBeforeUnmount } from "vue";
|
|
3
|
+
let timerId = -1;
|
|
4
|
+
let state = reactive({
|
|
5
|
+
foreColor: "#FF0000",
|
|
6
|
+
backColor: "#00FF00",
|
|
7
|
+
});
|
|
8
|
+
onMounted(() => {
|
|
9
|
+
timerId = setInterval(() => {
|
|
10
|
+
if (state.foreColor == "#00FF00") {
|
|
11
|
+
state.foreColor = "#FF0000";
|
|
12
|
+
state.backColor = "#00FF00";
|
|
13
|
+
} else {
|
|
14
|
+
state.foreColor = "#00FF00";
|
|
15
|
+
state.backColor = "#FF0000";
|
|
16
|
+
}
|
|
17
|
+
}, 3000);
|
|
18
|
+
});
|
|
19
|
+
onBeforeUnmount(() => {
|
|
20
|
+
{
|
|
21
|
+
if (timerId >= 0) {
|
|
22
|
+
clearInterval(timerId);
|
|
23
|
+
}
|
|
24
|
+
timerId = -1;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<div class="block">顶级元素的CSS class中包含变量 (不推荐)</div>
|
|
31
|
+
|
|
32
|
+
<div
|
|
33
|
+
:style="{
|
|
34
|
+
left: 70,
|
|
35
|
+
width: 65,
|
|
36
|
+
height: 65,
|
|
37
|
+
color: state.foreColor,
|
|
38
|
+
backgroundColor: state.backColor,
|
|
39
|
+
}"
|
|
40
|
+
>
|
|
41
|
+
子级元素CSS class中包含变量
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<style scoped>
|
|
46
|
+
.block {
|
|
47
|
+
width: 65;
|
|
48
|
+
height: 65;
|
|
49
|
+
/* word-wrap: break-word; */
|
|
50
|
+
color: v-bind(state.foreColor);
|
|
51
|
+
background-color: v-bind(state.backColor);
|
|
52
|
+
}
|
|
53
|
+
</style>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import ContentBlock from "../ContentBlock.vue";
|
|
3
|
+
import DivBackground from "./DivBackground.vue";
|
|
4
|
+
import DivClip from "./DivClip.vue";
|
|
5
|
+
import DivLayout from "./DivLayout.vue";
|
|
6
|
+
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
contentClass: String,
|
|
9
|
+
itemSides: Object,
|
|
10
|
+
});
|
|
11
|
+
const contentBlockProps = {
|
|
12
|
+
colIndex: 0,
|
|
13
|
+
itemSides: props.itemSides,
|
|
14
|
+
};
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<div id="item-root">
|
|
19
|
+
<ContentBlock
|
|
20
|
+
:class="contentClass"
|
|
21
|
+
:style="{ top: itemSides.height * 0 }"
|
|
22
|
+
:="contentBlockProps"
|
|
23
|
+
:index="0"
|
|
24
|
+
title="Layout(布局定位)"
|
|
25
|
+
>
|
|
26
|
+
<DivLayout />
|
|
27
|
+
</ContentBlock>
|
|
28
|
+
<ContentBlock
|
|
29
|
+
:class="contentClass"
|
|
30
|
+
:style="{ top: itemSides.height * 1 }"
|
|
31
|
+
:="contentBlockProps"
|
|
32
|
+
:index="1"
|
|
33
|
+
title="Background(加载图片)"
|
|
34
|
+
>
|
|
35
|
+
<DivBackground />
|
|
36
|
+
</ContentBlock>
|
|
37
|
+
<ContentBlock
|
|
38
|
+
:class="contentClass"
|
|
39
|
+
:style="{ top: itemSides.height * 2 }"
|
|
40
|
+
:="{ ...contentBlockProps, itemSides: { ...itemSides, height: 290 } }"
|
|
41
|
+
:index="2"
|
|
42
|
+
title="Clip(裁剪)"
|
|
43
|
+
>
|
|
44
|
+
<DivClip />
|
|
45
|
+
</ContentBlock>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import ContentBlock from "../ContentBlock.vue";
|
|
3
|
+
import DivCssScoped from "./DivCssScoped.vue";
|
|
4
|
+
import DivCssVar from "./DivCssVar.vue";
|
|
5
|
+
import DivRadius from "./DivRadius.vue";
|
|
6
|
+
import DivTransform from "./DivTransform.vue";
|
|
7
|
+
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
contentClass: String,
|
|
10
|
+
itemSides: Object,
|
|
11
|
+
});
|
|
12
|
+
const contentBlockProps = {
|
|
13
|
+
colIndex: 0,
|
|
14
|
+
itemSides: props.itemSides,
|
|
15
|
+
};
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<div id="item-root">
|
|
20
|
+
<ContentBlock
|
|
21
|
+
:class="contentClass"
|
|
22
|
+
:style="{ top: itemSides.height * 0 }"
|
|
23
|
+
:="contentBlockProps"
|
|
24
|
+
:index="1"
|
|
25
|
+
title="Radius(实现圆角)"
|
|
26
|
+
>
|
|
27
|
+
<DivRadius />
|
|
28
|
+
</ContentBlock>
|
|
29
|
+
<ContentBlock
|
|
30
|
+
:class="contentClass"
|
|
31
|
+
:style="{ top: itemSides.height * 1 }"
|
|
32
|
+
:="contentBlockProps"
|
|
33
|
+
:index="1"
|
|
34
|
+
title="Transform"
|
|
35
|
+
>
|
|
36
|
+
<DivTransform />
|
|
37
|
+
</ContentBlock>
|
|
38
|
+
<ContentBlock
|
|
39
|
+
:class="contentClass"
|
|
40
|
+
:style="{ top: itemSides.height * 2 }"
|
|
41
|
+
:="contentBlockProps"
|
|
42
|
+
:index="2"
|
|
43
|
+
title="CSS Var"
|
|
44
|
+
>
|
|
45
|
+
<DivCssVar />
|
|
46
|
+
</ContentBlock>
|
|
47
|
+
<ContentBlock
|
|
48
|
+
:class="contentClass"
|
|
49
|
+
:style="{ top: itemSides.height * 3 }"
|
|
50
|
+
:="contentBlockProps"
|
|
51
|
+
:index="3"
|
|
52
|
+
title="CSS Scoped"
|
|
53
|
+
>
|
|
54
|
+
<DivCssScoped jsvclass="block" />
|
|
55
|
+
</ContentBlock>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<style scoped>
|
|
60
|
+
.block {
|
|
61
|
+
width: 80;
|
|
62
|
+
height: 65;
|
|
63
|
+
color: #00ff00;
|
|
64
|
+
}
|
|
65
|
+
</style>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="layout-root">
|
|
3
|
+
<div
|
|
4
|
+
class="content-font"
|
|
5
|
+
:style="{ width: 70, height: 25, backgroundColor: 'rgba(0, 255, 0, 1)' }"
|
|
6
|
+
>
|
|
7
|
+
坐标未设
|
|
8
|
+
</div>
|
|
9
|
+
<!-- <div class="content-font" :style="{ top: 0, left: 75, backgroundColor: 'rgba(0, 255, 0, 1)' }">宽高未设</div> -->
|
|
10
|
+
<div
|
|
11
|
+
class="content-font"
|
|
12
|
+
:style="{
|
|
13
|
+
top: 30 * 1,
|
|
14
|
+
left: 0,
|
|
15
|
+
width: 70,
|
|
16
|
+
height: 25,
|
|
17
|
+
backgroundColor: 'rgba(0, 200, 0, 1)',
|
|
18
|
+
visibility: 'hidden',
|
|
19
|
+
}"
|
|
20
|
+
>
|
|
21
|
+
(X)不可视
|
|
22
|
+
</div>
|
|
23
|
+
<div
|
|
24
|
+
class="content-font"
|
|
25
|
+
:style="{
|
|
26
|
+
top: 30 * 1,
|
|
27
|
+
left: 75,
|
|
28
|
+
width: 70,
|
|
29
|
+
height: 25,
|
|
30
|
+
backgroundColor: 'rgba(0, 200, 0, 1)',
|
|
31
|
+
visibility: 'visible',
|
|
32
|
+
}"
|
|
33
|
+
>
|
|
34
|
+
可视属性
|
|
35
|
+
</div>
|
|
36
|
+
<div
|
|
37
|
+
v-show="vShow"
|
|
38
|
+
class="content-font"
|
|
39
|
+
:style="{
|
|
40
|
+
top: 30 * 2,
|
|
41
|
+
left: 75,
|
|
42
|
+
width: 70,
|
|
43
|
+
height: 25,
|
|
44
|
+
backgroundColor: 'rgba(0, 200, 0, 1)',
|
|
45
|
+
visibility: 'visible',
|
|
46
|
+
}"
|
|
47
|
+
>
|
|
48
|
+
v-show
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script setup>
|
|
54
|
+
import { ref, shallowRef, onUnmounted } from 'vue'
|
|
55
|
+
|
|
56
|
+
// v-show 控制
|
|
57
|
+
let vShow = ref(false);
|
|
58
|
+
let loopVShow = setInterval(() => {
|
|
59
|
+
vShow.value = !vShow.value;
|
|
60
|
+
}, 1000);
|
|
61
|
+
|
|
62
|
+
onUnmounted(() => {
|
|
63
|
+
clearInterval(loopVShow);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<style>
|
|
69
|
+
@import "../FontStyle.css";
|
|
70
|
+
</style>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import iconImgPath from "../../assets/icon.png";
|
|
3
|
+
const blockSize = {
|
|
4
|
+
width: 65,
|
|
5
|
+
height: 65,
|
|
6
|
+
};
|
|
7
|
+
const gap = 5;
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div id="layout-root">
|
|
12
|
+
<div
|
|
13
|
+
class="content-font"
|
|
14
|
+
:style="{
|
|
15
|
+
width: blockSize.width,
|
|
16
|
+
height: blockSize.height,
|
|
17
|
+
backgroundColor: 'rgba(255, 255, 0, 1)',
|
|
18
|
+
borderRadius: '10px',
|
|
19
|
+
}"
|
|
20
|
+
>
|
|
21
|
+
各角相同
|
|
22
|
+
</div>
|
|
23
|
+
<div
|
|
24
|
+
class="content-font"
|
|
25
|
+
:style="{
|
|
26
|
+
left: blockSize.width + gap,
|
|
27
|
+
width: blockSize.width,
|
|
28
|
+
height: blockSize.height,
|
|
29
|
+
backgroundColor: 'rgba(255, 255, 0, 1)',
|
|
30
|
+
borderRadius: '0 10px 20px 30px',
|
|
31
|
+
}"
|
|
32
|
+
>
|
|
33
|
+
各角不同
|
|
34
|
+
</div>
|
|
35
|
+
<div
|
|
36
|
+
class="content-font"
|
|
37
|
+
:style="{
|
|
38
|
+
top: blockSize.height + gap,
|
|
39
|
+
width: blockSize.width,
|
|
40
|
+
height: blockSize.height,
|
|
41
|
+
backgroundImage: `url(${iconImgPath})`,
|
|
42
|
+
borderRadius: '10px',
|
|
43
|
+
}"
|
|
44
|
+
>
|
|
45
|
+
各角相同
|
|
46
|
+
</div>
|
|
47
|
+
<div
|
|
48
|
+
class="content-font"
|
|
49
|
+
:style="{
|
|
50
|
+
left: blockSize.width + gap,
|
|
51
|
+
top: blockSize.height + gap,
|
|
52
|
+
width: blockSize.width,
|
|
53
|
+
height: blockSize.height,
|
|
54
|
+
backgroundImage: `url(${iconImgPath})`,
|
|
55
|
+
borderRadius: '0 10px 20px 30px',
|
|
56
|
+
}"
|
|
57
|
+
>
|
|
58
|
+
各角不同
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<style>
|
|
64
|
+
@import "../FontStyle.css";
|
|
65
|
+
</style>
|