<template>
	<view class="demo-block">
		<text class="demo-block__title-text ultra">遮罩层</text>
		<text class="demo-block__desc-text">通过遮罩层，可以强调部分内容</text>	
		<view class="demo-block__body">
			<view class="demo-block">
				<text class="demo-block__title-text">基础使用</text>
				<view class="demo-block__body">
					<button @click="onClick">显示</button>
					<l-overlay :visible="show" @click="onClick"></l-overlay>
				</view>	
			</view>	
			<view class="demo-block">
				<text class="demo-block__title-text">嵌入内容</text>
				<view class="demo-block__body">
					<button @click="show2 = true">显示</button>
					<l-overlay :visible="show2" @click="show2 = !show2">
						<view class="wrapper">
						    <view class="block" />
						</view>
					</l-overlay>
				</view>	
			</view>	
		</view>	
	</view>
</template>
<script lang="uts" setup>
	const show = ref(false);
	const show2 = ref(false);
	const onClick = () => {
		show.value = !show.value
	}
</script>
<style lang="scss">
	$card-bg-color: var(--doc-card-bg-color, white);
	// $page-bg-color: var(--doc-page-bg-color, #f5f5f5);
	$title-color: var(--doc-title-color, #000000E6);
	$summary-color: var(--doc-summary-color, #00000099);
	
	
	.wrapper {
	    display: flex;
	    align-items: center;
	    justify-content: center;
	    height: 100%;
	}
	
	.block {
	    width: 120px;
	    height: 120px;
	    background-color: $card-bg-color;
	}
	.demo-block {
		margin: 32px 20px 0;
		overflow: visible;
		&__title {
			margin: 0;
			margin-top: 8px;
			&-text {
				color: $summary-color;
				font-weight: 400;
				font-size: 14px;
				line-height: 16px;
				
				&.large {
					color: $title-color;
					font-size: 18px;
					font-weight: 700;
					line-height: 26px;
				}
				&.ultra {
					color: $title-color;
					font-size: 24px;
					font-weight: 700;
					line-height: 32px;
				}
			}
		}
		&__desc-text {
			color: $summary-color;
			margin: 8px 16px 0 0;
			font-size: 14px;
			line-height: 22px;
		}
		&__body {
			margin: 16px 0;
			overflow: visible;
			.demo-block {
				// margin-top: 0px;
				margin: 0;
			}
		}
	}
</style>
