From 8c2abd9e3f3ff434730ede2d0a79df93af013d49 Mon Sep 17 00:00:00 2001 From: xushengni Date: Thu, 5 Nov 2020 12:08:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=9C=86?= =?UTF-8?q?=E5=9C=88loading=E7=BB=84=E4=BB=B6=E3=80=81=E5=8D=87=E7=BA=A7to?= =?UTF-8?q?ast=E7=BB=84=E4=BB=B6UI=E3=80=81=E5=8D=87=E7=BA=A7button?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84loading=20UI=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E5=A4=8Dmsg=E7=BB=84=E4=BB=B6=E6=96=87=E6=9C=AC=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E8=8B=B1=E6=96=87=E5=8D=95=E8=AF=8D=E8=AF=8D=E9=97=B4?= =?UTF-8?q?=E6=8A=98=E8=A1=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 11 ++ dist/example/example.css | 2 +- dist/example/index.html | 92 +++++++++- dist/style/weui.css | 160 ++++++++++++++++-- dist/style/weui.min.css | 4 +- package.json | 2 +- src/example/button/button.html | 6 +- src/example/example.less | 8 + src/example/home.html | 6 + src/example/index.html | 1 + src/example/loading/loading.html | 20 +++ src/example/loadmore/loadmore.html | 6 +- src/example/toast/toast.html | 52 +++++- src/style/base/fn.less | 1 + src/style/base/mixin/setLoading.less | 34 ++++ .../widget/weui-button/weui-btn_loading.less | 4 + .../widget/weui-loading/weui-loading.less | 2 + .../weui-loading/weui-primary-loading.less | 78 +++++++++ .../widget/weui-media-box/weui-media-box.less | 5 +- src/style/widget/weui-page/weui-article.less | 1 + src/style/widget/weui-page/weui-msg.less | 2 + src/style/widget/weui-tips/weui-loadmore.less | 14 +- src/style/widget/weui-tips/weui-toast.less | 36 ++-- 23 files changed, 492 insertions(+), 55 deletions(-) create mode 100644 src/example/loading/loading.html create mode 100644 src/style/base/mixin/setLoading.less create mode 100644 src/style/widget/weui-loading/weui-primary-loading.less diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ddd6c3d..e17edaa3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +### v2.4.1 (2020-11-03) + +#### Features +* feat: 升级toast组件的UI +* feat: 新增圆圈loading组件 +* feat: 升级button组件的loading UI + +#### Bugfixes +* fix: msg组件文本区域新增英文词间折行加破折号的效果 + + ### v2.4.0 (2020-06-17) #### Features diff --git a/dist/example/example.css b/dist/example/example.css index 3608af38..c507b763 100644 --- a/dist/example/example.css +++ b/dist/example/example.css @@ -1 +1 @@ -body,html{height:100%;-webkit-tap-highlight-color:transparent}body{font-family:-apple-system-font,Helvetica Neue,Helvetica,sans-serif}ul{list-style:none}.page,body{background-color:var(--weui-BG-0)}.page{position:absolute;top:0;right:0;bottom:0;left:0;overflow-y:auto;-webkit-overflow-scrolling:touch;box-sizing:border-box;opacity:0;z-index:1}.page.js_show{opacity:1}.page.actionsheet,.page.article,.page.dialog,.page.form,.page.loadmore,.page.msg,.page.msg_success,.page.msg_text,.page.msg_text_primary,.page.msg_warn,.page.picker,.page.progress,.page.toast,.page.top-tips{background-color:var(--weui-BG-2)}.link{color:var(--weui-LINK)}.container{position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden;color:var(--weui-FG-0)}.page__hd{padding:40px}.page__bd_spacing{padding:0 16px}.page__ft{padding-top:40px;padding-bottom:10px;padding-bottom:calc(10px + constant(safe-area-inset-bottom));padding-bottom:calc(10px + env(safe-area-inset-bottom));text-align:center}.page__ft img{height:19px}body[data-weui-theme=dark] .page__ft img{-webkit-filter:invert(100) hue-rotate(180deg);filter:invert(100) hue-rotate(180deg)}@media (prefers-color-scheme:dark){body:not([data-weui-theme=light]) .page__ft img{-webkit-filter:invert(100) hue-rotate(180deg);filter:invert(100) hue-rotate(180deg)}}.page__ft.j_bottom{position:absolute;bottom:0;left:0;right:0}.page__title{text-align:left;font-size:20px;font-weight:400}.page__desc{margin-top:4px;color:var(--weui-FG-1);text-align:left;font-size:14px}.page.footer .page__ft,.page.gallery .page__ft,.page.navbar .page__ft,.page.tabbar .page__ft,.page[class*=form_] .page__ft,.page[class*=msg_] .page__ft{display:none}.weui-cell_example:before{left:52px}.page.home .page__intro-icon{margin-top:-.2em;margin-left:5px;width:16px;height:16px;vertical-align:middle}.page.home .page__title{font-size:0;margin-bottom:15px}body[data-weui-theme=dark] .page.home .page__title{-webkit-filter:invert(100) hue-rotate(180deg);filter:invert(100) hue-rotate(180deg)}@media (prefers-color-scheme:dark){body:not([data-weui-theme=light]) .page.home .page__title{-webkit-filter:invert(100) hue-rotate(180deg);filter:invert(100) hue-rotate(180deg)}}.page.home .page__bd img{width:30px;height:30px}body[data-weui-theme=dark] .page.home .page__bd img{-webkit-filter:invert(100) hue-rotate(180deg);filter:invert(100) hue-rotate(180deg)}@media (prefers-color-scheme:dark){body:not([data-weui-theme=light]) .page.home .page__bd img{-webkit-filter:invert(100) hue-rotate(180deg);filter:invert(100) hue-rotate(180deg)}}.page.home .page__bd li{margin:8px 0;background-color:var(--weui-BG-2);overflow:hidden;border-radius:2px;cursor:pointer}.page.home .page__bd li.js_show .weui-flex{opacity:.5}.page.home .page__bd li.js_show .page__category{height:auto}.page.home .page__bd li.js_show .page__category-content{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.page.home .page__bd li:first-child{margin-top:0}.page.home .page__category{height:0;overflow:hidden}.page.home .page__category-content{opacity:0;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-transition:.3s;transition:.3s}.page.home .weui-flex{padding:20px;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-transition:.3s;transition:.3s}.page.home .weui-cells{margin-top:0}.page.home .weui-cells:after,.page.home .weui-cells:before{display:none}.page.home .weui-cell{padding-left:20px;padding-right:20px}.page.home .weui-cell:before{left:20px;right:20px}.page.form .page__bd{padding-bottom:30px}.page.form .weui-label{width:3.1em}.page.form_page .weui-label{width:4.1em}.page.form_select .weui-cells__group_form .weui-cell_select-before .weui-select{width:3.1em}[class*=" form_"].page,[class^=form_].page{padding:0}.page.form_input_status .weui-label,.page.form_select .weui-label,.page.form_select_primary .weui-label,.page.form_vcode .weui-label{width:3.1em}.page.button{background-color:var(--weui-BG-0)}.page.button .weui-btn_mini{vertical-align:middle}.page.button .page__bd{padding:0}.page.button .button-sp-area{margin:15px auto;padding:15px;text-align:center}.page.button .button-sp-area.cell{padding:15px 0}.page.cell .page__bd{padding-bottom:30px}.page.dialog .page__bd{padding:0 15px}.page.panel .page__bd{padding-bottom:20px}.page.icons,.page.icons-svg{text-align:center}.page.icons-svg .page__bd,.page.icons .page__bd{padding:0 40px;text-align:left}.page.icons-svg .icon-box,.page.icons .icon-box{margin-bottom:25px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.page.icons-svg .icon-box i,.page.icons .icon-box i{margin-right:18px}.page.icons-svg .icon-box__ctn,.page.icons .icon-box__ctn{-webkit-flex-shrink:100;flex-shrink:100}.page.icons-svg .icon-box__title,.page.icons .icon-box__title{font-weight:400}.page.icons-svg .icon-box__desc,.page.icons .icon-box__desc{margin-top:6px;font-size:12px;color:#888}.page.icons-svg .icon_sp_area,.page.icons .icon_sp_area{margin-top:10px;text-align:left}.page.icons-svg .icon_sp_area i:before,.page.icons .icon_sp_area i:before{margin-bottom:5px}.page.flex .placeholder{margin:5px;padding:0 10px;background-color:var(--weui-BG-1);height:2.3em;line-height:2.3em;text-align:center;color:var(--weui-FG-1)}.page.layers{overflow-x:hidden;-webkit-perspective:1000px;perspective:1000px}@media only screen and (max-width:320px){.page.layers .page__hd{padding-left:20px;padding-right:20px}}.page.layers .page__bd{position:relative}.page.layers .page__desc{min-height:4.8em}.page.layers .layers__layer{position:absolute;left:50%;width:150px;height:266px;margin-left:-75px;box-sizing:border-box;-webkit-transition:.5s;transition:.5s;background:url(images/layers/transparent.gif) no-repeat 50%;background-size:contain;font-size:14px;color:var(--weui-WHITE)}.page.layers .layers__layer span{position:absolute;bottom:5px;left:0;right:0;text-align:center;-webkit-transition:.5s;transition:.5s}.page.layers .layers__layer:last-child span{color:#aaa}.page.layers .layers__layer.j_hide{opacity:0}.page.layers .layers__layer.j_pic span{color:transparent}@media only screen and (min-width:375px) and (min-height:603px){.page.layers .layers__layer{width:180px;height:320px;margin-left:-90px}}@media only screen and (min-width:414px) and (min-height:640px){.page.layers .layers__layer{width:200px;height:355px;margin-left:-100px}}.page.layers .layers__layer_popout{border:1px solid hsla(0,0%,80%,.5);z-index:4}.page.layers .layers__layer_popout.j_transform{-webkit-transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(120px);transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(120px)}@media only screen and (max-width:320px){.page.layers .layers__layer_popout.j_transform{-webkit-transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(140px);transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(140px)}}.page.layers .layers__layer_popout.j_pic{border-color:transparent;background-image:url(images/layers/popout.png)}.page.layers .layers__layer_mask{background-color:rgba(0,0,0,.5);z-index:3}.page.layers .layers__layer_mask.j_transform{-webkit-transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(40px);transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(40px)}@media only screen and (max-width:320px){.page.layers .layers__layer_mask.j_transform{-webkit-transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(80px);transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(80px)}}.page.layers .layers__layer_navigation{background-color:rgba(40,187,102,.5);z-index:2}.page.layers .layers__layer_navigation.j_transform{-webkit-transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-40px);transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-40px)}@media only screen and (max-width:320px){.page.layers .layers__layer_navigation.j_transform{-webkit-transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(20px);transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(20px)}}.page.layers .layers__layer_navigation.j_pic{background-color:transparent;background-image:url(images/layers/navigation.png)}.page.layers .layers__layer_content{background-color:var(--weui-BG-2);z-index:1}.page.layers .layers__layer_content.j_transform{-webkit-transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-120px);transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-120px)}@media only screen and (max-width:320px){.page.layers .layers__layer_content.j_transform{-webkit-transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-40px);transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-40px)}}.page.layers .layers__layer_content.j_pic{background-image:url(images/layers/content.png)}.page.searchbar .searchbar-result{display:none;margin-top:0;font-size:14px}.page.searchbar .searchbar-result .weui-cell__bd{padding:2px 0 2px 20px;color:var(--weui-FG-1)}.page.gallery{overflow:hidden}.weui-half-screen-dialog{-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;-webkit-transform:translateY(100%);transform:translateY(100%)}.weui-half-screen-dialog_show{-webkit-transform:translateY(0);transform:translateY(0)}@-webkit-keyframes a{0%{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@keyframes a{0%{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@-webkit-keyframes b{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);opacity:0}}@keyframes b{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);opacity:0}}.page.slideIn{-webkit-animation:a .2s forwards;animation:a .2s forwards}.page.slideOut{-webkit-animation:b .2s forwards;animation:b .2s forwards}@supports (top:constant(safe-area-inset-top)){.page{padding:constant(safe-area-inset-top) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left)}.page.navbar,.page.tabbar{padding-left:0;padding-right:0}.weui-tab__panel{padding-left:constant(safe-area-inset-left);padding-right:constant(safe-area-inset-right)}}@supports (top:env(safe-area-inset-top)){.page{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}.page.article,.page.msg_success,.page.msg_text,.page.msg_text_primary,.page.msg_warn,.page.navbar,.page.tabbar{padding:0}} \ No newline at end of file +body,html{height:100%;-webkit-tap-highlight-color:transparent}body{font-family:-apple-system-font,Helvetica Neue,Helvetica,sans-serif}ul{list-style:none}.page,body{background-color:var(--weui-BG-0)}.page{position:absolute;top:0;right:0;bottom:0;left:0;overflow-y:auto;-webkit-overflow-scrolling:touch;box-sizing:border-box;opacity:0;z-index:1}.page.js_show{opacity:1}.page.actionsheet,.page.article,.page.dialog,.page.form,.page.loadmore,.page.msg,.page.msg_success,.page.msg_text,.page.msg_text_primary,.page.msg_warn,.page.picker,.page.progress,.page.toast,.page.top-tips{background-color:var(--weui-BG-2)}.link{color:var(--weui-LINK)}.container{position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden;color:var(--weui-FG-0)}.page__hd{padding:40px}.page__bd_spacing{padding:0 16px}.page__ft{padding-top:40px;padding-bottom:10px;padding-bottom:calc(10px + constant(safe-area-inset-bottom));padding-bottom:calc(10px + env(safe-area-inset-bottom));text-align:center}.page__ft img{height:19px}body[data-weui-theme=dark] .page__ft img{-webkit-filter:invert(100) hue-rotate(180deg);filter:invert(100) hue-rotate(180deg)}@media (prefers-color-scheme:dark){body:not([data-weui-theme=light]) .page__ft img{-webkit-filter:invert(100) hue-rotate(180deg);filter:invert(100) hue-rotate(180deg)}}.page__ft.j_bottom{position:absolute;bottom:0;left:0;right:0}.page__title{text-align:left;font-size:20px;font-weight:400}.page__desc{margin-top:4px;color:var(--weui-FG-1);text-align:left;font-size:14px}.page.footer .page__ft,.page.gallery .page__ft,.page.navbar .page__ft,.page.tabbar .page__ft,.page[class*=form_] .page__ft,.page[class*=msg_] .page__ft{display:none}.weui-cell_example:before{left:52px}.page.home .page__intro-icon{margin-top:-.2em;margin-left:5px;width:16px;height:16px;vertical-align:middle}.page.home .page__title{font-size:0;margin-bottom:15px}body[data-weui-theme=dark] .page.home .page__title{-webkit-filter:invert(100) hue-rotate(180deg);filter:invert(100) hue-rotate(180deg)}@media (prefers-color-scheme:dark){body:not([data-weui-theme=light]) .page.home .page__title{-webkit-filter:invert(100) hue-rotate(180deg);filter:invert(100) hue-rotate(180deg)}}.page.home .page__bd img{width:30px;height:30px}body[data-weui-theme=dark] .page.home .page__bd img{-webkit-filter:invert(100) hue-rotate(180deg);filter:invert(100) hue-rotate(180deg)}@media (prefers-color-scheme:dark){body:not([data-weui-theme=light]) .page.home .page__bd img{-webkit-filter:invert(100) hue-rotate(180deg);filter:invert(100) hue-rotate(180deg)}}.page.home .page__bd li{margin:8px 0;background-color:var(--weui-BG-2);overflow:hidden;border-radius:2px;cursor:pointer}.page.home .page__bd li.js_show .weui-flex{opacity:.5}.page.home .page__bd li.js_show .page__category{height:auto}.page.home .page__bd li.js_show .page__category-content{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.page.home .page__bd li:first-child{margin-top:0}.page.home .page__category{height:0;overflow:hidden}.page.home .page__category-content{opacity:0;-webkit-transform:translateY(-50%);transform:translateY(-50%);-webkit-transition:.3s;transition:.3s}.page.home .weui-flex{padding:20px;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-transition:.3s;transition:.3s}.page.home .weui-cells{margin-top:0}.page.home .weui-cells:after,.page.home .weui-cells:before{display:none}.page.home .weui-cell{padding-left:20px;padding-right:20px}.page.home .weui-cell:before{left:20px;right:20px}.page.form .page__bd{padding-bottom:30px}.page.form .weui-label{width:3.1em}.page.form_page .weui-label{width:4.1em}.page.form_select .weui-cells__group_form .weui-cell_select-before .weui-select{width:3.1em}[class*=" form_"].page,[class^=form_].page{padding:0}.page.form_input_status .weui-label,.page.form_select .weui-label,.page.form_select_primary .weui-label,.page.form_vcode .weui-label{width:3.1em}.page.button{background-color:var(--weui-BG-0)}.page.button .weui-btn_mini{vertical-align:middle}.page.button .page__bd{padding:0}.page.button .button-sp-area{margin:15px auto;padding:15px;text-align:center}.page.button .button-sp-area.cell{padding:15px 0}.page.cell .page__bd{padding-bottom:30px}.page.dialog .page__bd{padding:0 15px}.page.panel .page__bd{padding-bottom:20px}.page.icons,.page.icons-svg{text-align:center}.page.icons-svg .page__bd,.page.icons .page__bd{padding:0 40px;text-align:left}.page.icons-svg .icon-box,.page.icons .icon-box{margin-bottom:25px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.page.icons-svg .icon-box i,.page.icons .icon-box i{margin-right:18px}.page.icons-svg .icon-box__ctn,.page.icons .icon-box__ctn{-webkit-flex-shrink:100;flex-shrink:100}.page.icons-svg .icon-box__title,.page.icons .icon-box__title{font-weight:400}.page.icons-svg .icon-box__desc,.page.icons .icon-box__desc{margin-top:6px;font-size:12px;color:#888}.page.icons-svg .icon_sp_area,.page.icons .icon_sp_area{margin-top:10px;text-align:left}.page.icons-svg .icon_sp_area i:before,.page.icons .icon_sp_area i:before{margin-bottom:5px}.page.flex .placeholder{margin:5px;padding:0 10px;background-color:var(--weui-BG-1);height:2.3em;line-height:2.3em;text-align:center;color:var(--weui-FG-1)}.page.layers{overflow-x:hidden;-webkit-perspective:1000px;perspective:1000px}@media only screen and (max-width:320px){.page.layers .page__hd{padding-left:20px;padding-right:20px}}.page.layers .page__bd{position:relative}.page.layers .page__desc{min-height:4.8em}.page.layers .layers__layer{position:absolute;left:50%;width:150px;height:266px;margin-left:-75px;box-sizing:border-box;-webkit-transition:.5s;transition:.5s;background:url(images/layers/transparent.gif) no-repeat 50%;background-size:contain;font-size:14px;color:var(--weui-WHITE)}.page.layers .layers__layer span{position:absolute;bottom:5px;left:0;right:0;text-align:center;-webkit-transition:.5s;transition:.5s}.page.layers .layers__layer:last-child span{color:#aaa}.page.layers .layers__layer.j_hide{opacity:0}.page.layers .layers__layer.j_pic span{color:transparent}@media only screen and (min-width:375px) and (min-height:603px){.page.layers .layers__layer{width:180px;height:320px;margin-left:-90px}}@media only screen and (min-width:414px) and (min-height:640px){.page.layers .layers__layer{width:200px;height:355px;margin-left:-100px}}.page.layers .layers__layer_popout{border:1px solid hsla(0,0%,80%,.5);z-index:4}.page.layers .layers__layer_popout.j_transform{-webkit-transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(120px);transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(120px)}@media only screen and (max-width:320px){.page.layers .layers__layer_popout.j_transform{-webkit-transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(140px);transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(140px)}}.page.layers .layers__layer_popout.j_pic{border-color:transparent;background-image:url(images/layers/popout.png)}.page.layers .layers__layer_mask{background-color:rgba(0,0,0,.5);z-index:3}.page.layers .layers__layer_mask.j_transform{-webkit-transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(40px);transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(40px)}@media only screen and (max-width:320px){.page.layers .layers__layer_mask.j_transform{-webkit-transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(80px);transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(80px)}}.page.layers .layers__layer_navigation{background-color:rgba(40,187,102,.5);z-index:2}.page.layers .layers__layer_navigation.j_transform{-webkit-transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-40px);transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-40px)}@media only screen and (max-width:320px){.page.layers .layers__layer_navigation.j_transform{-webkit-transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(20px);transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(20px)}}.page.layers .layers__layer_navigation.j_pic{background-color:transparent;background-image:url(images/layers/navigation.png)}.page.layers .layers__layer_content{background-color:var(--weui-BG-2);z-index:1}.page.layers .layers__layer_content.j_transform{-webkit-transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-120px);transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-120px)}@media only screen and (max-width:320px){.page.layers .layers__layer_content.j_transform{-webkit-transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-40px);transform:translateX(15px) rotateX(45deg) rotate(10deg) skew(-15deg) translateZ(-40px)}}.page.layers .layers__layer_content.j_pic{background-image:url(images/layers/content.png)}.page.searchbar .searchbar-result{display:none;margin-top:0;font-size:14px}.page.searchbar .searchbar-result .weui-cell__bd{padding:2px 0 2px 20px;color:var(--weui-FG-1)}.page.gallery{overflow:hidden}.weui-half-screen-dialog{-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;-webkit-transform:translateY(100%);transform:translateY(100%)}.weui-half-screen-dialog_show{-webkit-transform:translateY(0);transform:translateY(0)}.loading_demo{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.loading_demo .weui-loading,.loading_demo .weui-primary-loading{margin:0 5px}@-webkit-keyframes a{0%{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@keyframes a{0%{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@-webkit-keyframes b{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);opacity:0}}@keyframes b{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);opacity:0}}.page.slideIn{-webkit-animation:a .2s forwards;animation:a .2s forwards}.page.slideOut{-webkit-animation:b .2s forwards;animation:b .2s forwards}@supports (top:constant(safe-area-inset-top)){.page{padding:constant(safe-area-inset-top) constant(safe-area-inset-right) constant(safe-area-inset-bottom) constant(safe-area-inset-left)}.page.navbar,.page.tabbar{padding-left:0;padding-right:0}.weui-tab__panel{padding-left:constant(safe-area-inset-left);padding-right:constant(safe-area-inset-right)}}@supports (top:env(safe-area-inset-top)){.page{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}.page.article,.page.msg_success,.page.msg_text,.page.msg_text_primary,.page.msg_warn,.page.navbar,.page.tabbar{padding:0}} \ No newline at end of file diff --git a/dist/example/index.html b/dist/example/index.html index 167a07c5..b689c310 100644 --- a/dist/example/index.html +++ b/dist/example/index.html @@ -119,6 +119,12 @@

