├── .DS_Store ├── .github └── FUNDING.yml ├── Colorui-UniApp ├── .DS_Store ├── App.vue ├── Readme.md ├── colorui │ ├── animation.css │ ├── components │ │ └── cu-custom.vue │ ├── icon.css │ └── main.css ├── main.js ├── manifest.json ├── node_modules │ ├── .bin │ │ ├── prettier │ │ └── prettier.cmd │ └── prettier │ │ ├── README.md │ │ ├── bin-prettier.js │ │ ├── index.js │ │ ├── package.json │ │ ├── parser-babylon.js │ │ ├── parser-flow.js │ │ ├── parser-glimmer.js │ │ ├── parser-graphql.js │ │ ├── parser-markdown.js │ │ ├── parser-parse5.js │ │ ├── parser-postcss.js │ │ ├── parser-typescript.js │ │ ├── parser-vue.js │ │ └── third-party.js ├── package-lock.json ├── pages.json ├── pages │ ├── basics │ │ ├── avatar.vue │ │ ├── background.vue │ │ ├── button.vue │ │ ├── design.vue │ │ ├── home.vue │ │ ├── icon.vue │ │ ├── layout.vue │ │ ├── loading.vue │ │ ├── progress.vue │ │ ├── shadow.vue │ │ ├── tag.vue │ │ └── text.vue │ ├── component │ │ ├── bar.vue │ │ ├── card.vue │ │ ├── chat.vue │ │ ├── form.vue │ │ ├── home.vue │ │ ├── list.vue │ │ ├── modal.vue │ │ ├── nav.vue │ │ ├── steps.vue │ │ ├── swiper.vue │ │ └── timeline.vue │ ├── index │ │ └── index.vue │ └── plugin │ │ ├── animation.vue │ │ ├── drawer.vue │ │ ├── home.vue │ │ ├── indexes.vue │ │ └── verticalnav.vue └── static │ ├── BasicsBg.png │ ├── cjkz.png │ ├── componentBg.png │ ├── logo.png │ └── tabbar │ ├── about.png │ ├── about_cur.png │ ├── basics.png │ ├── basics_cur.png │ ├── component.png │ ├── component_cur.png │ ├── plugin.png │ └── plugin_cur.png ├── LICENSE ├── README.md ├── demo ├── app.js ├── app.json ├── app.wxss ├── colorui │ ├── animation.wxss │ ├── components │ │ ├── cu-custom.js │ │ ├── cu-custom.json │ │ ├── cu-custom.wxml │ │ └── cu-custom.wxss │ ├── icon.wxss │ └── main.wxss ├── images │ ├── BasicsBg.png │ ├── cjkz.png │ ├── componentBg.png │ ├── logo.png │ ├── share.jpg │ ├── tabbar │ │ ├── about.png │ │ ├── about_cur.png │ │ ├── basics.png │ │ ├── basics_cur.png │ │ ├── component.png │ │ ├── component_cur.png │ │ ├── plugin.png │ │ └── plugin_cur.png │ ├── wave.gif │ └── zanCode.jpg ├── pages │ ├── about │ │ ├── about │ │ │ ├── about.js │ │ │ ├── about.json │ │ │ ├── about.wxml │ │ │ └── about.wxss │ │ ├── home │ │ │ ├── home.js │ │ │ ├── home.json │ │ │ ├── home.wxml │ │ │ └── home.wxss │ │ ├── log │ │ │ ├── log.js │ │ │ ├── log.json │ │ │ ├── log.wxml │ │ │ └── log.wxss │ │ └── test │ │ │ ├── filter.js │ │ │ ├── filter.json │ │ │ ├── filter.wxml │ │ │ ├── filter.wxss │ │ │ ├── list.js │ │ │ ├── list.json │ │ │ ├── list.wxml │ │ │ └── list.wxss │ ├── auth │ │ ├── auth.js │ │ ├── auth.json │ │ ├── auth.wxml │ │ └── auth.wxss │ ├── basics │ │ ├── avatar │ │ │ ├── avatar.js │ │ │ ├── avatar.json │ │ │ ├── avatar.wxml │ │ │ └── avatar.wxss │ │ ├── background │ │ │ ├── background.js │ │ │ ├── background.json │ │ │ ├── background.wxml │ │ │ └── background.wxss │ │ ├── button │ │ │ ├── button.js │ │ │ ├── button.json │ │ │ ├── button.wxml │ │ │ ├── button.wxss │ │ │ ├── design.js │ │ │ ├── design.json │ │ │ ├── design.wxml │ │ │ └── design.wxss │ │ ├── home │ │ │ ├── home.js │ │ │ ├── home.json │ │ │ ├── home.wxml │ │ │ └── home.wxss │ │ ├── icon │ │ │ ├── icon.js │ │ │ ├── icon.json │ │ │ ├── icon.wxml │ │ │ └── icon.wxss │ │ ├── layout │ │ │ ├── layout.js │ │ │ ├── layout.json │ │ │ ├── layout.wxml │ │ │ └── layout.wxss │ │ ├── loading │ │ │ ├── loading.js │ │ │ ├── loading.json │ │ │ ├── loading.wxml │ │ │ └── loading.wxss │ │ ├── progress │ │ │ ├── progress.js │ │ │ ├── progress.json │ │ │ ├── progress.wxml │ │ │ └── progress.wxss │ │ ├── shadow │ │ │ ├── shadow.js │ │ │ ├── shadow.json │ │ │ ├── shadow.wxml │ │ │ └── shadow.wxss │ │ ├── tag │ │ │ ├── tag.js │ │ │ ├── tag.json │ │ │ ├── tag.wxml │ │ │ └── tag.wxss │ │ └── text │ │ │ ├── text.js │ │ │ ├── text.json │ │ │ ├── text.wxml │ │ │ └── text.wxss │ ├── component │ │ ├── bar │ │ │ ├── bar.js │ │ │ ├── bar.json │ │ │ ├── bar.wxml │ │ │ └── bar.wxss │ │ ├── card │ │ │ ├── card.js │ │ │ ├── card.json │ │ │ ├── card.wxml │ │ │ └── card.wxss │ │ ├── chat │ │ │ ├── chat.js │ │ │ ├── chat.json │ │ │ ├── chat.wxml │ │ │ └── chat.wxss │ │ ├── form │ │ │ ├── form.js │ │ │ ├── form.json │ │ │ ├── form.wxml │ │ │ └── form.wxss │ │ ├── home │ │ │ ├── home.js │ │ │ ├── home.json │ │ │ ├── home.wxml │ │ │ └── home.wxss │ │ ├── list │ │ │ ├── list.js │ │ │ ├── list.json │ │ │ ├── list.wxml │ │ │ └── list.wxss │ │ ├── modal │ │ │ ├── modal.js │ │ │ ├── modal.json │ │ │ ├── modal.wxml │ │ │ └── modal.wxss │ │ ├── nav │ │ │ ├── nav.js │ │ │ ├── nav.json │ │ │ ├── nav.wxml │ │ │ └── nav.wxss │ │ ├── steps │ │ │ ├── steps.js │ │ │ ├── steps.json │ │ │ ├── steps.wxml │ │ │ └── steps.wxss │ │ ├── swiper │ │ │ ├── swiper.js │ │ │ ├── swiper.json │ │ │ ├── swiper.wxml │ │ │ └── swiper.wxss │ │ └── timeline │ │ │ ├── timeline.js │ │ │ ├── timeline.json │ │ │ ├── timeline.wxml │ │ │ └── timeline.wxss │ ├── index │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ └── plugin │ │ ├── animation │ │ ├── animation.js │ │ ├── animation.json │ │ ├── animation.wxml │ │ └── animation.wxss │ │ ├── drawer │ │ ├── drawer.js │ │ ├── drawer.json │ │ ├── drawer.wxml │ │ └── drawer.wxss │ │ ├── gradual │ │ ├── gradual.js │ │ ├── gradual.json │ │ ├── gradual.wxml │ │ └── gradual.wxss │ │ ├── home │ │ ├── home.js │ │ ├── home.json │ │ ├── home.wxml │ │ └── home.wxss │ │ ├── indexes │ │ ├── indexes.js │ │ ├── indexes.json │ │ ├── indexes.wxml │ │ └── indexes.wxss │ │ └── verticalnav │ │ ├── verticalnav.js │ │ ├── verticalnav.json │ │ ├── verticalnav.wxml │ │ └── verticalnav.wxss ├── project.config.json ├── sitemap.json └── sitemap21.json └── template ├── app.js ├── app.json ├── app.wxss ├── colorui ├── animation.wxss ├── components │ ├── cu-custom.js │ ├── cu-custom.json │ ├── cu-custom.wxml │ └── cu-custom.wxss ├── icon.wxss └── main.wxss ├── pages └── index │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss ├── project.config.json ├── sitemap.json └── utils └── util.js /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/.DS_Store -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: ['https://cos.color-ui.com/web/yehv3.jpg'] 13 | -------------------------------------------------------------------------------- /Colorui-UniApp/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/Colorui-UniApp/.DS_Store -------------------------------------------------------------------------------- /Colorui-UniApp/Readme.md: -------------------------------------------------------------------------------- 1 |

ColorUI简介

2 | 3 | ## 前言 4 | ColorUI是一个css库!!!在你引入样式后可以根据class来调用组件,一些含有交互的操作我也有简单写,可以为你开发提供一些思路。插件市场版本如果和更新日志不一样,请移步Github下载。有组件需求或者Bug提交也可以移步到issues。 5 | 6 | ## 交流 7 | 微信群:加入微信群请先添加开发者微信,备注UniApp插件市场。QQ群:240787041 或扫描二维码。 8 |

9 | 10 | ## 素材 11 | ColorUI在语雀有个群友共同在维护的知识库,里面有一些群友改的模板和UI素材供开发使用哦! 12 | [语雀-ColorUI群资源](https://www.yuque.com/colorui) 13 | 14 | ## 开始使用 15 | 下载源码解压,复制根目录的 `/colorui` 文件夹到你的根目录 16 | 17 | `App.vue` 引入关键Css `main.css` `icon.css` 18 | ``` 19 | 25 | ``` 26 | 27 | ------ 28 | 29 | ## 使用自定义导航栏 30 | 导航栏作为常用组件有做简单封装,当然你也可以直接复制代码结构自己修改,达到个性化目的。 31 | 32 | `App.vue` 获得系统信息 33 | ``` 34 | onLaunch: function() { 35 | uni.getSystemInfo({ 36 | success: function(e) { 37 | // #ifndef MP 38 | Vue.prototype.StatusBar = e.statusBarHeight; 39 | if (e.platform == 'android') { 40 | Vue.prototype.CustomBar = e.statusBarHeight + 50; 41 | } else { 42 | Vue.prototype.CustomBar = e.statusBarHeight + 45; 43 | }; 44 | // #endif 45 | // #ifdef MP-WEIXIN 46 | Vue.prototype.StatusBar = e.statusBarHeight; 47 | let custom = wx.getMenuButtonBoundingClientRect(); 48 | Vue.prototype.Custom = custom; 49 | Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight; 50 | // #endif 51 | // #ifdef MP-ALIPAY 52 | Vue.prototype.StatusBar = e.statusBarHeight; 53 | Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight; 54 | // #endif 55 | } 56 | }) 57 | }, 58 | ``` 59 | 60 | `pages.json` 配置取消系统导航栏 61 | ``` 62 | "globalStyle": { 63 | "navigationStyle": "custom" 64 | }, 65 | ``` 66 | 复制代码结构可以直接使用,注意全局变量的获取。 67 | 68 | 使用封装,在`main.js` 引入 `cu-custom` 组件。 69 | ``` 70 | import cuCustom from './colorui/components/cu-custom.vue' 71 | Vue.component('cu-custom',cuCustom) 72 | ``` 73 | 74 | `page.vue` 页面可以直接调用了 75 | ``` 76 | 77 | 返回 78 | 导航栏 79 | 80 | ``` 81 | | 参数 | 作用 |类型 | 默认值 | 82 | | -------- | -----: |-----: | :----: | 83 | | bgColor | 背景颜色类名 |String | '' | 84 | | isBack | 是否开启返回 | Boolean | false | 85 | | bgImage | 背景图片路径 | String | '' | 86 | 87 | | slot块 | 作用 | 88 | | -------- | -----: | 89 | | backText | 返回时的文字 | 90 | | content | 中间区域 | 91 | | right | 右侧区域(小程序端可使用范围很窄!) | 92 | 93 | 94 | ------ 95 | 96 | 97 | ## 使用自定义Tabbar 98 | 这部分暂时没有封装,思路可以参考下我的源码,原理是一个主页面引入多个页面,在主页面进行切换显示。这样可以解决切换时闪烁的问题。 99 | 100 | 101 | ------ 102 | 103 | 104 | ## 更新日志 105 | 106 | * 2019年4月25日 v2.1.6 107 | * 删除var变量 向下兼容安卓APP 108 | * 优化单选等表单控件 109 | 110 | * 2019年4月25日 v2.1.5 111 | * 优化图片上传 112 | * 优化一些点击区域过小 113 | * 优化图标旋转 114 | * 优化demo显示 115 | * 优化阴影 116 | * 修复支付宝小程序编译出错 117 | 118 | * 2019年4月14日 v2.1.4 119 | * 新增多种阴影 120 | * 修复一些var属性的错误 121 | * 修复轮播图控制点隐藏不了 122 | * 修改图标类名 123 | * 修复表单组件里上传图片 ios没有图片显示问题 124 | 125 | 126 | * 2019年4月01日 v2.1.3 127 | * 优化代码,支持支付宝小程序 128 | * textarea 样式还原 129 | 130 | * 2019年3月28日 v2.1.2 131 | * 修复列表组件样式 132 | * 优化主样式代码 133 | 134 | * 2019年3月27日 v2.1.1 135 | * 新增多种扩展 136 | * 优化堆叠轮播图 137 | * 优化消息列表 138 | * 优化导航栏的封装 139 | * 修复卡片评论错位(3月27日16:32:17) 140 | 141 | * 2019年3月25日 v2.1.0 142 | * 完成元素,组件移植 143 | * icon文件更改名称,避免图标冲突 144 | * 针对不同端口做了优化 -------------------------------------------------------------------------------- /Colorui-UniApp/colorui/animation.css: -------------------------------------------------------------------------------- 1 | /* 2 | Animation 微动画 3 | 基于ColorUI组建库的动画模块 by 文晓港 2019年3月26日19:52:28 4 | */ 5 | 6 | /* css 滤镜 控制黑白底色gif的 */ 7 | .gif-black{ 8 | mix-blend-mode: screen; 9 | } 10 | .gif-white{ 11 | mix-blend-mode: multiply; 12 | } 13 | 14 | 15 | /* Animation css */ 16 | [class*=animation-] { 17 | animation-duration: .5s; 18 | animation-timing-function: ease-out; 19 | animation-fill-mode: both 20 | } 21 | 22 | .animation-fade { 23 | animation-name: fade; 24 | animation-duration: .8s; 25 | animation-timing-function: linear 26 | } 27 | 28 | .animation-scale-up { 29 | animation-name: scale-up 30 | } 31 | 32 | .animation-scale-down { 33 | animation-name: scale-down 34 | } 35 | 36 | .animation-slide-top { 37 | animation-name: slide-top 38 | } 39 | 40 | .animation-slide-bottom { 41 | animation-name: slide-bottom 42 | } 43 | 44 | .animation-slide-left { 45 | animation-name: slide-left 46 | } 47 | 48 | .animation-slide-right { 49 | animation-name: slide-right 50 | } 51 | 52 | .animation-shake { 53 | animation-name: shake 54 | } 55 | 56 | .animation-reverse { 57 | animation-direction: reverse 58 | } 59 | 60 | @keyframes fade { 61 | 0% { 62 | opacity: 0 63 | } 64 | 65 | 100% { 66 | opacity: 1 67 | } 68 | } 69 | 70 | @keyframes scale-up { 71 | 0% { 72 | opacity: 0; 73 | transform: scale(.2) 74 | } 75 | 76 | 100% { 77 | opacity: 1; 78 | transform: scale(1) 79 | } 80 | } 81 | 82 | @keyframes scale-down { 83 | 0% { 84 | opacity: 0; 85 | transform: scale(1.8) 86 | } 87 | 88 | 100% { 89 | opacity: 1; 90 | transform: scale(1) 91 | } 92 | } 93 | 94 | @keyframes slide-top { 95 | 0% { 96 | opacity: 0; 97 | transform: translateY(-100%) 98 | } 99 | 100 | 100% { 101 | opacity: 1; 102 | transform: translateY(0) 103 | } 104 | } 105 | 106 | @keyframes slide-bottom { 107 | 0% { 108 | opacity: 0; 109 | transform: translateY(100%) 110 | } 111 | 112 | 100% { 113 | opacity: 1; 114 | transform: translateY(0) 115 | } 116 | } 117 | 118 | @keyframes shake { 119 | 120 | 0%, 121 | 100% { 122 | transform: translateX(0) 123 | } 124 | 125 | 10% { 126 | transform: translateX(-9px) 127 | } 128 | 129 | 20% { 130 | transform: translateX(8px) 131 | } 132 | 133 | 30% { 134 | transform: translateX(-7px) 135 | } 136 | 137 | 40% { 138 | transform: translateX(6px) 139 | } 140 | 141 | 50% { 142 | transform: translateX(-5px) 143 | } 144 | 145 | 60% { 146 | transform: translateX(4px) 147 | } 148 | 149 | 70% { 150 | transform: translateX(-3px) 151 | } 152 | 153 | 80% { 154 | transform: translateX(2px) 155 | } 156 | 157 | 90% { 158 | transform: translateX(-1px) 159 | } 160 | } 161 | 162 | @keyframes slide-left { 163 | 0% { 164 | opacity: 0; 165 | transform: translateX(-100%) 166 | } 167 | 168 | 100% { 169 | opacity: 1; 170 | transform: translateX(0) 171 | } 172 | } 173 | 174 | @keyframes slide-right { 175 | 0% { 176 | opacity: 0; 177 | transform: translateX(100%) 178 | } 179 | 180 | 100% { 181 | opacity: 1; 182 | transform: translateX(0) 183 | } 184 | } -------------------------------------------------------------------------------- /Colorui-UniApp/colorui/components/cu-custom.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 66 | 67 | 70 | -------------------------------------------------------------------------------- /Colorui-UniApp/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App' 3 | 4 | import basics from './pages/basics/home.vue' 5 | Vue.component('basics',basics) 6 | 7 | import components from './pages/component/home.vue' 8 | Vue.component('components',components) 9 | 10 | import plugin from './pages/plugin/home.vue' 11 | Vue.component('plugin',plugin) 12 | 13 | import cuCustom from './colorui/components/cu-custom.vue' 14 | Vue.component('cu-custom',cuCustom) 15 | 16 | Vue.config.productionTip = false 17 | 18 | App.mpType = 'app' 19 | 20 | const app = new Vue({ 21 | ...App 22 | }) 23 | app.$mount() 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Colorui-UniApp/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "ColorUi for UniApp", 3 | "appid" : "", 4 | "description" : "", 5 | "versionName" : "ColorUi for UniApp 2.1.4", 6 | "versionCode" : 214, 7 | "transformPx" : false, 8 | "app-plus" : { 9 | /* 5+App特有相关 */ 10 | "modules" : {}, 11 | /* 模块配置 */ 12 | "distribute" : { 13 | /* 应用发布信息 */ 14 | "android" : { 15 | /* android打包配置 */ 16 | "permissions" : [ 17 | "", 18 | "", 19 | "", 20 | "", 21 | "", 22 | "", 23 | "", 24 | "", 25 | "", 26 | "", 27 | "", 28 | "", 29 | "", 30 | "", 31 | "", 32 | "", 33 | "", 34 | "", 35 | "", 36 | "", 37 | "", 38 | "" 39 | ] 40 | }, 41 | "ios" : {}, 42 | /* ios打包配置 */ 43 | "sdkConfigs" : {} 44 | } 45 | }, 46 | /* SDK配置 */ 47 | "quickapp" : {}, 48 | /* 快应用特有相关 */ 49 | "mp-weixin" : { 50 | /* 小程序特有相关 */ 51 | "appid" : "", 52 | "setting" : { 53 | "urlCheck" : false, 54 | "es6" : true 55 | } 56 | }, 57 | "h5" : { 58 | "title" : "ColorUi for UniApp", 59 | "domain" : "demo.color-ui.com" 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Colorui-UniApp/node_modules/.bin/prettier: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") 3 | 4 | case `uname` in 5 | *CYGWIN*) basedir=`cygpath -w "$basedir"`;; 6 | esac 7 | 8 | if [ -x "$basedir/node" ]; then 9 | "$basedir/node" "$basedir/../prettier/bin-prettier.js" "$@" 10 | ret=$? 11 | else 12 | node "$basedir/../prettier/bin-prettier.js" "$@" 13 | ret=$? 14 | fi 15 | exit $ret 16 | -------------------------------------------------------------------------------- /Colorui-UniApp/node_modules/.bin/prettier.cmd: -------------------------------------------------------------------------------- 1 | @IF EXIST "%~dp0\node.exe" ( 2 | "%~dp0\node.exe" "%~dp0\..\prettier\bin-prettier.js" %* 3 | ) ELSE ( 4 | @SETLOCAL 5 | @SET PATHEXT=%PATHEXT:;.JS;=;% 6 | node "%~dp0\..\prettier\bin-prettier.js" %* 7 | ) -------------------------------------------------------------------------------- /Colorui-UniApp/node_modules/prettier/README.md: -------------------------------------------------------------------------------- 1 | ![Prettier Banner](https://raw.githubusercontent.com/prettier/prettier-logo/master/images/prettier-banner-light.png) 2 | 3 |

