1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
| .skt-basic { position: relative; overflow: hidden; border: none !important; background-color: transparent !important; background-image: none !important; transform: scale(1, 0.9); transform-origin: left top; }
.skt-main { &::after { content: ''; position: absolute; left: 0; top: 0; z-index: 9; width: 100%; height: 100%; background-color: #e6e6e6; display: block; }
&.yyt-sk-round::after { border-radius: 4rpx; } &:not(.yyt-sk-not-ani)::before { position: absolute; top: 0; width: 30%; height: 100%; content: ''; background: linear-gradient( to right, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100% ); transform: skewX(-45deg); z-index: 99; animation: skeleton-ani 1s ease infinite; display: block; } &.yyt-light { &::after { background-color: #f8fafc; } } }
// 骨架屏 .skt-loading { pointer-events: none; .skeleton, .skeleton-25, .skeleton-50, .skeleton-75 { .skt-basic(); .skt-main(); } .skeleton-25 { transform: scale(0.25, 0.9); } .skeleton-50 { transform: scale(0.5, 0.9); } .skeleton-75 { transform: scale(0.75, 0.9); } }
@keyframes skeleton-ani { from { left: -100%; } to { left: 150%; } }
|