123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- <script setup>
- const props = defineProps({
- loading: {
- type: Boolean,
- default: false
- },
- delayLoading: {
- type: Boolean,
- default: false
- },
- })
- </script>
- <template>
- <view class="chat-answer_loading" v-if="delayLoading">
- <view class="loading-circus-wrapper">
- <view class="loading-icon">
- <view class="loading-circus">
- <view class="la-ball-circus la-sm la-dark">
- <view class="item"></view>
- <view class="item"></view>
- <view class="item"></view>
- <view class="item"></view>
- <view class="item"></view>
- </view>
- </view>
- </view>
- <text class="loading-text">
- <slot></slot>
- </text>
- </view>
- </view>
- </template>
- <style lang="scss" scoped>
- .loading-circus-wrapper {
- display: flex;
- align-items: center;
- .loading-icon {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 68rpx;
- height: 68rpx;
- border: 1px solid #A8D3F1;
- border-radius: 50%;
- }
- .loading-text {
- padding: 0 20rpx;
- font-size: 28rpx;
- font-weight: bold;
- color: #666;
- }
- }
- .la-ball-circus,
- .la-ball-circus>.item {
- position: relative;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- }
- .la-ball-circus {
- display: block;
- font-size: 0;
- color: #fff;
- }
- .la-ball-circus.la-dark {
- color: #333;
- }
- .la-ball-circus>.item {
- display: inline-block;
- float: none;
- background-color: #007aff;
- border: 0 solid currentColor;
- }
- .la-ball-circus {
- width: 16px;
- height: 16px;
- }
- .la-ball-circus>.item {
- position: absolute;
- top: 0;
- left: -100%;
- display: block;
- width: 16px;
- width: 100%;
- height: 16px;
- height: 100%;
- border-radius: 100%;
- opacity: .5;
- -webkit-animation: ball-circus-position 2.5s infinite cubic-bezier(.25, 0, .75, 1), ball-circus-size 2.5s infinite cubic-bezier(.25, 0, .75, 1);
- -moz-animation: ball-circus-position 2.5s infinite cubic-bezier(.25, 0, .75, 1), ball-circus-size 2.5s infinite cubic-bezier(.25, 0, .75, 1);
- -o-animation: ball-circus-position 2.5s infinite cubic-bezier(.25, 0, .75, 1), ball-circus-size 2.5s infinite cubic-bezier(.25, 0, .75, 1);
- animation: ball-circus-position 2.5s infinite cubic-bezier(.25, 0, .75, 1), ball-circus-size 2.5s infinite cubic-bezier(.25, 0, .75, 1);
- }
- .la-ball-circus>.item:nth-child(1) {
- -webkit-animation-delay: 0s, -.5s;
- -moz-animation-delay: 0s, -.5s;
- -o-animation-delay: 0s, -.5s;
- animation-delay: 0s, -.5s;
- }
- .la-ball-circus>.item:nth-child(2) {
- -webkit-animation-delay: -.5s, -1s;
- -moz-animation-delay: -.5s, -1s;
- -o-animation-delay: -.5s, -1s;
- animation-delay: -.5s, -1s;
- }
- .la-ball-circus>.item:nth-child(3) {
- -webkit-animation-delay: -1s, -1.5s;
- -moz-animation-delay: -1s, -1.5s;
- -o-animation-delay: -1s, -1.5s;
- animation-delay: -1s, -1.5s;
- }
- .la-ball-circus>.item:nth-child(4) {
- -webkit-animation-delay: -1.5s, -2s;
- -moz-animation-delay: -1.5s, -2s;
- -o-animation-delay: -1.5s, -2s;
- animation-delay: -1.5s, -2s;
- }
- .la-ball-circus>.item:nth-child(5) {
- -webkit-animation-delay: -2s, -2.5s;
- -moz-animation-delay: -2s, -2.5s;
- -o-animation-delay: -2s, -2.5s;
- animation-delay: -2s, -2.5s;
- }
- .la-ball-circus.la-sm {
- width: 8px;
- height: 8px;
- }
- .la-ball-circus.la-sm>.item {
- width: 8px;
- height: 8px;
- }
- .la-ball-circus.la-2x {
- width: 32px;
- height: 32px;
- }
- .la-ball-circus.la-2x>.item {
- width: 32px;
- height: 32px;
- }
- .la-ball-circus.la-3x {
- width: 48px;
- height: 48px;
- }
- .la-ball-circus.la-3x>.item {
- width: 48px;
- height: 48px;
- }
- /*
- * Animations
- */
- @-webkit-keyframes ball-circus-position {
- 50% {
- left: 100%;
- }
- }
- @-moz-keyframes ball-circus-position {
- 50% {
- left: 100%;
- }
- }
- @-o-keyframes ball-circus-position {
- 50% {
- left: 100%;
- }
- }
- @keyframes ball-circus-position {
- 50% {
- left: 100%;
- }
- }
- @-webkit-keyframes ball-circus-size {
- 50% {
- -webkit-transform: scale(.3, .3);
- transform: scale(.3, .3);
- }
- }
- @-moz-keyframes ball-circus-size {
- 50% {
- -moz-transform: scale(.3, .3);
- transform: scale(.3, .3);
- }
- }
- @-o-keyframes ball-circus-size {
- 50% {
- -o-transform: scale(.3, .3);
- transform: scale(.3, .3);
- }
- }
- @keyframes ball-circus-size {
- 50% {
- -webkit-transform: scale(.3, .3);
- -moz-transform: scale(.3, .3);
- -o-transform: scale(.3, .3);
- transform: scale(.3, .3);
- }
- }
- </style>
|