Browse Source

全局样式

master
Enzo 4 years ago
parent
commit
12f51e781f
  1. 3
      App.vue
  2. 184
      colorui/animation.css
  3. 76
      colorui/components/cu-custom.vue
  4. 1226
      colorui/icon.css
  5. 3972
      colorui/main.css
  6. 24
      main.js

3
App.vue

@ -14,5 +14,8 @@
<style lang="scss"> <style lang="scss">
@import "uview-ui/index.scss"; @import "uview-ui/index.scss";
@import './colorui/main.css';
@import './colorui/icon.css';
@import "@/colorui/animation.css";
/*每个页面公共css */ /*每个页面公共css */
</style> </style>

184
colorui/animation.css

@ -0,0 +1,184 @@
/*
Animation 微动画
基于ColorUI组建库的动画模块 by 文晓港 2019年3月26日19:52:28
*/
/* css 滤镜 控制黑白底色gif的 */
.gif-black{
mix-blend-mode: screen;
}
.gif-white{
mix-blend-mode: multiply;
}
/* Animation css */
[class*=animation-] {
animation-duration: .5s;
animation-timing-function: ease-out;
animation-fill-mode: both
}
.animation-fade {
animation-name: fade;
animation-duration: .8s;
animation-timing-function: linear
}
.animation-scale-up {
animation-name: scale-up
}
.animation-scale-down {
animation-name: scale-down
}
.animation-slide-top {
animation-name: slide-top
}
.animation-slide-bottom {
animation-name: slide-bottom
}
.animation-slide-left {
animation-name: slide-left
}
.animation-slide-right {
animation-name: slide-right
}
.animation-shake {
animation-name: shake
}
.animation-reverse {
animation-direction: reverse
}
@keyframes fade {
0% {
opacity: 0
}
100% {
opacity: 1
}
}
@keyframes scale-up {
0% {
opacity: 0;
transform: scale(.2)
}
100% {
opacity: 1;
transform: scale(1)
}
}
@keyframes scale-down {
0% {
opacity: 0;
transform: scale(1.8)
}
100% {
opacity: 1;
transform: scale(1)
}
}
@keyframes slide-top {
0% {
opacity: 0;
transform: translateY(-100%)
}
100% {
opacity: 1;
transform: translateY(0)
}
}
@keyframes slide-bottom {
0% {
opacity: 0;
transform: translateY(100%)
}
100% {
opacity: 1;
transform: translateY(0)
}
}
@keyframes shake {
0%,
100% {
transform: translateX(0)
}
10% {
transform: translateX(-9px)
}
20% {
transform: translateX(8px)
}
30% {
transform: translateX(-7px)
}
40% {
transform: translateX(6px)
}
50% {
transform: translateX(-5px)
}
60% {
transform: translateX(4px)
}
70% {
transform: translateX(-3px)
}
80% {
transform: translateX(2px)
}
90% {
transform: translateX(-1px)
}
}
@keyframes slide-left {
0% {
opacity: 0;
transform: translateX(-100%)
}
100% {
opacity: 1;
transform: translateX(0)
}
}
@keyframes slide-right {
0% {
opacity: 0;
transform: translateX(100%)
}
100% {
opacity: 1;
transform: translateX(0)
}
}

76
colorui/components/cu-custom.vue

@ -0,0 +1,76 @@
<template>
<view>
<view class="cu-custom" :style="[{height:CustomBar + 'px'}]">
<view class="cu-bar fixed" :style="style" :class="[bgImage!=''?'none-bg text-white bg-img':'',bgColor]">
<view class="action" @tap="BackPage" v-if="isBack">
<text class="cuIcon-back"></text>
<slot name="backText"></slot>
</view>
<view class="action">
<slot name="left"></slot>
</view>
<view class="content" :style="[{top:StatusBar + 'px'}]">
<slot name="content"></slot>
</view>
<slot name="right"></slot>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
StatusBar: this.StatusBar,
CustomBar: this.CustomBar
};
},
name: 'cu-custom',
computed: {
style() {
var StatusBar= this.StatusBar;
var CustomBar= this.CustomBar;
var bgImage = this.bgImage;
var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
if (this.bgImage) {
style = `${style}background-image:url(${bgImage});`;
}
return style
}
},
props: {
bgColor: {
type: String,
default: 'bg-white'
},
isBack: {
type: [Boolean, String],
default: true
},
bgImage: {
type: String,
default: ''
},
},
methods: {
BackPage() {
// #ifdef H5
window.history.go(-1)
// #endif
// #ifndef H5
uni.navigateBack({
delta: 1
});
// #endif
}
}
}
</script>
<style scoped>
.bg-img{
background-position: initial !important;
}
</style>

1226
colorui/icon.css
File diff suppressed because it is too large
View File

3972
colorui/main.css
File diff suppressed because it is too large
View File

24
main.js

@ -9,6 +9,30 @@ App.mpType = 'app'
import uView from 'uview-ui' import uView from 'uview-ui'
Vue.use(uView); Vue.use(uView);
//color-ui-标题组件
import cuCustom from './colorui/components/cu-custom.vue'
Vue.component('cu-custom', cuCustom)
// 上拉加载、下拉刷新
import MescrollBody from './components/mescroll-uni/mescroll-body.vue'
Vue.component('mescroll-body', MescrollBody)
//骨架屏
import Skeleton from './components/my-uni-skeleton/index.vue'
Vue.component('skeleton', Skeleton)
// //金融数字
// import aMount from './components/amount/index.vue'
// Vue.component('amount', aMount)
//路由跳转
Vue.prototype.$routerGo = (obj) => {
uni.navigateTo({
url: obj
})
}
const app = new Vue({ const app = new Vue({
...App ...App
}) })

Loading…
Cancel
Save