+ +
+

Loading

+
+
+
@@ -1531,14 +1539,32 @@

Toast

已完成

- + + + + + + @@ -1556,6 +1582,19 @@

Toast

}); }); + // warn + $(function(){ + var $warnToast = $('#warnToast'); + $('#showWarnToast').on('click', function(){ + if ($warnToast.css('display') != 'none') return; + + $warnToast.fadeIn(100); + setTimeout(function () { + $warnToast.fadeOut(100); + }, 2000); + }); + }); + // loading $(function(){ var $loadingToast = $('#loadingToast'); @@ -1568,6 +1607,19 @@

Toast

}, 2000); }); }); + + // text + $(function(){ + var $textToast = $('#textToast'); + $('#showTextToast').on('click', function(){ + if ($textToast.css('display') != 'none') return; + + $textToast.fadeIn(100); + setTimeout(function () { + $textToast.fadeOut(100); + }, 2000); + }); + }); @@ -2514,6 +2566,29 @@

Flex

+ + diff --git a/src/style/base/fn.less b/src/style/base/fn.less index 75c6a49e..0c11e1f9 100644 --- a/src/style/base/fn.less +++ b/src/style/base/fn.less @@ -21,6 +21,7 @@ @import "./mixin/mobile"; @import "./mixin/setOnepx"; @import "./mixin/setArrow"; +@import "./mixin/setLoading"; @import "./mixin/text"; diff --git a/src/style/base/mixin/setLoading.less b/src/style/base/mixin/setLoading.less new file mode 100644 index 00000000..efdfe03d --- /dev/null +++ b/src/style/base/mixin/setLoading.less @@ -0,0 +1,34 @@ +/* +* Tencent is pleased to support the open source community by making WeUI available. +* +* Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. +* +* Licensed under the MIT License (the "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://opensource.org/licenses/MIT +* +* Unless required by applicable law or agreed to in writing, software distributed under the License is +* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +* either express or implied. See the License for the specific language governing permissions and +* limitations under the License. +*/ + +.setWeuiPrimaryLoading(@size:20px){ + width:@size; + height:@size; + &:before,&:after{ + content:""; + display:block; + width:@size / 2; + height:@size; + } + &:before{ + border-top-left-radius:@size; + border-bottom-left-radius:@size; + } + &:after{ + border-top-right-radius:@size; + border-bottom-right-radius:@size; + } +} diff --git a/src/style/widget/weui-button/weui-btn_loading.less b/src/style/widget/weui-button/weui-btn_loading.less index 115143e5..1dc835c8 100644 --- a/src/style/widget/weui-button/weui-btn_loading.less +++ b/src/style/widget/weui-button/weui-btn_loading.less @@ -20,6 +20,10 @@ .weui-loading { margin: -0.2em 0.34em 0 0; } + .weui-primary-loading { + margin: -.2em 8px 0 0; + vertical-align:middle; + } &.weui-btn_primary { background-color: @weuiBtnPrimaryActiveBg; color: var(--weui-WHITE); diff --git a/src/style/widget/weui-loading/weui-loading.less b/src/style/widget/weui-loading/weui-loading.less index a81258d2..bed8cce5 100644 --- a/src/style/widget/weui-loading/weui-loading.less +++ b/src/style/widget/weui-loading/weui-loading.less @@ -15,6 +15,7 @@ */ @import "../../base/fn"; +@import "./weui-primary-loading"; .weui-loading { width: 20px; @@ -50,3 +51,4 @@ transform: rotate3d(0, 0, 1, 360deg); } } + diff --git a/src/style/widget/weui-loading/weui-primary-loading.less b/src/style/widget/weui-loading/weui-primary-loading.less new file mode 100644 index 00000000..88d08cdd --- /dev/null +++ b/src/style/widget/weui-loading/weui-primary-loading.less @@ -0,0 +1,78 @@ +/* +* Tencent is pleased to support the open source community by making WeUI available. +* +* Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. +* +* Licensed under the MIT License (the "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://opensource.org/licenses/MIT +* +* Unless required by applicable law or agreed to in writing, software distributed under the License is +* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +* either express or implied. See the License for the specific language governing permissions and +* limitations under the License. +*/ + +@import "../../base/fn"; + +// 默认灰色 +.weui-primary-loading{ + display:inline-flex; + position:relative; + width:16px; + height:16px; + vertical-align:middle; + color:var(--weui-FG); + animation: weuiLoading 1s steps(60,end) infinite; + + &:before,&:after{ + content:""; + display:block; + width:8px; + height:16px; + box-sizing:border-box; + border:2px solid; + border-color:currentColor; + opacity:.5; + } +} +.weui-primary-loading:before{ + border-right-width:0; + border-top-left-radius:16px; + border-bottom-left-radius:16px; + -webkit-mask-image:linear-gradient(180deg, rgba(0,0,0,1) 8%, rgba(0,0,0,.3) 95%); +} +.weui-primary-loading:after{ + border-left-width:0; + border-top-right-radius:16px; + border-bottom-right-radius:16px; + -webkit-mask-image:linear-gradient(225deg, rgba(0,0,0,0) 45% , rgba(0,0,0,.3) 95%); +} +.weui-primary-loading__dot{ + position:absolute; + top:0; + left:50%; + width:1px; + height:2px; + border-top-right-radius:2px; + border-bottom-right-radius:2px; + background:currentColor; + opacity:.5; +} + +// 默认灰色 +.weui-primary-loading_transparent{ + color:#FFFFFF; +} + +// 品牌色 +.weui-primary-loading_brand{ + color:var(--weui-BRAND); + .weui-primary-loading__dot, + &:before,&:after{ + opacity:.85; + } +} + + diff --git a/src/style/widget/weui-media-box/weui-media-box.less b/src/style/widget/weui-media-box/weui-media-box.less index 545944c3..95d64bca 100644 --- a/src/style/widget/weui-media-box/weui-media-box.less +++ b/src/style/widget/weui-media-box/weui-media-box.less @@ -44,9 +44,7 @@ line-height: 1.4; color: @weuiTextColorTitle; .ellipsis(); - - word-wrap: break-word; - word-break: break-all; + .hyphens; } .weui-media-box__desc { color: @weuiTextColorTips; @@ -54,6 +52,7 @@ line-height: 1.4; padding-top: 4px; .ellipsisLn(2); + .hyphens; } .weui-media-box__info { margin-top: 16px; diff --git a/src/style/widget/weui-page/weui-article.less b/src/style/widget/weui-page/weui-article.less index 2ccd9962..f1d55ea6 100644 --- a/src/style/widget/weui-page/weui-article.less +++ b/src/style/widget/weui-page/weui-article.less @@ -22,6 +22,7 @@ padding: 24px calc(16px ~"+ env(safe-area-inset-right)") calc(24px ~"+ env(safe-area-inset-bottom)") calc(16px ~"+ env(safe-area-inset-left)"); font-size: 17px; color: var(--weui-FG-0); + .hyphens; section { margin-bottom: 1.5em; } diff --git a/src/style/widget/weui-page/weui-msg.less b/src/style/widget/weui-page/weui-msg.less index 32e97933..fa127eb4 100644 --- a/src/style/widget/weui-page/weui-msg.less +++ b/src/style/widget/weui-page/weui-msg.less @@ -42,6 +42,7 @@ padding: 0 32px; flex: 1; line-height: 1.6; + .hyphens; &:first-child { padding-top: 96px; } } .weui-msg__title { @@ -78,6 +79,7 @@ .weui-msg__tips-area { margin-bottom: 16px; padding: 0 40px; + .hyphens; .weui-msg__opr-area + & { margin-bottom: 48px; } diff --git a/src/style/widget/weui-tips/weui-loadmore.less b/src/style/widget/weui-tips/weui-loadmore.less index b0306b29..2fd46125 100644 --- a/src/style/widget/weui-tips/weui-loadmore.less +++ b/src/style/widget/weui-tips/weui-loadmore.less @@ -18,20 +18,26 @@ .weui-loadmore { width: 65%; - margin: 1.5em auto; - line-height: 1.6em; - font-size: 14px; + margin: 20px auto; text-align: center; + font-size:0; + + .weui-loading, + .weui-primary-loading{ + margin-right:8px; + } } .weui-loadmore__tips { display: inline-block; vertical-align: middle; + font-size: 14px; + line-height: 1.6; color: @weuiTextColorTitle; } .weui-loadmore_line { border-top: 1px solid @weuiLineColorLight; - margin-top: 2.4em; + margin-top: 32px; .weui-loadmore__tips { position: relative; top: -0.9em; diff --git a/src/style/widget/weui-tips/weui-toast.less b/src/style/widget/weui-tips/weui-toast.less index 7bc13382..c65ac1de 100644 --- a/src/style/widget/weui-tips/weui-toast.less +++ b/src/style/widget/weui-tips/weui-toast.less @@ -19,35 +19,49 @@ .weui-toast { position: fixed; z-index: 5000; - width: 120px; - height: 120px; + width: 136px; + height: 136px; top: 40%; left: 50%; transform: translate(-50%, -50%); text-align: center; - border-radius: 5px; + border-radius: 12px; color: rgba(255, 255, 255, 0.9); display: flex; flex-direction: column; align-items: center; justify-content: center; background-color: var(--weui-BG-4); + box-sizing:border-box; + line-height:1.4; +} +.weui-toast_text { + height:auto; + min-width:152px; + max-width:216px; + padding:12px 0; + .weui-toast__content { + font-size:14px; + } } .weui-icon_toast { display: block; + width: 40px; + height: 40px; + margin-bottom:16px; &.weui-icon-success-no-circle { color: rgba(255, 255, 255, 0.9); - width: 55px; - height: 55px; } - &.weui-loading { - margin: 8px 0; - width: 38px; - height: 38px; - vertical-align: baseline; + &.weui-icon-warn { + color: rgba(255, 255, 255, 0.9); + } + &.weui-primary-loading { + .setWeuiPrimaryLoading(36px); } } .weui-toast__content { - font-size: 14px; + font-size: 17px; + padding:0 12px; + .hyphens; } From a233df7c6e428c84f28815bbb16ee9570caeed4e Mon Sep 17 00:00:00 2001 From: xushengni Date: Thu, 5 Nov 2020 12:13:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0changelog?= =?UTF-8?q?=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e17edaa3..56d60c5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### v2.4.1 (2020-11-03) +### v2.4.1 (2020-11-05) #### Features * feat: 升级toast组件的UI