首页 » 99链接平台 » 前端css学习:实现图片动画剪辑的一些简单的效果(代码)(明度效果动画剪辑设置)

前端css学习:实现图片动画剪辑的一些简单的效果(代码)(明度效果动画剪辑设置)

雨夜梧桐 2024-11-17 17:35:53 0

扫一扫用手机浏览

文章目录 [+]

前端css学习:实现图片动画剪辑的一些简单的效果

https://www.ixigua.com/i7008117700752835104/

代码:

前端css学习:实现图片动画剪辑的一些简单的效果(代码)(明度效果动画剪辑设置) 99链接平台
(图片来自网络侵删)

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title></title> <style type="text/css"> .box { width: 750px; height: 520px; margin: 50px auto; background-image: url(罪业狂屠-暖心女仆.jpg); position: relative; / 溢出隐藏 / overflow: hidden; / 设置视距,作用于3D转换的子元素 / perspective: 500px; } .box img { / 设置图片位置 / position: absolute; top: 0; left: 0; } .img1 { z-index: 100; / 动画 / animation: image1 2s linear 1s; / 让动画停留在最后一帧,不回到开始处 / animation-fill-mode: forwards; } @keyframes image1 { 0% { transform: scale(1); } 50% { / 缩放,缩小 / transform: scale(0.5); / 设置不透明度 / opacity: 1; } 100% { transform: scale(0.0001); opacity: 0; } } .img2 { z-index: 99; animation: image2 2s linear 3s; animation-fill-mode: forwards; } @keyframes image2 { 0% { transform: scale(1); } 50% { / 放大 / transform: scale(1.5); / 设置不透明度 / opacity: 1; } 100% { transform: scale(5); opacity: 0; } } .img3 { z-index: 98; animation: image3 2s linear 5s; animation-fill-mode: forwards; } @keyframes image3 { 0% { transform: translateX(0); } 50% { / 移动,向X轴 / transform: translateX(200px); opacity: 1; } 100% { transform: translateX(400px); opacity: 0; } } .img4 { z-index: 97; animation: image4 2s linear 7s; animation-fill-mode: forwards; } @keyframes image4 { 0% { transform: translateY(0); } 50% { / 移动,向Y轴 / transform: translateY(200px); opacity: 1; } 100% { transform: translateY(400px); opacity: 0; } } .img5 { z-index: 96; animation: image5 2s linear 9s; animation-fill-mode: forwards; } @keyframes image5 { 0% { transform: translateZ(0); } 50% { / 移动,向Z轴 / transform: translateZ(-200px); opacity: 1; } 100% { transform: translateZ(-1000px); opacity: 0; } } .img6 { z-index: 95; animation: image6 2s linear 11s; animation-fill-mode: forwards; } @keyframes image6 { 0% { transform: translate(0,0); } 50% { / 移动xy / transform: translate(300px,300px); opacity: 1; } 100% { transform: translate(-300px,-300px); opacity: 0; } } .img7 { z-index: 94; animation: image7 2s linear 13s; animation-fill-mode: forwards; } @keyframes image7 { 0% { transform: translate3d(0,0,0) } 50% { / 移动xyz / transform: translate3d(300px,-300px,-1000px); opacity: 1; } 100% { transform: translate3d(-900px,900px,-1500px); opacity: 0; } } .img8 { z-index: 93; animation: image8 2s linear 15s; animation-fill-mode: forwards; } @keyframes image8 { 0% { transform: scale(1); } 50% { / 放大 / transform: scale(1.5); opacity: 2; } 100% { / 缩小 / transform: scale(0.5); opacity: 0; } } .img9 { z-index: 92; animation: image9 2s linear 17s; animation-fill-mode: forwards; } @keyframes image9 { 0% { transform: rotate(0deg); } 50% { / 旋转 / transform: rotate(180deg); opacity: 1; } 100% { transform: rotate(360deg); opacity: 0; } } .img10 { z-index: 91; animation: image10 2s linear 19s; animation-fill-mode: forwards; } @keyframes image10 { 0% { / 旋转 缩放 / transform: rotate(0deg) scale(1); } 50% { transform: rotate(-180deg) scale(0.5); opacity: 1; } 100% { transform: rotate(-360deg) scale(0.0001); opacity: 0; } } .img11 { z-index: 90; animation: image11 2s linear 21s; animation-fill-mode: forwards; } @keyframes image11 { 0% { / 位移 / transform: translate(0,0) skewX(0deg); } 50% { transform: translate(100px,-100px) skewX(45deg); opacity: 1; } 100% { transform: translate(-100px,-200px) skewX(75deg); opacity: 0; } } </style></head><body> <div class="box"> <img class="img1" src="阿修罗.jpg" alt="" /> <img class="img2" src="埃及艳后.jpg" alt="" /> <img class="img3" src="暗精灵.jpg" alt="" /> <img class="img4" src="暗月猎手.jpg" alt="" /> <img class="img5" src="冰雪女王.jpg" alt="" /> <img class="img6" src="嫦娥.jpg" alt="" /> <img class="img7" src="炽焰火女.jpg" alt="" /> <img class="img8" src="大乔.jpg" alt="" /> <img class="img9" src="貂蝉.jpg" alt="" /> <img class="img10" src="宫本武藏.jpg" alt="" /> <img class="img11" src="红炎双刃.jpg" alt="" /> </div></body></html>

实现效果—视频链接:

前端css学习:实现图片动画剪辑的一些简单的效果

https://www.ixigua.com/i7008117700752835104/

标签:

相关文章

C语言,编程之旅的起点,学习之途的挑战

自古以来,编程语言便是计算机科学领域的一把钥匙,它打开了人类与计算机沟通的大门。而在众多的编程语言中,C语言以其简洁、高效、灵活等...

99链接平台 2024-12-27 阅读0 评论0

CSS3回旋之美,介绍动画的魔法魅力

在互联网飞速发展的今天,网页设计已成为衡量一个网站品质的重要标准。而CSS3回旋动画作为一种新兴的网页设计技术,以其独特的视觉效果...

99链接平台 2024-12-27 阅读0 评论0

C语言的诞生,编程世界的里程碑

自计算机问世以来,编程语言便应运而生。其中,C语言作为编程世界的里程碑,对计算机科学的发展产生了深远的影响。本文将回顾C语言的诞生...

99链接平台 2024-12-27 阅读0 评论0

湖南IT产业蓬勃发展,助力区域经济腾飞

随着我国经济的快速发展,信息技术产业已成为推动经济增长的重要引擎。近年来,湖南省积极拥抱信息化浪潮,以创新为驱动,大力发展IT产业...

99链接平台 2024-12-27 阅读0 评论0