如何制作CSS剪贴显示背景背景,而仅在剪裁的部分中应用动画?

问题描述 投票:0回答:1

您可以使用

::after
伪元素仅在框架内应用动画,以确保#Screen-Container's
clip-path
css animation css-animations clip clip-path
1个回答
0
投票

@keyframes expandCircle { 0% { clip-path: circle(0% at center); } 100% { clip-path: circle(100% at center); } } @keyframes melt { 0% { filter: blur(20px) contrast(400%) saturate(250%) brightness(125%); pointer-events: none; } 100% { filter: none; pointer-events: all; } } #screen-container { position: absolute; width: 100%; height: 100%; background-image: url("system/wallpaper/paint.bmp"); background-repeat: no-repeat; background-size: cover; background-color: #000000; } #clip-circle { position: absolute; width: 100%; height: 100%; clip-path: circle(0% at center); animation: expandCircle 3s forwards; overflow: hidden; } #clip-circle::after { content: ""; position: absolute; width: 100%; height: 100%; background-image: inherit; background-size: cover; clip-path: inherit; animation: melt 2s forwards; }


最新问题
© www.soinside.com 2019 - 2025. All rights reserved.