Opinionated Code Formatter

4 | 5 |

6 | 7 | JavaScript 8 | · Flow 9 | · TypeScript 10 | · CSS 11 | · SCSS 12 | · Less 13 | · JSX 14 | · Vue 15 | · GraphQL 16 | · JSON 17 | · Markdown 18 | · 19 | Your favorite language? 20 | 21 | 22 |

23 | 24 |

25 | 26 | Gitter 27 | 28 | 29 | Travis 30 | 31 | 32 | Codecov 33 | 34 | 35 | npm version 36 | 37 | 38 | monthly downloads 39 | 40 | 41 | code style: prettier 42 | 43 | 44 | Follow+Prettier+on+Twitter 45 | 46 |

47 | 48 | ## Intro 49 | 50 | Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary. 51 | 52 | ### Input 53 | 54 | 55 | ```js 56 | foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne()); 57 | ``` 58 | 59 | ### Output 60 | 61 | ```js 62 | foo( 63 | reallyLongArg(), 64 | omgSoManyParameters(), 65 | IShouldRefactorThis(), 66 | isThereSeriouslyAnotherOne() 67 | ); 68 | ``` 69 | 70 | Prettier can be run [in your editor](http://prettier.io/docs/en/editors.html) on-save, in a [pre-commit hook](https://prettier.io/docs/en/precommit.html), or in [CI environments](https://prettier.io/docs/en/cli.html#list-different) to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again! 71 | 72 | --- 73 | 74 | **[Documentation](https://prettier.io/docs/en/)** 75 | 76 | 77 | [Install](https://prettier.io/docs/en/install.html) · 78 | [Options](https://prettier.io/docs/en/options.html) · 79 | [CLI](https://prettier.io/docs/en/cli.html) · 80 | [API](https://prettier.io/docs/en/api.html) 81 | 82 | **[Playground](https://prettier.io/playground/)** 83 | 84 | --- 85 | 86 | ## Badge 87 | 88 | Show the world you're using _Prettier_ → [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) 89 | 90 | ```md 91 | [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) 92 | ``` 93 | 94 | ## Contributing 95 | 96 | See [CONTRIBUTING.md](CONTRIBUTING.md). 97 | -------------------------------------------------------------------------------- /Colorui-UniApp/node_modules/prettier/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "prettier@~1.12.0", 3 | "_id": "prettier@1.12.1", 4 | "_inBundle": false, 5 | "_integrity": "sha1-wa0g6APndJ+vkFpAnSNn4Gu+cyU=", 6 | "_location": "/prettier", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "prettier@~1.12.0", 12 | "name": "prettier", 13 | "escapedName": "prettier", 14 | "rawSpec": "~1.12.0", 15 | "saveSpec": null, 16 | "fetchSpec": "~1.12.0" 17 | }, 18 | "_requiredBy": [ 19 | "#USER", 20 | "/" 21 | ], 22 | "_resolved": "http://registry.npm.taobao.org/prettier/download/prettier-1.12.1.tgz", 23 | "_shasum": "c1ad20e803e7749faf905a409d2367e06bbe7325", 24 | "_spec": "prettier@~1.12.0", 25 | "_where": "E:\\weilanwlSVN\\colorui\\github\\ColorUI\\Colorui-UniApp", 26 | "author": { 27 | "name": "James Long" 28 | }, 29 | "bin": { 30 | "prettier": "./bin-prettier.js" 31 | }, 32 | "bugs": { 33 | "url": "https://github.com/prettier/prettier/issues" 34 | }, 35 | "bundleDependencies": false, 36 | "deprecated": false, 37 | "description": "Prettier is an opinionated code formatter", 38 | "devDependencies": { 39 | "babel-cli": "6.24.1", 40 | "babel-preset-es2015": "6.24.1", 41 | "codecov": "2.2.0", 42 | "cross-env": "5.0.5", 43 | "eslint": "4.18.2", 44 | "eslint-config-prettier": "2.9.0", 45 | "eslint-friendly-formatter": "3.0.0", 46 | "eslint-plugin-import": "2.9.0", 47 | "eslint-plugin-prettier": "2.6.0", 48 | "eslint-plugin-react": "7.7.0", 49 | "jest": "21.1.0", 50 | "mkdirp": "0.5.1", 51 | "prettier": "1.12.0", 52 | "prettylint": "1.0.0", 53 | "rimraf": "2.6.2", 54 | "rollup": "0.47.6", 55 | "rollup-plugin-commonjs": "8.2.6", 56 | "rollup-plugin-json": "2.1.1", 57 | "rollup-plugin-node-builtins": "2.0.0", 58 | "rollup-plugin-node-globals": "1.1.0", 59 | "rollup-plugin-node-resolve": "2.0.0", 60 | "rollup-plugin-replace": "1.2.1", 61 | "shelljs": "0.8.1", 62 | "snapshot-diff": "0.2.2", 63 | "strip-ansi": "4.0.0", 64 | "tempy": "0.2.1", 65 | "uglify-es": "3.3.9", 66 | "webpack": "2.6.1" 67 | }, 68 | "engines": { 69 | "node": ">=4" 70 | }, 71 | "files": [ 72 | "*.js" 73 | ], 74 | "homepage": "https://prettier.io", 75 | "license": "MIT", 76 | "main": "./index.js", 77 | "name": "prettier", 78 | "repository": { 79 | "type": "git", 80 | "url": "git+https://github.com/prettier/prettier.git" 81 | }, 82 | "scripts": { 83 | "prepublishOnly": "node -e \"assert.equal(require('.').version, require('..').version)\"" 84 | }, 85 | "version": "1.12.1" 86 | } 87 | -------------------------------------------------------------------------------- /Colorui-UniApp/node_modules/prettier/parser-vue.js: -------------------------------------------------------------------------------- 1 | "use strict";function makeMap(e,t){const n=Object.create(null),a=e.split(",");for(let e=0;en[e.toLowerCase()]:e=>n[e]}const no=()=>!1,isNonPhrasingTag=makeMap("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),attribute=/^\s*([^\s"'<>/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ncname="[a-zA-Z_][\\w\\-\\.]*",qnameCapture=`((?:${ncname}\\:)?${ncname})`,startTagOpen=new RegExp(`^<${qnameCapture}`),startTagClose=/^\s*(\/?)>/,endTag=new RegExp(`^<\\/${qnameCapture}[^>]*>`),doctype=/^]+>/i,comment=/^/g,"$1").replace(//g,"$1")),shouldIgnoreFirstNewline(a,r)&&(r=r.slice(1)),t.chars&&t.chars(r),""));i+=e.length-o.length,e=o,h(a,i-n,i)}else{let n,a,r,o=e.indexOf("<");if(0===o){if(comment.test(e)){const n=e.indexOf("--\x3e");if(n>=0){t.shouldKeepComment&&t.comment(e.substring(4,n)),l(n+3);continue}}if(conditionalComment.test(e)){const t=e.indexOf("]>");if(t>=0){l(t+2);continue}}const n=e.match(doctype);if(n){l(n[0].length);continue}const a=e.match(endTag);if(a){const e=i;l(a[0].length),h(a[1],e,i);continue}const r=d();if(r){g(r),shouldIgnoreFirstNewline(c,e)&&l(1);continue}}if(o>=0){for(a=e.slice(o);!(endTag.test(a)||startTagOpen.test(a)||comment.test(a)||conditionalComment.test(a)||(r=a.indexOf("<",1))<0);)o+=r,a=e.slice(o);n=e.substring(0,o),l(o)}o<0&&(n=e,e=""),t.chars&&n&&t.chars(n)}if(e===s){t.chars&&t.chars(e),"production"!==process.env.NODE_ENV&&!n.length&&t.warn&&t.warn(`Mal-formatted tag at end of template: "${e}"`);break}}function l(t){i+=t,e=e.substring(t)}function d(){const t=e.match(startTagOpen);if(t){const n={tagName:t[1],attrs:[],start:i};let a,r;for(l(t[0].length);!(a=e.match(startTagClose))&&(r=e.match(attribute));)l(r[0].length),n.attrs.push(r);if(a)return n.unarySlash=a[1],l(a[0].length),n.end=i,n}}function g(e){const s=e.tagName,i=e.unarySlash;a&&("p"===c&&isNonPhrasingTag(s)&&h(c),o(s)&&c===s&&h(s));const l=r(s)||!!i,d=e.attrs.length,g=new Array(d);for(let n=0;n=0&&n[o].lowerCasedTag!==s;o--);else o=0;if(o>=0){for(let s=n.length-1;s>=o;s--)"production"!==process.env.NODE_ENV&&(s>o||!e)&&t.warn&&t.warn(`tag <${n[s].tag}> has no matching end tag.`),t.end&&t.end(n[s].tag,a,r);n.length=o,c=o&&n[o-1].tag}else"br"===s?t.start&&t.start(e,[],!0,a,r):"p"===s&&(t.start&&t.start(e,[],!1,a,r),t.end&&t.end(e,a,r))}h()}function parse(e){const t={tag:"root",attrs:[],unary:!1,start:0,contentStart:0,contentEnd:e.length,end:e.length,children:[],comments:[]},n=[t];let a=t;return parseHTML(e,{start:function(e,t,r,o,s){const c={tag:e,attrs:t,unary:r,start:o,children:[]};a.children.push(c),r?c.end=s:(c.contentStart=s,n.push(c),a=c)},end:function(e,t,r){n.pop(),a.contentEnd=t,a.end=r,a=n[n.length-1]}}),t}var parserVue=parse;module.exports=parserVue; 2 | -------------------------------------------------------------------------------- /Colorui-UniApp/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "requires": true, 3 | "lockfileVersion": 1, 4 | "dependencies": { 5 | "prettier": { 6 | "version": "1.12.1", 7 | "resolved": "http://registry.npm.taobao.org/prettier/download/prettier-1.12.1.tgz", 8 | "integrity": "sha1-wa0g6APndJ+vkFpAnSNn4Gu+cyU=" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Colorui-UniApp/pages.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages 4 | { 5 | "path": "pages/index/index", 6 | "style": {} 7 | }, 8 | { 9 | "path": "pages/basics/layout", 10 | "style": {} 11 | }, 12 | { 13 | "path": "pages/basics/background", 14 | "style": {} 15 | }, 16 | { 17 | "path": "pages/basics/text", 18 | "style": {} 19 | }, 20 | { 21 | "path": "pages/basics/icon", 22 | "style": {} 23 | }, 24 | { 25 | "path": "pages/basics/button", 26 | "style": {} 27 | }, 28 | { 29 | "path": "pages/basics/design", 30 | "style": {} 31 | }, 32 | { 33 | "path": "pages/basics/tag", 34 | "style": {} 35 | }, 36 | { 37 | "path": "pages/basics/avatar", 38 | "style": {} 39 | }, 40 | { 41 | "path": "pages/basics/progress", 42 | "style": {} 43 | }, 44 | { 45 | "path": "pages/basics/shadow", 46 | "style": {} 47 | }, 48 | { 49 | "path": "pages/basics/loading", 50 | "style": {} 51 | }, 52 | { 53 | "path": "pages/component/bar", 54 | "style": {} 55 | }, 56 | { 57 | "path": "pages/component/nav", 58 | "style": {} 59 | }, 60 | { 61 | "path": "pages/component/list", 62 | "style": {} 63 | }, 64 | { 65 | "path": "pages/component/card", 66 | "style": {} 67 | }, 68 | { 69 | "path": "pages/component/form", 70 | "style": {} 71 | }, 72 | { 73 | "path": "pages/component/timeline", 74 | "style": {} 75 | }, 76 | { 77 | "path": "pages/component/chat", 78 | "style": {} 79 | }, 80 | { 81 | "path": "pages/component/swiper", 82 | "style": {} 83 | }, 84 | { 85 | "path": "pages/component/modal", 86 | "style": {} 87 | }, 88 | { 89 | "path": "pages/component/steps", 90 | "style": {} 91 | }, { 92 | "path": "pages/plugin/indexes", 93 | "style": {} 94 | }, { 95 | "path": "pages/plugin/animation", 96 | "style": {} 97 | }, { 98 | "path": "pages/plugin/drawer", 99 | "style": {} 100 | }, { 101 | "path": "pages/plugin/verticalnav", 102 | "style": {} 103 | } 104 | ], 105 | "globalStyle": { 106 | "mp-alipay": { 107 | /* 支付宝小程序特有相关 */ 108 | "transparentTitle": "always", 109 | "allowsBounceVertical": "NO" 110 | }, 111 | "navigationBarBackgroundColor": "#0081ff", 112 | "navigationBarTitleText": "ColorUi for UniApp", 113 | "navigationStyle": "custom", 114 | "navigationBarTextStyle": "white" 115 | }, 116 | "usingComponts": true, 117 | "condition": { //模式配置,仅开发期间生效 118 | "current": 0, //当前激活的模式(list 的索引项) 119 | "list": [{ 120 | "name": "表单", //模式名称 121 | "path": "pages/component/form", //启动页面 122 | "query": "" //启动参数 123 | } 124 | ] 125 | } 126 | 127 | } 128 | -------------------------------------------------------------------------------- /Colorui-UniApp/pages/basics/avatar.vue: -------------------------------------------------------------------------------- 1 | 88 | 89 | 105 | 106 | 109 | -------------------------------------------------------------------------------- /Colorui-UniApp/pages/basics/button.vue: -------------------------------------------------------------------------------- 1 | 100 | 101 | 120 | 121 | 124 | -------------------------------------------------------------------------------- /Colorui-UniApp/pages/basics/design.vue: -------------------------------------------------------------------------------- 1 | 75 | 76 | 122 | 123 | 131 | -------------------------------------------------------------------------------- /Colorui-UniApp/pages/basics/home.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 92 | 93 | 98 | -------------------------------------------------------------------------------- /Colorui-UniApp/pages/basics/loading.vue: -------------------------------------------------------------------------------- 1 | 63 | 64 | 65 | 98 | 99 | 102 | -------------------------------------------------------------------------------- /Colorui-UniApp/pages/basics/shadow.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | 51 | 52 | 55 | -------------------------------------------------------------------------------- /Colorui-UniApp/pages/basics/tag.vue: -------------------------------------------------------------------------------- 1 | 117 | 118 | 127 | 128 | 131 | -------------------------------------------------------------------------------- /Colorui-UniApp/pages/component/chat.vue: -------------------------------------------------------------------------------- 1 | 90 | 91 | 108 | 109 | 114 | -------------------------------------------------------------------------------- /Colorui-UniApp/pages/component/home.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 87 | 88 | 93 | -------------------------------------------------------------------------------- /Colorui-UniApp/pages/component/nav.vue: -------------------------------------------------------------------------------- 1 | 70 | 71 | 87 | 88 | 91 | -------------------------------------------------------------------------------- /Colorui-UniApp/pages/component/steps.vue: -------------------------------------------------------------------------------- 1 | 66 | 67 | 111 | 112 | 115 | -------------------------------------------------------------------------------- /Colorui-UniApp/pages/component/timeline.vue: -------------------------------------------------------------------------------- 1 | 88 | 89 | 98 | 99 | 102 | -------------------------------------------------------------------------------- /Colorui-UniApp/pages/index/index.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 43 | 44 | 47 | -------------------------------------------------------------------------------- /Colorui-UniApp/pages/plugin/home.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 61 | 62 | 104 | -------------------------------------------------------------------------------- /Colorui-UniApp/static/BasicsBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/Colorui-UniApp/static/BasicsBg.png -------------------------------------------------------------------------------- /Colorui-UniApp/static/cjkz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/Colorui-UniApp/static/cjkz.png -------------------------------------------------------------------------------- /Colorui-UniApp/static/componentBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/Colorui-UniApp/static/componentBg.png -------------------------------------------------------------------------------- /Colorui-UniApp/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/Colorui-UniApp/static/logo.png -------------------------------------------------------------------------------- /Colorui-UniApp/static/tabbar/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/Colorui-UniApp/static/tabbar/about.png -------------------------------------------------------------------------------- /Colorui-UniApp/static/tabbar/about_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/Colorui-UniApp/static/tabbar/about_cur.png -------------------------------------------------------------------------------- /Colorui-UniApp/static/tabbar/basics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/Colorui-UniApp/static/tabbar/basics.png -------------------------------------------------------------------------------- /Colorui-UniApp/static/tabbar/basics_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/Colorui-UniApp/static/tabbar/basics_cur.png -------------------------------------------------------------------------------- /Colorui-UniApp/static/tabbar/component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/Colorui-UniApp/static/tabbar/component.png -------------------------------------------------------------------------------- /Colorui-UniApp/static/tabbar/component_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/Colorui-UniApp/static/tabbar/component_cur.png -------------------------------------------------------------------------------- /Colorui-UniApp/static/tabbar/plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/Colorui-UniApp/static/tabbar/plugin.png -------------------------------------------------------------------------------- /Colorui-UniApp/static/tabbar/plugin_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/Colorui-UniApp/static/tabbar/plugin_cur.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 weilanwl 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /demo/app.js: -------------------------------------------------------------------------------- 1 | //app.js 2 | App({ 3 | onLaunch: function() { 4 | if (wx.cloud) { 5 | wx.cloud.init({ 6 | traceUser: true 7 | }) 8 | } 9 | wx.getSystemInfo({ 10 | success: e => { 11 | this.globalData.StatusBar = e.statusBarHeight; 12 | let capsule = wx.getMenuButtonBoundingClientRect(); 13 | if (capsule) { 14 | this.globalData.Custom = capsule; 15 | this.globalData.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight; 16 | } else { 17 | this.globalData.CustomBar = e.statusBarHeight + 50; 18 | } 19 | } 20 | }) 21 | }, 22 | globalData: { 23 | ColorList: [{ 24 | title: '嫣红', 25 | name: 'red', 26 | color: '#e54d42' 27 | }, 28 | { 29 | title: '桔橙', 30 | name: 'orange', 31 | color: '#f37b1d' 32 | }, 33 | { 34 | title: '明黄', 35 | name: 'yellow', 36 | color: '#fbbd08' 37 | }, 38 | { 39 | title: '橄榄', 40 | name: 'olive', 41 | color: '#8dc63f' 42 | }, 43 | { 44 | title: '森绿', 45 | name: 'green', 46 | color: '#39b54a' 47 | }, 48 | { 49 | title: '天青', 50 | name: 'cyan', 51 | color: '#1cbbb4' 52 | }, 53 | { 54 | title: '海蓝', 55 | name: 'blue', 56 | color: '#0081ff' 57 | }, 58 | { 59 | title: '姹紫', 60 | name: 'purple', 61 | color: '#6739b6' 62 | }, 63 | { 64 | title: '木槿', 65 | name: 'mauve', 66 | color: '#9c26b0' 67 | }, 68 | { 69 | title: '桃粉', 70 | name: 'pink', 71 | color: '#e03997' 72 | }, 73 | { 74 | title: '棕褐', 75 | name: 'brown', 76 | color: '#a5673f' 77 | }, 78 | { 79 | title: '玄灰', 80 | name: 'grey', 81 | color: '#8799a3' 82 | }, 83 | { 84 | title: '草灰', 85 | name: 'gray', 86 | color: '#aaaaaa' 87 | }, 88 | { 89 | title: '墨黑', 90 | name: 'black', 91 | color: '#333333' 92 | }, 93 | { 94 | title: '雅白', 95 | name: 'white', 96 | color: '#ffffff' 97 | }, 98 | ] 99 | } 100 | }) -------------------------------------------------------------------------------- /demo/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/index/index", 4 | "pages/basics/home/home", 5 | "pages/basics/layout/layout", 6 | "pages/basics/button/button", 7 | "pages/basics/button/design", 8 | "pages/basics/tag/tag", 9 | "pages/basics/avatar/avatar", 10 | "pages/basics/progress/progress", 11 | "pages/basics/shadow/shadow", 12 | "pages/basics/background/background", 13 | "pages/basics/text/text", 14 | "pages/basics/icon/icon", 15 | "pages/basics/loading/loading", 16 | "pages/component/home/home", 17 | "pages/component/list/list", 18 | "pages/component/bar/bar", 19 | "pages/component/timeline/timeline", 20 | "pages/component/chat/chat", 21 | "pages/component/form/form", 22 | "pages/component/nav/nav", 23 | "pages/component/card/card", 24 | "pages/component/swiper/swiper", 25 | "pages/component/modal/modal", 26 | "pages/component/steps/steps", 27 | "pages/plugin/home/home", 28 | "pages/plugin/indexes/indexes", 29 | "pages/plugin/gradual/gradual", 30 | "pages/plugin/animation/animation", 31 | "pages/about/about/about", 32 | "pages/about/log/log", 33 | "pages/about/test/list", 34 | "pages/about/test/filter", 35 | "pages/about/home/home", 36 | "pages/plugin/drawer/drawer", 37 | "pages/plugin/verticalnav/verticalnav" 38 | ], 39 | "window": { 40 | "navigationBarBackgroundColor": "#39b54a", 41 | "navigationBarTitleText": "Color UI", 42 | "navigationStyle": "custom", 43 | "navigationBarTextStyle": "white" 44 | }, 45 | "usingComponents": { 46 | "cu-custom": "/colorui/components/cu-custom" 47 | }, 48 | "sitemapLocation": "sitemap21.json" 49 | } -------------------------------------------------------------------------------- /demo/app.wxss: -------------------------------------------------------------------------------- 1 | @import "colorui/main.wxss"; 2 | @import "colorui/icon.wxss"; 3 | 4 | .scrollPage { 5 | height: 100vh; 6 | } 7 | 8 | .nav-list { 9 | display: flex; 10 | flex-wrap: wrap; 11 | padding: 0px 40rpx 0px; 12 | justify-content: space-between; 13 | } 14 | 15 | .nav-li { 16 | padding: 30rpx; 17 | border-radius: 12rpx; 18 | width: 45%; 19 | margin: 0 2.5% 40rpx; 20 | background-image: url(https://image.weilanwl.com/color2.0/cardBg.png); 21 | background-size: cover; 22 | background-position: center; 23 | position: relative; 24 | z-index: 1; 25 | } 26 | 27 | .nav-li::after { 28 | content: ""; 29 | position: absolute; 30 | z-index: -1; 31 | background-color: inherit; 32 | width: 100%; 33 | height: 100%; 34 | left: 0; 35 | bottom: -10%; 36 | border-radius: 10rpx; 37 | opacity: 0.2; 38 | transform: scale(0.9, 0.9); 39 | } 40 | 41 | .nav-li.cur { 42 | color: #fff; 43 | background: rgb(94, 185, 94); 44 | box-shadow: 4rpx 4rpx 6rpx rgba(94, 185, 94, 0.4); 45 | } 46 | 47 | .nav-title { 48 | font-size: 32rpx; 49 | font-weight: 300; 50 | } 51 | 52 | .nav-title::first-letter { 53 | font-size: 40rpx; 54 | margin-right: 4rpx; 55 | } 56 | 57 | .nav-name { 58 | font-size: 28rpx; 59 | text-transform: Capitalize; 60 | margin-top: 20rpx; 61 | position: relative; 62 | } 63 | 64 | .nav-name::before { 65 | content: ""; 66 | position: absolute; 67 | display: block; 68 | width: 40rpx; 69 | height: 6rpx; 70 | background: #fff; 71 | bottom: 0; 72 | right: 0; 73 | opacity: 0.5; 74 | } 75 | 76 | .nav-name::after { 77 | content: ""; 78 | position: absolute; 79 | display: block; 80 | width: 100rpx; 81 | height: 1px; 82 | background: #fff; 83 | bottom: 0; 84 | right: 40rpx; 85 | opacity: 0.3; 86 | } 87 | 88 | .nav-name::first-letter { 89 | font-weight: bold; 90 | font-size: 36rpx; 91 | margin-right: 1px; 92 | } 93 | 94 | .nav-li text { 95 | position: absolute; 96 | right: 30rpx; 97 | top: 30rpx; 98 | font-size: 52rpx; 99 | width: 60rpx; 100 | height: 60rpx; 101 | text-align: center; 102 | line-height: 60rpx; 103 | } 104 | 105 | .text-light { 106 | font-weight: 300; 107 | } 108 | -------------------------------------------------------------------------------- /demo/colorui/animation.wxss: -------------------------------------------------------------------------------- 1 | /* 2 | Animation 微动画 3 | 基于ColorUI组建库的动画模块 by 文晓港 2019年3月26日19:52:28 4 | */ 5 | 6 | /* css 滤镜 控制黑白底色gif的 */ 7 | .gif-black{ 8 | mix-blend-mode: screen; 9 | } 10 | .gif-white{ 11 | mix-blend-mode: multiply; 12 | } 13 | 14 | 15 | /* Animation css */ 16 | [class*=animation-] { 17 | animation-duration: .5s; 18 | animation-timing-function: ease-out; 19 | animation-fill-mode: both 20 | } 21 | 22 | .animation-fade { 23 | animation-name: fade; 24 | animation-duration: .8s; 25 | animation-timing-function: linear 26 | } 27 | 28 | .animation-scale-up { 29 | animation-name: scale-up 30 | } 31 | 32 | .animation-scale-down { 33 | animation-name: scale-down 34 | } 35 | 36 | .animation-slide-top { 37 | animation-name: slide-top 38 | } 39 | 40 | .animation-slide-bottom { 41 | animation-name: slide-bottom 42 | } 43 | 44 | .animation-slide-left { 45 | animation-name: slide-left 46 | } 47 | 48 | .animation-slide-right { 49 | animation-name: slide-right 50 | } 51 | 52 | .animation-shake { 53 | animation-name: shake 54 | } 55 | 56 | .animation-reverse { 57 | animation-direction: reverse 58 | } 59 | 60 | @keyframes fade { 61 | 0% { 62 | opacity: 0 63 | } 64 | 65 | 100% { 66 | opacity: 1 67 | } 68 | } 69 | 70 | @keyframes scale-up { 71 | 0% { 72 | opacity: 0; 73 | transform: scale(.2) 74 | } 75 | 76 | 100% { 77 | opacity: 1; 78 | transform: scale(1) 79 | } 80 | } 81 | 82 | @keyframes scale-down { 83 | 0% { 84 | opacity: 0; 85 | transform: scale(1.8) 86 | } 87 | 88 | 100% { 89 | opacity: 1; 90 | transform: scale(1) 91 | } 92 | } 93 | 94 | @keyframes slide-top { 95 | 0% { 96 | opacity: 0; 97 | transform: translateY(-100%) 98 | } 99 | 100 | 100% { 101 | opacity: 1; 102 | transform: translateY(0) 103 | } 104 | } 105 | 106 | @keyframes slide-bottom { 107 | 0% { 108 | opacity: 0; 109 | transform: translateY(100%) 110 | } 111 | 112 | 100% { 113 | opacity: 1; 114 | transform: translateY(0) 115 | } 116 | } 117 | 118 | @keyframes shake { 119 | 120 | 0%, 121 | 100% { 122 | transform: translateX(0) 123 | } 124 | 125 | 10% { 126 | transform: translateX(-9px) 127 | } 128 | 129 | 20% { 130 | transform: translateX(8px) 131 | } 132 | 133 | 30% { 134 | transform: translateX(-7px) 135 | } 136 | 137 | 40% { 138 | transform: translateX(6px) 139 | } 140 | 141 | 50% { 142 | transform: translateX(-5px) 143 | } 144 | 145 | 60% { 146 | transform: translateX(4px) 147 | } 148 | 149 | 70% { 150 | transform: translateX(-3px) 151 | } 152 | 153 | 80% { 154 | transform: translateX(2px) 155 | } 156 | 157 | 90% { 158 | transform: translateX(-1px) 159 | } 160 | } 161 | 162 | @keyframes slide-left { 163 | 0% { 164 | opacity: 0; 165 | transform: translateX(-100%) 166 | } 167 | 168 | 100% { 169 | opacity: 1; 170 | transform: translateX(0) 171 | } 172 | } 173 | 174 | @keyframes slide-right { 175 | 0% { 176 | opacity: 0; 177 | transform: translateX(100%) 178 | } 179 | 180 | 100% { 181 | opacity: 1; 182 | transform: translateX(0) 183 | } 184 | } -------------------------------------------------------------------------------- /demo/colorui/components/cu-custom.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Component({ 3 | /** 4 | * 组件的一些选项 5 | */ 6 | options: { 7 | addGlobalClass: true, 8 | multipleSlots: true 9 | }, 10 | /** 11 | * 组件的对外属性 12 | */ 13 | properties: { 14 | bgColor: { 15 | type: String, 16 | default: '' 17 | }, 18 | isCustom: { 19 | type: [Boolean, String], 20 | default: false 21 | }, 22 | isBack: { 23 | type: [Boolean, String], 24 | default: false 25 | }, 26 | bgImage: { 27 | type: String, 28 | default: '' 29 | }, 30 | }, 31 | /** 32 | * 组件的初始数据 33 | */ 34 | data: { 35 | StatusBar: app.globalData.StatusBar, 36 | CustomBar: app.globalData.CustomBar, 37 | Custom: app.globalData.Custom 38 | }, 39 | /** 40 | * 组件的方法列表 41 | */ 42 | methods: { 43 | BackPage() { 44 | wx.navigateBack({ 45 | delta: 1 46 | }); 47 | }, 48 | toHome(){ 49 | wx.reLaunch({ 50 | url: '/pages/index/index', 51 | }) 52 | } 53 | } 54 | }) -------------------------------------------------------------------------------- /demo/colorui/components/cu-custom.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /demo/colorui/components/cu-custom.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /demo/colorui/components/cu-custom.wxss: -------------------------------------------------------------------------------- 1 | /* colorui/components/cu-custom.wxss */ -------------------------------------------------------------------------------- /demo/images/BasicsBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/images/BasicsBg.png -------------------------------------------------------------------------------- /demo/images/cjkz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/images/cjkz.png -------------------------------------------------------------------------------- /demo/images/componentBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/images/componentBg.png -------------------------------------------------------------------------------- /demo/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/images/logo.png -------------------------------------------------------------------------------- /demo/images/share.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/images/share.jpg -------------------------------------------------------------------------------- /demo/images/tabbar/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/images/tabbar/about.png -------------------------------------------------------------------------------- /demo/images/tabbar/about_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/images/tabbar/about_cur.png -------------------------------------------------------------------------------- /demo/images/tabbar/basics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/images/tabbar/basics.png -------------------------------------------------------------------------------- /demo/images/tabbar/basics_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/images/tabbar/basics_cur.png -------------------------------------------------------------------------------- /demo/images/tabbar/component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/images/tabbar/component.png -------------------------------------------------------------------------------- /demo/images/tabbar/component_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/images/tabbar/component_cur.png -------------------------------------------------------------------------------- /demo/images/tabbar/plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/images/tabbar/plugin.png -------------------------------------------------------------------------------- /demo/images/tabbar/plugin_cur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/images/tabbar/plugin_cur.png -------------------------------------------------------------------------------- /demo/images/wave.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/images/wave.gif -------------------------------------------------------------------------------- /demo/images/zanCode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/images/zanCode.jpg -------------------------------------------------------------------------------- /demo/pages/about/about/about.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | StatusBar: app.globalData.StatusBar, 5 | CustomBar: app.globalData.CustomBar, 6 | ColorList: app.globalData.ColorList, 7 | }, 8 | onLoad: function () { }, 9 | pageBack() { 10 | wx.navigateBack({ 11 | delta: 1 12 | }); 13 | } 14 | }); 15 | -------------------------------------------------------------------------------- /demo/pages/about/about/about.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/about/about/about.wxml: -------------------------------------------------------------------------------- 1 | 返回关于 2 | 3 | 关于ColorUI组件库 4 | 5 | Hi!开发者~欢迎使用ColorUI组件库! 6 | 该项目是我个人开发的一款高颜值的微信小程序组件库。这个项目不仅有一些漂亮的基础元素,还有一些实用的组件。扩展中心也会不定期更新一些小程序的解决方案,或者你有一些好的想法可以在GitHub里提交给我,我会加入到扩展里。 7 | 项目是开源的,不收取任何费用,如果这个项目有帮到你,或者你觉得很赞,可以在GitHub里扫描赞赏码支持一下! 8 | 该项目你可以用到除组件库小程序的任何项目。作者我也是花了时间和精力的,我不希望你拷贝一份,做一些修改发布就变成了一个独立的项目,当然!扩展再发布是可以的,但前提是注明一下我这个原作者٩(๑❛ᴗ❛๑)۶ 9 | 更多功能敬请期待! 10 | 11 | -------------------------------------------------------------------------------- /demo/pages/about/about/about.wxss: -------------------------------------------------------------------------------- 1 | .UCenter-bg { 2 | background-image: url(https://image.weilanwl.com/color2.0/index.jpg); 3 | background-size: cover; 4 | height: 700rpx; 5 | display: flex; 6 | justify-content: center; 7 | padding-top: 40rpx; 8 | overflow: hidden; 9 | position: relative; 10 | flex-direction: column; 11 | align-items: center; 12 | color: #fff; 13 | font-weight: 300; 14 | text-shadow: 0 0 3px rgba(0,0,0,0.3); 15 | } 16 | .UCenter-bg text{ 17 | opacity: 0.8; 18 | } 19 | .UCenter-bg image { 20 | width: 250rpx; 21 | height: 250rpx; 22 | } 23 | 24 | .UCenter-bg .animation-wave { 25 | position: absolute; 26 | bottom: 0; 27 | } 28 | -------------------------------------------------------------------------------- /demo/pages/about/home/home.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | options: { 3 | addGlobalClass: true, 4 | }, 5 | data: { 6 | starCount: 0, 7 | forksCount: 0, 8 | visitTotal: 0, 9 | }, 10 | attached() { 11 | console.log("success") 12 | let that = this; 13 | wx.showLoading({ 14 | title: '数据加载中', 15 | mask: true, 16 | }) 17 | let i = 0; 18 | numDH(); 19 | function numDH() { 20 | if (i < 20) { 21 | setTimeout(function () { 22 | that.setData({ 23 | starCount: i, 24 | forksCount: i, 25 | visitTotal: i 26 | }) 27 | i++ 28 | numDH(); 29 | }, 20) 30 | } else { 31 | that.setData({ 32 | starCount: that.coutNum(3000), 33 | forksCount: that.coutNum(484), 34 | visitTotal: that.coutNum(24000) 35 | }) 36 | } 37 | } 38 | wx.hideLoading() 39 | }, 40 | methods: { 41 | coutNum(e) { 42 | if (e > 1000 && e < 10000) { 43 | e = (e / 1000).toFixed(1) + 'k' 44 | } 45 | if (e > 10000) { 46 | e = (e / 10000).toFixed(1) + 'W' 47 | } 48 | return e 49 | }, 50 | CopyLink(e) { 51 | wx.setClipboardData({ 52 | data: e.currentTarget.dataset.link, 53 | success: res => { 54 | wx.showToast({ 55 | title: '已复制', 56 | duration: 1000, 57 | }) 58 | } 59 | }) 60 | }, 61 | showModal(e) { 62 | this.setData({ 63 | modalName: e.currentTarget.dataset.target 64 | }) 65 | }, 66 | hideModal(e) { 67 | this.setData({ 68 | modalName: null 69 | }) 70 | }, 71 | showQrcode() { 72 | wx.previewImage({ 73 | urls: ['https://image.weilanwl.com/color2.0/zanCode.jpg'], 74 | current: 'https://image.weilanwl.com/color2.0/zanCode.jpg' // 当前显示图片的http链接 75 | }) 76 | }, 77 | } 78 | }) -------------------------------------------------------------------------------- /demo/pages/about/home/home.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /demo/pages/about/home/home.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ColorUI组件库 5 | v2.0 6 | 7 | 8 | By:文晓港 9 | 10 | 11 | 12 | 13 | 14 | {{visitTotal}} 15 | 16 | View 17 | 18 | 19 | {{starCount}} 20 | 21 | Star 22 | 23 | 24 | {{forksCount}} 25 | 26 | Fork 27 | 28 | 29 | 30 | 31 | 32 | 33 | GitHub 34 | 35 | 36 | 37 | 38 | 39 | 关于ColorUI组件库 40 | 41 | 42 | 43 | 44 | 45 | 日志 46 | 47 | 48 | 49 | 50 | 51 | 赞赏支持 52 | 53 | 54 | 55 | 59 | 60 | 61 | 62 | 63 | Bug测试 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /demo/pages/about/home/home.wxss: -------------------------------------------------------------------------------- 1 | .UCenter-bg { 2 | background-image: url(https://image.weilanwl.com/color2.0/index.jpg); 3 | background-size: cover; 4 | height: 550rpx; 5 | display: flex; 6 | justify-content: center; 7 | padding-top: 40rpx; 8 | overflow: hidden; 9 | position: relative; 10 | flex-direction: column; 11 | align-items: center; 12 | color: #fff; 13 | font-weight: 300; 14 | text-shadow: 0 0 3px rgba(0, 0, 0, 0.3); 15 | } 16 | 17 | .UCenter-bg text { 18 | opacity: 0.8; 19 | } 20 | 21 | .UCenter-bg image { 22 | width: 200rpx; 23 | height: 200rpx; 24 | } 25 | 26 | .UCenter-bg .gif-wave{ 27 | position: absolute; 28 | width: 100%; 29 | bottom: 0; 30 | left: 0; 31 | z-index: 99; 32 | mix-blend-mode: screen; 33 | height: 100rpx; 34 | } 35 | 36 | map,.mapBox{ 37 | left: 0; 38 | z-index: 99; 39 | mix-blend-mode: screen; 40 | height: 100rpx; 41 | } 42 | 43 | map,.mapBox{ 44 | width: 750rpx; 45 | height: 300rpx; 46 | } -------------------------------------------------------------------------------- /demo/pages/about/log/log.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | StatusBar: app.globalData.StatusBar, 5 | CustomBar: app.globalData.CustomBar, 6 | ColorList: app.globalData.ColorList, 7 | }, 8 | onLoad: function () { }, 9 | pageBack() { 10 | wx.navigateBack({ 11 | delta: 1 12 | }); 13 | } 14 | }); 15 | -------------------------------------------------------------------------------- /demo/pages/about/log/log.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/about/log/log.wxss: -------------------------------------------------------------------------------- 1 | page { 2 | background: #fff; 3 | } 4 | -------------------------------------------------------------------------------- /demo/pages/about/test/filter.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | data: { 3 | scrollLeft: 0, 4 | TabCur: 0, 5 | }, 6 | tabSelect(e) { 7 | console.log(e); 8 | this.setData({ 9 | TabCur: e.currentTarget.dataset.id, 10 | scrollLeft: (e.currentTarget.dataset.id - 1) * 60 11 | }) 12 | } 13 | }) 14 | -------------------------------------------------------------------------------- /demo/pages/about/test/filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {} 3 | } -------------------------------------------------------------------------------- /demo/pages/about/test/filter.wxml: -------------------------------------------------------------------------------- 1 | filter:blur引起的ios花屏测试 2 | 3 | 4 | Tab{{index}} 5 | 6 | 7 | 8 | 阴影层 9 | 10 | 11 | 12 | 去掉动画 13 | 14 | 15 | 16 | 去掉after 17 | 18 | 19 | 20 | 去掉动画和after 21 | 22 | -------------------------------------------------------------------------------- /demo/pages/about/test/filter.wxss: -------------------------------------------------------------------------------- 1 | .ABox ,.Box { 2 | padding: 30rpx; 3 | border-radius: 12rpx; 4 | position: relative; 5 | z-index: 1; 6 | } 7 | 8 | .ABox::after { 9 | content: ""; 10 | position: absolute; 11 | z-index: -1; 12 | background-color: inherit; 13 | width: 100%; 14 | height: 100%; 15 | left: 0; 16 | bottom: -20rpx; 17 | border-radius: 10rpx; 18 | opacity: 0.2; 19 | transform: scale(0.9, 0.9); 20 | } -------------------------------------------------------------------------------- /demo/pages/about/test/list.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | data: { 3 | scrollLeft: 0, 4 | TabCur: 0, 5 | }, 6 | tabSelect(e) { 7 | console.log(e); 8 | this.setData({ 9 | TabCur: e.currentTarget.dataset.id, 10 | scrollLeft: (e.currentTarget.dataset.id - 1) * 60 11 | }) 12 | } 13 | }) 14 | -------------------------------------------------------------------------------- /demo/pages/about/test/list.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {} 3 | } -------------------------------------------------------------------------------- /demo/pages/about/test/list.wxml: -------------------------------------------------------------------------------- 1 | 测试 2 | 3 | 4 | filter:blur引起的ios花屏测试 5 | 6 | -------------------------------------------------------------------------------- /demo/pages/about/test/list.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/pages/about/test/list.wxss -------------------------------------------------------------------------------- /demo/pages/auth/auth.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | StatusBar: app.globalData.StatusBar, 5 | CustomBar: app.globalData.CustomBar, 6 | ColorList: app.globalData.ColorList, 7 | }, 8 | onGetUserInfo: function (e) { 9 | if (!this.logged && e.detail.userInfo) { 10 | app.globalData.userInfo = e.detail.userInfo; 11 | wx.switchTab({ 12 | url: '/pages/basics/home/home', 13 | }) 14 | } 15 | } 16 | }); 17 | -------------------------------------------------------------------------------- /demo/pages/auth/auth.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/auth/auth.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ColorUI组件库 4 | v2.0 5 | 6 | 7 | By:文晓港 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /demo/pages/auth/auth.wxss: -------------------------------------------------------------------------------- 1 | .UCenter-bg { 2 | background-image: url(https://image.weilanwl.com/color2.0/index.jpg); 3 | background-size: cover; 4 | height: 700rpx; 5 | display: flex; 6 | justify-content: center; 7 | overflow: hidden; 8 | position: relative; 9 | flex-direction: column; 10 | align-items: center; 11 | color: #fff; 12 | font-weight: 300; 13 | text-shadow: 0 0 3px rgba(0,0,0,0.3); 14 | } 15 | .UCenter-bg::after { 16 | content: ""; 17 | position: absolute; 18 | width: 100vw; 19 | height: 50vw; 20 | background-color: #f1f1f1; 21 | transform: rotate(-10deg) scale(2,2); 22 | bottom: -60vw; 23 | left: 0; 24 | right: 0; 25 | margin: auto; 26 | 27 | } 28 | .UCenter-bg text{ 29 | opacity: 0.8; 30 | } 31 | .UCenter-bg image { 32 | width: 250rpx; 33 | height: 250rpx; 34 | } -------------------------------------------------------------------------------- /demo/pages/basics/avatar/avatar.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | ColorList: app.globalData.ColorList, 5 | avatar: [ 6 | 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg', 7 | 'https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg', 8 | 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25002.jpg', 9 | 'https://ossweb-img.qq.com/images/lol/web201310/skin/big91012.jpg' 10 | ], 11 | } 12 | }) 13 | -------------------------------------------------------------------------------- /demo/pages/basics/avatar/avatar.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/basics/avatar/avatar.wxml: -------------------------------------------------------------------------------- 1 | 返回头像 2 | 3 | 4 | 头像形状 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 头像尺寸 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | A 24 | B 25 | C 26 | D 27 | 28 | 29 | 30 | 31 | 32 | wl 33 | 34 | 35 | 网络 36 | 37 | 38 | 39 | 40 | 内嵌文字(图标) 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 头像颜色 55 | 56 | 57 | 58 | 59 | {{item.name}} 60 | 61 | 62 | 63 | 64 | 头像组 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 头像标签 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /demo/pages/basics/avatar/avatar.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/pages/basics/avatar/avatar.wxss -------------------------------------------------------------------------------- /demo/pages/basics/background/background.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | ColorList: app.globalData.ColorList 5 | } 6 | }) -------------------------------------------------------------------------------- /demo/pages/basics/background/background.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/basics/background/background.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/pages/basics/background/background.wxss -------------------------------------------------------------------------------- /demo/pages/basics/button/button.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | ColorList: app.globalData.ColorList, 5 | }, 6 | SetShadow(e) { 7 | this.setData({ 8 | shadow: e.detail.value 9 | }) 10 | }, 11 | SetBorderSize(e) { 12 | this.setData({ 13 | bordersize: e.detail.value 14 | }) 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /demo/pages/basics/button/button.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/basics/button/button.wxml: -------------------------------------------------------------------------------- 1 | 2 | 返回 3 | 按钮 4 | 5 | 6 | 7 | 按钮形状 8 | 9 | 10 | 11 | 设计 12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | 23 | 按钮尺寸 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 按钮颜色 34 | 35 | 36 | 阴影 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 镂空按钮 48 | 49 | 50 | 51 | 55 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 块状按钮 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 无效状态 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 按钮加图标 88 | 89 | 90 | 91 | 93 | 95 | 96 | -------------------------------------------------------------------------------- /demo/pages/basics/button/button.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/pages/basics/button/button.wxss -------------------------------------------------------------------------------- /demo/pages/basics/button/design.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | ColorList: app.globalData.ColorList, 5 | color:'red' 6 | }, 7 | showModal(e) { 8 | this.setData({ 9 | modalName: e.currentTarget.dataset.target 10 | }) 11 | }, 12 | hideModal(e) { 13 | this.setData({ 14 | modalName: null 15 | }) 16 | }, 17 | SetRound (e) { 18 | this.setData({ 19 | round: e.detail.value 20 | }) 21 | }, 22 | SetSize(e) { 23 | this.setData({ 24 | size: e.detail.value 25 | }) 26 | }, 27 | SetColor(e) { 28 | this.setData({ 29 | color: e.currentTarget.dataset.color, 30 | modalName: null 31 | }) 32 | }, 33 | SetShadow(e) { 34 | this.setData({ 35 | shadow: e.detail.value 36 | }) 37 | }, 38 | SetBorder(e){ 39 | this.setData({ 40 | border: e.detail.value 41 | }) 42 | if (!e.detail.value){ 43 | this.setData({ 44 | bordersize: false 45 | }) 46 | } 47 | }, 48 | SetBorderSize(e) { 49 | this.setData({ 50 | bordersize: e.detail.value 51 | }) 52 | }, 53 | SetBlock(e) { 54 | this.setData({ 55 | block: e.detail.value 56 | }) 57 | } 58 | }) 59 | -------------------------------------------------------------------------------- /demo/pages/basics/button/design.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/basics/button/design.wxml: -------------------------------------------------------------------------------- 1 | 返回按钮 / 设计 2 | 3 | 4 | 5 | 6 | class="cu-btn {{border?'line':'bg'}}{{bordersize?bordersize:''}}-{{color}} {{round?'round':''}} {{size}} {{shadow?'shadow':''}} {{block?'block':''}}" 7 | 8 | 9 | 选择颜色 10 | 11 | 12 | 13 | 是否圆角 14 | 15 | 16 | 17 | 选择尺寸 18 | 19 | 23 | 27 | 31 | 32 | 33 | 34 | 是否添加阴影 35 | 36 | 37 | 38 | 是否镂空 39 | 40 | 41 | 42 | 边框大小 43 | 44 | 48 | 52 | 53 | 54 | 55 | 56 | 57 | 选择颜色 58 | 59 | 60 | 61 | 62 | 63 | 64 | {{item.title}} 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /demo/pages/basics/button/design.wxss: -------------------------------------------------------------------------------- 1 | .box{ 2 | display: flex; 3 | align-items: center; 4 | justify-content: center; 5 | height: 200rpx; 6 | } -------------------------------------------------------------------------------- /demo/pages/basics/home/home.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | options: { 3 | addGlobalClass: true, 4 | }, 5 | data: { 6 | elements: [{ 7 | title: '布局', 8 | name: 'layout', 9 | color: 'cyan', 10 | icon: 'newsfill' 11 | }, 12 | { 13 | title: '背景', 14 | name: 'background', 15 | color: 'blue', 16 | icon: 'colorlens' 17 | }, 18 | { 19 | title: '文本', 20 | name: 'text', 21 | color: 'purple', 22 | icon: 'font' 23 | }, 24 | { 25 | title: '图标 ', 26 | name: 'icon', 27 | color: 'mauve', 28 | icon: 'icon' 29 | }, 30 | { 31 | title: '按钮', 32 | name: 'button', 33 | color: 'pink', 34 | icon: 'btn' 35 | }, 36 | { 37 | title: '标签', 38 | name: 'tag', 39 | color: 'brown', 40 | icon: 'tagfill' 41 | }, 42 | { 43 | title: '头像', 44 | name: 'avatar', 45 | color: 'red', 46 | icon: 'myfill' 47 | }, 48 | { 49 | title: '进度条', 50 | name: 'progress', 51 | color: 'orange', 52 | icon: 'icloading' 53 | }, 54 | { 55 | title: '边框阴影', 56 | name: 'shadow', 57 | color: 'olive', 58 | icon: 'copy' 59 | }, 60 | { 61 | title: '加载', 62 | name: 'loading', 63 | color: 'green', 64 | icon: 'loading2' 65 | }, 66 | ], 67 | } 68 | }) -------------------------------------------------------------------------------- /demo/pages/basics/home/home.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /demo/pages/basics/home/home.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{item.title}} 6 | {{item.name}} 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/pages/basics/home/home.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/pages/basics/home/home.wxss -------------------------------------------------------------------------------- /demo/pages/basics/icon/icon.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/basics/icon/icon.wxml: -------------------------------------------------------------------------------- 1 | 返回图标 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | {{item.name}} 12 | 13 | -------------------------------------------------------------------------------- /demo/pages/basics/icon/icon.wxss: -------------------------------------------------------------------------------- 1 | page{ 2 | padding-top: 100rpx; 3 | } 4 | item.none{ 5 | display: none; 6 | } -------------------------------------------------------------------------------- /demo/pages/basics/layout/layout.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | CustomBar: app.globalData.CustomBar, 5 | TabCur:0, 6 | tabNav: ['Flex布局', 'Grid布局', '辅助布局'] 7 | }, 8 | tabSelect(e) { 9 | console.log(e); 10 | this.setData({ 11 | TabCur: e.currentTarget.dataset.id, 12 | scrollLeft: (e.currentTarget.dataset.id - 1) * 60 13 | }) 14 | } 15 | }) -------------------------------------------------------------------------------- /demo/pages/basics/layout/layout.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/basics/layout/layout.wxss: -------------------------------------------------------------------------------- 1 | page{ 2 | padding-top: 90rpx; 3 | } 4 | -------------------------------------------------------------------------------- /demo/pages/basics/loading/loading.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | CustomBar: app.globalData.CustomBar, 5 | loadProgress:0 6 | }, 7 | isLoading (e) { 8 | this.setData({ 9 | isLoad: e.detail.value 10 | }) 11 | }, 12 | loadModal () { 13 | this.setData({ 14 | loadModal: true 15 | }) 16 | setTimeout(()=> { 17 | this.setData({ 18 | loadModal: false 19 | }) 20 | }, 2000) 21 | }, 22 | loadProgress(){ 23 | this.setData({ 24 | loadProgress: this.data.loadProgress+3 25 | }) 26 | if (this.data.loadProgress<100){ 27 | setTimeout(() => { 28 | this.loadProgress(); 29 | }, 100) 30 | }else{ 31 | this.setData({ 32 | loadProgress: 0 33 | }) 34 | } 35 | } 36 | }); 37 | -------------------------------------------------------------------------------- /demo/pages/basics/loading/loading.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/basics/loading/loading.wxml: -------------------------------------------------------------------------------- 1 | 2 | 返回 3 | 加载 4 | 5 | 6 | 7 | 8 | 9 | 10 | 背景 11 | 12 | 13 | 14 | 15 | 16 | 加载状态 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 加载错误 26 | 27 | 28 | 29 | 30 | 31 | 32 | 弹框加载 33 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | 43 | 加载中... 44 | 45 | 46 | 47 | 进度条加载 48 | 49 | 50 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /demo/pages/basics/loading/loading.wxss: -------------------------------------------------------------------------------- 1 | /* pages/basics/load/load.wxss */ 2 | -------------------------------------------------------------------------------- /demo/pages/basics/progress/progress.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | ColorList: app.globalData.ColorList, 5 | color:'red', 6 | }, 7 | onLoad() { 8 | let that = this; 9 | setTimeout(function() { 10 | that.setData({ 11 | loading: true 12 | }) 13 | }, 500) 14 | }, 15 | showModal(e) { 16 | this.setData({ 17 | modalName: e.currentTarget.dataset.target 18 | }) 19 | }, 20 | hideModal(e) { 21 | this.setData({ 22 | modalName: null 23 | }) 24 | }, 25 | SetColor(e) { 26 | this.setData({ 27 | color: e.currentTarget.dataset.color, 28 | modalName: null 29 | }) 30 | }, 31 | SetActive(e) { 32 | this.setData({ 33 | active: e.detail.value 34 | }) 35 | } 36 | }) -------------------------------------------------------------------------------- /demo/pages/basics/progress/progress.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/basics/progress/progress.wxml: -------------------------------------------------------------------------------- 1 | 返回进度条 2 | 3 | 4 | 进度条形状 5 | 6 | 7 | 8 | 9 | 61.8% 10 | 11 | 12 | 61.8% 13 | 14 | 15 | 61.8% 16 | 17 | 18 | 19 | 20 | 进度条尺寸 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 进度条颜色 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 进度条条纹 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 进度条比例 64 | 65 | 66 | 67 | 68 | 30% 69 | 45% 70 | 25% 71 | 72 | 73 | 74 | 75 | 进度条布局 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 80% 90 | 91 | 92 | 93 | 94 | 95 | 选择颜色 96 | 97 | 98 | 99 | 100 | 101 | 102 | {{item.title}} 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /demo/pages/basics/progress/progress.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/pages/basics/progress/progress.wxss -------------------------------------------------------------------------------- /demo/pages/basics/shadow/shadow.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | SetSize(e) { 4 | this.setData({ 5 | size: e.detail.value 6 | }) 7 | } 8 | }) 9 | -------------------------------------------------------------------------------- /demo/pages/basics/shadow/shadow.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/basics/shadow/shadow.wxml: -------------------------------------------------------------------------------- 1 | 2 | 返回 3 | 边框阴影 4 | 5 | 6 | 7 | 边框 8 | 9 | 10 | 11 | 12 | 13 | 14 | 四周 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 阴影 23 | 24 | 25 | 26 | 默认阴影 27 | 根据背景颜色而改变的阴影 28 | 长阴影 29 | 长阴影 30 | 翘边阴影 31 | 32 | 根据背景图而改变的阴影 33 | 34 | -------------------------------------------------------------------------------- /demo/pages/basics/shadow/shadow.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/pages/basics/shadow/shadow.wxss -------------------------------------------------------------------------------- /demo/pages/basics/tag/tag.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | ColorList: app.globalData.ColorList 5 | } 6 | }) 7 | -------------------------------------------------------------------------------- /demo/pages/basics/tag/tag.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/basics/tag/tag.wxml: -------------------------------------------------------------------------------- 1 | 返回标签 2 | 3 | 4 | 标签形状 5 | 6 | 7 | 8 | 默认 9 | 椭圆 10 | 圆角 11 | 12 | 13 | 14 | 标签尺寸 15 | 16 | 17 | 18 | 小尺寸 19 | 普通尺寸 20 | 21 | 22 | 23 | 标签颜色 24 | 25 | 26 | 27 | 28 | {{item.title}} 29 | 30 | 31 | {{item.title}} 32 | 33 | 34 | 35 | 36 | 镂空标签 37 | 38 | 39 | 40 | 41 | {{item.title}} 42 | 43 | 44 | 45 | 46 | 胶囊样式 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 12 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 23 64 | 65 | 66 | 67 | 68 | 说明 69 | 70 | 71 | 123 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 23 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 23 88 | 89 | 90 | 91 | 92 | 93 | 数字标签 94 | 95 | 96 | 97 | 98 | 港 99 | 99+ 100 | 101 | 102 | 9 103 | 104 | 105 | 106 | 107 | 108 | 109 | 99+ 110 | 111 | -------------------------------------------------------------------------------- /demo/pages/basics/tag/tag.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/pages/basics/tag/tag.wxss -------------------------------------------------------------------------------- /demo/pages/basics/text/text.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | list: [{ 5 | title: '嫣红', 6 | name: 'red', 7 | color: '#e54d42' 8 | }, 9 | { 10 | title: '桔橙', 11 | name: 'orange', 12 | color: '#f37b1d' 13 | }, 14 | { 15 | title: '明黄', 16 | name: 'yellow', 17 | color: '#fbbd08' 18 | }, 19 | { 20 | title: '橄榄', 21 | name: 'olive', 22 | color: '#8dc63f' 23 | }, 24 | { 25 | title: '森绿', 26 | name: 'green', 27 | color: '#39b54a' 28 | }, 29 | { 30 | title: '天青', 31 | name: 'cyan', 32 | color: '#1cbbb4' 33 | }, 34 | { 35 | title: '海蓝', 36 | name: 'blue', 37 | color: '#0081ff' 38 | }, 39 | { 40 | title: '姹紫', 41 | name: 'purple', 42 | color: '#6739b6' 43 | }, 44 | { 45 | title: '木槿', 46 | name: 'mauve', 47 | color: '#9c26b0' 48 | }, 49 | { 50 | title: '桃粉', 51 | name: 'pink', 52 | color: '#e03997' 53 | }, 54 | { 55 | title: '棕褐', 56 | name: 'brown', 57 | color: '#a5673f' 58 | }, 59 | { 60 | title: '玄灰', 61 | name: 'grey', 62 | color: '#8799a3' 63 | }, 64 | { 65 | title: '草灰', 66 | name: 'gray', 67 | color: '#aaaaaa' 68 | }, 69 | { 70 | title: '墨黑', 71 | name: 'black', 72 | color: '#333333' 73 | }, 74 | { 75 | title: '雅白', 76 | name: 'white', 77 | color: '#ffffff' 78 | }, 79 | ] 80 | } 81 | }) -------------------------------------------------------------------------------- /demo/pages/basics/text/text.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/basics/text/text.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/pages/basics/text/text.wxss -------------------------------------------------------------------------------- /demo/pages/component/bar/bar.js: -------------------------------------------------------------------------------- 1 | Page({}) -------------------------------------------------------------------------------- /demo/pages/component/bar/bar.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/component/bar/bar.wxss: -------------------------------------------------------------------------------- 1 | .box { 2 | margin: 20rpx 0; 3 | } 4 | 5 | .box view.cu-bar { 6 | margin-top: 20rpx; 7 | } 8 | -------------------------------------------------------------------------------- /demo/pages/component/card/card.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | StatusBar: app.globalData.StatusBar, 5 | CustomBar: app.globalData.CustomBar 6 | }, 7 | isCard(e) { 8 | this.setData({ 9 | isCard: e.detail.value 10 | }) 11 | }, 12 | }); 13 | -------------------------------------------------------------------------------- /demo/pages/component/card/card.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/component/card/card.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/pages/component/card/card.wxss -------------------------------------------------------------------------------- /demo/pages/component/chat/chat.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | data: { 3 | InputBottom: 0 4 | }, 5 | InputFocus(e) { 6 | this.setData({ 7 | InputBottom: e.detail.height 8 | }) 9 | }, 10 | InputBlur(e) { 11 | this.setData({ 12 | InputBottom: 0 13 | }) 14 | } 15 | }) -------------------------------------------------------------------------------- /demo/pages/component/chat/chat.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/component/chat/chat.wxml: -------------------------------------------------------------------------------- 1 | 返回聊天 2 | 3 | 4 | 5 | 6 | 喵喵喵!喵喵喵!喵喵喵!喵喵!喵喵!!喵!喵喵喵! 7 | 8 | 9 | 10 | 2018年3月23日 13:23 11 | 12 | 对方撤回一条消息! 13 | 14 | 15 | 16 | 17 | 喵喵喵!喵喵喵! 18 | 19 | 20 | 13:23 21 | 22 | 23 | 对方拒绝了你的消息 24 | 25 | 26 | 对方开启了好友验证,你还不是他(她)的好友。请先发送好友验证请求,对方验证通过后,才能聊天。 27 | 发送好友验证 28 | 29 | 30 | 31 | 32 | 33 | 34 | 13:23 35 | 36 | 37 | 38 | 39 | 3" 40 | 41 | 42 | 43 | 44 | 45 | 46 | 13:23 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 喵星球,喵喵市 55 | 56 | 57 | 58 | 13:23 59 | 60 | 61 | 62 | 63 | 64 | @#$^&** 65 | 66 | 67 | 翻译错误 68 | 69 | 70 | 13:23 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /demo/pages/component/chat/chat.wxss: -------------------------------------------------------------------------------- 1 | page{ 2 | padding-bottom: 100rpx; 3 | } -------------------------------------------------------------------------------- /demo/pages/component/form/form.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/component/form/form.wxss: -------------------------------------------------------------------------------- 1 | .cu-form-group .title { 2 | min-width: calc(4em + 30rpx); 3 | } 4 | -------------------------------------------------------------------------------- /demo/pages/component/home/home.js: -------------------------------------------------------------------------------- 1 | Component({ 2 | options: { 3 | addGlobalClass: true, 4 | }, 5 | data: { 6 | elements: [ 7 | { title: '操作条', name: 'bar', color: 'purple', icon: 'vipcard' }, 8 | { title: '导航栏 ', name: 'nav', color: 'mauve', icon: 'formfill' }, 9 | { title: '列表', name: 'list', color: 'pink', icon: 'list' }, 10 | { title: '卡片', name: 'card', color: 'brown', icon: 'newsfill' }, 11 | { title: '表单', name: 'form', color: 'red', icon: 'formfill' }, 12 | { title: '时间轴', name: 'timeline', color: 'orange', icon: 'timefill' }, 13 | { title: '聊天', name: 'chat', color: 'green', icon: 'messagefill' }, 14 | { title: '轮播', name: 'swiper', color: 'olive', icon: 'album' }, 15 | { title: '模态框', name: 'modal', color: 'grey', icon: 'squarecheckfill' }, 16 | { title: '步骤条', name: 'steps', color: 'cyan', icon: 'roundcheckfill' }, 17 | ], 18 | }, 19 | }) 20 | -------------------------------------------------------------------------------- /demo/pages/component/home/home.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /demo/pages/component/home/home.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{item.title}} 6 | {{item.name}} 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/pages/component/home/home.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/pages/component/home/home.wxss -------------------------------------------------------------------------------- /demo/pages/component/list/list.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | StatusBar: app.globalData.StatusBar, 5 | CustomBar: app.globalData.CustomBar, 6 | iconList: [{ 7 | icon: 'cardboardfill', 8 | color: 'red', 9 | badge: 120, 10 | name: 'VR' 11 | }, { 12 | icon: 'recordfill', 13 | color: 'orange', 14 | badge: 1, 15 | name: '录像' 16 | }, { 17 | icon: 'picfill', 18 | color: 'yellow', 19 | badge: 0, 20 | name: '图像' 21 | }, { 22 | icon: 'noticefill', 23 | color: 'olive', 24 | badge: 22, 25 | name: '通知' 26 | }, { 27 | icon: 'upstagefill', 28 | color: 'cyan', 29 | badge: 0, 30 | name: '排行榜' 31 | }, { 32 | icon: 'clothesfill', 33 | color: 'blue', 34 | badge: 0, 35 | name: '皮肤' 36 | }, { 37 | icon: 'discoverfill', 38 | color: 'purple', 39 | badge: 0, 40 | name: '发现' 41 | }, { 42 | icon: 'questionfill', 43 | color: 'mauve', 44 | badge: 0, 45 | name: '帮助' 46 | }, { 47 | icon: 'commandfill', 48 | color: 'purple', 49 | badge: 0, 50 | name: '问答' 51 | }, { 52 | icon: 'brandfill', 53 | color: 'mauve', 54 | badge: 0, 55 | name: '版权' 56 | }], 57 | gridCol:3, 58 | skin: false 59 | }, 60 | showModal(e) { 61 | this.setData({ 62 | modalName: e.currentTarget.dataset.target 63 | }) 64 | }, 65 | hideModal(e) { 66 | this.setData({ 67 | modalName: null 68 | }) 69 | }, 70 | gridchange: function (e) { 71 | this.setData({ 72 | gridCol: e.detail.value 73 | }); 74 | }, 75 | gridswitch: function (e) { 76 | this.setData({ 77 | gridBorder: e.detail.value 78 | }); 79 | }, 80 | menuBorder: function (e) { 81 | this.setData({ 82 | menuBorder: e.detail.value 83 | }); 84 | }, 85 | menuArrow: function (e) { 86 | this.setData({ 87 | menuArrow: e.detail.value 88 | }); 89 | }, 90 | menuCard: function (e) { 91 | this.setData({ 92 | menuCard: e.detail.value 93 | }); 94 | }, 95 | switchSex: function (e) { 96 | this.setData({ 97 | skin: e.detail.value 98 | }); 99 | }, 100 | 101 | // ListTouch触摸开始 102 | ListTouchStart(e) { 103 | this.setData({ 104 | ListTouchStart: e.touches[0].pageX 105 | }) 106 | }, 107 | 108 | // ListTouch计算方向 109 | ListTouchMove(e) { 110 | this.setData({ 111 | ListTouchDirection: e.touches[0].pageX - this.data.ListTouchStart > 0 ? 'right' : 'left' 112 | }) 113 | }, 114 | 115 | // ListTouch计算滚动 116 | ListTouchEnd(e) { 117 | if (this.data.ListTouchDirection =='left'){ 118 | this.setData({ 119 | modalName: e.currentTarget.dataset.target 120 | }) 121 | } else { 122 | this.setData({ 123 | modalName: null 124 | }) 125 | } 126 | this.setData({ 127 | ListTouchDirection: null 128 | }) 129 | }, 130 | }) -------------------------------------------------------------------------------- /demo/pages/component/list/list.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/component/list/list.wxss: -------------------------------------------------------------------------------- 1 | .page { 2 | height: 100Vh; 3 | width: 100vw; 4 | } 5 | 6 | .page.show { 7 | overflow: hidden; 8 | } 9 | 10 | .switch-sex::after { 11 | content: "\e716"; 12 | } 13 | 14 | .switch-sex::before { 15 | content: "\e7a9"; 16 | } 17 | 18 | .switch-music::after { 19 | content: "\e66a"; 20 | } 21 | 22 | .switch-music::before { 23 | content: "\e6db"; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /demo/pages/component/modal/modal.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | CustomBar: app.globalData.CustomBar, 5 | checkbox: [{ 6 | value: 0, 7 | name: '10元', 8 | checked: false, 9 | hot: false, 10 | }, { 11 | value: 1, 12 | name: '20元', 13 | checked: true, 14 | hot: false, 15 | }, { 16 | value: 2, 17 | name: '30元', 18 | checked: true, 19 | hot: true, 20 | }, { 21 | value: 3, 22 | name: '60元', 23 | checked: false, 24 | hot: true, 25 | }, { 26 | value: 4, 27 | name: '80元', 28 | checked: false, 29 | hot: false, 30 | }, { 31 | value: 5, 32 | name: '100元', 33 | checked: false, 34 | hot: false, 35 | }] 36 | }, 37 | showModal(e) { 38 | this.setData({ 39 | modalName: e.currentTarget.dataset.target 40 | }) 41 | }, 42 | hideModal(e) { 43 | this.setData({ 44 | modalName: null 45 | }) 46 | }, 47 | ChooseCheckbox(e) { 48 | let items = this.data.checkbox; 49 | let values = e.currentTarget.dataset.value; 50 | for (let i = 0, lenI = items.length; i < lenI; ++i) { 51 | if (items[i].value == values) { 52 | items[i].checked = !items[i].checked; 53 | break 54 | } 55 | } 56 | this.setData({ 57 | checkbox: items 58 | }) 59 | } 60 | }) -------------------------------------------------------------------------------- /demo/pages/component/modal/modal.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/component/modal/modal.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/pages/component/modal/modal.wxss -------------------------------------------------------------------------------- /demo/pages/component/nav/nav.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | data: { 3 | TabCur: 0, 4 | scrollLeft:0 5 | }, 6 | tabSelect(e) { 7 | this.setData({ 8 | TabCur: e.currentTarget.dataset.id, 9 | scrollLeft: (e.currentTarget.dataset.id-1)*60 10 | }) 11 | } 12 | }) -------------------------------------------------------------------------------- /demo/pages/component/nav/nav.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/component/nav/nav.wxml: -------------------------------------------------------------------------------- 1 | 返回导航栏 2 | 3 | Tab{{index}} 4 | 5 | 6 | 7 | 默认 8 | 9 | 10 | 11 | 12 | Tab{{index}} 13 | 14 | 15 | 16 | 17 | 居中 18 | 19 | 20 | 21 | 22 | Tab{{index}} 23 | 24 | 25 | 26 | 27 | 平分 28 | 29 | 30 | 31 | 32 | 33 | Tab{{index}} 34 | 35 | 36 | 37 | 38 | 39 | 背景 40 | 41 | 42 | 43 | 44 | Tab{{index}} 45 | 46 | 47 | 48 | 49 | 图标 50 | 51 | 52 | 53 | 54 | 数码 55 | 56 | 57 | 排行榜 58 | 59 | 60 | 皮肤 61 | 62 | 63 | -------------------------------------------------------------------------------- /demo/pages/component/nav/nav.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/pages/component/nav/nav.wxss -------------------------------------------------------------------------------- /demo/pages/component/steps/steps.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | data: { 3 | basicsList: [{ 4 | icon: 'usefullfill', 5 | name: '开始' 6 | }, { 7 | icon: 'radioboxfill', 8 | name: '等待' 9 | }, { 10 | icon: 'roundclosefill', 11 | name: '错误' 12 | }, { 13 | icon: 'roundcheckfill', 14 | name: '完成' 15 | }, ], 16 | basics: 0, 17 | numList: [{ 18 | name: '开始' 19 | }, { 20 | name: '等待' 21 | }, { 22 | name: '错误' 23 | }, { 24 | name: '完成' 25 | }, ], 26 | num: 0, 27 | scroll: 0 28 | }, 29 | basicsSteps() { 30 | this.setData({ 31 | basics: this.data.basics == this.data.basicsList.length - 1 ? 0 : this.data.basics + 1 32 | }) 33 | }, 34 | numSteps() { 35 | this.setData({ 36 | num: this.data.num == this.data.numList.length - 1 ? 0 : this.data.num + 1 37 | }) 38 | }, 39 | scrollSteps() { 40 | this.setData({ 41 | scroll: this.data.scroll == 9 ? 0 : this.data.scroll + 1 42 | }) 43 | } 44 | }) -------------------------------------------------------------------------------- /demo/pages/component/steps/steps.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {} 3 | } -------------------------------------------------------------------------------- /demo/pages/component/steps/steps.wxml: -------------------------------------------------------------------------------- 1 | 返回步骤条 2 | 3 | 4 | 基本用法 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {{item.name}} 14 | 15 | 16 | 17 | 18 | 19 | 20 | {{item.name}} 21 | 22 | 23 | 24 | 25 | 26 | 27 | {{item.name}} 28 | 29 | 30 | 31 | 32 | 33 | 数字完成 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | {{item.name}} 43 | 44 | 45 | 46 | 47 | 48 | 多级显示 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | Level {{index + 1}} 57 | 58 | 59 | -------------------------------------------------------------------------------- /demo/pages/component/steps/steps.wxss: -------------------------------------------------------------------------------- 1 | .steps-bottom.cu-steps .cu-item .num::before { 2 | content: "\e668"; 3 | font-family: 'iconfont'; 4 | } 5 | -------------------------------------------------------------------------------- /demo/pages/component/swiper/swiper.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | data: { 3 | cardCur: 0, 4 | swiperList: [{ 5 | id: 0, 6 | type: 'image', 7 | url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84000.jpg' 8 | }, { 9 | id: 1, 10 | type: 'image', 11 | url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84001.jpg', 12 | }, { 13 | id: 2, 14 | type: 'image', 15 | url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big39000.jpg' 16 | }, { 17 | id: 3, 18 | type: 'image', 19 | url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg' 20 | }, { 21 | id: 4, 22 | type: 'image', 23 | url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25011.jpg' 24 | }, { 25 | id: 5, 26 | type: 'image', 27 | url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big21016.jpg' 28 | }, { 29 | id: 6, 30 | type: 'image', 31 | url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg' 32 | }], 33 | }, 34 | onLoad() { 35 | this.towerSwiper('swiperList'); 36 | // 初始化towerSwiper 传已有的数组名即可 37 | }, 38 | DotStyle(e) { 39 | this.setData({ 40 | DotStyle: e.detail.value 41 | }) 42 | }, 43 | // cardSwiper 44 | cardSwiper(e) { 45 | this.setData({ 46 | cardCur: e.detail.current 47 | }) 48 | }, 49 | // towerSwiper 50 | // 初始化towerSwiper 51 | towerSwiper(name) { 52 | let list = this.data[name]; 53 | for (let i = 0; i < list.length; i++) { 54 | list[i].zIndex = parseInt(list.length / 2) + 1 - Math.abs(i - parseInt(list.length / 2)) 55 | list[i].mLeft = i - parseInt(list.length / 2) 56 | } 57 | this.setData({ 58 | swiperList: list 59 | }) 60 | }, 61 | // towerSwiper触摸开始 62 | towerStart(e) { 63 | this.setData({ 64 | towerStart: e.touches[0].pageX 65 | }) 66 | }, 67 | // towerSwiper计算方向 68 | towerMove(e) { 69 | this.setData({ 70 | direction: e.touches[0].pageX - this.data.towerStart > 0 ? 'right' : 'left' 71 | }) 72 | }, 73 | // towerSwiper计算滚动 74 | towerEnd(e) { 75 | let direction = this.data.direction; 76 | let list = this.data.swiperList; 77 | if (direction == 'right') { 78 | let mLeft = list[0].mLeft; 79 | let zIndex = list[0].zIndex; 80 | for (let i = 1; i < list.length; i++) { 81 | list[i - 1].mLeft = list[i].mLeft 82 | list[i - 1].zIndex = list[i].zIndex 83 | } 84 | list[list.length - 1].mLeft = mLeft; 85 | list[list.length - 1].zIndex = zIndex; 86 | this.setData({ 87 | swiperList: list 88 | }) 89 | } else { 90 | let mLeft = list[list.length - 1].mLeft; 91 | let zIndex = list[list.length - 1].zIndex; 92 | for (let i = list.length - 1; i > 0; i--) { 93 | list[i].mLeft = list[i - 1].mLeft 94 | list[i].zIndex = list[i - 1].zIndex 95 | } 96 | list[0].mLeft = mLeft; 97 | list[0].zIndex = zIndex; 98 | this.setData({ 99 | swiperList: list 100 | }) 101 | } 102 | } 103 | }) -------------------------------------------------------------------------------- /demo/pages/component/swiper/swiper.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/component/swiper/swiper.wxml: -------------------------------------------------------------------------------- 1 | 2 | 返回 3 | 轮播图 4 | 5 | 6 | 7 | 全屏限高轮播 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 卡片式轮播 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 堆叠式轮播 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /demo/pages/component/swiper/swiper.wxss: -------------------------------------------------------------------------------- 1 | .tower-swiper .tower-item { 2 | transform: scale(calc(0.5 + var(--index) / 10)); 3 | margin-left: calc(var(--left) * 100rpx - 150rpx); 4 | z-index: var(--index); 5 | } -------------------------------------------------------------------------------- /demo/pages/component/timeline/timeline.js: -------------------------------------------------------------------------------- 1 | Page({}); 2 | -------------------------------------------------------------------------------- /demo/pages/component/timeline/timeline.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/component/timeline/timeline.wxml: -------------------------------------------------------------------------------- 1 | 2 | 返回 3 | 时间轴 4 | 5 | 6 | 昨天 7 | 8 | 9 | 22:22 【广州市】快件已到达地球 10 | 11 | 12 | 13 | 14 | 这是第一次,我家的铲屎官走了这么久。久到足足有三天!! 15 | 16 | 17 | 18 | 19 | 这是第一次,我家的铲屎官走了这么久。 20 | 21 | 22 | 23 | 24 | 20:00 【月球】快件已到达月球,准备发往地球 25 | 26 | 27 | 10:00 【银河系】快件已到达银河系,准备发往月球 28 | 29 | 30 | 31 | 32 | 33 | 06-17 34 | 35 | 36 | 01:30 【喵星】 MX-12138 已揽收,准备发往银河系 37 | 38 | 39 | 40 | 41 | 42 | 06-17 43 | 44 | 45 | 46 | 上午 47 | 10:00 48 | 49 | 这是第一次,我家的铲屎官走了这么久。久到足足有三天!! 在听到他的脚步声响在楼梯间的那一刻,我简直想要破门而出,对着他狠狠地吼上10分钟,然后再看心情要不要他进门。 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 文晓港 59 | 60 | 消息未送达 61 | 62 | 63 | 22:20 64 | 5 65 | 66 | 67 | 68 | 69 | 99+ 70 | 71 | 72 | 文晓港 73 | SVIP 74 | 75 | 76 | 收到红包 77 | 78 | 79 | 22:20 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /demo/pages/component/timeline/timeline.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/demo/pages/component/timeline/timeline.wxss -------------------------------------------------------------------------------- /demo/pages/index/index.js: -------------------------------------------------------------------------------- 1 | Page({ 2 | data: { 3 | PageCur: 'basics' 4 | }, 5 | NavChange(e) { 6 | this.setData({ 7 | PageCur: e.currentTarget.dataset.cur 8 | }) 9 | }, 10 | onShareAppMessage() { 11 | return { 12 | title: 'ColorUI-高颜值的小程序UI组件库', 13 | imageUrl: '/images/share.jpg', 14 | path: '/pages/index/index' 15 | } 16 | }, 17 | }) -------------------------------------------------------------------------------- /demo/pages/index/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "basics": "/pages/basics/home/home", 4 | "component": "/pages/component/home/home", 5 | "plugin": "/pages/plugin/home/home", 6 | "about": "/pages/about/home/home" 7 | } 8 | } -------------------------------------------------------------------------------- /demo/pages/index/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 元素 11 | 12 | 13 | 14 | 15 | 16 | 组件 17 | 18 | 19 | 20 | 21 | 22 | 扩展 23 | 24 | 25 | 26 | 27 | 28 | 关于 29 | 30 | -------------------------------------------------------------------------------- /demo/pages/index/index.wxss: -------------------------------------------------------------------------------- 1 | /* pages/index/index.wxss */ -------------------------------------------------------------------------------- /demo/pages/plugin/animation/animation.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | StatusBar: app.globalData.StatusBar, 5 | CustomBar: app.globalData.CustomBar, 6 | list: [{ 7 | name: 'fade', 8 | color: 'red' 9 | }, 10 | { 11 | name: 'scale-up', 12 | color: 'orange' 13 | }, 14 | { 15 | name: 'scale-down', 16 | color: 'olive' 17 | }, 18 | { 19 | name: 'slide-top', 20 | color: 'green' 21 | }, { 22 | name: 'slide-bottom', 23 | color: 'cyan' 24 | }, 25 | { 26 | name: 'slide-left', 27 | color: 'blue' 28 | }, 29 | { 30 | name: 'slide-right', 31 | color: 'purple' 32 | }, 33 | { 34 | name: 'shake', 35 | color: 'mauve' 36 | } 37 | ], 38 | toggleDelay: false 39 | }, 40 | toggle(e) { 41 | console.log(e); 42 | var anmiaton = e.currentTarget.dataset.class; 43 | var that = this; 44 | that.setData({ 45 | animation: anmiaton 46 | }) 47 | setTimeout(function() { 48 | that.setData({ 49 | animation: '' 50 | }) 51 | }, 1000) 52 | }, 53 | toggleDelay() { 54 | var that = this; 55 | that.setData({ 56 | toggleDelay: true 57 | }) 58 | setTimeout(function() { 59 | that.setData({ 60 | toggleDelay: false 61 | }) 62 | }, 1000) 63 | } 64 | }) -------------------------------------------------------------------------------- /demo/pages/plugin/animation/animation.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/plugin/animation/animation.wxml: -------------------------------------------------------------------------------- 1 | 2 | 返回 3 | 微动画 4 | 5 | 6 | 7 | 默认效果 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 反向动画 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 延迟执行 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | Gif动画 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /demo/pages/plugin/animation/animation.wxss: -------------------------------------------------------------------------------- 1 | @import "../../../colorui/animation.wxss"; 2 | 3 | image[class*="gif-"] { 4 | border-radius: 6rpx; 5 | display: block; 6 | } 7 | -------------------------------------------------------------------------------- /demo/pages/plugin/drawer/drawer.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | StatusBar: app.globalData.StatusBar, 8 | CustomBar: app.globalData.CustomBar, 9 | Custom: app.globalData.Custom, 10 | hasUserInfo: false, 11 | canIUse: wx.canIUse('button.open-type.getUserInfo'), 12 | TabCur: 1, 13 | scrollLeft: 0 14 | }, 15 | getUserInfo: function (e) { 16 | console.log(e) 17 | app.globalData.userInfo = e.detail.userInfo 18 | this.setData({ 19 | userInfo: e.detail.userInfo, 20 | hasUserInfo: true 21 | }) 22 | }, 23 | showModal(e) { 24 | this.setData({ 25 | modalName: e.currentTarget.dataset.target 26 | }) 27 | }, 28 | hideModal(e) { 29 | this.setData({ 30 | modalName: null 31 | }) 32 | }, 33 | tabSelect(e) { 34 | console.log(e); 35 | this.setData({ 36 | TabCur: e.currentTarget.dataset.id, 37 | scrollLeft: (e.currentTarget.dataset.id - 1) * 60 38 | }) 39 | } 40 | }) 41 | -------------------------------------------------------------------------------- /demo/pages/plugin/drawer/drawer.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {} 3 | } -------------------------------------------------------------------------------- /demo/pages/plugin/drawer/drawer.wxml: -------------------------------------------------------------------------------- 1 | 2 | 返回 3 | 全屏抽屉 4 | 5 | 6 | 7 | 打开抽屉 8 | 9 | 10 | 11 | 12 | 13 | 14 | {{index +1}} 15 | 16 | 17 | 18 | 19 | 20 | 21 | 打开抽屉 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | {{index +1}} 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /demo/pages/plugin/drawer/drawer.wxss: -------------------------------------------------------------------------------- 1 | page { 2 | background-image: var(--gradualBlue); 3 | width: 100vw; 4 | overflow: hidden; 5 | } 6 | 7 | .DrawerPage { 8 | position: fixed; 9 | width: 100vw; 10 | height: 100vh; 11 | left: 0vw; 12 | background-color: #f1f1f1; 13 | transition: all 0.4s; 14 | } 15 | 16 | .DrawerPage.show { 17 | transform: scale(0.9, 0.9); 18 | left: 85vw; 19 | box-shadow: 0 0 60rpx rgba(0, 0, 0, 0.2); 20 | transform-origin: 0; 21 | } 22 | 23 | .DrawerWindow { 24 | position: absolute; 25 | width: 85vw; 26 | height: 100vh; 27 | left: 0; 28 | top: 0; 29 | transform: scale(0.9, 0.9) translateX(-100%); 30 | opacity: 0; 31 | pointer-events: none; 32 | transition: all 0.4s; 33 | } 34 | 35 | .DrawerWindow.show { 36 | transform: scale(1, 1) translateX(0%); 37 | opacity: 1; 38 | pointer-events: all; 39 | } 40 | 41 | .DrawerClose { 42 | position: absolute; 43 | width: 40vw; 44 | height: 100vh; 45 | right: 0; 46 | top: 0; 47 | color: transparent; 48 | padding-bottom: 30rpx; 49 | display: flex; 50 | align-items: flex-end; 51 | justify-content: center; 52 | background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.6)); 53 | letter-spacing: 5px; 54 | font-size: 50rpx; 55 | opacity: 0; 56 | pointer-events: none; 57 | transition: all 0.4s; 58 | } 59 | 60 | .DrawerClose.show { 61 | opacity: 1; 62 | pointer-events: all; 63 | width: 15vw; 64 | color: #fff; 65 | } 66 | 67 | .DrawerPage .cu-bar.tabbar .action button.icon { 68 | width: 64rpx; 69 | height: 64rpx; 70 | line-height: 64rpx; 71 | margin: 0; 72 | display: inline-block; 73 | } 74 | 75 | .DrawerPage .cu-bar.tabbar .action .cu-avatar { 76 | margin: 0; 77 | } 78 | 79 | .DrawerPage .nav { 80 | flex: 1; 81 | } 82 | 83 | .DrawerPage .nav .cu-item.cur { 84 | border-bottom: 0; 85 | position: relative; 86 | } 87 | 88 | .DrawerPage .nav .cu-item.cur::after { 89 | content: ""; 90 | width: 10rpx; 91 | height: 10rpx; 92 | background-color: currentColor; 93 | position: absolute; 94 | bottom: 10rpx; 95 | border-radius: 10rpx; 96 | left: 0; 97 | right: 0; 98 | margin: auto; 99 | } 100 | 101 | .DrawerPage .cu-bar.tabbar .action { 102 | flex: initial; 103 | } 104 | -------------------------------------------------------------------------------- /demo/pages/plugin/gradual/gradual.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | StatusBar: app.globalData.StatusBar, 5 | CustomBar: app.globalData.CustomBar, 6 | }, 7 | }); -------------------------------------------------------------------------------- /demo/pages/plugin/gradual/gradual.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/plugin/gradual/gradual.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 渐变 5 | 6 | 7 | -------------------------------------------------------------------------------- /demo/pages/plugin/gradual/gradual.wxss: -------------------------------------------------------------------------------- 1 | /* miniprogram/pages/plugin/gradual/gradual.wxss */ -------------------------------------------------------------------------------- /demo/pages/plugin/home/home.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Component({ 3 | options: { 4 | addGlobalClass: true, 5 | }, 6 | data: { 7 | StatusBar: app.globalData.StatusBar, 8 | CustomBar: app.globalData.CustomBar, 9 | list: [{ 10 | title: '索引列表', 11 | img: 'https://image.weilanwl.com/color2.0/plugin/sylb2244.jpg', 12 | url: '/indexes/indexes' 13 | }, 14 | { 15 | title: '微动画', 16 | img: 'https://image.weilanwl.com/color2.0/plugin/wdh2236.jpg', 17 | url: '/animation/animation' 18 | }, 19 | { 20 | title: '全屏抽屉', 21 | img: 'https://image.weilanwl.com/color2.0/plugin/qpct2148.jpg', 22 | url: '/drawer/drawer' 23 | }, 24 | { 25 | title: '垂直导航', 26 | img: 'https://image.weilanwl.com/color2.0/plugin/qpczdh2307.jpg', 27 | url: '/verticalnav/verticalnav' 28 | } 29 | ] 30 | }, 31 | methods: { 32 | toChild(e) { 33 | wx.navigateTo({ 34 | url: '/pages/plugin' + e.currentTarget.dataset.url 35 | }) 36 | }, 37 | } 38 | }); -------------------------------------------------------------------------------- /demo/pages/plugin/home/home.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /demo/pages/plugin/home/home.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{item.title}} 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /demo/pages/plugin/home/home.wxss: -------------------------------------------------------------------------------- 1 | 2 | .cardTitle{ 3 | color: #fff; 4 | padding: 90rpx 60rpx; 5 | font-size: 40rpx; 6 | font-weight: 300; 7 | transform: skew(-10deg, 0deg); 8 | position: relative; 9 | text-shadow: 0px 0px 6rpx rgba(0,0,0,0.3) 10 | } 11 | 12 | .cardTitle::before{ 13 | content: ""; 14 | position: absolute; 15 | width: 60rpx; 16 | height: 6rpx; 17 | border-radius: 20rpx; 18 | background-color: #fff; 19 | display: block; 20 | top: 60rpx; 21 | left: 50rpx; 22 | transform: skew(10deg, 0deg); 23 | } 24 | .cardTitle::after{ 25 | content: ""; 26 | position: absolute; 27 | width: 140rpx; 28 | border-radius: 6rpx; 29 | height: 24rpx; 30 | background-color: #fff; 31 | display: block; 32 | bottom: 76rpx; 33 | left: 90rpx; 34 | transform: skew(10deg, 0deg); 35 | opacity: 0.1; 36 | } -------------------------------------------------------------------------------- /demo/pages/plugin/indexes/indexes.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Page({ 3 | data: { 4 | StatusBar: app.globalData.StatusBar, 5 | CustomBar: app.globalData.CustomBar, 6 | hidden: true 7 | }, 8 | onLoad() { 9 | let list = []; 10 | for (let i = 0; i < 26; i++) { 11 | list[i] = String.fromCharCode(65 + i) 12 | } 13 | this.setData({ 14 | list: list, 15 | listCur: list[0] 16 | }) 17 | }, 18 | onReady() { 19 | let that = this; 20 | wx.createSelectorQuery().select('.indexBar-box').boundingClientRect(function(res) { 21 | that.setData({ 22 | boxTop: res.top 23 | }) 24 | }).exec(); 25 | wx.createSelectorQuery().select('.indexes').boundingClientRect(function(res) { 26 | that.setData({ 27 | barTop: res.top 28 | }) 29 | }).exec() 30 | }, 31 | //获取文字信息 32 | getCur(e) { 33 | this.setData({ 34 | hidden: false, 35 | listCur: this.data.list[e.target.id], 36 | }) 37 | }, 38 | 39 | setCur(e) { 40 | this.setData({ 41 | hidden: true, 42 | listCur: this.data.listCur 43 | }) 44 | }, 45 | //滑动选择Item 46 | tMove(e) { 47 | let y = e.touches[0].clientY, 48 | offsettop = this.data.boxTop, 49 | that = this; 50 | //判断选择区域,只有在选择区才会生效 51 | if (y > offsettop) { 52 | let num = parseInt((y - offsettop) / 20); 53 | this.setData({ 54 | listCur: that.data.list[num] 55 | }) 56 | }; 57 | }, 58 | 59 | //触发全部开始选择 60 | tStart() { 61 | this.setData({ 62 | hidden: false 63 | }) 64 | }, 65 | 66 | //触发结束选择 67 | tEnd() { 68 | this.setData({ 69 | hidden: true, 70 | listCurID: this.data.listCur 71 | }) 72 | }, 73 | indexSelect(e) { 74 | let that = this; 75 | let barHeight = this.data.barHeight; 76 | let list = this.data.list; 77 | let scrollY = Math.ceil(list.length * e.detail.y / barHeight); 78 | for (let i = 0; i < list.length; i++) { 79 | if (scrollY < i + 1) { 80 | that.setData({ 81 | listCur: list[i], 82 | movableY: i * 20 83 | }) 84 | return false 85 | } 86 | } 87 | } 88 | }); -------------------------------------------------------------------------------- /demo/pages/plugin/indexes/indexes.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/pages/plugin/indexes/indexes.wxml: -------------------------------------------------------------------------------- 1 | 2 | 返回 3 | 索引 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | {{list[index]}} 17 | 18 | 19 | {{list[index]}} 20 | 21 | {{list[index]}} 22 | {{list[sub]}} 23 | 24 | 有{{sub+2}}个主子需要伺候 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | {{list[index]}} 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /demo/pages/plugin/indexes/indexes.wxss: -------------------------------------------------------------------------------- 1 | page { 2 | padding-top: 100rpx; 3 | } 4 | 5 | .indexes { 6 | position: relative; 7 | } 8 | 9 | .indexBar { 10 | position: fixed; 11 | right: 0px; 12 | bottom: 0px; 13 | padding: 20rpx 20rpx 20rpx 60rpx; 14 | display: flex; 15 | align-items: center; 16 | } 17 | 18 | .indexBar .indexBar-box { 19 | width: 40rpx; 20 | height: auto; 21 | background: #fff; 22 | display: flex; 23 | flex-direction: column; 24 | box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.1); 25 | border-radius: 10rpx; 26 | } 27 | 28 | .indexBar-item { 29 | flex: 1; 30 | width: 40rpx; 31 | height: 40rpx; 32 | display: flex; 33 | align-items: center; 34 | justify-content: center; 35 | font-size: 24rpx; 36 | color: #888; 37 | } 38 | 39 | movable-view.indexBar-item { 40 | width: 40rpx; 41 | height: 40rpx; 42 | z-index: 9; 43 | position: relative; 44 | } 45 | 46 | movable-view.indexBar-item::before { 47 | content: ""; 48 | display: block; 49 | position: absolute; 50 | left: 0; 51 | top: 10rpx; 52 | height: 20rpx; 53 | width: 4rpx; 54 | background-color: #f37b1d; 55 | } 56 | 57 | .indexToast { 58 | position: fixed; 59 | top: 0; 60 | right: 80rpx; 61 | bottom: 0; 62 | background: rgba(0, 0, 0, 0.5); 63 | width: 100rpx; 64 | height: 100rpx; 65 | border-radius: 10rpx; 66 | margin: auto; 67 | color: #fff; 68 | line-height: 100rpx; 69 | text-align: center; 70 | font-size: 48rpx; 71 | } 72 | -------------------------------------------------------------------------------- /demo/pages/plugin/verticalnav/verticalnav.js: -------------------------------------------------------------------------------- 1 | const app = getApp() 2 | Page({ 3 | data: { 4 | StatusBar: app.globalData.StatusBar, 5 | CustomBar: app.globalData.CustomBar, 6 | Custom: app.globalData.Custom, 7 | TabCur: 0, 8 | MainCur: 0, 9 | VerticalNavTop: 0, 10 | list: [], 11 | load: true 12 | }, 13 | onLoad() { 14 | wx.showLoading({ 15 | title: '加载中...', 16 | mask: true 17 | }); 18 | let list = [{}]; 19 | for (let i = 0; i < 26; i++) { 20 | list[i] = {}; 21 | list[i].name = String.fromCharCode(65 + i); 22 | list[i].id = i; 23 | } 24 | this.setData({ 25 | list: list, 26 | listCur: list[0] 27 | }) 28 | }, 29 | onReady() { 30 | wx.hideLoading() 31 | }, 32 | tabSelect(e) { 33 | this.setData({ 34 | TabCur: e.currentTarget.dataset.id, 35 | MainCur: e.currentTarget.dataset.id, 36 | VerticalNavTop: (e.currentTarget.dataset.id - 1) * 50 37 | }) 38 | }, 39 | VerticalMain(e) { 40 | let that = this; 41 | let list = this.data.list; 42 | let tabHeight = 0; 43 | if (this.data.load) { 44 | for (let i = 0; i < list.length; i++) { 45 | let view = wx.createSelectorQuery().select("#main-" + list[i].id); 46 | view.fields({ 47 | size: true 48 | }, data => { 49 | list[i].top = tabHeight; 50 | tabHeight = tabHeight + data.height; 51 | list[i].bottom = tabHeight; 52 | }).exec(); 53 | } 54 | that.setData({ 55 | load: false, 56 | list: list 57 | }) 58 | } 59 | let scrollTop = e.detail.scrollTop + 20; 60 | for (let i = 0; i < list.length; i++) { 61 | if (scrollTop > list[i].top && scrollTop < list[i].bottom) { 62 | that.setData({ 63 | VerticalNavTop: (list[i].id - 1) * 50, 64 | TabCur: list[i].id 65 | }) 66 | return false 67 | } 68 | } 69 | } 70 | }) -------------------------------------------------------------------------------- /demo/pages/plugin/verticalnav/verticalnav.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {} 3 | } -------------------------------------------------------------------------------- /demo/pages/plugin/verticalnav/verticalnav.wxss: -------------------------------------------------------------------------------- 1 | /* pages/component/nav/nav.wxss */ 2 | .VerticalNav.nav { 3 | width: 200rpx; 4 | white-space: initial; 5 | } 6 | 7 | .VerticalNav.nav .cu-item { 8 | width: 100%; 9 | text-align: center; 10 | background-color: #fff; 11 | margin: 0; 12 | border: none; 13 | height: 50px; 14 | position: relative; 15 | } 16 | 17 | .VerticalNav.nav .cu-item.cur { 18 | background-color: #f1f1f1; 19 | } 20 | .VerticalNav.nav .cu-item.cur::after { 21 | content: ""; 22 | width: 8rpx; 23 | height: 30rpx; 24 | border-radius: 10rpx 0 0 10rpx; 25 | position: absolute; 26 | background-color: currentColor; 27 | top: 0; 28 | right: 0rpx; 29 | bottom: 0; 30 | margin: auto; 31 | } 32 | .VerticalBox{ 33 | display: flex; 34 | } 35 | .VerticalMain{ 36 | background-color: #f1f1f1; 37 | } -------------------------------------------------------------------------------- /demo/sitemap.json: -------------------------------------------------------------------------------- 1 | { 2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", 3 | "rules": [{ 4 | "action": "allow", 5 | "page": "*" 6 | }] 7 | } -------------------------------------------------------------------------------- /demo/sitemap21.json: -------------------------------------------------------------------------------- 1 | { 2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", 3 | "rules": [{ 4 | "action": "allow", 5 | "page": "*" 6 | }] 7 | } -------------------------------------------------------------------------------- /template/app.js: -------------------------------------------------------------------------------- 1 | //app.js 2 | App({ 3 | onLaunch: function() { 4 | // 展示本地存储能力 5 | var logs = wx.getStorageSync('logs') || [] 6 | logs.unshift(Date.now()) 7 | wx.setStorageSync('logs', logs) 8 | 9 | // 登录 10 | wx.login({ 11 | success: res => { 12 | // 发送 res.code 到后台换取 openId, sessionKey, unionId 13 | } 14 | }) 15 | // 获取用户信息 16 | wx.getSetting({ 17 | success: res => { 18 | if (res.authSetting['scope.userInfo']) { 19 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 20 | wx.getUserInfo({ 21 | success: res => { 22 | // 可以将 res 发送给后台解码出 unionId 23 | this.globalData.userInfo = res.userInfo 24 | 25 | // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 26 | // 所以此处加入 callback 以防止这种情况 27 | if (this.userInfoReadyCallback) { 28 | this.userInfoReadyCallback(res) 29 | } 30 | } 31 | }) 32 | } 33 | } 34 | }) 35 | // 获取系统状态栏信息 36 | wx.getSystemInfo({ 37 | success: e => { 38 | this.globalData.StatusBar = e.statusBarHeight; 39 | let capsule = wx.getMenuButtonBoundingClientRect(); 40 | if (capsule) { 41 | this.globalData.Custom = capsule; 42 | this.globalData.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight; 43 | } else { 44 | this.globalData.CustomBar = e.statusBarHeight + 50; 45 | } 46 | } 47 | }) 48 | }, 49 | globalData: { 50 | userInfo: null 51 | } 52 | }) -------------------------------------------------------------------------------- /template/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/index/index" 4 | ], 5 | "window": { 6 | "backgroundTextStyle": "light", 7 | "navigationBarBackgroundColor": "#fff", 8 | "navigationBarTitleText": "ColorUI", 9 | "navigationStyle": "custom", 10 | "navigationBarTextStyle": "white" 11 | }, 12 | "usingComponents": { 13 | "cu-custom": "/colorui/components/cu-custom" 14 | }, 15 | "sitemapLocation": "sitemap.json" 16 | } -------------------------------------------------------------------------------- /template/app.wxss: -------------------------------------------------------------------------------- 1 | @import "colorui/main.wxss"; 2 | @import "colorui/icon.wxss"; 3 | -------------------------------------------------------------------------------- /template/colorui/animation.wxss: -------------------------------------------------------------------------------- 1 | /* 2 | Animation 微动画 3 | 基于ColorUI组建库的动画模块 by 文晓港 2019年3月26日19:52:28 4 | */ 5 | 6 | /* css 滤镜 控制黑白底色gif的 */ 7 | .gif-black{ 8 | mix-blend-mode: screen; 9 | } 10 | .gif-white{ 11 | mix-blend-mode: multiply; 12 | } 13 | 14 | 15 | /* Animation css */ 16 | [class*=animation-] { 17 | animation-duration: .5s; 18 | animation-timing-function: ease-out; 19 | animation-fill-mode: both 20 | } 21 | 22 | .animation-fade { 23 | animation-name: fade; 24 | animation-duration: .8s; 25 | animation-timing-function: linear 26 | } 27 | 28 | .animation-scale-up { 29 | animation-name: scale-up 30 | } 31 | 32 | .animation-scale-down { 33 | animation-name: scale-down 34 | } 35 | 36 | .animation-slide-top { 37 | animation-name: slide-top 38 | } 39 | 40 | .animation-slide-bottom { 41 | animation-name: slide-bottom 42 | } 43 | 44 | .animation-slide-left { 45 | animation-name: slide-left 46 | } 47 | 48 | .animation-slide-right { 49 | animation-name: slide-right 50 | } 51 | 52 | .animation-shake { 53 | animation-name: shake 54 | } 55 | 56 | .animation-reverse { 57 | animation-direction: reverse 58 | } 59 | 60 | @keyframes fade { 61 | 0% { 62 | opacity: 0 63 | } 64 | 65 | 100% { 66 | opacity: 1 67 | } 68 | } 69 | 70 | @keyframes scale-up { 71 | 0% { 72 | opacity: 0; 73 | transform: scale(.2) 74 | } 75 | 76 | 100% { 77 | opacity: 1; 78 | transform: scale(1) 79 | } 80 | } 81 | 82 | @keyframes scale-down { 83 | 0% { 84 | opacity: 0; 85 | transform: scale(1.8) 86 | } 87 | 88 | 100% { 89 | opacity: 1; 90 | transform: scale(1) 91 | } 92 | } 93 | 94 | @keyframes slide-top { 95 | 0% { 96 | opacity: 0; 97 | transform: translateY(-100%) 98 | } 99 | 100 | 100% { 101 | opacity: 1; 102 | transform: translateY(0) 103 | } 104 | } 105 | 106 | @keyframes slide-bottom { 107 | 0% { 108 | opacity: 0; 109 | transform: translateY(100%) 110 | } 111 | 112 | 100% { 113 | opacity: 1; 114 | transform: translateY(0) 115 | } 116 | } 117 | 118 | @keyframes shake { 119 | 120 | 0%, 121 | 100% { 122 | transform: translateX(0) 123 | } 124 | 125 | 10% { 126 | transform: translateX(-9px) 127 | } 128 | 129 | 20% { 130 | transform: translateX(8px) 131 | } 132 | 133 | 30% { 134 | transform: translateX(-7px) 135 | } 136 | 137 | 40% { 138 | transform: translateX(6px) 139 | } 140 | 141 | 50% { 142 | transform: translateX(-5px) 143 | } 144 | 145 | 60% { 146 | transform: translateX(4px) 147 | } 148 | 149 | 70% { 150 | transform: translateX(-3px) 151 | } 152 | 153 | 80% { 154 | transform: translateX(2px) 155 | } 156 | 157 | 90% { 158 | transform: translateX(-1px) 159 | } 160 | } 161 | 162 | @keyframes slide-left { 163 | 0% { 164 | opacity: 0; 165 | transform: translateX(-100%) 166 | } 167 | 168 | 100% { 169 | opacity: 1; 170 | transform: translateX(0) 171 | } 172 | } 173 | 174 | @keyframes slide-right { 175 | 0% { 176 | opacity: 0; 177 | transform: translateX(100%) 178 | } 179 | 180 | 100% { 181 | opacity: 1; 182 | transform: translateX(0) 183 | } 184 | } -------------------------------------------------------------------------------- /template/colorui/components/cu-custom.js: -------------------------------------------------------------------------------- 1 | const app = getApp(); 2 | Component({ 3 | /** 4 | * 组件的一些选项 5 | */ 6 | options: { 7 | addGlobalClass: true, 8 | multipleSlots: true 9 | }, 10 | /** 11 | * 组件的对外属性 12 | */ 13 | properties: { 14 | bgColor: { 15 | type: String, 16 | default: '' 17 | }, 18 | isCustom: { 19 | type: [Boolean, String], 20 | default: false 21 | }, 22 | isBack: { 23 | type: [Boolean, String], 24 | default: false 25 | }, 26 | bgImage: { 27 | type: String, 28 | default: '' 29 | }, 30 | }, 31 | /** 32 | * 组件的初始数据 33 | */ 34 | data: { 35 | StatusBar: app.globalData.StatusBar, 36 | CustomBar: app.globalData.CustomBar, 37 | Custom: app.globalData.Custom 38 | }, 39 | /** 40 | * 组件的方法列表 41 | */ 42 | methods: { 43 | BackPage() { 44 | wx.navigateBack({ 45 | delta: 1 46 | }); 47 | }, 48 | toHome(){ 49 | wx.reLaunch({ 50 | url: '/pages/index/index', 51 | }) 52 | } 53 | } 54 | }) -------------------------------------------------------------------------------- /template/colorui/components/cu-custom.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": {} 4 | } -------------------------------------------------------------------------------- /template/colorui/components/cu-custom.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /template/colorui/components/cu-custom.wxss: -------------------------------------------------------------------------------- 1 | /* colorui/components/cu-custom.wxss */ -------------------------------------------------------------------------------- /template/pages/index/index.js: -------------------------------------------------------------------------------- 1 | //index.js 2 | //获取应用实例 3 | const app = getApp() 4 | 5 | Page({ 6 | data: { 7 | StatusBar: app.globalData.StatusBar, 8 | CustomBar: app.globalData.CustomBar, 9 | motto: 'Hi 开发者!', 10 | userInfo: {}, 11 | hasUserInfo: false, 12 | canIUse: wx.canIUse('button.open-type.getUserInfo') 13 | }, 14 | //事件处理函数 15 | bindViewTap: function() { 16 | wx.navigateTo({ 17 | url: '../logs/logs' 18 | }) 19 | }, 20 | onLoad: function () { 21 | if (app.globalData.userInfo) { 22 | this.setData({ 23 | userInfo: app.globalData.userInfo, 24 | hasUserInfo: true 25 | }) 26 | } else if (this.data.canIUse){ 27 | // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 28 | // 所以此处加入 callback 以防止这种情况 29 | app.userInfoReadyCallback = res => { 30 | this.setData({ 31 | userInfo: res.userInfo, 32 | hasUserInfo: true 33 | }) 34 | } 35 | } else { 36 | // 在没有 open-type=getUserInfo 版本的兼容处理 37 | wx.getUserInfo({ 38 | success: res => { 39 | app.globalData.userInfo = res.userInfo 40 | this.setData({ 41 | userInfo: res.userInfo, 42 | hasUserInfo: true 43 | }) 44 | } 45 | }) 46 | } 47 | }, 48 | getUserInfo: function(e) { 49 | console.log(e) 50 | app.globalData.userInfo = e.detail.userInfo 51 | this.setData({ 52 | userInfo: e.detail.userInfo, 53 | hasUserInfo: true 54 | }) 55 | } 56 | }) 57 | -------------------------------------------------------------------------------- /template/pages/index/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": {} 3 | } -------------------------------------------------------------------------------- /template/pages/index/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | ColorUI 空白模板 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{userInfo.nickName}} 11 | 12 | 13 | 14 | 15 | 16 | {{motto}} 17 | -------------------------------------------------------------------------------- /template/pages/index/index.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weilanwl/coloruicss/ce1a7feb765f2d89b56577c5a9df96e214ed23ba/template/pages/index/index.wxss -------------------------------------------------------------------------------- /template/project.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "项目配置文件", 3 | "packOptions": { 4 | "ignore": [] 5 | }, 6 | "setting": { 7 | "urlCheck": true, 8 | "es6": true, 9 | "postcss": true, 10 | "minified": true, 11 | "newFeature": true, 12 | "autoAudits": false 13 | }, 14 | "compileType": "miniprogram", 15 | "libVersion": "2.4.2", 16 | "appid": "wxfd5241d66a07713f", 17 | "projectname": "ColorUI-template", 18 | "debugOptions": { 19 | "hidedInDevtools": [] 20 | }, 21 | "isGameTourist": false, 22 | "simulatorType": "wechat", 23 | "simulatorPluginLibVersion": {}, 24 | "condition": { 25 | "search": { 26 | "current": -1, 27 | "list": [] 28 | }, 29 | "conversation": { 30 | "current": -1, 31 | "list": [] 32 | }, 33 | "game": { 34 | "currentL": -1, 35 | "list": [] 36 | }, 37 | "miniprogram": { 38 | "current": -1, 39 | "list": [] 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /template/sitemap.json: -------------------------------------------------------------------------------- 1 | { 2 | "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", 3 | "rules": [{ 4 | "action": "allow", 5 | "page": "*" 6 | }] 7 | } -------------------------------------------------------------------------------- /template/utils/util.js: -------------------------------------------------------------------------------- 1 | const formatTime = date => { 2 | const year = date.getFullYear() 3 | const month = date.getMonth() + 1 4 | const day = date.getDate() 5 | const hour = date.getHours() 6 | const minute = date.getMinutes() 7 | const second = date.getSeconds() 8 | 9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') 10 | } 11 | 12 | const formatNumber = n => { 13 | n = n.toString() 14 | return n[1] ? n : '0' + n 15 | } 16 | 17 | module.exports = { 18 | formatTime: formatTime 19 | } 20 | --------------------------------------------------------------------------------