关键词:
<!DOCTYPE html><html>
<head>
<meta charset="utf-8" />
<style type="text/css">
.animate {
width: 200px;
height: 200px;
margin: 0 auto;
border-radius: 50%;
background-color: #f00;
line-height: 200px;
border-radius: 50%;
text-align: center;
color: #fff;
font-size: 20px;
}
.animate-transition {
transition: transform 2s linear;
-moz-transition: -moz-transform 2s linear;
-webkit-transition: -webkit-transform 2s linear;
-o-transition: -o-transform 2s linear;
}
.animate-transition:hover {
cursor: pointer;
transform: rotate(360deg);
-moz-transform: rotate(360deg);
-webkit-transform: rotate(360deg);
-o-transform: rotate(360deg);
}
</style>
</head>
<body>
<div class="animate animate-transition">Transition Animation</div>
</body>
</html>
<!DOCTYPE html><html>
<head>
<meta charset="utf-8" />
<style type="text/css">
.animate {
width: 200px;
height: 200px;
margin: 0 auto;
border-radius: 50%;
background-color: #f00;
line-height: 200px;
border-radius: 50%;
text-align: center;
color: #fff;
font-size: 20px;
}
.animate-keyframes {
-webkit-animation: none;
}
.animate-keyframes:hover {
cursor: pointer;
-webkit-animation: frames 2s linear infinite;
}
@-webkit-keyframes frames {
0% {
background-color: #f00;
-webkit-transform: rotate(0deg);
}
100% {
background-color: #f00;
-webkit-transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="animate animate-keyframes">Transition Animation</div>
</body>
</html>
<html>
<head>
<meta charset="utf-8" />
<style type="text/css">
.animate-svg {
width: 200px;
margin: 0 auto;
}
</style>
</head>
<body>
<div class="animate-svg">
<svg id="svgAnimation" ns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200">
<g transform="translate(100, 100)">
<g>
<rect width="200" height="200" rx="100" ry="100" fill="red" transform="translate(-100, -100)"></rect>
<text x="-60" y="-0" font-size="20" fill="white">SVG Animation</text>
<animateTransform attributeName="transform" attributeType="xml" type="rotate" from="0" to="360" dur="3s" repeatCount="indefinite">SVG Animation</animateTransform>
</g>
</g>
</svg>
</div>
</body>
</html>
<html>
<head>
<meta charset="utf-8" />
<style type="text/css">
.animate {
width: 200px;
height: 200px;
margin: 0 auto;
border-radius: 50%;
line-height: 200px;
border-radius: 50%;
text-align: center;
color: #fff;
font-size: 20px;
}
.animate-input {
margin-top: 10px;
text-align: center;
}
</style>
</head>
<body>
<div id="animate-RAF" class="animate animate-RAF">RAF Animation</div>
<div class="animate-input"><input type="button" id="btn_start" value="Start" style="width:100px;height:30px;" /></div>
<script type="text/javascript">
var animate_raf = document.getElementById("animate-RAF"),
btn_start = document.getElementById("btn_start"),
frameid = null;
function frame(time) {
animate_raf.style[‘-webkit-transform‘] = ‘rotate(‘ + Math.cos(time/1000) * 360 + ‘deg)‘;
frameid = requestAnimationFrame(frame);
}
// 绑定事件
btn_start.addEventListener("click", function(event) {
var val = this.value;
if (val == "Start") {
frameid = requestAnimationFrame(frame);
this.value = "Pause";
} else {
this.value = "Start";
cancelAnimationFrame(frameid);
}
}, false);
</script>
</body>
</html>
<html>
<head>
<meta charset="utf-8" />
<style type="text/css">
.animate {
width: 200px;
height: 200px;
margin: 0 auto;
border-radius: 50%;
line-height: 200px;
border-radius: 50%;
text-align: center;
color: #fff;
font-size: 20px;
cursor: pointer;
}
.web-animation-1 {
-webkit-transform: rotate(360deg);
}
</style>
</head>
<body>
<div id="web_animation_1" class="animate web-animation-1">Web Animation-1</div>
<script src="web-animations.js"></script>
<script type="text/javascript">
var web_animation_1 = document.getElementById("web_animation_1");
web_animation_1.addEventListener(‘click‘, function() {
web_animation_1.animate([{
transform: ‘rotate(0deg)‘
}, {
transform: ‘rotate(360deg)‘
}],{
duration: 2
});
}, false);
</script>
</body>
</html>
<html>
<head>
<meta charset="utf-8" />
<style type="text/css">
.animate {
width: 200px;
height: 200px;
margin: 0 auto;
border-radius: 50%;
background-color: #f00;
line-height: 200px;
border-radius: 50%;
text-align: center;
color: #fff;
font-size: 20px;
cursor: pointer;
}
.web-animation-2 {
-webkit-transform: rotate(360deg);
}
</style>
</head>
<body>
<div id="web_animation_2" class="animate web-animation-2">Web Animation-2</div>
<script src="web-animations.js"></script>
<script type="text/javascript">
var web_animation_2 = document.getElementById("web_animation_2");
web_animation_2.addEventListener(‘click‘, function() {
web_animation_2.animate([{
transform: ‘rotate(0deg)‘
}, {
transform: ‘rotate(360deg)‘
}],{
// 旋转方向
direction: "alternate",
// 旋转值
duration: 1,
// 迭代
iterations: Infinity,
// 缓解过渡
easing: ‘ease-in-out‘,
// 播放速率
playbackRate: 2
});
}, false);
</script>
</body>
</html>
<html>
<head>
<meta charset="utf-8" />
<style type="text/css">
.web_animation_4 {
width: 700px;
margin: 0 auto;
padding: 10px;
background-color: #ccc;
cursor: pointer;
}
.web_animation_4 .par-timing-box {
background-color: #00f;
height: 20px;
margin: 10px;
}
</style>
</head>
<body>
<div id="web_animation_4" class="web_animation_4">
<div id="parItem1" class="par-timing-box" style="width: 500px;"></div>
<div id="parItem2" class="par-timing-box" style="width: 700px;"></div>
<div id="parItem3" class="par-timing-box" style="width: 200px;"></div>
</div>
<script src="web-animations.js"></script>
<script type="text/javascript">
var web_animation_4 = document.getElementById("web_animation_4"),
parItem1 = document.getElementById("parItem1"),
parItem2 = document.getElementById("parItem2"),
parItem3 = document.getElementById("parItem3");
web_animation_4.addEventListener(‘click‘, function() {
var obj = new ParGroup([
new Animation(parItem1, [{width: ‘0px‘}, {width: ‘500px‘}], 1),
new Animation(parItem2, [{width: ‘0px‘}, {width: ‘700px‘}], 1),
new Animation(parItem3, [{width: ‘0px‘}, {width: ‘200px‘}], 1)
]);
document.timeline.play(obj);
}, false);
</script>
</body>
</html>
前端常用书签整合
1.CSS公共样式:http://xuqian0808.blog.163.com/blog/static/170125710201321945327506/2.前端学习资源整合:http://blog.csdn.net/alin_leeon/article/details/520843783.前端规范建站:https://wenku.baidu.com/view/7d09e235852458fb7 查看详情
整合大量开源库项目能够载入gif动画的gifimageview
转载请注明出处王亟亟的大牛之路上周大多数时间都是依据兴起,想到什么做什么写了几个自己定义控件,把Soyi丢在那没怎么动,今天就把写的东西整合进来,顺便把SOyi”个人研发的结构理一下”。先上一下今天整合之后的效... 查看详情
前端整合mathjaxjs的配置笔记
这篇文章是我给Pinghsu主题添加数学公式功能的一个小教程,包含我大量的官方文档阅读后的实践,跟着这篇配置教程走,你可以做到给任何一个需要数学公式的站点添加支持。教程如标题所述是针对 Mathjax 的实践,我简... 查看详情
转载grunt整合版30分钟学会使用grunt打包前端代码
【grunt整合版】30分钟学会使用grunt打包前端代码grunt是一套前端自动化工具,一个基于nodeJs的命令行工具,一般用于:①压缩文件②合并文件③简单语法检查对于其他用法,我还不太清楚,我们这里简单介绍下grunt的压缩、合并... 查看详情
前端自动化框架typescript+puppeteer+jest整合
前提:掌握Jest+Puppeteer1.Jest环境配置2.Jest-MATCHERS匹配器3.Jest-全局变量设置4.Puppeteer安装5.Puppeteer元素获取6.Puppeteer文本值获取7.Puppeteeriframe切换8.Puppeteer拖拽9.PuppeteerJs脚本执行一需要安装的插件安装包命令TypeScriptnpminstalltypescript--sa 查看详情
循序渐进vue+element前端应用开发(12)---整合abp框架的前端登录处理
VUE+Element前端是一个纯粹的前端处理,前面介绍了很多都是Vue+Element开发的基础,从本章随笔开始,就需要进入深水区了,需要结合ABP框架使用(如果不知道,请自行补习一下我的随笔:ABP框架使用),ABP框架作为后端,是一个... 查看详情
grunt整合版30分钟学会使用grunt打包前端代码
grunt是一套前端自动化工具,一个基于nodeJs的命令行工具,一般用于:①压缩文件②合并文件③简单语法检查对于其他用法,我还不太清楚,我们这里简单介绍下grunt的压缩、合并文件,初学,有误请包涵准备阶段1、nodeJs环境因... 查看详情
ue4开发神秘海域类游戏原型初阶:动画资源的整合
前一篇已经确定神海类游戏原型的目标,首先要做的就是3C‘s(Character,Controls,Camera)的开发。 UE4的3C‘s的程序部分开发主要也就是基于他的GamePlayFramework来进行的,只要在C++里开发完成,通过蓝图类继承,把参数暴露给蓝图... 查看详情
11前端css动画
异常兴奋,今天要做一个小动画,fighting CSS动画transformrotate旋转transform-rotate(value)2D旋转translate偏移transform-translateX(value)X轴方向偏移value元素父元素为原点正值从左到右value要求是一个绝对元素(px|%|em|rem|vh...)transform-translateY... 查看详情
整合ssm三大框架使用注解开发查询用户信息
...ingmvc工作原理 二、分析第一步:发起请求到前端控制器(DispatcherServlet)第二步:前端控制器请求HandlerMapping查找Handler可以根据xml配置、注解进行查找第三步:处理器映射器HandlerMapping向前端控制器返回Handler第四步:... 查看详情
前端实现动画(代码片段)
通常在前端中,实现动画的方案主要有6种:CSS3transition;CSS3animation;javascript直接实现;SVG(可伸缩矢量图形);Canvas动画;requestAnimationFrame;首先,我们来搭一个基本结构框架:<style> div position:relative; ... 查看详情
grunt整合版30分钟学会使用grunt打包前端代码
grunt是一套前端自动化工具,一个基于nodeJs的命令行工具,一般用于:①压缩文件②合并文件③简单语法检查对于其他用法,我还不太清楚,我们这里简单介绍下grunt的压缩、合并文件,初学,有误请包涵准备阶段1、nodeJs环境因... 查看详情
前端动画效果的实现
用CSS3实现动画效果:@keyframes和animation共同实现。@keyframesmyfirst {from{background:red;}to{background:yellow;} } @-webkit-keyframesmyfirst/*SafariandChrome*/ {from{background:red;}to{background:yellow;} }绑定到div控 查看详情
springboot系列springboot整合pagehelper分页组件以及前端js分页插件(代码片段)
七、SpringBoot整合pageHelper分页组件以及前端js分页插件1、PageHelper简介2、PageHelper支持物理分页的数据库3、SpringBoot集成PageHelper4、配置datasource和thymeleaf5、选用SystemUserinfo和SystemRole数据库表6、[mybatis逆向工程](https://blog.csdn.net/qq_5259 查看详情
前端深入之css篇丨2020年前,彻底掌握css动画transition
原文:前端深入之css篇丨2020年前,彻底掌握css动画【transition】写在前面马上就2020年了,不知道小伙伴们今年学习了css3动画了吗?说起来css动画是一个很尬的事,一方面因为公司用css动画比较少,另一方面大部分开发者习惯了用J... 查看详情
前端延迟加载(代码片段)
一整合由于本人的码云太多太乱了,于是决定一个一个的整合到一个springboot项目里面。附上自己的github项目地址https://github.com/247292980/spring-boot附上汇总博文地址https://www.cnblogs.com/ydymz/p/9391653.html以整合功能spring-boot,FusionChart,t... 查看详情
前端开发常用css动画代码
/*向左移动并弹性显示*/@-webkit-keyframesfadeToLeftTan{0%{-webkit-transform:translateX(100%);opacity:0;}70%{-webkit-transform:translateX(-5%);opacity:1;}80%{-webkit-transform:translateX(2%);opacity:1;}90%{-webk 查看详情
前端之路——在less中创建动画
参考技术A如下图概括地说就是通过less的mixin,创建函数,从函数中返回动画名。以上,就可以在less中创建一个动画了。当然,这是一个很粗糙的例子,需要没有浏览器前缀,动画本身也很简单。 查看详情