vue-transition-animation
<!Doctype>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"/>
<style>
* {
margin: 0;
padding: 0;
} @keyframes shape-change {
0%, 100% {
border-radius: 50%;
background: red
}
50% {
border-radius: 0;
background: blue
}
} @keyframes moveball-in {
0% {
transform: translate3d(300px, -200px, 0)
}
50% {
transform: translate3d(100px, -400px, 0)
}
100% {
transform: translate3d(0, 0, 0)
}
} @keyframes moveball-out {
0% {
transform: translate3d(0, 0, 0)
}
50% {
transform: translate3d(100px, -400px, 0)
}
100% {
transform: translate3d(300px, -200px, 0)
}
} .btn {
width: 40px;
height: 30px;
margin-top: 40px;
border: none;
outline: none;
background: red;
color: #fff;
} .ball {
position: absolute;
bottom: 20px;
left: 20px;
width: 50px;
height: 50px;
transition: all 1s cubic-bezier(.22, -0.86, .97, .58)
} .ball.move-enter-active {
opacity: 1;
animation: moveball-in 1s;
} .ball.move-enter-active .inner {
animation: shape-change 1s
} .ball.move-leave-active {
opacity: 0.8;
animation: moveball-out 1s
} .ball.move-leave-active .inner {
animation: shape-change 1s
} .inner {
display: inline-block;
width: 30px;
height: 30px;
border-radius: 50%;
background: red;
transition: all 1s linear;
}
</style>
</head>
<body>
<div id="app">
<template>
<div class="app">
<button @click="showball" class="btn">show</button>
<transition name="move" type="animation">
<div class="ball" v-show="show">
<div class="inner"></div>
</div>
</transition>
</div>
</template>
</div>
<script src="../vue.js"></script>
<script>
var app = new Vue({
el: "#app",
data: {
show: false
},
methods: {
showball: function () {
this.show = !this.show;
} }
});
</script>
</body>
</html>

vue-transition-animation的更多相关文章
- css3 transition animation nick
时光转眼即逝,又到周六了,今天写点某部分人看不起的css玩玩! 转换 转换属性transform: 浏览器前缀: -webkit-transform;-o-transform;-moz-transfo ...
- Atitti css transition Animation differ区别
Atitti css transition Animation differ区别 1.1. transition的优点在于简单易用,但是它有几个很大的局限. 1 1.2. Transition ...
- Atitti css transition Animation differ区别
Atitti css transition Animation differ区别 1.1. transition的优点在于简单易用,但是它有几个很大的局限. 1 1.2. js 动态改变 st ...
- A transition animation compatible Library.
Android5.0之后为我们提供了许多炫酷的界面过渡效果,其中共享元素过渡也是很有亮点的一个效果,但这个效果只能在Android5.0之后使用,那今天我们就来将共享元素过渡效果兼容到Android4 ...
- css3动画transition animation
CSS动画简介 transition animation transition过渡:css3通过transitions属性引入时间概念,通过开始.结束状态自动计算中间状态,实现状态改变的过渡效果 ...
- CSS3 & transition & animation
CSS3 & transition & animation https://developer.mozilla.org/en-US/docs/Web/CSS/transition-ti ...
- CSS动画-transition/animation
HTML系列: 人人都懂的HTML基础知识-HTML教程(1) HTML元素大全(1) HTML元素大全(2)-表单 CSS系列: CSS基础知识筑基 常用CSS样式属性 CSS选择器大全48式 CS ...
- vue transition
Vue.js 教程 (9) : 过渡动画 Vue.js 提供非常简单的过渡动画接口.这些过渡动画在 Vue.js 将目标元素插入或移除出 DOM 的时候会自动执行.能够触发动画的指令包括 v-if , ...
- css3的新特性transform,transition,animation
一.transform css3引入了一些可以对网页元素进行变换的属性,比如旋转,缩放,移动,或者沿着水平或者垂直方向扭曲(斜切变换)等等.这些的基础都是transform属性 transform属性 ...
- css笔记——区分css3中的transform transition animation
出处:http://blog.csdn.net/dyllove98/article/details/8957232 CSS3中和动画有关的属性有三个 transform. transition ...
随机推荐
- FPGA学习-PS2接口
选自http://m.elecfans.com/article/774143.html
- ElasticSearch 2.0以后的改动导致旧的资料和书籍需要订正的部分
id原先是可以通过path指定字段的 "thread": { "_id" : { "path" : "thread_id" ...
- 二:HDFS 命令指南
命令具体选项请参考: http://hadoop.apache.org/docs/r2.6.3/hadoop-project-dist/hadoop-hdfs/HDFSCommands.html ...
- 微信小程序:封装全局的promise异步调用方法
微信小程序:封装全局的promise异步调用方法 一:封装 function POST(url, params) { let promise = new Promise(function (resol ...
- vue.js学习之 跨域请求代理与axios传参
vue.js学习之 跨域请求代理与axios传参 一:跨域请求代理 1:打开config/index.js module.exports{ dev: { } } 在这里面找到proxyTable{}, ...
- jQuery实现仿京东商城图片放大镜
效果图: 不废话直接上代码: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...
- Uncaught Error: Syntax error, unrecognized expression: |117的js错误
117指的是js代码在浏览器运行时的出错的行号 var a="117|117" 前面的错误是由于有特殊符号“|”,用$("txtId"+a).val();去取 ...
- iOS- UIPickerView餐厅点餐系统
在餐厅里的点餐系统的核心控件就是UIPickerView 今天晚上在整理以前的项目笔记时,特意把UIPickerView单独拿出来,做了一个简陋的点餐道具. 因为没有素材图片,所有大家将就看看吧 0. ...
- Spring Boot(七)扩展分析
前面的章节在分析SpringBoot启动过程中,我们发现SpringBoot使用Spring框架提供的SpringFactoriesLoader这个类,实现检索META-INF/spring.fact ...
- PHP中Session和Cookie的探究
一.Session (1)Session的由来以及介绍 Session:在计算机中,尤其是在网络应用中,称为“会话控制”,生存时间为用户在浏览某个网站时,从进入网站到关闭这个网站所经过的这段时间,也就 ...