<template>
	<view class="loader-all" v-if="show">
		<view class="loader"></view>
	</view>
</template>

<script>
	export default {
		props:{
			show:{
				type:Boolean,
				default: false
			}
		},
		data() {
			return {
			}
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	@keyframes animloader {
		0% {
		    transform:translateX(-100%) scale(0);
	    }
	    50% {
	        transform:translateX(0%) scale(1);
	    }
	    100% {
	        transform:translateX(100%) scale(0);
	    }
	}
	
	.loader-all{
		position: fixed;
		width: 100%;
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		top: 0;
		left: 0;
		background-color: rgba(255, 255, 255, 0.5);
		z-index: 9999;
	}
	
	.loader {
	  position: relative;
	  margin-top: -200rpx;
	  width: 48px;
	  height: 48px;
	
	    &::before, &::after {
	        content:'';
	        width: 100%;
	        height: 100%;
	        position: absolute;
	        top: 0;
	        left: 0;
	        border-radius: 50%;
	        background: linear-gradient(180deg, #a8f0ee 0%, #f0fdbf 100%);
	        transform:scale(0);
	        animation:animloader 1.5s infinite ease-in-out;
	    }
	
	    &::after {
	        animation-delay:0.75s;
	    }
	}
</style>
