FCC---Animate Elements at Variable Rates----一闪一闪亮晶晶,不同的闪动节奏
There are a variety of ways to alter the animation rates of similarly animated elements.
So far, this has been achieved by applying an animation-iteration-count property and setting @keyframes rules.
To illustrate, the animation on the right consists of two "stars" that each decrease in size and opacity at the 20% mark in the @keyframes rule, which creates the twinkle animation.
You can change the @keyframes rule for one of the elements so the stars twinkle at different rates.
练习题目:
Alter the animation rate for the element with the class name of star-1 by changing its @keyframes rule to 50%.
练习代码:
<style>
.stars {
background-color: white;
height: 30px;
width: 30px;
border-radius: 50%;
animation-iteration-count: infinite;
} .star-1 {
margin-top: 15%;
margin-left: 60%;
animation-name: twinkle-1;
animation-duration: 1s;
} .star-2 {
margin-top: 25%;
margin-left: 25%;
animation-name: twinkle-2;
animation-duration: 1s;
} @keyframes twinkle-1 {
50% {
transform: scale(0.5);
opacity: 0.5;
}
} @keyframes twinkle-2 {
20% {
transform: scale(0.5);
opacity: 0.5;
}
} #back {
position: fixed;
padding:;
margin:;
top:;
left:;
width: 100%;
height: 100%;
background: linear-gradient(black, #000099, #66c2ff, #ffcccc, #ffeee6);
}
</style> <div id="back"></div>
<div class="star-1 stars"></div>
<div class="star-2 stars"></div>
效果如下:

FCC---Animate Elements at Variable Rates----一闪一闪亮晶晶,不同的闪动节奏的更多相关文章
- Openjudge-计算概论(A)-晶晶赴约会
描述 晶晶的朋友贝贝约晶晶下周一起去看展览,但晶晶每周的1.3.5有课必须上课,请帮晶晶判断她能否接受贝贝的邀请,如果能输出YES:如果不能则输出NO. 输入输入有一行,贝贝邀请晶晶去看展览的日期,用 ...
- 2718:晶晶赴约会-poj
总时间限制: 1000ms 内存限制: 65536kB 描述 晶晶的朋友贝贝约晶晶下周一起去看展览,但晶晶每周的1.3.5有课必须上课,请帮晶晶判断她能否接受贝贝的邀请,如果能输出YES:如果不能 ...
- 计算概论(A)/基础编程练习1(8题)/3:晶晶赴约会
#include<stdio.h> int main() { int w; scanf("%d", &w); || w==) { printf("%s ...
- LuoguB2045 晶晶赴约会 题解
Content 贝贝邀请晶晶下个星期 \(x\)(如果 \(x=7\) 表示星期日)一起去看展览,但是晶晶下个星期 \(1,3,5\) 都有课.请你判断晶晶能否同意贝贝的请求. 数据范围:\(x\in ...
- FCC---Animate Multiple Elements at Variable Rates---还可以改循环时间,达到不同律动频率的效果
In the previous challenge, you changed the animation rates for two similarly animated elements by al ...
- (NO.00004)iOS实现打砖块游戏(十一):"一闪一闪亮晶晶,我们都是小星星"
大熊猫猪·侯佩原创或翻译作品.欢迎转载,转载请注明出处. 如果觉得写的不好请告诉我,如果觉得不错请多多支持点赞.谢谢! hopy ;) 现在一个基本的游戏逻辑已经搭建好了,但是感觉还是缺点什么呢? 蠢 ...
- 2.HTML+CSS制作一闪一闪亮晶晶的星星(stars)
效果地址:https://codepen.io/flyingliao/pen/NJxbdB?editors=1100 HTML code: <div class="stars" ...
- ios--计时器演示样例:一闪一闪亮晶晶(动画)
本演示样例实现的动画:UIView定时消失随后又闪现,即一闪一闪的动画 所採用的技术:定时器(NSTimer) + 动画(beginAnimations/commitAnimations) 详细实现步 ...
- SVG 动画(animate、animateTransform、animateMotion)
原文:https://blog.csdn.net/chy555chy/article/details/53535581 参考 MDN开发文档 https://developer.mozilla.org ...
随机推荐
- 订单结算submit_order.php扣库存,扣账号金额(学生笔记)
<?php header("Content-type: text/html; charset=utf-8"); session_start(); include_once(& ...
- 记录一次netcore3.0 code first使用迁移命令报错问题
环境描述:macOS .vscode .netcore3.0 迁移工具:Microsoft.EntityFrameworkCore.Tools 遇到的问题: Could not execute bec ...
- Java面试基础 -- Docker篇
1.什么是Docker? Docker是一个容器化平台,它以容器的形式将您的应用程序及其所有依赖项打包在一起,以确保您的应用程序在任何环境中无缝运行. 2.什么是Docker镜像? Docker镜像是 ...
- Xcode报错:could not attach to pid:"1764"
这种错误不是什么问题,按照参考链接操作即可,亲测有效: https://www.cnblogs.com/luorende/p/6295945.html 在运行项目时出现了如下错误 (基本上重新启动项目 ...
- Http相关小知识点笔记咯~
协议 先来说说什么是协议,协议其实指的是通信协议(Communications Protocol),也称传输协议.Wiki中的描述的是这样的,通信协议定义了通信中的语法学,语义学和同步规则以及可能存在 ...
- Saltstack_使用指南13_runner的job和manage与execution的saltutil
1. 主机规划 salt 版本 [root@salt100 ~]# salt --version salt (Oxygen) [root@salt100 ~]# salt-minion --versi ...
- Memcached 基本语法 记录
set 命令:命令将value数值存储在指定的key中: set key flags exptime bytes [noreply] value key:键值 key-value 结构中的 key,用 ...
- Python 实现 Hangman 小游戏
Hangman--游戏简介--> 百度百科 打印Hangman def printHangman(N): # 第一行 print("\t____") # 第二行 print( ...
- Win10家庭版激活方法
由于电脑换过主板,系统过了段时间显示未激活的状态,当时没注意随着主板口袋里的密匙,当作垃圾一起扔了,在网上试了几种方式,以下这个方法让我成功激活了系统 对开始菜单点击右键,选择Windows Powe ...
- [Go] 使用protobuf进行序列化和反序列化
先定义消息类型 orders.proto syntax = "proto2"; package message; message Orders { required int32 o ...