| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <template>
- <view class="grid-loader">
- <view class="cube"></view>
- <view class="cube"></view>
- <view class="cube"></view>
- <view class="cube"></view>
- <view class="cube"></view>
- <view class="cube"></view>
- <view class="cube"></view>
- <view class="cube"></view>
- <view class="cube"></view>
- </view>
- </template>
- <script>
- export default {
- name: 'ls-loading',
- data() {
- return {};
- },
- methods: {}
- };
- </script>
- <style lang="scss" scoped>
- /* From Uiverse.io by PriyanshuGupta28 */
- .grid-loader {
- display: grid;
- grid-template-columns: repeat(3, 1fr);
- gap: 8rpx;
- transform: rotate(45deg);
- opacity: 0;
- animation: fadeIn 0.5s ease-out forwards;
- margin-right: 20rpx;
- }
- @keyframes fadeIn {
- to {
- opacity: 1;
- }
- }
- .cube {
- width: 12rpx;
- height: 12rpx;
- background: #333;
- animation: cubeScale 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
- /* 新增颜色动画 */
- box-shadow: 0 0 15px rgba(205, 152, 61, 0.3);
- transform: scale(0);
- opacity: 0;
- }
- @keyframes cubeScale {
- 0% {
- transform: scale(0);
- opacity: 0;
- background: #333;
- /* 起始黑色 */
- }
- 50% {
- transform: scale(1);
- opacity: 1;
- background: #FFD700;
- /* 放大时变为金色 */
- }
- 100% {
- transform: scale(0);
- opacity: 0;
- background: #333;
- /* 缩回黑色 */
- }
- }
- /* Staggered animation delays */
- .cube:nth-child(1) {
- animation-delay: 0.2s;
- }
- .cube:nth-child(2) {
- animation-delay: 0.4s;
- }
- .cube:nth-child(3) {
- animation-delay: 0.6s;
- }
- .cube:nth-child(4) {
- animation-delay: 0.8s;
- }
- .cube:nth-child(5) {
- animation-delay: 1s;
- }
- .cube:nth-child(6) {
- animation-delay: 1.2s;
- }
- .cube:nth-child(7) {
- animation-delay: 1.4s;
- }
- .cube:nth-child(8) {
- animation-delay: 1.6s;
- }
- .cube:nth-child(9) {
- animation-delay: 1.8s;
- }
- </style>
|