web前端复习第九课

                                               2D特效平移

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		.box{
			width: 200px;
			height: 200px;
			background-color: skyblue;

			/*平移 ,可以为负值*/
			/*transform: translateX(20px) translateY(20px);*/
			/*简写的形式*/
			transform: translate(20px,50px);
		}
	</style>
</head>
<body>
	<div class="box">
		
	</div>
</body>
</html>

                                            2D特效缩放

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		.box{
			width: 200px;
			height: 200px;
			background-color: skyblue;
			margin: 100px auto;
			/*缩放*/
			/*取值范围0~1,超过1则放大,负值就是反向缩小,超过负一,则反向放大*/
			transform: scaleX(0.9) scaleY(0.5);
			/*简写形式*/
			transform: scale(0.5,0.5);
		}
	</style>
</head>
<body>
	<div class="box">
		hello word
	</div>
</body>
</html>

                                               2D特效旋转

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		.box{
			width: 200px;
			height: 200px;
			background-color: skyblue;
			margin: 100px auto;
			
			/*旋转*/
			/*transform: rotateX(45deg) rotateY(45deg);*/
			/*简写形式*/
			/*transform: rotate(40deg,0deg);*/
		
			transform: rotateZ(45deg);
	</style>
</head>
<body>
	<div class="box">
		hello word
	</div>
</body>
</html>

                                           2D特效倾斜

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		.box{
			width: 200px;
			height: 200px;
			background-color: skyblue;
			margin: 100px auto;
			
			/*倾斜*/
			transform: skewX(0deg) skewY(40deg);

			/*简写形式*/
			transform: skew(0deg,20deg);
		}
	</style>
</head>
<body>
	<div class="box">
		hello word
	</div>
</body>
</html>

                                                原点变换

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		.box{
			width: 200px;
			height: 200px;
			background-color: skyblue;
			margin: 100px auto;
			
			transform: rotateZ(0deg);

			/*原点变换*/
			/*可以用,top  left  right  bottom  center  改变变换的原点*/
			/*也可以用px值去表示*/
			/*也可以用百分比去表示*/
			transform-origin: 50% 75%;
		}
	</style>
</head>
<body>
	<div class="box">
		hello word
	</div>
</body>
</html>

                                               过渡效果

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		.box{
			width: 200px;
			height: 200px;
			background-color: skyblue;
			margin: 100px auto;
		}
		.box:hover{
			width: 1000px;
			height: 400px;
			background-color: red;
			/*先指定一下需要过渡的属性*/
			/*可以单独指定,多个中间用逗号分割,all代表所有属性*/
			transition-property: all;
			/*指定过渡持续时间*/
			transition-duration: 10s;
			/*指定过渡的效果*/
			transition-timing-function: cubic-bezier(0,1.84,1,-1.03);
			/*过渡开始之前的延迟时间*/
			transition-delay: 1s;

			/*简写形式*/
			transition: all 10s 1s;
						/*指定的需要过渡的属性,执行时间,执行开始的延迟时间*/
		}
	</style>
</head>
<body>
	<div class="box"></div>
</body>
</html>

                                                   动画

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		.box{
			width: 200px;
			height: 200px;
			background-color: red;
			/*定义动画的名称*/
			animation-name: myanimation;
			/*定义动画开始之前的延迟时间*/
			animation-delay: 1s;
			/*定义动画执行时间*/
			animation-duration: 5s;
			/*定义动画执行效果*/
			animation-timing-function: ease;
			/*定义动画的执行次数,可以用数字代替,执行几次,也可以用infinite无限执行*/
			animation-iteration-count: infinite;
			/*定义当前动画效果播放的方向*/
			animation-direction: alternate;
			/*定义动画开始之前或者播放之后进行的操作。*/
			/*animation-fill-mode: both;*/
			/*定义动画状态的  paused暂停   running播放*/
			animation-play-state: running;
		}

		@keyframes myanimation{
			0%{
				transform: translate(0px,0px) rotateZ(0deg);
				background-color: #f00;
			}
			25%{
				transform: translate(400px,0px) rotateZ(360deg);
				background-color: #0f0;
			}
			50%{
				transform: translate(400px,400px) rotateZ(720deg);
				background-color: #00f;
			}
			75%{
				transform: translate(800px,400px) rotateZ(1080deg);
				background-color: #ff0;
			}
			100%{
				transform: translate(0px,0px) rotateZ(1440deg);
				background-color: #0ff;
			}
		}
	</style>
</head>
<body>
	<div class="box">
		
	</div>
</body>
</html>

 

出现这个错误的原因是在导入seaborn包时,无法从typing模块中导入名为'Protocol'的对象。 解决这个问题的方法有以下几种: 1. 检查你的Python版本是否符合seaborn包的要求,如果不符合,尝试更新Python版本。 2. 检查你的环境中是否安装了typing_extensions包,如果没有安装,可以使用以下命令安装:pip install typing_extensions。 3. 如果你使用的是Python 3.8版本以下的版本,你可以尝试使用typing_extensions包来代替typing模块来解决该问题。 4. 检查你的代码是否正确导入了seaborn包,并且没有其他导入错误。 5. 如果以上方法都无法解决问题,可以尝试在你的代码中使用其他的可替代包或者更新seaborn包的版本来解决该问题。 总结: 出现ImportError: cannot import name 'Protocol' from 'typing'错误的原因可能是由于Python版本不兼容、缺少typing_extensions包或者导入错误等原因造成的。可以根据具体情况尝试上述方法来解决该问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [ImportError: cannot import name ‘Literal‘ from ‘typing‘ (D:\Anaconda\envs\tensorflow\lib\typing....](https://blog.youkuaiyun.com/yuhaix/article/details/124528628)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

思丰百年

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值