@nutui/nutui 2.3.10 → 2.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nutui.css +38 -38
- package/dist/nutui.css.map +1 -1
- package/dist/nutui.js +1659 -5025
- package/dist/nutui.js.map +1 -1
- package/dist/nutui.min.css +2 -2
- package/dist/nutui.min.js +11 -5
- package/dist/nutui.min.js.map +1 -1
- package/dist/packages/actionsheet/actionsheet.css +1 -1
- package/dist/packages/actionsheet/actionsheet.js +2 -2
- package/dist/packages/actionsheet/actionsheet.js.map +1 -1
- package/dist/packages/address/address.css +2 -2
- package/dist/packages/address/address.js +2 -2
- package/dist/packages/address/address.js.map +1 -1
- package/dist/packages/avatar/avatar.css +2 -2
- package/dist/packages/avatar/avatar.js +2 -2
- package/dist/packages/avatar/avatar.js.map +1 -1
- package/dist/packages/backtop/backtop.css +2 -2
- package/dist/packages/backtop/backtop.js +2 -2
- package/dist/packages/backtop/backtop.js.map +1 -1
- package/dist/packages/badge/badge.css +2 -2
- package/dist/packages/badge/badge.js +2 -2
- package/dist/packages/badge/badge.js.map +1 -1
- package/dist/packages/button/button.css +2 -2
- package/dist/packages/button/button.js +2 -2
- package/dist/packages/button/button.js.map +1 -1
- package/dist/packages/buttongroup/buttongroup.css +2 -2
- package/dist/packages/buttongroup/buttongroup.js +2 -2
- package/dist/packages/buttongroup/buttongroup.js.map +1 -1
- package/dist/packages/calendar/calendar.css +1 -1
- package/dist/packages/calendar/calendar.js +2 -2
- package/dist/packages/calendar/calendar.js.map +1 -1
- package/dist/packages/cell/cell.css +1 -1
- package/dist/packages/cell/cell.js +2 -2
- package/dist/packages/cell/cell.js.map +1 -1
- package/dist/packages/checkbox/checkbox.css +2 -2
- package/dist/packages/checkbox/checkbox.js +2 -2
- package/dist/packages/checkbox/checkbox.js.map +1 -1
- package/dist/packages/checkboxgroup/checkboxgroup.css +2 -2
- package/dist/packages/checkboxgroup/checkboxgroup.js +2 -2
- package/dist/packages/checkboxgroup/checkboxgroup.js.map +1 -1
- package/dist/packages/circleprogress/circleprogress.css +1 -1
- package/dist/packages/circleprogress/circleprogress.js +2 -2
- package/dist/packages/circleprogress/circleprogress.js.map +1 -1
- package/dist/packages/col/col.css +1 -1
- package/dist/packages/col/col.js +2 -2
- package/dist/packages/col/col.js.map +1 -1
- package/dist/packages/collapse/collapse.css +1 -1
- package/dist/packages/collapse/collapse.js +2 -2
- package/dist/packages/collapse/collapse.js.map +1 -1
- package/dist/packages/collapseitem/collapseitem.css +1 -1
- package/dist/packages/collapseitem/collapseitem.js +2 -2
- package/dist/packages/collapseitem/collapseitem.js.map +1 -1
- package/dist/packages/countdown/countdown.css +1 -1
- package/dist/packages/countdown/countdown.js +2 -2
- package/dist/packages/countdown/countdown.js.map +1 -1
- package/dist/packages/countup/countup.css +1 -1
- package/dist/packages/countup/countup.js +2 -2
- package/dist/packages/countup/countup.js.map +1 -1
- package/dist/packages/coupon/coupon.css +2 -2
- package/dist/packages/coupon/coupon.js +2 -2
- package/dist/packages/coupon/coupon.js.map +1 -1
- package/dist/packages/datepicker/datepicker.css +1 -1
- package/dist/packages/datepicker/datepicker.js +2 -2
- package/dist/packages/datepicker/datepicker.js.map +1 -1
- package/dist/packages/dialog/dialog.css +2 -2
- package/dist/packages/dialog/dialog.js +2 -2
- package/dist/packages/dialog/dialog.js.map +1 -1
- package/dist/packages/drag/drag.css +1 -1
- package/dist/packages/drag/drag.js +2 -2
- package/dist/packages/drag/drag.js.map +1 -1
- package/dist/packages/elevator/elevator.css +1 -1
- package/dist/packages/elevator/elevator.js +2 -2
- package/dist/packages/elevator/elevator.js.map +1 -1
- package/dist/packages/fixednav/fixednav.css +2 -2
- package/dist/packages/fixednav/fixednav.js +2 -2
- package/dist/packages/fixednav/fixednav.js.map +1 -1
- package/dist/packages/flex/flex.css +1 -1
- package/dist/packages/flex/flex.js +2 -2
- package/dist/packages/flex/flex.js.map +1 -1
- package/dist/packages/icon/icon.css +1 -1
- package/dist/packages/icon/icon.js +2 -2
- package/dist/packages/icon/icon.js.map +1 -1
- package/dist/packages/imagepicker/imagepicker.css +2 -2
- package/dist/packages/imagepicker/imagepicker.js +2 -2
- package/dist/packages/imagepicker/imagepicker.js.map +1 -1
- package/dist/packages/infiniteloading/infiniteloading.css +1 -1
- package/dist/packages/infiniteloading/infiniteloading.js +2 -2
- package/dist/packages/infiniteloading/infiniteloading.js.map +1 -1
- package/dist/packages/lazyload/lazyload.css +1 -1
- package/dist/packages/lazyload/lazyload.js +11 -5
- package/dist/packages/lazyload/lazyload.js.map +1 -1
- package/dist/packages/leftslip/leftslip.css +1 -1
- package/dist/packages/leftslip/leftslip.js +2 -2
- package/dist/packages/leftslip/leftslip.js.map +1 -1
- package/dist/packages/luckdraw/luckdraw.css +2 -2
- package/dist/packages/luckdraw/luckdraw.js +2 -2
- package/dist/packages/luckdraw/luckdraw.js.map +1 -1
- package/dist/packages/luckycard/luckycard.css +1 -1
- package/dist/packages/luckycard/luckycard.js +2 -2
- package/dist/packages/luckycard/luckycard.js.map +1 -1
- package/dist/packages/magic/magic.css +2 -2
- package/dist/packages/magic/magic.js +2 -2
- package/dist/packages/magic/magic.js.map +1 -1
- package/dist/packages/menu/menu.css +2 -2
- package/dist/packages/menu/menu.js +2 -2
- package/dist/packages/menu/menu.js.map +1 -1
- package/dist/packages/navbar/navbar.css +1 -1
- package/dist/packages/navbar/navbar.js +2 -2
- package/dist/packages/navbar/navbar.js.map +1 -1
- package/dist/packages/ninegrid/ninegrid.css +2 -2
- package/dist/packages/ninegrid/ninegrid.js +2 -2
- package/dist/packages/ninegrid/ninegrid.js.map +1 -1
- package/dist/packages/noticebar/noticebar.css +2 -2
- package/dist/packages/noticebar/noticebar.js +2 -2
- package/dist/packages/noticebar/noticebar.js.map +1 -1
- package/dist/packages/notify/notify.css +2 -2
- package/dist/packages/notify/notify.js +2 -2
- package/dist/packages/notify/notify.js.map +1 -1
- package/dist/packages/numberkeyboard/numberkeyboard.css +2 -2
- package/dist/packages/numberkeyboard/numberkeyboard.js +2 -2
- package/dist/packages/numberkeyboard/numberkeyboard.js.map +1 -1
- package/dist/packages/picker/picker-slot.vue +17 -14
- package/dist/packages/picker/picker.css +1 -1
- package/dist/packages/picker/picker.js +2 -2
- package/dist/packages/picker/picker.js.map +1 -1
- package/dist/packages/picker/picker.vue +18 -13
- package/dist/packages/popup/popup.css +2 -2
- package/dist/packages/popup/popup.js +2 -2
- package/dist/packages/popup/popup.js.map +1 -1
- package/dist/packages/price/price.css +1 -1
- package/dist/packages/price/price.js +2 -2
- package/dist/packages/price/price.js.map +1 -1
- package/dist/packages/progress/progress.css +2 -2
- package/dist/packages/progress/progress.js +2 -2
- package/dist/packages/progress/progress.js.map +1 -1
- package/dist/packages/radio/radio.css +2 -2
- package/dist/packages/radio/radio.js +2 -2
- package/dist/packages/radio/radio.js.map +1 -1
- package/dist/packages/radiogroup/radiogroup.css +1 -1
- package/dist/packages/radiogroup/radiogroup.js +2 -2
- package/dist/packages/radiogroup/radiogroup.js.map +1 -1
- package/dist/packages/range/range.css +2 -2
- package/dist/packages/range/range.js +2 -2
- package/dist/packages/range/range.js.map +1 -1
- package/dist/packages/rate/rate.css +1 -1
- package/dist/packages/rate/rate.js +2 -2
- package/dist/packages/rate/rate.js.map +1 -1
- package/dist/packages/row/row.css +1 -1
- package/dist/packages/row/row.js +2 -2
- package/dist/packages/row/row.js.map +1 -1
- package/dist/packages/scroller/scroller.css +1 -1
- package/dist/packages/scroller/scroller.js +2 -2
- package/dist/packages/scroller/scroller.js.map +1 -1
- package/dist/packages/searchbar/searchbar.css +2 -2
- package/dist/packages/searchbar/searchbar.js +2 -2
- package/dist/packages/searchbar/searchbar.js.map +1 -1
- package/dist/packages/shortpassword/shortpassword.css +2 -2
- package/dist/packages/shortpassword/shortpassword.js +2 -2
- package/dist/packages/shortpassword/shortpassword.js.map +1 -1
- package/dist/packages/sidenavbar/sidenavbar.css +1 -1
- package/dist/packages/sidenavbar/sidenavbar.js +2 -2
- package/dist/packages/sidenavbar/sidenavbar.js.map +1 -1
- package/dist/packages/sidenavbaritem/sidenavbaritem.css +1 -1
- package/dist/packages/sidenavbaritem/sidenavbaritem.js +2 -2
- package/dist/packages/sidenavbaritem/sidenavbaritem.js.map +1 -1
- package/dist/packages/signature/signature.css +2 -2
- package/dist/packages/signature/signature.js +2 -2
- package/dist/packages/signature/signature.js.map +1 -1
- package/dist/packages/skeleton/skeleton.css +2 -2
- package/dist/packages/skeleton/skeleton.js +2 -2
- package/dist/packages/skeleton/skeleton.js.map +1 -1
- package/dist/packages/slider/slider.css +2 -2
- package/dist/packages/slider/slider.js +2 -2
- package/dist/packages/slider/slider.js.map +1 -1
- package/dist/packages/stepper/stepper.css +2 -2
- package/dist/packages/stepper/stepper.js +2 -2
- package/dist/packages/stepper/stepper.js.map +1 -1
- package/dist/packages/steps/steps.css +2 -2
- package/dist/packages/steps/steps.js +2 -2
- package/dist/packages/steps/steps.js.map +1 -1
- package/dist/packages/subsidenavbar/subsidenavbar.css +1 -1
- package/dist/packages/subsidenavbar/subsidenavbar.js +2 -2
- package/dist/packages/subsidenavbar/subsidenavbar.js.map +1 -1
- package/dist/packages/swiper/swiper.css +2 -2
- package/dist/packages/swiper/swiper.js +2 -2
- package/dist/packages/swiper/swiper.js.map +1 -1
- package/dist/packages/switch/switch.css +2 -2
- package/dist/packages/switch/switch.js +2 -2
- package/dist/packages/switch/switch.js.map +1 -1
- package/dist/packages/tab/tab.css +2 -2
- package/dist/packages/tab/tab.js +2 -2
- package/dist/packages/tab/tab.js.map +1 -1
- package/dist/packages/tabbar/tabbar.css +2 -2
- package/dist/packages/tabbar/tabbar.js +2 -2
- package/dist/packages/tabbar/tabbar.js.map +1 -1
- package/dist/packages/tabpanel/tabpanel.css +1 -1
- package/dist/packages/tabpanel/tabpanel.js +2 -2
- package/dist/packages/tabpanel/tabpanel.js.map +1 -1
- package/dist/packages/tabselect/tabselect.css +2 -2
- package/dist/packages/tabselect/tabselect.js +2 -2
- package/dist/packages/tabselect/tabselect.js.map +1 -1
- package/dist/packages/textbox/textbox.css +1 -1
- package/dist/packages/textbox/textbox.js +2 -2
- package/dist/packages/textbox/textbox.js.map +1 -1
- package/dist/packages/textinput/textinput.css +2 -2
- package/dist/packages/textinput/textinput.js +2 -2
- package/dist/packages/textinput/textinput.js.map +1 -1
- package/dist/packages/timeline/timeline.css +2 -2
- package/dist/packages/timeline/timeline.js +2 -2
- package/dist/packages/timeline/timeline.js.map +1 -1
- package/dist/packages/timelineitem/timelineitem.css +1 -1
- package/dist/packages/timelineitem/timelineitem.js +2 -2
- package/dist/packages/timelineitem/timelineitem.js.map +1 -1
- package/dist/packages/toast/toast.css +2 -2
- package/dist/packages/toast/toast.js +2 -2
- package/dist/packages/toast/toast.js.map +1 -1
- package/dist/packages/uploader/uploader.css +1 -1
- package/dist/packages/uploader/uploader.js +2 -2
- package/dist/packages/uploader/uploader.js.map +1 -1
- package/dist/packages/video/video.css +2 -2
- package/dist/packages/video/video.js +2 -2
- package/dist/packages/video/video.js.map +1 -1
- package/package.json +1 -1
- package/dist/.DS_Store +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v2.3.
|
|
2
|
+
* @nutui/nutui v2.3.11 - luckdraw.js, 73382f82a2742e2b1bc6, Mon Oct 17 2022 18:27:02 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2017-2020 JDC
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("luckdraw",[],e):"object"==typeof exports?exports.luckdraw=e():t.luckdraw=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="./",r(r.s=199)}({0:function(t,e,r){"use strict";function n(t,e,r,n,i,o,s,a){var u,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=r,l._compiled=!0),n&&(l.functional=!0),o&&(l._scopeId="data-v-"+o),s?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},l._ssrRegister=u):i&&(u=a?function(){i.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:i),u)if(l.functional){l._injectStyles=u;var c=l.render;l.render=function(t,e){return u.call(e),c(t,e)}}else{var f=l.beforeCreate;l.beforeCreate=f?[].concat(f,u):[u]}return{exports:t,options:l}}r.d(e,"a",(function(){return n}))},133:function(t,e,r){},199:function(t,e,r){"use strict";r.r(e);var n={name:"nut-luckdraw",mounted:function(){this.init()},props:{luckWidth:{required:!0},luckHeight:{required:!0},prizeList:{required:!0},turnsNumber:{default:5},styleOpt:{default:function(){return{prizeBgColors:["rgb(255, 231, 149)","rgb(255, 247, 223)","rgb(255, 231, 149)","rgb(255, 247, 223)","rgb(255, 231, 149)","rgb(255, 247, 223)"],borderColor:"#ff9800"}}},turnsTime:{default:5}},watch:{prizeList:function(t,e){this.init()}},data:function(){return{winningPrize:0,startRotateDegree:0,rotateAngle:0,rotateTransition:""}},methods:{getRotateAngle:function(t){var e=360/this.prizeList.length*t+180/this.prizeList.length;return{transform:"rotate(".concat(e,"deg)")}},init:function(){var t=this.styleOpt,e=this.prizeList.length,r=t.prizeBgColors,n=t.borderColor,i=this.$refs.canvas.getContext("2d"),o=this.$refs.canvas.width=this.$refs.luckdraw.clientWidth,s=this.$refs.canvas.height=this.$refs.luckdraw.clientHeight;i.translate(0,s),i.rotate(-90*Math.PI/180);var a=o/2-1,u=2*Math.PI/e;i.clearRect(0,0,o,s),i.strokeStyle=n;for(var l=0;l<e;l++){var c=l*u;this.prizeList[l].prizeColor?i.fillStyle=this.prizeList[l].prizeColor:i.fillStyle=r[l],i.beginPath(),i.arc(.5*o,.5*s,a,c,c+u,!1),i.arc(.5*o,.5*s,0,c+u,c,!0),i.stroke(),i.fill(),i.save()}},rotate:function(t){var e=this,r=this.turnsTime,n=this.startRotateDegree+360*this.turnsNumber+360-(180/this.prizeList.length+360/this.prizeList.length*t)-this.startRotateDegree%360;this.startRotateDegree=n,this.rotateAngle="rotate(".concat(n,"deg)"),this.rotateTransition="transform ".concat(r,"s cubic-bezier(0.250, 0.460, 0.455, 0.995)"),setTimeout((function(){e.$emit("end-turns")}),1e3*r+500)}}},i=r(0),o=Object(i.a)(n,(function(){var t=this,e=t
|
|
6
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("luckdraw",[],e):"object"==typeof exports?exports.luckdraw=e():t.luckdraw=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="./",r(r.s=199)}({0:function(t,e,r){"use strict";function n(t,e,r,n,i,o,s,a){var u,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=r,l._compiled=!0),n&&(l.functional=!0),o&&(l._scopeId="data-v-"+o),s?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},l._ssrRegister=u):i&&(u=a?function(){i.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:i),u)if(l.functional){l._injectStyles=u;var c=l.render;l.render=function(t,e){return u.call(e),c(t,e)}}else{var f=l.beforeCreate;l.beforeCreate=f?[].concat(f,u):[u]}return{exports:t,options:l}}r.d(e,"a",(function(){return n}))},133:function(t,e,r){},199:function(t,e,r){"use strict";r.r(e);var n={name:"nut-luckdraw",mounted:function(){this.init()},props:{luckWidth:{required:!0},luckHeight:{required:!0},prizeList:{required:!0},turnsNumber:{default:5},styleOpt:{default:function(){return{prizeBgColors:["rgb(255, 231, 149)","rgb(255, 247, 223)","rgb(255, 231, 149)","rgb(255, 247, 223)","rgb(255, 231, 149)","rgb(255, 247, 223)"],borderColor:"#ff9800"}}},turnsTime:{default:5}},watch:{prizeList:function(t,e){this.init()}},data:function(){return{winningPrize:0,startRotateDegree:0,rotateAngle:0,rotateTransition:""}},methods:{getRotateAngle:function(t){var e=360/this.prizeList.length*t+180/this.prizeList.length;return{transform:"rotate(".concat(e,"deg)")}},init:function(){var t=this.styleOpt,e=this.prizeList.length,r=t.prizeBgColors,n=t.borderColor,i=this.$refs.canvas.getContext("2d"),o=this.$refs.canvas.width=this.$refs.luckdraw.clientWidth,s=this.$refs.canvas.height=this.$refs.luckdraw.clientHeight;i.translate(0,s),i.rotate(-90*Math.PI/180);var a=o/2-1,u=2*Math.PI/e;i.clearRect(0,0,o,s),i.strokeStyle=n;for(var l=0;l<e;l++){var c=l*u;this.prizeList[l].prizeColor?i.fillStyle=this.prizeList[l].prizeColor:i.fillStyle=r[l],i.beginPath(),i.arc(.5*o,.5*s,a,c,c+u,!1),i.arc(.5*o,.5*s,0,c+u,c,!0),i.stroke(),i.fill(),i.save()}},rotate:function(t){var e=this,r=this.turnsTime,n=this.startRotateDegree+360*this.turnsNumber+360-(180/this.prizeList.length+360/this.prizeList.length*t)-this.startRotateDegree%360;this.startRotateDegree=n,this.rotateAngle="rotate(".concat(n,"deg)"),this.rotateTransition="transform ".concat(r,"s cubic-bezier(0.250, 0.460, 0.455, 0.995)"),setTimeout((function(){e.$emit("end-turns")}),1e3*r+500)}}},i=r(0),o=Object(i.a)(n,(function(){var t=this,e=t._self._c;return e("div",{ref:"luckdraw",staticClass:"nut-luckdraw",style:{width:t.luckWidth,height:t.luckHeight}},[e("div",{staticClass:"lucktable",style:{transform:t.rotateAngle,transition:t.rotateTransition}},[e("canvas",{ref:"canvas",attrs:{id:"canvas"}},[t._v("\n 浏览器版本过低\n ")]),t._v(" "),e("div",{staticClass:"prize"},t._l(t.prizeList,(function(r,n){return e("div",{key:n,staticClass:"item",style:t.getRotateAngle(n)},[t._t("item",null,{item:r})],2)})),0)])])}),[],!1,null,null,null).exports;r(133);o.install=function(t){t.component(o.name,o)};e.default=o}})}));
|
|
7
7
|
//# sourceMappingURL=luckdraw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://[name]/webpack/universalModuleDefinition","webpack://[name]/webpack/bootstrap","webpack://[name]/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://[name]/./src/packages/luckdraw/luckdraw.vue?e845","webpack://[name]/./src/packages/luckdraw/luckdraw.vue?2393","webpack://[name]/src/packages/luckdraw/luckdraw.vue","webpack://[name]/./src/packages/luckdraw/luckdraw.vue","webpack://[name]/./src/packages/luckdraw/index.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","normalizeComponent","scriptExports","render","staticRenderFns","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","options","_compiled","functional","_scopeId","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","add","_ssrRegister","$root","$options","shadowRoot","_injectStyles","originalRender","h","existing","beforeCreate","concat","mounted","init","props","luckWidth","required","luckHeight","prizeList","turnsNumber","default","styleOpt","prizeBgColors","borderColor","turnsTime","watch","data","winningPrize","startRotateDegree","rotateAngle","rotateTransition","methods","getRotateAngle","transform","ctx","translate","canvasH","rotate","clearRect","canvasW","strokeStyle","index","fillStyle","beginPath","arc","outRadius","angle","baseAngle","stroke","fill","save","setTimeout","_vm","_h","$createElement","_c","_self","ref","staticClass","style","width","height","transition","attrs","_v","_l","item","_t","LuckDraw","install","Vue","component"],"mappings":";;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,WAAY,GAAIH,GACG,iBAAZC,QACdA,QAAkB,SAAID,IAEtBD,EAAe,SAAIC,IARrB,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B,uDACMqB,YAAW,WACT,EAAR,qBACA,c,OC/Ge,EAXC,YACd,GHRW,WAAa,IAAIC,EAAI3G,KAAS4G,EAAGD,EAAIE,eAAmBC,EAAGH,EAAII,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,IAAI,WAAWC,YAAY,eAAeC,MAAM,CAAGC,MAAOR,EAAIrC,UAAW8C,OAAQT,EAAInC,aAAe,CAACsC,EAAG,MAAM,CAACG,YAAY,YAAYC,MAAM,CAAG1B,UAAWmB,EAAIvB,YAAaiC,WAAYV,EAAItB,mBAAqB,CAACyB,EAAG,SAAS,CAACE,IAAI,SAASM,MAAM,CAAC,GAAK,WAAW,CAACX,EAAIY,GAAG,2BAA2BZ,EAAIY,GAAG,KAAKT,EAAG,MAAM,CAACG,YAAY,SAASN,EAAIa,GAAIb,EAAa,WAAE,SAASc,EAAKzB,GAAO,OAAOc,EAAG,MAAM,CAACnF,IAAIqE,EAAMiB,YAAY,OAAOC,MAAOP,EAAIpB,eAAeS,IAAS,CAACW,EAAIe,GAAG,OAAO,KAAK,CAAC,KAAOD,KAAQ,MAAK,SAC3kB,IGUpB,EACA,KACA,KACA,M,eCXFE,EAASC,QAAU,SAASC,GAC1BA,EAAIC,UAAUH,EAAShH,KAAMgH,IAGhBA","file":"luckdraw/luckdraw.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"luckdraw\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"luckdraw\"] = factory();\n\telse\n\t\troot[\"luckdraw\"] = factory();\n})((typeof self !== 'undefined' ? self : this), function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 199);\n","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:\"luckdraw\",staticClass:\"nut-luckdraw\",style:({ width: _vm.luckWidth, height: _vm.luckHeight })},[_c('div',{staticClass:\"lucktable\",style:({ transform: _vm.rotateAngle, transition: _vm.rotateTransition })},[_c('canvas',{ref:\"canvas\",attrs:{\"id\":\"canvas\"}},[_vm._v(\"\\n 浏览器版本过低\\n \")]),_vm._v(\" \"),_c('div',{staticClass:\"prize\"},_vm._l((_vm.prizeList),function(item,index){return _c('div',{key:index,staticClass:\"item\",style:(_vm.getRotateAngle(index))},[_vm._t(\"item\",null,{\"item\":item})],2)}),0)])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./luckdraw.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./luckdraw.vue?vue&type=script&lang=js&\"","<template>\n <div class=\"nut-luckdraw\" ref=\"luckdraw\" :style=\"{ width: luckWidth, height: luckHeight }\">\n <div class=\"lucktable\" :style=\"{ transform: rotateAngle, transition: rotateTransition }\">\n <canvas id=\"canvas\" ref=\"canvas\">\n 浏览器版本过低\n </canvas>\n <div class=\"prize\">\n <div v-for=\"(item, index) in prizeList\" class=\"item\" :style=\"getRotateAngle(index)\" :key=\"index\">\n <slot name=\"item\" :item=\"item\"></slot>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nexport default {\n name: 'nut-luckdraw',\n mounted() {\n this.init();\n },\n props: {\n luckWidth: {\n required: true\n },\n luckHeight: {\n required: true\n },\n prizeList: {\n required: true\n },\n turnsNumber: {\n default: 5\n },\n styleOpt: {\n default: () => {\n return {\n // 每一块扇形的背景色,默认值,可通过父组件来改变\n prizeBgColors: [\n 'rgb(255, 231, 149)',\n 'rgb(255, 247, 223)',\n 'rgb(255, 231, 149)',\n 'rgb(255, 247, 223)',\n 'rgb(255, 231, 149)',\n 'rgb(255, 247, 223)'\n ],\n // 每一块扇形的外边框颜色,默认值,可通过父组件来改变\n borderColor: '#ff9800'\n };\n }\n },\n turnsTime: {\n // 转动需要持续的时间(秒)\n default: 5\n }\n },\n watch: {\n prizeList: function(newVal, oldVal) {\n this.init();\n }\n },\n data() {\n return {\n winningPrize: 0,\n // 开始转动的角度\n startRotateDegree: 0,\n // 设置指针默认指向的位置,现在是默认指向2个扇形之间的边线上\n rotateAngle: 0, //`rotate(30deg)`\n rotateTransition: ''\n };\n },\n methods: {\n // 根据index计算每一格要旋转的角度的样式\n getRotateAngle(index) {\n const angle = (360 / this.prizeList.length) * index + 180 / this.prizeList.length;\n return {\n transform: `rotate(${angle}deg)`\n };\n },\n // 初始化圆形转盘canvas\n init() {\n const data = this.styleOpt;\n const prizeNum = this.prizeList.length;\n const { prizeBgColors, borderColor } = data;\n // 开始绘画\n const canvas = this.$refs.canvas;\n const ctx = canvas.getContext('2d');\n const canvasW = (this.$refs.canvas.width = this.$refs.luckdraw.clientWidth); // 画板的高度\n const canvasH = (this.$refs.canvas.height = this.$refs.luckdraw.clientHeight); // 画板的宽度\n // translate方法重新映射画布上的 (0,0) 位置\n ctx.translate(0, canvasH);\n // rotate方法旋转当前的绘图,因为文字是和当前扇形中心线垂直的\n ctx.rotate((-90 * Math.PI) / 180);\n // 圆环的外圆的半径,可用来调整圆盘大小来适应外部盒子的大小\n const outRadius = canvasW / 2 - 1;\n // 圆环的内圆的半径\n const innerRadius = 0;\n const baseAngle = (Math.PI * 2) / prizeNum; // 每个奖项所占角度数\n ctx.clearRect(0, 0, canvasW, canvasH); //去掉背景默认色\n ctx.strokeStyle = borderColor; // 设置画图线的颜色\n for (let index = 0; index < prizeNum; index++) {\n const angle = index * baseAngle;\n if (this.prizeList[index]['prizeColor']) {\n ctx.fillStyle = this.prizeList[index]['prizeColor']; //设置每个扇形区域的颜色,根据每条数据中单独设置的优先\n } else {\n ctx.fillStyle = prizeBgColors[index]; //设置每个扇形区域的颜色\n }\n ctx.beginPath(); //开始绘制\n // 标准圆弧:arc(x,y,radius,startAngle,endAngle,anticlockwise)\n ctx.arc(canvasW * 0.5, canvasH * 0.5, outRadius, angle, angle + baseAngle, false);\n ctx.arc(canvasW * 0.5, canvasH * 0.5, innerRadius, angle + baseAngle, angle, true);\n ctx.stroke();\n ctx.fill();\n ctx.save();\n }\n },\n // 转动起来\n rotate(index) {\n const turnsTime = this.turnsTime;\n const rotateAngle =\n this.startRotateDegree +\n this.turnsNumber * 360 +\n 360 -\n (180 / this.prizeList.length + (360 / this.prizeList.length) * index) -\n (this.startRotateDegree % 360);\n this.startRotateDegree = rotateAngle;\n this.rotateAngle = `rotate(${rotateAngle}deg)`;\n this.rotateTransition = `transform ${turnsTime}s cubic-bezier(0.250, 0.460, 0.455, 0.995)`;\n setTimeout(() => {\n this.$emit('end-turns');\n }, turnsTime * 1000 + 500);\n }\n }\n};\n</script>\n","import { render, staticRenderFns } from \"./luckdraw.vue?vue&type=template&id=c2015698&\"\nimport script from \"./luckdraw.vue?vue&type=script&lang=js&\"\nexport * from \"./luckdraw.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import LuckDraw from './luckdraw.vue';\nimport './luckdraw.scss';\n\nLuckDraw.install = function(Vue) {\n Vue.component(LuckDraw.name, LuckDraw);\n};\n\nexport default LuckDraw;\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack://[name]/webpack/universalModuleDefinition","webpack://[name]/webpack/bootstrap","webpack://[name]/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://[name]/./src/packages/luckdraw/luckdraw.vue?ec3d","webpack://[name]/./src/packages/luckdraw/luckdraw.vue?2393","webpack://[name]/src/packages/luckdraw/luckdraw.vue","webpack://[name]/./src/packages/luckdraw/luckdraw.vue","webpack://[name]/./src/packages/luckdraw/index.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","normalizeComponent","scriptExports","render","staticRenderFns","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","options","_compiled","functional","_scopeId","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","add","_ssrRegister","$root","$options","shadowRoot","_injectStyles","originalRender","h","existing","beforeCreate","concat","mounted","props","luckWidth","required","luckHeight","prizeList","turnsNumber","default","styleOpt","prizeBgColors","borderColor","turnsTime","watch","data","winningPrize","startRotateDegree","rotateAngle","rotateTransition","methods","getRotateAngle","transform","init","ctx","rotate","setTimeout","_vm","_c","_self","ref","staticClass","style","width","height","transition","attrs","_v","_l","item","index","_t","LuckDraw","install","Vue","component"],"mappings":";;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,WAAY,GAAIH,GACG,iBAAZC,QACdA,QAAkB,SAAID,IAEtBD,EAAe,SAAIC,IARrB,CASoB,oBAATK,KAAuBA,KAAOC,MAAO,WAChD,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,E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A","file":"luckdraw/luckdraw.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"luckdraw\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"luckdraw\"] = factory();\n\telse\n\t\troot[\"luckdraw\"] = factory();\n})((typeof self !== 'undefined' ? self : this), function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 199);\n","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent(\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */,\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options =\n typeof scriptExports === 'function' ? scriptExports.options : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) {\n // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{ref:\"luckdraw\",staticClass:\"nut-luckdraw\",style:({ width: _vm.luckWidth, height: _vm.luckHeight })},[_c('div',{staticClass:\"lucktable\",style:({ transform: _vm.rotateAngle, transition: _vm.rotateTransition })},[_c('canvas',{ref:\"canvas\",attrs:{\"id\":\"canvas\"}},[_vm._v(\"\\n 浏览器版本过低\\n \")]),_vm._v(\" \"),_c('div',{staticClass:\"prize\"},_vm._l((_vm.prizeList),function(item,index){return _c('div',{key:index,staticClass:\"item\",style:(_vm.getRotateAngle(index))},[_vm._t(\"item\",null,{\"item\":item})],2)}),0)])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./luckdraw.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./luckdraw.vue?vue&type=script&lang=js&\"","<template>\n <div class=\"nut-luckdraw\" ref=\"luckdraw\" :style=\"{ width: luckWidth, height: luckHeight }\">\n <div class=\"lucktable\" :style=\"{ transform: rotateAngle, transition: rotateTransition }\">\n <canvas id=\"canvas\" ref=\"canvas\">\n 浏览器版本过低\n </canvas>\n <div class=\"prize\">\n <div v-for=\"(item, index) in prizeList\" class=\"item\" :style=\"getRotateAngle(index)\" :key=\"index\">\n <slot name=\"item\" :item=\"item\"></slot>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nexport default {\n name: 'nut-luckdraw',\n mounted() {\n this.init();\n },\n props: {\n luckWidth: {\n required: true\n },\n luckHeight: {\n required: true\n },\n prizeList: {\n required: true\n },\n turnsNumber: {\n default: 5\n },\n styleOpt: {\n default: () => {\n return {\n // 每一块扇形的背景色,默认值,可通过父组件来改变\n prizeBgColors: [\n 'rgb(255, 231, 149)',\n 'rgb(255, 247, 223)',\n 'rgb(255, 231, 149)',\n 'rgb(255, 247, 223)',\n 'rgb(255, 231, 149)',\n 'rgb(255, 247, 223)'\n ],\n // 每一块扇形的外边框颜色,默认值,可通过父组件来改变\n borderColor: '#ff9800'\n };\n }\n },\n turnsTime: {\n // 转动需要持续的时间(秒)\n default: 5\n }\n },\n watch: {\n prizeList: function(newVal, oldVal) {\n this.init();\n }\n },\n data() {\n return {\n winningPrize: 0,\n // 开始转动的角度\n startRotateDegree: 0,\n // 设置指针默认指向的位置,现在是默认指向2个扇形之间的边线上\n rotateAngle: 0, //`rotate(30deg)`\n rotateTransition: ''\n };\n },\n methods: {\n // 根据index计算每一格要旋转的角度的样式\n getRotateAngle(index) {\n const angle = (360 / this.prizeList.length) * index + 180 / this.prizeList.length;\n return {\n transform: `rotate(${angle}deg)`\n };\n },\n // 初始化圆形转盘canvas\n init() {\n const data = this.styleOpt;\n const prizeNum = this.prizeList.length;\n const { prizeBgColors, borderColor } = data;\n // 开始绘画\n const canvas = this.$refs.canvas;\n const ctx = canvas.getContext('2d');\n const canvasW = (this.$refs.canvas.width = this.$refs.luckdraw.clientWidth); // 画板的高度\n const canvasH = (this.$refs.canvas.height = this.$refs.luckdraw.clientHeight); // 画板的宽度\n // translate方法重新映射画布上的 (0,0) 位置\n ctx.translate(0, canvasH);\n // rotate方法旋转当前的绘图,因为文字是和当前扇形中心线垂直的\n ctx.rotate((-90 * Math.PI) / 180);\n // 圆环的外圆的半径,可用来调整圆盘大小来适应外部盒子的大小\n const outRadius = canvasW / 2 - 1;\n // 圆环的内圆的半径\n const innerRadius = 0;\n const baseAngle = (Math.PI * 2) / prizeNum; // 每个奖项所占角度数\n ctx.clearRect(0, 0, canvasW, canvasH); //去掉背景默认色\n ctx.strokeStyle = borderColor; // 设置画图线的颜色\n for (let index = 0; index < prizeNum; index++) {\n const angle = index * baseAngle;\n if (this.prizeList[index]['prizeColor']) {\n ctx.fillStyle = this.prizeList[index]['prizeColor']; //设置每个扇形区域的颜色,根据每条数据中单独设置的优先\n } else {\n ctx.fillStyle = prizeBgColors[index]; //设置每个扇形区域的颜色\n }\n ctx.beginPath(); //开始绘制\n // 标准圆弧:arc(x,y,radius,startAngle,endAngle,anticlockwise)\n ctx.arc(canvasW * 0.5, canvasH * 0.5, outRadius, angle, angle + baseAngle, false);\n ctx.arc(canvasW * 0.5, canvasH * 0.5, innerRadius, angle + baseAngle, angle, true);\n ctx.stroke();\n ctx.fill();\n ctx.save();\n }\n },\n // 转动起来\n rotate(index) {\n const turnsTime = this.turnsTime;\n const rotateAngle =\n this.startRotateDegree +\n this.turnsNumber * 360 +\n 360 -\n (180 / this.prizeList.length + (360 / this.prizeList.length) * index) -\n (this.startRotateDegree % 360);\n this.startRotateDegree = rotateAngle;\n this.rotateAngle = `rotate(${rotateAngle}deg)`;\n this.rotateTransition = `transform ${turnsTime}s cubic-bezier(0.250, 0.460, 0.455, 0.995)`;\n setTimeout(() => {\n this.$emit('end-turns');\n }, turnsTime * 1000 + 500);\n }\n }\n};\n</script>\n","import { render, staticRenderFns } from \"./luckdraw.vue?vue&type=template&id=c2015698&\"\nimport script from \"./luckdraw.vue?vue&type=script&lang=js&\"\nexport * from \"./luckdraw.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import LuckDraw from './luckdraw.vue';\nimport './luckdraw.scss';\n\nLuckDraw.install = function(Vue) {\n Vue.component(LuckDraw.name, LuckDraw);\n};\n\nexport default LuckDraw;\n"],"sourceRoot":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v2.3.
|
|
2
|
+
* @nutui/nutui v2.3.11 - luckycard.css, 73382f82a2742e2b1bc6, Mon Oct 17 2022 18:27:02 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2017-2020 JDC
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/.nut-luckycard{position:relative}.nut-luckycard .nut-cover{position:absolute;top:0;left:0}.nut-luckycard .nut-content{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;height:100%;width:100%;line-height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v2.3.
|
|
2
|
+
* @nutui/nutui v2.3.11 - luckycard.js, 73382f82a2742e2b1bc6, Mon Oct 17 2022 18:27:02 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2017-2020 JDC
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("luckycard",[],e):"object"==typeof exports?exports.luckycard=e():t.luckycard=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="./",n(n.s=168)}({0:function(t,e,n){"use strict";function o(t,e,n,o,i,r,c,s){var a,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=n,l._compiled=!0),o&&(l.functional=!0),r&&(l._scopeId="data-v-"+r),c?(a=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(c)},l._ssrRegister=a):i&&(a=s?function(){i.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:i),a)if(l.functional){l._injectStyles=a;var u=l.render;l.render=function(t,e){return a.call(e),u(t,e)}}else{var h=l.beforeCreate;l.beforeCreate=h?[].concat(h,a):[a]}return{exports:t,options:l}}n.d(e,"a",(function(){return o}))},150:function(t,e,n){"use strict";n(75)},151:function(t,e,n){},168:function(t,e,n){"use strict";n.r(e);var o=n(
|
|
6
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("luckycard",[],e):"object"==typeof exports?exports.luckycard=e():t.luckycard=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="./",n(n.s=168)}({0:function(t,e,n){"use strict";function o(t,e,n,o,i,r,c,s){var a,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=n,l._compiled=!0),o&&(l.functional=!0),r&&(l._scopeId="data-v-"+r),c?(a=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(c)},l._ssrRegister=a):i&&(a=s?function(){i.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:i),a)if(l.functional){l._injectStyles=a;var u=l.render;l.render=function(t,e){return a.call(e),u(t,e)}}else{var h=l.beforeCreate;l.beforeCreate=h?[].concat(h,a):[a]}return{exports:t,options:l}}n.d(e,"a",(function(){return o}))},150:function(t,e,n){"use strict";n(75)},151:function(t,e,n){},168:function(t,e,n){"use strict";n.r(e);var o=n(6),i=n.n(o);function r(t,e){this.cover=null,this.ctx=null,this.scratchDiv=t.scratchDiv,this.cardDiv=null,this.cHeight=0,this.cWidth=0,this.supportTouch=!1,this.events=[],this.startEventHandler=null,this.moveEventHandler=null,this.endEventHandler=null,this.opt={coverColor:"#C5C5C5",coverImg:"",ratio:.8,callback:null},this.init(t,e)}function c(t,e,n){var o=t.getImageData(0,0,this.cWidth,this.cHeight),i=[];s(o.data,(function(t,e){var n=o.data[e+3];0===n&&i.push(n)})),i.length/o.data.length>n&&e&&"function"==typeof e&&e()}function s(t,e){return Array.prototype.forEach.call(t,(function(t,n){e(t,n)}))}function a(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))}function l(t){t.preventDefault(),this.moveEventHandler=u.bind(this),this.cover.addEventListener(this.events[1],this.moveEventHandler,!1),this.endEventHandler=h.bind(this),document.addEventListener(this.events[2],this.endEventHandler,!1)}function u(t){t.preventDefault();var e=this.supportTouch?t.touches[0]:t,n=this.cover.getBoundingClientRect(),o=document.documentElement.scrollTop||document.body.scrollTop,i=document.documentElement.scrollLeft||document.body.scrollLeft,r=e.pageX-n.left-i,c=e.pageY-n.top-o;this.ctx.beginPath(),this.ctx.fillStyle="#FFFFFF",this.ctx.globalCompositeOperation="destination-out",this.ctx.arc(r,c,10,0,2*Math.PI),this.ctx.fill()}function h(t){t.preventDefault(),this.opt.callback&&"function"==typeof this.opt.callback&&c.call(this,this.ctx,this.opt.callback,this.opt.ratio),this.cover.removeEventListener(this.events[1],this.moveEventHandler,!1),document.removeEventListener(this.events[2],this.endEventHandler,!1)}r.prototype.createCanvas=function(){if(this.cover=document.createElement("canvas"),this.cover.className="nut-cover",this.cover.height=this.cHeight,this.cover.width=this.cWidth,this.ctx=this.cover.getContext("2d"),this.opt.coverImg){var t=this,e=new Image;e.src=this.opt.coverImg,e.onload=function(){t.ctx.drawImage(e,0,0,t.cover.width,t.cover.height)}}else this.ctx.fillStyle=this.opt.coverColor,this.ctx.fillRect(0,0,this.cover.width,this.cover.height);this.scratchDiv.appendChild(this.cover),this.cardDiv.style.opacity=1},r.prototype.eventDetect=function(){"ontouchstart"in window&&(this.supportTouch=!0),this.events=this.supportTouch?["touchstart","touchmove","touchend"]:["mousedown","mousemove","mouseup"],this.addEvent()},r.prototype.addEvent=function(){this.startEventHandler=l.bind(this),this.cover.addEventListener(this.events[0],this.startEventHandler,!1)},r.prototype.clearCover=function(){this.ctx.clearRect(0,0,this.cover.width,this.cover.height),this.cover.removeEventListener(this.events[0],this.startEventHandler),this.cover.removeEventListener(this.events[1],this.moveEventHandler),this.cover.removeEventListener(this.events[2],this.endEventHandler)},r.prototype.init=function(t,e){if(a()){var n=this;s(arguments,(function(t){if("object"===i()(t))for(var e in t)"callback"===e&&"function"==typeof t[e]?n.opt.callback=t[e].bind(n):e in n.opt&&(n.opt[e]=t[e]);else"function"==typeof t&&(n.opt.callback=t.bind(n))})),this.scratchDiv&&(this.cardDiv=this.scratchDiv.querySelector(".nut-content"),this.cardDiv&&(this.cHeight=this.cardDiv.clientHeight,this.cWidth=this.cardDiv.clientWidth,this.cardDiv.style.opacity=0,this.createCanvas(),this.eventDetect()))}else alert("对不起,当前浏览器不支持Canvas,无法使用本控件!")},r.case=function(t,e){return new r(t,e)};var d=r.case,v={name:"nut-luckycard",props:{content:{type:String,default:""},height:{type:[String,Number],default:50},width:{type:[String,Number],default:300},coverColor:{type:String,default:"#C5C5C5"},coverImg:{type:String,default:""},fontSize:{type:[String,Number],default:20},backgroundColor:{type:String,default:"#FFFFFF"},ratio:{type:[String,Number],default:.5}},data:function(){return{luckcard:null}},methods:{clearCover:function(){console.log(this.luckcard),this.luckcard.clearCover()}},mounted:function(){var t=this;this.$nextTick((function(){var e=t;t.luckcard=d({scratchDiv:t.$el,coverColor:t.coverColor,coverImg:t.coverImg,ratio:Number(t.ratio),callback:function(){this.clearCover(),e.$emit("open",this)}})}))}},f=(n(150),n(0)),p=Object(f.a)(v,(function(){var t=this._self._c;return t("div",{staticClass:"nut-luckycard",style:{height:this.height+"px",width:this.width+"px"}},[t("div",{staticClass:"nut-content",style:{backgroundColor:this.backgroundColor,fontSize:this.fontSize+"px"},domProps:{innerHTML:this._s(this.content)}})])}),[],!1,null,null,null).exports;n(151);p.install=function(t){t.component(p.name,p)};e.default=p},6:function(t,e){function n(e){return t.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},75:function(t,e,n){}})}));
|
|
7
7
|
//# sourceMappingURL=luckycard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://[name]/webpack/universalModuleDefinition","webpack://[name]/webpack/bootstrap","webpack://[name]/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://[name]/./src/packages/luckycard/luckycard.vue?807d","webpack://[name]/./src/packages/luckycard/luckycard.vue?62f1","webpack://[name]/./src/packages/luckycard/luckycard.js","webpack://[name]/./src/packages/luckycard/luckycard.vue?a47c","webpack://[name]/src/packages/luckycard/luckycard.vue","webpack://[name]/./src/packages/luckycard/luckycard.vue","webpack://[name]/./src/packages/luckycard/index.js","webpack://[name]/./node_modules/@babel/runtime/helpers/typeof.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","normalizeComponent","scriptExports","render","staticRenderFns","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","options","_compiled","functional","_scopeId","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","add","_ssrRegister","$root","$options","shadowRoot","_injectStyles","originalRender","h","existing","beforeCreate","concat","LuckyCard","settings","callback","cover","ctx","scratchDiv","cardDiv","cHeight","cWidth","supportTouch","events","startEventHandler","moveEventHandler","endEventHandler","opt","coverColor","coverImg","ratio","init","_calcArea","pixels","getImageData","transPixels","_forEach","data","item","pixel","push","length","items","Array","forEach","idx","_isCanvasSupported","elem","document","createElement","getContext","_startEventHandler","event","preventDefault","_moveEventHandler","addEventListener","_endEventHandler","evt","touches","coverPos","getBoundingClientRect","pageScrollTop","documentElement","scrollTop","body","pageScrollLeft","scrollLeft","mouseX","pageX","left","mouseY","pageY","top","beginPath","fillStyle","globalCompositeOperation","arc","Math","PI","fill","removeEventListener","createCanvas","className","height","width","_this","Image","src","onload","drawImage","fillRect","appendChild","style","opacity","eventDetect","window","addEvent","clearCover","clearRect","arguments","k","querySelector","clientHeight","clientWidth","alert","case","props","content","type","String","default","Number","fontSize","backgroundColor","luckcard","methods","console","log","mounted","$nextTick","_vm","$emit","_h","$createElement","_c","_self","staticClass","domProps","_s","install","Vue","component","_typeof","obj","iterator","constructor"],"mappings":";;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,YAAa,GAAIH,GACE,iBAAZC,QACdA,QAAmB,UAAID,IAEvBD,EAAgB,UAAIC,IARtB,CASoB,oBAATK,KAAuBA,KAAOC,MAAO,WAChD,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUR,QAGnC,IAAIC,EAASK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CAAGT,OAA7GzI,KAAyHyI,OAAS,KAAMC,MAAxI1I,KAAmJ0I,MAAQ,OAAS,CAACwC,EAAG,MAAM,CAACE,YAAY,cAAclC,MAAM,CAAGqB,gBAAlNvK,KAAuOuK,gBAAiBD,SAAxPtK,KAAsQsK,SAAW,MAAQe,SAAS,CAAC,UAAnSrL,KAAmTsL,GAAnTtL,KAA0TiK,gBACtU,IIWpB,EACA,KACA,KACA,M,eCZF9F,EAAUoH,QAAU,SAASC,GAC3BA,EAAIC,UAAUtH,EAAUxD,KAAMwD,IAGjBA,a,gBCPf,SAASuH,EAAQC,GAiBf,MAdsB,mBAAXxK,QAAoD,iBAApBA,OAAOyK,UAChDhM,EAAOD,QAAU+L,EAAU,SAAiBC,GAC1C,cAAcA,GAGhB/L,EAAOD,QAAiB,QAAIC,EAAOD,QAASC,EAAOD,QAAQ6B,YAAa,IAExE5B,EAAOD,QAAU+L,EAAU,SAAiBC,GAC1C,OAAOA,GAAyB,mBAAXxK,QAAyBwK,EAAIE,cAAgB1K,QAAUwK,IAAQxK,OAAOa,UAAY,gBAAkB2J,GAG3H/L,EAAOD,QAAiB,QAAIC,EAAOD,QAASC,EAAOD,QAAQ6B,YAAa,GAGnEkK,EAAQC,GAGjB/L,EAAOD,QAAU+L,EACjB9L,EAAOD,QAAiB,QAAIC,EAAOD,QAASC,EAAOD,QAAQ6B,YAAa,G","file":"luckycard/luckycard.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"luckycard\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"luckycard\"] = factory();\n\telse\n\t\troot[\"luckycard\"] = factory();\n})((typeof self !== 'undefined' ? self : this), function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 168);\n","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--0-0!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js!../../../node_modules/sass-loader/dist/cjs.js??ref--0-3!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./luckycard.vue?vue&type=style&index=0&lang=scss&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"nut-luckycard\",style:({ height: _vm.height + 'px', width: _vm.width + 'px' })},[_c('div',{staticClass:\"nut-content\",style:({ backgroundColor: _vm.backgroundColor, fontSize: _vm.fontSize + 'px' }),domProps:{\"innerHTML\":_vm._s(_vm.content)}})])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/*\n * lucky-card.js - Scratch CARDS based on HTML5 Canvas\n *\n * Copyright (c) 2015 Frans Lee dmon@foxmail.com\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/mit-license.php\n *\n * Version: 1.0.3\n */\n'use strict';\n\n/**\n * Instantiate parameters\n *\n * @constructor\n */\nfunction LuckyCard(settings, callback) {\n this.cover = null;\n this.ctx = null;\n this.scratchDiv = settings.scratchDiv;\n this.cardDiv = null;\n this.cHeight = 0;\n this.cWidth = 0;\n this.supportTouch = false;\n this.events = [];\n this.startEventHandler = null;\n this.moveEventHandler = null;\n this.endEventHandler = null;\n\n this.opt = {\n coverColor: '#C5C5C5',\n coverImg: '',\n ratio: .8,\n callback: null\n };\n\n this.init(settings, callback);\n};\n\nfunction _calcArea(ctx, callback, ratio) {\n var pixels = ctx.getImageData(0, 0, this.cWidth, this.cHeight);\n var transPixels = [];\n _forEach(pixels.data, function(item, i) {\n var pixel = pixels.data[i + 3];\n if (pixel === 0) {\n transPixels.push(pixel);\n }\n });\n\n if (transPixels.length / pixels.data.length > ratio) {\n callback && typeof callback === 'function' && callback();\n }\n}\n\nfunction _forEach(items, callback) {\n return Array.prototype.forEach.call(items, function(item, idx) {\n callback(item, idx);\n });\n}\n\nfunction _isCanvasSupported() {\n var elem = document.createElement('canvas');\n return !!(elem.getContext && elem.getContext('2d'));\n}\n\n/**\n * touchstart/mousedown event handler\n */\nfunction _startEventHandler(event) {\n event.preventDefault();\n this.moveEventHandler = _moveEventHandler.bind(this);\n this.cover.addEventListener(this.events[1], this.moveEventHandler, false);\n this.endEventHandler = _endEventHandler.bind(this);\n document.addEventListener(this.events[2], this.endEventHandler, false);\n};\n\n/**\n * touchmove/mousemove event handler\n */\nfunction _moveEventHandler(event) {\n event.preventDefault();\n var evt = this.supportTouch ? event.touches[0] : event;\n var coverPos = this.cover.getBoundingClientRect();\n var pageScrollTop = document.documentElement.scrollTop || document.body.scrollTop;\n var pageScrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;\n var mouseX = evt.pageX - coverPos.left - pageScrollLeft;\n var mouseY = evt.pageY - coverPos.top - pageScrollTop;\n\n this.ctx.beginPath();\n this.ctx.fillStyle = '#FFFFFF';\n this.ctx.globalCompositeOperation = \"destination-out\";\n this.ctx.arc(mouseX, mouseY, 10, 0, 2 * Math.PI);\n this.ctx.fill();\n};\n\n/**\n * touchend/mouseup event handler\n */\nfunction _endEventHandler(event) {\n event.preventDefault();\n if (this.opt.callback && typeof this.opt.callback === 'function') _calcArea.call(this, this.ctx, this.opt.callback, this.opt.ratio);\n this.cover.removeEventListener(this.events[1], this.moveEventHandler, false);\n document.removeEventListener(this.events[2], this.endEventHandler, false);\n};\n\n/**\n * Create Canvas element\n */\nLuckyCard.prototype.createCanvas = function() {\n this.cover = document.createElement('canvas');\n this.cover.className = 'nut-cover';\n this.cover.height = this.cHeight;\n this.cover.width = this.cWidth;\n this.ctx = this.cover.getContext('2d');\n if (this.opt.coverImg) {\n var _this = this;\n var coverImg = new Image();\n coverImg.src = this.opt.coverImg;\n coverImg.onload = function() {\n _this.ctx.drawImage(coverImg, 0, 0, _this.cover.width, _this.cover.height);\n }\n } else {\n this.ctx.fillStyle = this.opt.coverColor;\n this.ctx.fillRect(0, 0, this.cover.width, this.cover.height);\n }\n this.scratchDiv.appendChild(this.cover);\n this.cardDiv.style.opacity = 1;\n}\n\n/**\n * To detect whether support touch events\n */\nLuckyCard.prototype.eventDetect = function() {\n if ('ontouchstart' in window) this.supportTouch = true;\n this.events = this.supportTouch ? ['touchstart', 'touchmove', 'touchend'] : ['mousedown', 'mousemove', 'mouseup'];\n this.addEvent();\n};\n\n/**\n * Add touchstart/mousedown event listener\n */\nLuckyCard.prototype.addEvent = function() {\n this.startEventHandler = _startEventHandler.bind(this);\n this.cover.addEventListener(this.events[0], this.startEventHandler, false);\n};\n\n/**\n * Clear pixels of canvas\n */\nLuckyCard.prototype.clearCover = function() {\n this.ctx.clearRect(0, 0, this.cover.width, this.cover.height);\n this.cover.removeEventListener(this.events[0], this.startEventHandler);\n this.cover.removeEventListener(this.events[1], this.moveEventHandler);\n this.cover.removeEventListener(this.events[2], this.endEventHandler);\n};\n\n\n/**\n * LuckyCard initializer\n *\n * @param {Object} settings Settings for LuckyCard\n * @param {function} callback callback function\n */\nLuckyCard.prototype.init = function(settings, callback) {\n if (!_isCanvasSupported()) {\n alert('对不起,当前浏览器不支持Canvas,无法使用本控件!');\n return;\n }\n var _this = this;\n _forEach(arguments, function(item) {\n if (typeof item === \"object\") {\n for (var k in item) {\n if (k === 'callback' && typeof item[k] === 'function') {\n _this.opt.callback = item[k].bind(_this);\n } else {\n k in _this.opt && (_this.opt[k] = item[k]);\n }\n }\n } else if (typeof item === \"function\") {\n _this.opt.callback = item.bind(_this);\n }\n });\n /* this.scratchDiv = document.getElementById('scratch');*/\n if (!this.scratchDiv) return;\n this.cardDiv = this.scratchDiv.querySelector('.nut-content');\n if (!this.cardDiv) return;\n\n this.cHeight = this.cardDiv.clientHeight;\n this.cWidth = this.cardDiv.clientWidth;\n this.cardDiv.style.opacity = 0;\n this.createCanvas();\n this.eventDetect();\n};\n\n/**\n * To generate an instance of object\n *\n * @param {Object} settings Settings for LuckyCard\n * @param {function} callback callback function\n */\nLuckyCard.case = function(settings, callback) {\n return new LuckyCard(settings, callback);\n};\n\nexport default LuckyCard.case;","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./luckycard.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./luckycard.vue?vue&type=script&lang=js&\"","<template>\n <div class=\"nut-luckycard\" :style=\"{ height: height + 'px', width: width + 'px' }\">\n <div class=\"nut-content\" v-html=\"content\" :style=\"{ backgroundColor: backgroundColor, fontSize: fontSize + 'px' }\"></div>\n </div>\n</template>\n\n<script>\nimport LuckyCard from './luckycard.js';\nexport default {\n name: 'nut-luckycard',\n props: {\n content: {\n type: String,\n default: ''\n },\n height: {\n type: [String, Number],\n default: 50\n },\n width: {\n type: [String, Number],\n default: 300\n },\n coverColor: {\n type: String,\n default: '#C5C5C5'\n },\n coverImg: {\n type: String,\n default: ''\n },\n fontSize: {\n type: [String, Number],\n default: 20\n },\n backgroundColor: {\n type: String,\n default: '#FFFFFF'\n },\n ratio: {\n type: [String, Number],\n default: 0.5\n }\n },\n data() {\n return {\n luckcard: null\n };\n },\n methods: {\n clearCover() {\n console.log(this.luckcard);\n this.luckcard.clearCover();\n }\n },\n mounted() {\n this.$nextTick(() => {\n const _vm = this;\n this.luckcard = LuckyCard({\n scratchDiv: this.$el,\n coverColor: this.coverColor,\n coverImg: this.coverImg,\n ratio: Number(this.ratio),\n callback: function() {\n //console.log(this);\n this.clearCover();\n _vm.$emit('open', this);\n }\n });\n });\n }\n};\n</script>\n<style lang=\"scss\">\n.nut-luckycard {\n position: relative;\n .nut-cover {\n position: absolute;\n top: 0;\n left: 0;\n }\n .nut-content {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n line-height: 100%;\n user-select: none;\n }\n}\n</style>\n","import { render, staticRenderFns } from \"./luckycard.vue?vue&type=template&id=1a2402ac&\"\nimport script from \"./luckycard.vue?vue&type=script&lang=js&\"\nexport * from \"./luckycard.vue?vue&type=script&lang=js&\"\nimport style0 from \"./luckycard.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import LuckyCard from './luckycard.vue';\nimport './luckycard.scss';\n\nLuckyCard.install = function(Vue) {\n Vue.component(LuckyCard.name, LuckyCard);\n};\n\nexport default LuckyCard","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack://[name]/webpack/universalModuleDefinition","webpack://[name]/webpack/bootstrap","webpack://[name]/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://[name]/./src/packages/luckycard/luckycard.vue?dd02","webpack://[name]/./src/packages/luckycard/luckycard.vue?3456","webpack://[name]/./src/packages/luckycard/luckycard.js","webpack://[name]/./src/packages/luckycard/luckycard.vue?a47c","webpack://[name]/src/packages/luckycard/luckycard.vue","webpack://[name]/./src/packages/luckycard/luckycard.vue","webpack://[name]/./src/packages/luckycard/index.js","webpack://[name]/./node_modules/@babel/runtime/helpers/typeof.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","normalizeComponent","scriptExports","render","staticRenderFns","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","options","_compiled","functional","_scopeId","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","add","_ssrRegister","$root","$options","shadowRoot","_injectStyles","originalRender","h","existing","beforeCreate","concat","LuckyCard","settings","callback","cover","ctx","scratchDiv","cardDiv","cHeight","cWidth","supportTouch","events","startEventHandler","moveEventHandler","endEventHandler","opt","coverColor","coverImg","ratio","init","_calcArea","pixels","getImageData","transPixels","_forEach","data","item","pixel","push","length","items","Array","forEach","idx","_isCanvasSupported","elem","document","createElement","getContext","_startEventHandler","event","preventDefault","_moveEventHandler","addEventListener","_endEventHandler","evt","touches","coverPos","getBoundingClientRect","pageScrollTop","documentElement","scrollTop","body","pageScrollLeft","scrollLeft","mouseX","pageX","left","mouseY","pageY","top","beginPath","fillStyle","globalCompositeOperation","arc","Math","PI","fill","removeEventListener","createCanvas","className","height","width","_this","Image","src","onload","drawImage","fillRect","appendChild","style","opacity","eventDetect","window","addEvent","clearCover","clearRect","arguments","k","querySelector","clientHeight","clientWidth","alert","case","props","content","type","default","fontSize","backgroundColor","luckcard","methods","console","mounted","_vm","_c","_self","staticClass","domProps","_s","install","Vue","component","_typeof","obj","iterator","constructor"],"mappings":";;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,YAAa,GAAIH,GACE,iBAAZC,QACdA,QAAmB,UAAID,IAEvBD,EAAgB,UAAIC,IARtB,CASoB,oBAATK,KAAuBA,KAAOC,MAAO,WAChD,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUR,QAGnC,IAAIC,EAASK,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHV,QAAS,IAUV,OANAW,EAAQH,GAAUI,KAAKX,EAAOD,QAASC,EAAQA,EAAOD,QAASO,GAG/DN,EAAOS,GAAI,EAGJT,EAAOD,QA0Df,OArDAO,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASf,EAASgB,EAAMC,GAC3CV,EAAoBW,EAAElB,EAASgB,IAClCG,OAAOC,eAAepB,EAASgB,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAASvB,GACX,oBAAXwB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAepB,EAASwB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAepB,EAAS,aAAc,CAAE0B,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQnB,EAAoBmB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFAxB,EAAoBgB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CA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AA3EzI,KAAuFyI,OAAS,KAAMC,MAAtG1I,KAAiH0I,MAAQ,OAAS,CAACiC,EAAG,MAAM,CAACE,YAAY,cAAc3B,MAAM,CAAGmB,gBAAhLrK,KAAqMqK,gBAAiBD,SAAtNpK,KAAoOoK,SAAW,MAAQU,SAAS,CAAC,UAAjQ9K,KAAiR+K,GAAjR/K,KAAwRiK,gBAEzS,IIUpB,EACA,KACA,KACA,M,eCZF9F,EAAU6G,QAAU,SAASC,GAC3BA,EAAIC,UAAU/G,EAAUxD,KAAMwD,IAGjBA,a,gBCPf,SAASgH,EAAQC,GAGf,OAAQxL,EAAOD,QAAUwL,EAAU,mBAAqBhK,QAAU,iBAAmBA,OAAOkK,SAAW,SAAUD,GAC/G,cAAcA,GACZ,SAAUA,GACZ,OAAOA,GAAO,mBAAqBjK,QAAUiK,EAAIE,cAAgBnK,QAAUiK,IAAQjK,OAAOa,UAAY,gBAAkBoJ,GACvHxL,EAAOD,QAAQ6B,YAAa,EAAM5B,EAAOD,QAAiB,QAAIC,EAAOD,QAAUwL,EAAQC,GAE5FxL,EAAOD,QAAUwL,EAASvL,EAAOD,QAAQ6B,YAAa,EAAM5B,EAAOD,QAAiB,QAAIC,EAAOD,S","file":"luckycard/luckycard.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"luckycard\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"luckycard\"] = factory();\n\telse\n\t\troot[\"luckycard\"] = factory();\n})((typeof self !== 'undefined' ? self : this), function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 168);\n","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent(\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */,\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options =\n typeof scriptExports === 'function' ? scriptExports.options : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) {\n // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--0-0!../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js!../../../node_modules/sass-loader/dist/cjs.js??ref--0-3!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./luckycard.vue?vue&type=style&index=0&id=1a2402ac&prod&lang=scss&\"","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"nut-luckycard\",style:({ height: _vm.height + 'px', width: _vm.width + 'px' })},[_c('div',{staticClass:\"nut-content\",style:({ backgroundColor: _vm.backgroundColor, fontSize: _vm.fontSize + 'px' }),domProps:{\"innerHTML\":_vm._s(_vm.content)}})])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/*\n * lucky-card.js - Scratch CARDS based on HTML5 Canvas\n *\n * Copyright (c) 2015 Frans Lee dmon@foxmail.com\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/mit-license.php\n *\n * Version: 1.0.3\n */\n'use strict';\n\n/**\n * Instantiate parameters\n *\n * @constructor\n */\nfunction LuckyCard(settings, callback) {\n this.cover = null;\n this.ctx = null;\n this.scratchDiv = settings.scratchDiv;\n this.cardDiv = null;\n this.cHeight = 0;\n this.cWidth = 0;\n this.supportTouch = false;\n this.events = [];\n this.startEventHandler = null;\n this.moveEventHandler = null;\n this.endEventHandler = null;\n\n this.opt = {\n coverColor: '#C5C5C5',\n coverImg: '',\n ratio: .8,\n callback: null\n };\n\n this.init(settings, callback);\n};\n\nfunction _calcArea(ctx, callback, ratio) {\n var pixels = ctx.getImageData(0, 0, this.cWidth, this.cHeight);\n var transPixels = [];\n _forEach(pixels.data, function(item, i) {\n var pixel = pixels.data[i + 3];\n if (pixel === 0) {\n transPixels.push(pixel);\n }\n });\n\n if (transPixels.length / pixels.data.length > ratio) {\n callback && typeof callback === 'function' && callback();\n }\n}\n\nfunction _forEach(items, callback) {\n return Array.prototype.forEach.call(items, function(item, idx) {\n callback(item, idx);\n });\n}\n\nfunction _isCanvasSupported() {\n var elem = document.createElement('canvas');\n return !!(elem.getContext && elem.getContext('2d'));\n}\n\n/**\n * touchstart/mousedown event handler\n */\nfunction _startEventHandler(event) {\n event.preventDefault();\n this.moveEventHandler = _moveEventHandler.bind(this);\n this.cover.addEventListener(this.events[1], this.moveEventHandler, false);\n this.endEventHandler = _endEventHandler.bind(this);\n document.addEventListener(this.events[2], this.endEventHandler, false);\n};\n\n/**\n * touchmove/mousemove event handler\n */\nfunction _moveEventHandler(event) {\n event.preventDefault();\n var evt = this.supportTouch ? event.touches[0] : event;\n var coverPos = this.cover.getBoundingClientRect();\n var pageScrollTop = document.documentElement.scrollTop || document.body.scrollTop;\n var pageScrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;\n var mouseX = evt.pageX - coverPos.left - pageScrollLeft;\n var mouseY = evt.pageY - coverPos.top - pageScrollTop;\n\n this.ctx.beginPath();\n this.ctx.fillStyle = '#FFFFFF';\n this.ctx.globalCompositeOperation = \"destination-out\";\n this.ctx.arc(mouseX, mouseY, 10, 0, 2 * Math.PI);\n this.ctx.fill();\n};\n\n/**\n * touchend/mouseup event handler\n */\nfunction _endEventHandler(event) {\n event.preventDefault();\n if (this.opt.callback && typeof this.opt.callback === 'function') _calcArea.call(this, this.ctx, this.opt.callback, this.opt.ratio);\n this.cover.removeEventListener(this.events[1], this.moveEventHandler, false);\n document.removeEventListener(this.events[2], this.endEventHandler, false);\n};\n\n/**\n * Create Canvas element\n */\nLuckyCard.prototype.createCanvas = function() {\n this.cover = document.createElement('canvas');\n this.cover.className = 'nut-cover';\n this.cover.height = this.cHeight;\n this.cover.width = this.cWidth;\n this.ctx = this.cover.getContext('2d');\n if (this.opt.coverImg) {\n var _this = this;\n var coverImg = new Image();\n coverImg.src = this.opt.coverImg;\n coverImg.onload = function() {\n _this.ctx.drawImage(coverImg, 0, 0, _this.cover.width, _this.cover.height);\n }\n } else {\n this.ctx.fillStyle = this.opt.coverColor;\n this.ctx.fillRect(0, 0, this.cover.width, this.cover.height);\n }\n this.scratchDiv.appendChild(this.cover);\n this.cardDiv.style.opacity = 1;\n}\n\n/**\n * To detect whether support touch events\n */\nLuckyCard.prototype.eventDetect = function() {\n if ('ontouchstart' in window) this.supportTouch = true;\n this.events = this.supportTouch ? ['touchstart', 'touchmove', 'touchend'] : ['mousedown', 'mousemove', 'mouseup'];\n this.addEvent();\n};\n\n/**\n * Add touchstart/mousedown event listener\n */\nLuckyCard.prototype.addEvent = function() {\n this.startEventHandler = _startEventHandler.bind(this);\n this.cover.addEventListener(this.events[0], this.startEventHandler, false);\n};\n\n/**\n * Clear pixels of canvas\n */\nLuckyCard.prototype.clearCover = function() {\n this.ctx.clearRect(0, 0, this.cover.width, this.cover.height);\n this.cover.removeEventListener(this.events[0], this.startEventHandler);\n this.cover.removeEventListener(this.events[1], this.moveEventHandler);\n this.cover.removeEventListener(this.events[2], this.endEventHandler);\n};\n\n\n/**\n * LuckyCard initializer\n *\n * @param {Object} settings Settings for LuckyCard\n * @param {function} callback callback function\n */\nLuckyCard.prototype.init = function(settings, callback) {\n if (!_isCanvasSupported()) {\n alert('对不起,当前浏览器不支持Canvas,无法使用本控件!');\n return;\n }\n var _this = this;\n _forEach(arguments, function(item) {\n if (typeof item === \"object\") {\n for (var k in item) {\n if (k === 'callback' && typeof item[k] === 'function') {\n _this.opt.callback = item[k].bind(_this);\n } else {\n k in _this.opt && (_this.opt[k] = item[k]);\n }\n }\n } else if (typeof item === \"function\") {\n _this.opt.callback = item.bind(_this);\n }\n });\n /* this.scratchDiv = document.getElementById('scratch');*/\n if (!this.scratchDiv) return;\n this.cardDiv = this.scratchDiv.querySelector('.nut-content');\n if (!this.cardDiv) return;\n\n this.cHeight = this.cardDiv.clientHeight;\n this.cWidth = this.cardDiv.clientWidth;\n this.cardDiv.style.opacity = 0;\n this.createCanvas();\n this.eventDetect();\n};\n\n/**\n * To generate an instance of object\n *\n * @param {Object} settings Settings for LuckyCard\n * @param {function} callback callback function\n */\nLuckyCard.case = function(settings, callback) {\n return new LuckyCard(settings, callback);\n};\n\nexport default LuckyCard.case;","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./luckycard.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./luckycard.vue?vue&type=script&lang=js&\"","<template>\n <div class=\"nut-luckycard\" :style=\"{ height: height + 'px', width: width + 'px' }\">\n <div class=\"nut-content\" v-html=\"content\" :style=\"{ backgroundColor: backgroundColor, fontSize: fontSize + 'px' }\"></div>\n </div>\n</template>\n\n<script>\nimport LuckyCard from './luckycard.js';\nexport default {\n name: 'nut-luckycard',\n props: {\n content: {\n type: String,\n default: ''\n },\n height: {\n type: [String, Number],\n default: 50\n },\n width: {\n type: [String, Number],\n default: 300\n },\n coverColor: {\n type: String,\n default: '#C5C5C5'\n },\n coverImg: {\n type: String,\n default: ''\n },\n fontSize: {\n type: [String, Number],\n default: 20\n },\n backgroundColor: {\n type: String,\n default: '#FFFFFF'\n },\n ratio: {\n type: [String, Number],\n default: 0.5\n }\n },\n data() {\n return {\n luckcard: null\n };\n },\n methods: {\n clearCover() {\n console.log(this.luckcard);\n this.luckcard.clearCover();\n }\n },\n mounted() {\n this.$nextTick(() => {\n const _vm = this;\n this.luckcard = LuckyCard({\n scratchDiv: this.$el,\n coverColor: this.coverColor,\n coverImg: this.coverImg,\n ratio: Number(this.ratio),\n callback: function() {\n //console.log(this);\n this.clearCover();\n _vm.$emit('open', this);\n }\n });\n });\n }\n};\n</script>\n<style lang=\"scss\">\n.nut-luckycard {\n position: relative;\n .nut-cover {\n position: absolute;\n top: 0;\n left: 0;\n }\n .nut-content {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n line-height: 100%;\n user-select: none;\n }\n}\n</style>\n","import { render, staticRenderFns } from \"./luckycard.vue?vue&type=template&id=1a2402ac&\"\nimport script from \"./luckycard.vue?vue&type=script&lang=js&\"\nexport * from \"./luckycard.vue?vue&type=script&lang=js&\"\nimport style0 from \"./luckycard.vue?vue&type=style&index=0&id=1a2402ac&prod&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import LuckyCard from './luckycard.vue';\nimport './luckycard.scss';\n\nLuckyCard.install = function(Vue) {\n Vue.component(LuckyCard.name, LuckyCard);\n};\n\nexport default LuckyCard","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;"],"sourceRoot":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v2.3.
|
|
2
|
+
* @nutui/nutui v2.3.11 - magic.css, 73382f82a2742e2b1bc6, Mon Oct 17 2022 18:27:02 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2017-2020 JDC
|
|
4
4
|
* Released under the MIT License.
|
|
5
|
-
*/.adjust-position{margin-top:-20px;margin-bottom:-20px}.header-wrap{position:relative;height:710px}.header-wrap .img-header{position:absolute;bottom:0;width:100%}.cube-item{height:90px;width:88px;-webkit-border-radius:26px;border-radius:26px;overflow:hidden;position:relative;-webkit-transform:translateZ(0);transform:translateZ(0)}.cube-item:before{content:"";position:absolute;bottom:0;left:0;width:100%;height:60px;-webkit-border-radius:0 0 26px 26px;border-radius:0 0 26px 26px}.cube-item-box{height:63px;background:#fff;-webkit-border-radius:26px 26px 11px 11px;border-radius:26px 26px 11px 11px;background-size:cover;background-repeat:no-repeat}.cube-item-box,.cube-item .sub-name{width:100%;text-align:center;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);overflow:hidden}.cube-item .sub-name{top:63px;padding:0 10px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#fff;font-size:14px;line-height:27px;white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis}.cube-item .sub-image{display:block;width:60px;height:60px;margin:0 auto;background-color:#fff;background-position:50%;background-size:100%;-webkit-transform:translateY(6px);-ms-transform:translateY(6px);transform:translateY(6px)}.cube-item .sub-desc{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;width:77px;-webkit-box-sizing:border-box;box-sizing:border-box;height:15px;color:#fff;-webkit-border-radius:6px;border-radius:6px;font-size:12px;text-align:center;position:absolute;bottom:29px;left:50%;-webkit-transform-origin:0 center;-ms-transform-origin:0 center;transform-origin:0 center;-webkit-transform:translate3d(-50%,0,1px);transform:translate3d(-50%,0,1px)}.cube-item .sub-desc span{width:100%;display:block;line-height:normal;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.cube-item--pic:before{background:url(https://img12.360buyimg.com/imagetools/jfs/t1/184083/34/6101/38841/60b065caEaaf7c5d0/eec4cd260f46d9f0.png) no-repeat 50%/100%;height:100%}.cube-item--pic .cube-item-box,.cube-item--pic .sub-desc,.cube-item--pic .sub-name{display:none}.cube-item--act:before{background:url(https://img11.360buyimg.com/imagetools/jfs/t1/195605/17/5252/39357/60b065caEe0aa4c7e/04a341f4e51c6a9b.png) no-repeat 50%/100%}.cube-item--act .sub-desc{background:#ff5c17}.cube-item--rank:before{background:url(https://img14.360buyimg.com/imagetools/jfs/t1/183388/37/6207/39741/60b065caEea1440a1/8860c63660fc9ac4.png) no-repeat 50%/100%}.cube-item--rank .sub-desc{background:#1f95fb}.cube-item--shop:before{background:url(https://img12.360buyimg.com/imagetools/jfs/t1/184083/34/6101/38841/60b065caEaaf7c5d0/eec4cd260f46d9f0.png) no-repeat 50%/100%}.cube-item--shop .sub-desc{background:#ffd01f}.cube-item--shop .sub-desc span{color:#000}.cube-item--lbs:before{background:url(https://img10.360buyimg.com/imagetools/jfs/t1/129094/23/18726/38672/60b065caEb849e8cb/da761e3ebae5bc84.png) no-repeat 50%/100%}.cube-item--lbs .sub-desc{background:#ffd01f}.cube-item--lbs .sub-desc span{color:#000}.cube-item--unread{-webkit-box-shadow:0 0 20px hsla(0,0%,100%,.2);box-shadow:0 0 20px hsla(0,0%,100%,.2);-webkit-animation:show 2s infinite;animation:show 2s infinite}.cube-item--special{background-size:cover;background-repeat:no-repeat}.cube-item--special .cube-item-box,.cube-item--special .sub-desc,.cube-item--special:before{display:none}@-webkit-keyframes show{0%{-webkit-box-shadow:0 0 20px hsla(0,0%,100%,.2);box-shadow:0 0 20px hsla(0,0%,100%,.2)}50%{-webkit-box-shadow:0 0 20px hsla(0,0%,100%,.5);box-shadow:0 0 20px hsla(0,0%,100%,.5)}to{-webkit-box-shadow:0 0 20px hsla(0,0%,100%,.2);box-shadow:0 0 20px hsla(0,0%,100%,.2)}}@keyframes show{0%{-webkit-box-shadow:0 0 20px hsla(0,0%,100%,.2);box-shadow:0 0 20px hsla(0,0%,100%,.2)}50%{-webkit-box-shadow:0 0 20px hsla(0,0%,100%,.5);box-shadow:0 0 20px hsla(0,0%,100%,.5)}to{-webkit-box-shadow:0 0 20px hsla(0,0%,100%,.2);box-shadow:0 0 20px hsla(0,0%,100%,.2)}}.cube-wrapper--inited .cube-col .cube-item .sub-image{-webkit-animation:cube-image .2s cubic-bezier(.33,0,.67,1) 1s forwards;animation:cube-image .2s cubic-bezier(.33,0,.67,1) 1s forwards}@-webkit-keyframes cube-image{0%{-webkit-transform:translateY(13px);transform:translateY(13px)}66%{-webkit-transform:translateY(-5px);transform:translateY(-5px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes cube-image{0%{-webkit-transform:translateY(13px);transform:translateY(13px)}66%{-webkit-transform:translateY(-5px);transform:translateY(-5px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}.cube{width:100%;z-index:10}.cube-container{width:100%;padding:15px 0;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;overflow:hidden}.cube-wrapper{width:100%;white-space:nowrap;-webkit-perspective:500px;perspective:500px;-webkit-animation-play-state:paused;animation-play-state:paused;-webkit-transition-property:all;-o-transition-property:all;transition-property:all;-webkit-transition-timing-function:cubic-bezier(.39,.575,.565,1);-o-transition-timing-function:cubic-bezier(.39,.575,.565,1);transition-timing-function:cubic-bezier(.39,.575,.565,1)}.cube-col{display:inline-block;width:25%;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:inherit;-o-transition:inherit;transition:inherit}.cube-col--anime:nth-child(5) .cube-item-wrap{-webkit-animation:cube5 .56s cubic-bezier(.33,0,.67,1) 1s both;animation:cube5 .56s cubic-bezier(.33,0,.67,1) 1s both}@-webkit-keyframes cube5{0%{-webkit-animation-timing-function:cubic-bezier(.33,0,.67,1);animation-timing-function:cubic-bezier(.33,0,.67,1);-webkit-transform:translate3d(733px,0,0);transform:translate3d(733px,0,0)}57%{-webkit-animation-timing-function:cubic-bezier(.33,0,.67,1);animation-timing-function:cubic-bezier(.33,0,.67,1);-webkit-transform:translate3d(-30px,0,0);transform:translate3d(-30px,0,0)}58%{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translate3d(-30px,0,0);transform:translate3d(-30px,0,0)}to{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes cube5{0%{-webkit-animation-timing-function:cubic-bezier(.33,0,.67,1);animation-timing-function:cubic-bezier(.33,0,.67,1);-webkit-transform:translate3d(733px,0,0);transform:translate3d(733px,0,0)}57%{-webkit-animation-timing-function:cubic-bezier(.33,0,.67,1);animation-timing-function:cubic-bezier(.33,0,.67,1);-webkit-transform:translate3d(-30px,0,0);transform:translate3d(-30px,0,0)}58%{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translate3d(-30px,0,0);transform:translate3d(-30px,0,0)}to{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translateZ(0);transform:translateZ(0)}}.cube-col--anime:nth-child(6) .cube-item-wrap{-webkit-animation:cube6 .56s cubic-bezier(.33,0,.83,1) 1.08s both;animation:cube6 .56s cubic-bezier(.33,0,.83,1) 1.08s both}@-webkit-keyframes cube6{0%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(554px,0,0);transform:translate3d(554px,0,0)}57%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}58%{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}to{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes cube6{0%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(554px,0,0);transform:translate3d(554px,0,0)}57%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}58%{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}to{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translateZ(0);transform:translateZ(0)}}.cube-col--anime:nth-child(7) .cube-item-wrap{-webkit-animation:cube7 .56s cubic-bezier(.33,0,.83,1) 1.16s both;animation:cube7 .56s cubic-bezier(.33,0,.83,1) 1.16s both}@-webkit-keyframes cube7{0%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(378px,0,0);transform:translate3d(378px,0,0)}57%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}58%{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}to{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes cube7{0%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(378px,0,0);transform:translate3d(378px,0,0)}57%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}58%{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}to{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translateZ(0);transform:translateZ(0)}}.cube-col--anime:nth-child(8) .cube-item-wrap{-webkit-animation:cube8 .56s cubic-bezier(.33,0,.83,1) 1.28s both;animation:cube8 .56s cubic-bezier(.33,0,.83,1) 1.28s both}@-webkit-keyframes cube8{0%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(205px,0,0);transform:translate3d(205px,0,0)}57%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}58%{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}to{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes cube8{0%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(205px,0,0);transform:translate3d(205px,0,0)}57%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}58%{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}to{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translateZ(0);transform:translateZ(0)}}.cube-item-wrap{margin-bottom:16px}
|
|
5
|
+
*/.adjust-position{margin-top:-20px;margin-bottom:-20px}.header-wrap{position:relative;height:710px}.header-wrap .img-header{position:absolute;bottom:0;width:100%}.cube-item{height:90px;width:88px;border-radius:26px;overflow:hidden;position:relative;-webkit-transform:translateZ(0);transform:translateZ(0)}.cube-item:before{content:"";position:absolute;bottom:0;left:0;width:100%;height:60px;border-radius:0 0 26px 26px}.cube-item-box{height:63px;background:#fff;border-radius:26px 26px 11px 11px;background-size:cover;background-repeat:no-repeat}.cube-item-box,.cube-item .sub-name{width:100%;text-align:center;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);overflow:hidden}.cube-item .sub-name{top:63px;padding:0 10px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#fff;font-size:14px;line-height:27px;white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis}.cube-item .sub-image{display:block;width:60px;height:60px;margin:0 auto;background-color:#fff;background-position:50%;background-size:100%;-webkit-transform:translateY(6px);-ms-transform:translateY(6px);transform:translateY(6px)}.cube-item .sub-desc{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;width:77px;-webkit-box-sizing:border-box;box-sizing:border-box;height:15px;color:#fff;border-radius:6px;font-size:12px;text-align:center;position:absolute;bottom:29px;left:50%;-webkit-transform-origin:0 center;-ms-transform-origin:0 center;transform-origin:0 center;-webkit-transform:translate3d(-50%,0,1px);transform:translate3d(-50%,0,1px)}.cube-item .sub-desc span{width:100%;display:block;line-height:normal;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.cube-item--pic:before{background:url(https://img12.360buyimg.com/imagetools/jfs/t1/184083/34/6101/38841/60b065caEaaf7c5d0/eec4cd260f46d9f0.png) no-repeat 50%/100%;height:100%}.cube-item--pic .cube-item-box,.cube-item--pic .sub-desc,.cube-item--pic .sub-name{display:none}.cube-item--act:before{background:url(https://img11.360buyimg.com/imagetools/jfs/t1/195605/17/5252/39357/60b065caEe0aa4c7e/04a341f4e51c6a9b.png) no-repeat 50%/100%}.cube-item--act .sub-desc{background:#ff5c17}.cube-item--rank:before{background:url(https://img14.360buyimg.com/imagetools/jfs/t1/183388/37/6207/39741/60b065caEea1440a1/8860c63660fc9ac4.png) no-repeat 50%/100%}.cube-item--rank .sub-desc{background:#1f95fb}.cube-item--shop:before{background:url(https://img12.360buyimg.com/imagetools/jfs/t1/184083/34/6101/38841/60b065caEaaf7c5d0/eec4cd260f46d9f0.png) no-repeat 50%/100%}.cube-item--shop .sub-desc{background:#ffd01f}.cube-item--shop .sub-desc span{color:#000}.cube-item--lbs:before{background:url(https://img10.360buyimg.com/imagetools/jfs/t1/129094/23/18726/38672/60b065caEb849e8cb/da761e3ebae5bc84.png) no-repeat 50%/100%}.cube-item--lbs .sub-desc{background:#ffd01f}.cube-item--lbs .sub-desc span{color:#000}.cube-item--unread{-webkit-box-shadow:0 0 20px hsla(0,0%,100%,.2);box-shadow:0 0 20px hsla(0,0%,100%,.2);-webkit-animation:show 2s infinite;animation:show 2s infinite}.cube-item--special{background-size:cover;background-repeat:no-repeat}.cube-item--special .cube-item-box,.cube-item--special .sub-desc,.cube-item--special:before{display:none}@-webkit-keyframes show{0%{-webkit-box-shadow:0 0 20px hsla(0,0%,100%,.2);box-shadow:0 0 20px hsla(0,0%,100%,.2)}50%{-webkit-box-shadow:0 0 20px hsla(0,0%,100%,.5);box-shadow:0 0 20px hsla(0,0%,100%,.5)}to{-webkit-box-shadow:0 0 20px hsla(0,0%,100%,.2);box-shadow:0 0 20px hsla(0,0%,100%,.2)}}@keyframes show{0%{-webkit-box-shadow:0 0 20px hsla(0,0%,100%,.2);box-shadow:0 0 20px hsla(0,0%,100%,.2)}50%{-webkit-box-shadow:0 0 20px hsla(0,0%,100%,.5);box-shadow:0 0 20px hsla(0,0%,100%,.5)}to{-webkit-box-shadow:0 0 20px hsla(0,0%,100%,.2);box-shadow:0 0 20px hsla(0,0%,100%,.2)}}.cube-wrapper--inited .cube-col .cube-item .sub-image{-webkit-animation:cube-image .2s cubic-bezier(.33,0,.67,1) 1s forwards;animation:cube-image .2s cubic-bezier(.33,0,.67,1) 1s forwards}@-webkit-keyframes cube-image{0%{-webkit-transform:translateY(13px);transform:translateY(13px)}66%{-webkit-transform:translateY(-5px);transform:translateY(-5px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes cube-image{0%{-webkit-transform:translateY(13px);transform:translateY(13px)}66%{-webkit-transform:translateY(-5px);transform:translateY(-5px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}.cube{width:100%;z-index:10}.cube-container{width:100%;padding:15px 0;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;overflow:hidden}.cube-wrapper{width:100%;white-space:nowrap;-webkit-perspective:500px;perspective:500px;-webkit-animation-play-state:paused;animation-play-state:paused;-webkit-transition-property:all;-o-transition-property:all;transition-property:all;-webkit-transition-timing-function:cubic-bezier(.39,.575,.565,1);-o-transition-timing-function:cubic-bezier(.39,.575,.565,1);transition-timing-function:cubic-bezier(.39,.575,.565,1)}.cube-col{display:inline-block;width:25%;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:inherit;-o-transition:inherit;transition:inherit}.cube-col--anime:nth-child(5) .cube-item-wrap{-webkit-animation:cube5 .56s cubic-bezier(.33,0,.67,1) 1s both;animation:cube5 .56s cubic-bezier(.33,0,.67,1) 1s both}@-webkit-keyframes cube5{0%{-webkit-animation-timing-function:cubic-bezier(.33,0,.67,1);animation-timing-function:cubic-bezier(.33,0,.67,1);-webkit-transform:translate3d(733px,0,0);transform:translate3d(733px,0,0)}57%{-webkit-animation-timing-function:cubic-bezier(.33,0,.67,1);animation-timing-function:cubic-bezier(.33,0,.67,1);-webkit-transform:translate3d(-30px,0,0);transform:translate3d(-30px,0,0)}58%{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translate3d(-30px,0,0);transform:translate3d(-30px,0,0)}to{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes cube5{0%{-webkit-animation-timing-function:cubic-bezier(.33,0,.67,1);animation-timing-function:cubic-bezier(.33,0,.67,1);-webkit-transform:translate3d(733px,0,0);transform:translate3d(733px,0,0)}57%{-webkit-animation-timing-function:cubic-bezier(.33,0,.67,1);animation-timing-function:cubic-bezier(.33,0,.67,1);-webkit-transform:translate3d(-30px,0,0);transform:translate3d(-30px,0,0)}58%{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translate3d(-30px,0,0);transform:translate3d(-30px,0,0)}to{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translateZ(0);transform:translateZ(0)}}.cube-col--anime:nth-child(6) .cube-item-wrap{-webkit-animation:cube6 .56s cubic-bezier(.33,0,.83,1) 1.08s both;animation:cube6 .56s cubic-bezier(.33,0,.83,1) 1.08s both}@-webkit-keyframes cube6{0%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(554px,0,0);transform:translate3d(554px,0,0)}57%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}58%{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}to{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes cube6{0%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(554px,0,0);transform:translate3d(554px,0,0)}57%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}58%{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}to{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translateZ(0);transform:translateZ(0)}}.cube-col--anime:nth-child(7) .cube-item-wrap{-webkit-animation:cube7 .56s cubic-bezier(.33,0,.83,1) 1.16s both;animation:cube7 .56s cubic-bezier(.33,0,.83,1) 1.16s both}@-webkit-keyframes cube7{0%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(378px,0,0);transform:translate3d(378px,0,0)}57%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}58%{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}to{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes cube7{0%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(378px,0,0);transform:translate3d(378px,0,0)}57%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}58%{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}to{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translateZ(0);transform:translateZ(0)}}.cube-col--anime:nth-child(8) .cube-item-wrap{-webkit-animation:cube8 .56s cubic-bezier(.33,0,.83,1) 1.28s both;animation:cube8 .56s cubic-bezier(.33,0,.83,1) 1.28s both}@-webkit-keyframes cube8{0%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(205px,0,0);transform:translate3d(205px,0,0)}57%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}58%{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}to{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translateZ(0);transform:translateZ(0)}}@keyframes cube8{0%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(205px,0,0);transform:translate3d(205px,0,0)}57%{-webkit-animation-timing-function:cubic-bezier(.33,0,.83,1);animation-timing-function:cubic-bezier(.33,0,.83,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}58%{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translate3d(-20px,0,0);transform:translate3d(-20px,0,0)}to{-webkit-animation-timing-function:cubic-bezier(.17,0,.67,1);animation-timing-function:cubic-bezier(.17,0,.67,1);-webkit-transform:translateZ(0);transform:translateZ(0)}}.cube-item-wrap{margin-bottom:16px}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v2.3.
|
|
2
|
+
* @nutui/nutui v2.3.11 - magic.js, 73382f82a2742e2b1bc6, Mon Oct 17 2022 18:27:02 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2017-2020 JDC
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("magic",[],e):"object"==typeof exports?exports.magic=e():t.magic=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="./",n(n.s=158)}({0:function(t,e,n){"use strict";function i(t,e,n,i,r,a,o,s){var c,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=n,l._compiled=!0),i&&(l.functional=!0),a&&(l._scopeId="data-v-"+a),o?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},l._ssrRegister=c):r&&(c=s?function(){r.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:r),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(t,e){return c.call(e),u(t,e)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,c):[c]}return{exports:t,options:l}}n.d(e,"a",(function(){return i}))},13:function(t,e,n){var i=n(9);t.exports=function(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},154:function(t,e,n){},158:function(t,e,n){"use strict";n.r(e);var i=n(4),r=n.n(i),a={name:"CubeItem",props:{item:{type:Object,default:null}},data:function(){return{}},methods:{cubeClick:function(t){this.$emit("clickEvent",t)}}},o=n(0),s=Object(o.a)(a,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"cube-item cube-item--"+t.item.type,on:{click:function(e){return t.cubeClick(t.item)}}},[n("div",{staticClass:"cube-item-box"},[n("div",{staticClass:"sub-image",style:{backgroundImage:"url("+t.item.pictureUrl+")"}})]),t._v(" "),t.item.desc?n("div",{staticClass:"sub-desc"},[n("span",[t._v(t._s(t.item.desc))])]):t._e(),t._v(" "),t.item.name?n("div",{staticClass:"sub-name"},[n("span",[t._v(t._s(t.item.name))])]):t._e()])}),[],!1,null,null,null).exports;function c(t,e,n,i){return-n*(t/=i)*(t-2)+e}function l(t,e){var n=window.getComputedStyle(t,null),i=n.getPropertyValue("-webkit-"+e)||n.getPropertyValue("-moz-"+e)||n.getPropertyValue("-ms-"+e)||n.getPropertyValue("-o-"+e)||n.getPropertyValue(e);return i&&"none"!=i?i:null}var u={props:{dataMagic:{type:[Object,Array],default:null},type:{type:String,default:"rank"},overflow:{type:[String,Number],default:1.4,validator:function(t){return t>=1&&t<1.5}},autoplay:{type:Boolean,default:!1},interval:{type:[String,Number],default:3e3}},components:{CubeItem:s},data:function(){return{clone:4}},computed:{data_top:function(){return this.dataMagic.filter((function(t,e){return e%2==0}))},data_bottom:function(){return this.dataMagic.filter((function(t,e){return e%2==1}))}},watch:{autoplay:function(t){t?this.startPlay():this.clearPlayer()}},mounted:function(){var t=this;this.$nextTick((function(){t.canMove=!0,t.$wrapper=t.$refs.wrapper,t.$cubes=r()(t.$wrapper.children),t.ITEM_WIDTH=t.$wrapper.clientWidth/4,t.computeWidth={"-2":2*-t.ITEM_WIDTH,"-1":-t.ITEM_WIDTH,0:0,1:t.ITEM_WIDTH,2:2*t.ITEM_WIDTH,3:3*t.ITEM_WIDTH,4:4*t.ITEM_WIDTH,5:5*t.ITEM_WIDTH},t.current=t.clone,t.endX=-t.ITEM_WIDTH*t.current,t.offsetX=t.endX,t.$wrapper.style.transitionDuration=null,t.$cubes.forEach((function(t,e){t.style.transition&&(t.style.transition=null)})),t.setWrapper(t.endX),t.setCube(t.endX),t.$wrapper.style.webkitPerspectiveOrigin="".concat(t.current*t.ITEM_WIDTH+t.$wrapper.clientWidth/2,"px center"),setTimeout((function(){t.startPlay(),t.$wrapper.classList.add("cube-wrapper--inited")}),1e3),t.bindEvent()})),this.initWQVisibleEvent(),document.addEventListener("visibilitychange",(function(e){e.hidden?t.clearPlayer():t.startPlay()}))},methods:{clickEvent:function(t){this.$emit("clickItem",t)},bindEvent:function(){this.$wrapper.addEventListener("touchstart",this.touchStartHandler),this.$wrapper.addEventListener("touchmove",this.touchMoveHandler),this.$wrapper.addEventListener("touchend",this.touchEndHandler)},initWQVisibleEvent:function(){document.addEventListener("qbrowserVisibilityChange",(function(t){var e=document.createEvent("HTMLEvents");e.initEvent("visibilitychange",!1,!1),e.hidden=t.hidden,document.dispatchEvent(e)}),!0),document.addEventListener("visibilitychange",(function(t){t.hidden=void 0===t.hidden?document.hidden:t.hidden}),!0)},startPlay:function(){var t=this;this.autoplay&&(this.clearPlayer(),this.player=setInterval((function(){t.canMove=!0,t.goto(t.current+1,600,!0)}),this.interval))},clearPlayer:function(){clearInterval(this.player),this.player=null},touchStartHandler:function(t){this.canMove&&(this.clearPlayer(),this.touching=!0,this.$wrapper.style.transitionDuration,this.startX=t.touches[0].pageX,this.startY=t.touches[0].pageY,this.$wrapper.style.transitionDuration=null,this.$cubes.forEach((function(t,e){t.style.transition&&(t.style.transition=null)})))},touchMoveHandler:function(t){if(this.canMove&&this.touching){var e=t.touches[0].pageX-this.startX,n=t.touches[0].pageY-this.startY;if(Math.abs(n)>1.5*Math.abs(e)||t.cancelable&&t.preventDefault(),(e/=3)>0)this.direction=-1;else{if(!(e<0))return;this.direction=1}this.offsetX=e+this.endX;this.getMiddleRotate(e);this.setWrapper(this.offsetX),this.setCube(this.offsetX,this.offsetX>0?e:-e)}},touchEndHandler:function(t){if(this.canMove&&this.touching){var e,n=this.offsetX%this.ITEM_WIDTH*this.direction;((e=-(e=0==n?this.offsetX/this.ITEM_WIDTH:n>0&&n<this.ITEM_WIDTH*(3/4)||n<0&&n>=-this.ITEM_WIDTH*(1/4)?Math.ceil(this.offsetX/this.ITEM_WIDTH):Math.floor(this.offsetX/this.ITEM_WIDTH)))>=this.data_bottom.length+this.clone||e<=this.clone-1)&&(this.canMove=!1),this.goto(e,400),this.startPlay(),this.touching=!1}},continueTransition:function(){var t=l(this.$wrapper,"transform"),e=l(this.$wrapper,"perspective-origin");t&&this.$wrapper.style.transitionDuration&&(this.$wrapper.style.transform=t,this.$wrapper.style.perspectiveOrigin=e,this.$cubes.forEach((function(t){t.style.transform=l(t,"transform"),t.style.opacity=+l(t,"opacity"),t.style.transformOrigin=l(t,"transform-origin")})),this.endX=0)},setWrapper:function(t,e,n){var i=this;this.offsetX=t,e>0&&(this.$wrapper.style.transitionDuration="".concat(e,"ms")),n?setTimeout((function(){i.$wrapper.style.transform="translate3d(".concat(t,"px, 0, 0)")}),0):this.$wrapper.style.transform="translate3d(".concat(t,"px, 0, 0)")},setCube:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.$cubes.forEach((function(i,r){i.style.transition&&(i.style.transition=null);var a=r*e.ITEM_WIDTH+t;if(a>e.computeWidth[-1]&&a<e.computeWidth[0]){var o=c(a%e.ITEM_WIDTH,0,-e.ITEM_WIDTH,-e.ITEM_WIDTH);i.style.transform="rotateY(".concat(e.getBetweenRotate(a),"deg) translate3d(0, ").concat(e.getTranslate(a),"px, 0)"),i.style.opacity=e.getOpacity(o)}else if(a>e.computeWidth[3]&&a<e.computeWidth[4]){var s=c(a%e.ITEM_WIDTH,0,e.ITEM_WIDTH,e.ITEM_WIDTH);i.style.transform="rotateY(".concat(e.getBetweenRotate(a),"deg) translate3d(0, ").concat(e.getTranslate(a),"px, 0)"),i.style.opacity=e.getOpacity(s)}else a>=e.computeWidth[4]&&a<e.computeWidth[5]?(i.style.transform="rotateY(60deg) translate3d(0, ".concat(e.getTranslate(a),"px, 0)"),i.style.opacity=0):a>e.computeWidth[-2]&&a<=e.computeWidth[-1]?(i.style.transform="rotateY(-60deg) translate3d(0, ".concat(e.getTranslate(a),"px, 0)"),i.style.opacity=0):a>=e.computeWidth[0]&&a<=e.computeWidth[3]&&(i.style.transform="rotateY(".concat(e.getMiddleRotate(n),"deg) translate3d(0, ").concat(e.getTranslate(a),"px, 0)"),i.style.opacity=1);i.style.transformOrigin=e.getTransformOrigin(a)}))},getTransformOrigin:function(t,e){if(t>=this.computeWidth[-1]&&t<=this.computeWidth[4]){var n=this.ITEM_WIDTH-t/3;return n<this.computeWidth[0]?n=this.computeWidth[0]:n>this.computeWidth[1]&&(n=this.computeWidth[1]),"".concat(n,"px center")}},getBetweenRotate:function(t){return t%this.ITEM_WIDTH*(360/this.$wrapper.clientWidth)*70/90},getMiddleRotate:function(t){var e=.35;return t>5*this.ITEM_WIDTH/10?.35*(this.ITEM_WIDTH-t):t<5*-this.ITEM_WIDTH/10?-.35*(this.ITEM_WIDTH+t):e*t},getOpacity:function(t){return 1-Math.abs(t)/this.ITEM_WIDTH%1},getTranslate:function(t){return t>this.computeWidth[2]?t>this.computeWidth[3]?(this.computeWidth[3]-t)/5:(this.computeWidth[3]-t)/7:t<this.computeWidth[1]?t<0?t/5:t/7:this.ITEM_WIDTH/7},transitionEndHandler:function(t){var e=this;t.target===this.$wrapper&&(this.$wrapper.style.transitionDuration=null,this.$cubes.forEach((function(t,e){t.style.transition&&(t.style.transition=null)})),this.$wrapper.style.webkitPerspectiveOrigin="".concat(this.current*this.ITEM_WIDTH+this.$wrapper.clientWidth/2,"px center"),this.current>=this.data_bottom.length+this.clone?(this.goto(this.current%this.data_bottom.length,0),setTimeout((function(){e.canMove=!0}),0)):this.current<=this.clone-1&&(this.goto(this.data_bottom.length+this.current,0),setTimeout((function(){e.canMove=!0}),0)))},goto:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:400,i=arguments.length>2?arguments[2]:void 0,r=i?t-.5:t;this.$wrapper.style.webkitPerspectiveOrigin="".concat(r*this.ITEM_WIDTH+this.$wrapper.clientWidth/2,"px center"),this.current=t,this.endX=-t*this.ITEM_WIDTH,n?(this.setWrapper(this.endX,n),this.$cubes.forEach((function(r,a){var o=a*e.ITEM_WIDTH+e.endX;r.style.transformOrigin=e.getTransformOrigin(o),t-1==a?(r.style.transition="all ".concat(n,"ms cubic-bezier(0.215, 0.610, 0.355, 1.000)"),r.style.transform="rotateY(-60deg) translate3d(0, ".concat(e.getTranslate(r.offsetLeft+e.endX),"px, 0)"),r.style.opacity=0):t+4==a?(r.style.transition="all ".concat(n,"ms cubic-bezier(0.215, 0.610, 0.355, 1.000)"),r.style.transform="rotateY(60deg) translate3d(0, ".concat(e.getTranslate(r.offsetLeft+e.endX),"px, 0)"),r.style.opacity=0):a>t-1&&a<t+4?(r.style.transition=i?"transform ".concat(n,"ms cubic-bezier(0.22, 0.01, 0.68, 1.00), opacity ").concat(.9*n,"ms cubic-bezier(0.62, 0.02, 0.68, 1.00)"):"all ".concat(n,"ms cubic-bezier(0.390, 0.575, 0.565, 1.000)"),r.style.transform="rotateY(0.1deg) translate3d(0, ".concat(e.getTranslate(r.offsetLeft+e.endX),"px, 0)"),r.style.opacity=1):(r.style.transition=null,r.style.transform=null,r.style.opacity=null,r.style.transformOrigin=null)}))):(this.$wrapper.style.transitionDuration=null,this.$wrapper.style.transitionDuration=null,this.$cubes.forEach((function(t,e){t.style.transition&&(t.style.transition=null)})),this.setCube(this.endX,0),this.setWrapper(this.endX,0,!0))}}},p=Object(o.a)(u,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"cube"},[n("div",{ref:"container",staticClass:"adjust-position cube-container"},[n("div",{ref:"wrapper",staticClass:"cube-wrapper",on:{transitionend:t.transitionEndHandler}},[t._l(t.clone,(function(e){return n("div",{key:"clone-prev-"+e,staticClass:"cube-col"},[n("CubeItem",{staticClass:"cube-item-wrap",attrs:{item:t.data_top[e+t.data_bottom.length-t.clone-1]},on:{clickEvent:t.clickEvent}}),t._v(" "),n("CubeItem",{staticClass:"cube-item-wrap",attrs:{item:t.data_bottom[e+t.data_bottom.length-t.clone-1]},on:{clickEvent:t.clickEvent}})],1)})),t._v(" "),t._l(t.data_bottom,(function(e,i){return n("div",{key:i,staticClass:"cube-col cube-col--anime"},[n("CubeItem",{staticClass:"cube-item-wrap",attrs:{item:t.data_top[i]},on:{clickEvent:t.clickEvent}}),t._v(" "),n("CubeItem",{staticClass:"cube-item-wrap",attrs:{item:t.data_bottom[i]},on:{clickEvent:t.clickEvent}})],1)})),t._v(" "),t._l(t.data_bottom.slice(0,t.clone),(function(e,i){return n("div",{key:"clone-next-"+i,staticClass:"cube-col"},[n("CubeItem",{staticClass:"cube-item-wrap",attrs:{item:t.data_top[i]},on:{clickEvent:t.clickEvent}}),t._v(" "),n("CubeItem",{staticClass:"cube-item-wrap",attrs:{item:t.data_bottom[i]},on:{clickEvent:t.clickEvent}})],1)}))],2)])])}),[],!1,null,null,null).exports,d={name:"nut-magic",components:{Cube:p},props:{data:{type:[Object,Array],default:function(){return[]}},type:{type:String,default:"rank"},autoplay:{default:!0}},computed:{},data:function(){return{}},watch:{data:function(t,e){}},methods:{clickItem:function(t){this.$emit("click",t)}}},h=Object(o.a)(d,(function(){var t=this.$createElement,e=this._self._c||t;return this.data&&this.data.length>=8?e("Cube",{attrs:{dataMagic:this.data,type:this.type,autoplay:this.autoplay},on:{clickItem:this.clickItem}}):this._e()}),[],!1,null,"601c4726",null).exports;n(154);h.install=function(t){t.component(h.name,h),t.component("Cube",p),t.component("CubeItem",s)};e.default=h},4:function(t,e,n){var i=n(46),r=n(47),a=n(13),o=n(48);t.exports=function(t){return i(t)||r(t)||a(t)||o()},t.exports.default=t.exports,t.exports.__esModule=!0},46:function(t,e,n){var i=n(9);t.exports=function(t){if(Array.isArray(t))return i(t)},t.exports.default=t.exports,t.exports.__esModule=!0},47:function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.default=t.exports,t.exports.__esModule=!0},48:function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},9:function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i},t.exports.default=t.exports,t.exports.__esModule=!0}})}));
|
|
6
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("magic",[],e):"object"==typeof exports?exports.magic=e():t.magic=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="./",n(n.s=158)}({0:function(t,e,n){"use strict";function i(t,e,n,i,r,a,o,s){var c,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=n,l._compiled=!0),i&&(l.functional=!0),a&&(l._scopeId="data-v-"+a),o?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},l._ssrRegister=c):r&&(c=s?function(){r.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:r),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(t,e){return c.call(e),u(t,e)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,c):[c]}return{exports:t,options:l}}n.d(e,"a",(function(){return i}))},13:function(t,e,n){var i=n(9);t.exports=function(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports},154:function(t,e,n){},158:function(t,e,n){"use strict";n.r(e);var i=n(4),r=n.n(i),a={name:"CubeItem",props:{item:{type:Object,default:null}},data:function(){return{}},methods:{cubeClick:function(t){this.$emit("clickEvent",t)}}},o=n(0),s=Object(o.a)(a,(function(){var t=this,e=t._self._c;return e("div",{class:"cube-item cube-item--"+t.item.type,on:{click:function(e){return t.cubeClick(t.item)}}},[e("div",{staticClass:"cube-item-box"},[e("div",{staticClass:"sub-image",style:{backgroundImage:`url(${t.item.pictureUrl})`}})]),t._v(" "),t.item.desc?e("div",{staticClass:"sub-desc"},[e("span",[t._v(t._s(t.item.desc))])]):t._e(),t._v(" "),t.item.name?e("div",{staticClass:"sub-name"},[e("span",[t._v(t._s(t.item.name))])]):t._e()])}),[],!1,null,null,null).exports;function c(t,e,n,i){return-n*(t/=i)*(t-2)+e}function l(t,e){var n=window.getComputedStyle(t,null),i=n.getPropertyValue("-webkit-"+e)||n.getPropertyValue("-moz-"+e)||n.getPropertyValue("-ms-"+e)||n.getPropertyValue("-o-"+e)||n.getPropertyValue(e);return i&&"none"!=i?i:null}var u={props:{dataMagic:{type:[Object,Array],default:null},type:{type:String,default:"rank"},overflow:{type:[String,Number],default:1.4,validator:function(t){return t>=1&&t<1.5}},autoplay:{type:Boolean,default:!1},interval:{type:[String,Number],default:3e3}},components:{CubeItem:s},data:function(){return{clone:4}},computed:{data_top:function(){return this.dataMagic.filter((function(t,e){return e%2==0}))},data_bottom:function(){return this.dataMagic.filter((function(t,e){return e%2==1}))}},watch:{autoplay:function(t){t?this.startPlay():this.clearPlayer()}},mounted:function(){var t=this;this.$nextTick((function(){t.canMove=!0,t.$wrapper=t.$refs.wrapper,t.$cubes=r()(t.$wrapper.children),t.ITEM_WIDTH=t.$wrapper.clientWidth/4,t.computeWidth={"-2":2*-t.ITEM_WIDTH,"-1":-t.ITEM_WIDTH,0:0,1:t.ITEM_WIDTH,2:2*t.ITEM_WIDTH,3:3*t.ITEM_WIDTH,4:4*t.ITEM_WIDTH,5:5*t.ITEM_WIDTH},t.current=t.clone,t.endX=-t.ITEM_WIDTH*t.current,t.offsetX=t.endX,t.$wrapper.style.transitionDuration=null,t.$cubes.forEach((function(t,e){t.style.transition&&(t.style.transition=null)})),t.setWrapper(t.endX),t.setCube(t.endX),t.$wrapper.style.webkitPerspectiveOrigin="".concat(t.current*t.ITEM_WIDTH+t.$wrapper.clientWidth/2,"px center"),setTimeout((function(){t.startPlay(),t.$wrapper.classList.add("cube-wrapper--inited")}),1e3),t.bindEvent()})),this.initWQVisibleEvent(),document.addEventListener("visibilitychange",(function(e){e.hidden?t.clearPlayer():t.startPlay()}))},methods:{clickEvent:function(t){this.$emit("clickItem",t)},bindEvent:function(){this.$wrapper.addEventListener("touchstart",this.touchStartHandler),this.$wrapper.addEventListener("touchmove",this.touchMoveHandler),this.$wrapper.addEventListener("touchend",this.touchEndHandler)},initWQVisibleEvent:function(){document.addEventListener("qbrowserVisibilityChange",(function(t){var e=document.createEvent("HTMLEvents");e.initEvent("visibilitychange",!1,!1),e.hidden=t.hidden,document.dispatchEvent(e)}),!0),document.addEventListener("visibilitychange",(function(t){t.hidden=void 0===t.hidden?document.hidden:t.hidden}),!0)},startPlay:function(){var t=this;this.autoplay&&(this.clearPlayer(),this.player=setInterval((function(){t.canMove=!0,t.goto(t.current+1,600,!0)}),this.interval))},clearPlayer:function(){clearInterval(this.player),this.player=null},touchStartHandler:function(t){this.canMove&&(this.clearPlayer(),this.touching=!0,this.$wrapper.style.transitionDuration,this.startX=t.touches[0].pageX,this.startY=t.touches[0].pageY,this.$wrapper.style.transitionDuration=null,this.$cubes.forEach((function(t,e){t.style.transition&&(t.style.transition=null)})))},touchMoveHandler:function(t){if(this.canMove&&this.touching){var e=t.touches[0].pageX-this.startX,n=t.touches[0].pageY-this.startY;if(Math.abs(n)>1.5*Math.abs(e)||t.cancelable&&t.preventDefault(),(e/=3)>0)this.direction=-1;else{if(!(e<0))return;this.direction=1}this.offsetX=e+this.endX;this.getMiddleRotate(e);this.setWrapper(this.offsetX),this.setCube(this.offsetX,this.offsetX>0?e:-e)}},touchEndHandler:function(t){if(this.canMove&&this.touching){var e,n=this.offsetX%this.ITEM_WIDTH*this.direction;((e=-(e=0==n?this.offsetX/this.ITEM_WIDTH:n>0&&n<this.ITEM_WIDTH*(3/4)||n<0&&n>=-this.ITEM_WIDTH*(1/4)?Math.ceil(this.offsetX/this.ITEM_WIDTH):Math.floor(this.offsetX/this.ITEM_WIDTH)))>=this.data_bottom.length+this.clone||e<=this.clone-1)&&(this.canMove=!1),this.goto(e,400),this.startPlay(),this.touching=!1}},continueTransition:function(){var t=l(this.$wrapper,"transform"),e=l(this.$wrapper,"perspective-origin");t&&this.$wrapper.style.transitionDuration&&(this.$wrapper.style.transform=t,this.$wrapper.style.perspectiveOrigin=e,this.$cubes.forEach((function(t){t.style.transform=l(t,"transform"),t.style.opacity=+l(t,"opacity"),t.style.transformOrigin=l(t,"transform-origin")})),this.endX=0)},setWrapper:function(t,e,n){var i=this;this.offsetX=t,e>0&&(this.$wrapper.style.transitionDuration="".concat(e,"ms")),n?setTimeout((function(){i.$wrapper.style.transform="translate3d(".concat(t,"px, 0, 0)")}),0):this.$wrapper.style.transform="translate3d(".concat(t,"px, 0, 0)")},setCube:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.$cubes.forEach((function(i,r){i.style.transition&&(i.style.transition=null);var a=r*e.ITEM_WIDTH+t;if(a>e.computeWidth[-1]&&a<e.computeWidth[0]){var o=c(a%e.ITEM_WIDTH,0,-e.ITEM_WIDTH,-e.ITEM_WIDTH);i.style.transform="rotateY(".concat(e.getBetweenRotate(a),"deg) translate3d(0, ").concat(e.getTranslate(a),"px, 0)"),i.style.opacity=e.getOpacity(o)}else if(a>e.computeWidth[3]&&a<e.computeWidth[4]){var s=c(a%e.ITEM_WIDTH,0,e.ITEM_WIDTH,e.ITEM_WIDTH);i.style.transform="rotateY(".concat(e.getBetweenRotate(a),"deg) translate3d(0, ").concat(e.getTranslate(a),"px, 0)"),i.style.opacity=e.getOpacity(s)}else a>=e.computeWidth[4]&&a<e.computeWidth[5]?(i.style.transform="rotateY(60deg) translate3d(0, ".concat(e.getTranslate(a),"px, 0)"),i.style.opacity=0):a>e.computeWidth[-2]&&a<=e.computeWidth[-1]?(i.style.transform="rotateY(-60deg) translate3d(0, ".concat(e.getTranslate(a),"px, 0)"),i.style.opacity=0):a>=e.computeWidth[0]&&a<=e.computeWidth[3]&&(i.style.transform="rotateY(".concat(e.getMiddleRotate(n),"deg) translate3d(0, ").concat(e.getTranslate(a),"px, 0)"),i.style.opacity=1);i.style.transformOrigin=e.getTransformOrigin(a)}))},getTransformOrigin:function(t,e){if(t>=this.computeWidth[-1]&&t<=this.computeWidth[4]){var n=this.ITEM_WIDTH-t/3;return n<this.computeWidth[0]?n=this.computeWidth[0]:n>this.computeWidth[1]&&(n=this.computeWidth[1]),"".concat(n,"px center")}},getBetweenRotate:function(t){return t%this.ITEM_WIDTH*(360/this.$wrapper.clientWidth)*70/90},getMiddleRotate:function(t){var e=.35;return t>5*this.ITEM_WIDTH/10?.35*(this.ITEM_WIDTH-t):t<5*-this.ITEM_WIDTH/10?-.35*(this.ITEM_WIDTH+t):e*t},getOpacity:function(t){return 1-Math.abs(t)/this.ITEM_WIDTH%1},getTranslate:function(t){return t>this.computeWidth[2]?t>this.computeWidth[3]?(this.computeWidth[3]-t)/5:(this.computeWidth[3]-t)/7:t<this.computeWidth[1]?t<0?t/5:t/7:this.ITEM_WIDTH/7},transitionEndHandler:function(t){var e=this;t.target===this.$wrapper&&(this.$wrapper.style.transitionDuration=null,this.$cubes.forEach((function(t,e){t.style.transition&&(t.style.transition=null)})),this.$wrapper.style.webkitPerspectiveOrigin="".concat(this.current*this.ITEM_WIDTH+this.$wrapper.clientWidth/2,"px center"),this.current>=this.data_bottom.length+this.clone?(this.goto(this.current%this.data_bottom.length,0),setTimeout((function(){e.canMove=!0}),0)):this.current<=this.clone-1&&(this.goto(this.data_bottom.length+this.current,0),setTimeout((function(){e.canMove=!0}),0)))},goto:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:400,i=arguments.length>2?arguments[2]:void 0,r=i?t-.5:t;this.$wrapper.style.webkitPerspectiveOrigin="".concat(r*this.ITEM_WIDTH+this.$wrapper.clientWidth/2,"px center"),this.current=t,this.endX=-t*this.ITEM_WIDTH,n?(this.setWrapper(this.endX,n),this.$cubes.forEach((function(r,a){var o=a*e.ITEM_WIDTH+e.endX;r.style.transformOrigin=e.getTransformOrigin(o),t-1==a?(r.style.transition="all ".concat(n,"ms cubic-bezier(0.215, 0.610, 0.355, 1.000)"),r.style.transform="rotateY(-60deg) translate3d(0, ".concat(e.getTranslate(r.offsetLeft+e.endX),"px, 0)"),r.style.opacity=0):t+4==a?(r.style.transition="all ".concat(n,"ms cubic-bezier(0.215, 0.610, 0.355, 1.000)"),r.style.transform="rotateY(60deg) translate3d(0, ".concat(e.getTranslate(r.offsetLeft+e.endX),"px, 0)"),r.style.opacity=0):a>t-1&&a<t+4?(r.style.transition=i?"transform ".concat(n,"ms cubic-bezier(0.22, 0.01, 0.68, 1.00), opacity ").concat(.9*n,"ms cubic-bezier(0.62, 0.02, 0.68, 1.00)"):"all ".concat(n,"ms cubic-bezier(0.390, 0.575, 0.565, 1.000)"),r.style.transform="rotateY(0.1deg) translate3d(0, ".concat(e.getTranslate(r.offsetLeft+e.endX),"px, 0)"),r.style.opacity=1):(r.style.transition=null,r.style.transform=null,r.style.opacity=null,r.style.transformOrigin=null)}))):(this.$wrapper.style.transitionDuration=null,this.$wrapper.style.transitionDuration=null,this.$cubes.forEach((function(t,e){t.style.transition&&(t.style.transition=null)})),this.setCube(this.endX,0),this.setWrapper(this.endX,0,!0))}}},p=Object(o.a)(u,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"cube"},[e("div",{ref:"container",staticClass:"adjust-position cube-container"},[e("div",{ref:"wrapper",staticClass:"cube-wrapper",on:{transitionend:t.transitionEndHandler}},[t._l(t.clone,(function(n){return e("div",{key:"clone-prev-"+n,staticClass:"cube-col"},[e("CubeItem",{staticClass:"cube-item-wrap",attrs:{item:t.data_top[n+t.data_bottom.length-t.clone-1]},on:{clickEvent:t.clickEvent}}),t._v(" "),e("CubeItem",{staticClass:"cube-item-wrap",attrs:{item:t.data_bottom[n+t.data_bottom.length-t.clone-1]},on:{clickEvent:t.clickEvent}})],1)})),t._v(" "),t._l(t.data_bottom,(function(n,i){return e("div",{key:i,staticClass:"cube-col cube-col--anime"},[e("CubeItem",{staticClass:"cube-item-wrap",attrs:{item:t.data_top[i]},on:{clickEvent:t.clickEvent}}),t._v(" "),e("CubeItem",{staticClass:"cube-item-wrap",attrs:{item:t.data_bottom[i]},on:{clickEvent:t.clickEvent}})],1)})),t._v(" "),t._l(t.data_bottom.slice(0,t.clone),(function(n,i){return e("div",{key:"clone-next-"+i,staticClass:"cube-col"},[e("CubeItem",{staticClass:"cube-item-wrap",attrs:{item:t.data_top[i]},on:{clickEvent:t.clickEvent}}),t._v(" "),e("CubeItem",{staticClass:"cube-item-wrap",attrs:{item:t.data_bottom[i]},on:{clickEvent:t.clickEvent}})],1)}))],2)])])}),[],!1,null,null,null).exports,d={name:"nut-magic",components:{Cube:p},props:{data:{type:[Object,Array],default:function(){return[]}},type:{type:String,default:"rank"},autoplay:{default:!0}},computed:{},data:function(){return{}},watch:{data:function(t,e){}},methods:{clickItem:function(t){this.$emit("click",t)}}},h=Object(o.a)(d,(function(){var t=this._self._c;return this.data&&this.data.length>=8?t("Cube",{attrs:{dataMagic:this.data,type:this.type,autoplay:this.autoplay},on:{clickItem:this.clickItem}}):this._e()}),[],!1,null,"601c4726",null).exports;n(154);h.install=function(t){t.component(h.name,h),t.component("Cube",p),t.component("CubeItem",s)};e.default=h},4:function(t,e,n){var i=n(46),r=n(47),a=n(13),o=n(48);t.exports=function(t){return i(t)||r(t)||a(t)||o()},t.exports.__esModule=!0,t.exports.default=t.exports},46:function(t,e,n){var i=n(9);t.exports=function(t){if(Array.isArray(t))return i(t)},t.exports.__esModule=!0,t.exports.default=t.exports},47:function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},48:function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},9:function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i},t.exports.__esModule=!0,t.exports.default=t.exports}})}));
|
|
7
7
|
//# sourceMappingURL=magic.js.map
|