css3 花瓣按钮
2017-08-03 13:44
190 查看
<template> <div class="pin-star"> <input type="checkbox" class="pin-leaf-checkbox"> <div class="pin-star-leaf"> </div> <div class="pin-star-leaf"> </div> <div class="pin-star-leaf"> </div> <div class="pin-star-leaf"> </div> <div class="pin-star-leaf"> </div> <div class="pin-star-center"> </div> </div> </template> <style lang="stylus" rel="stylesheet/stylus" scoped> .pin-star{ position: relative width: 300px height: 300px } .pin-leaf-checkbox, .pin-star-center { width: 45px; height: 50px; position: absolute; left: 0; right: 0; top: -60px; bottom: 0; margin: auto; background-color: #fff; border-radius: 50%; cursor: pointer; z-index: 999 } .pin-star-center, .pin-star-leaf{ pointer-events: none; } .pin-star-center > input[type="checkbox"]{ width: 100%; height: 100%; cursor: pointer; } .pin-star-leaf { width: 60px height: 120px background-color: #b8f0f5 border-radius: 50%/30% 30% 70% 70% position: absolute left: 0 right: 0 top: 0 bottom: 0 margin: auto opacity: 0.5 transition: transform 1s cubic-bezier(.8,-.5,.2,1.4); transform-origin: 30px 30px &:nth-of-type(1) { background-color: #B8F0F5 } &:nth-of-type(2) { background-color: #9CF3DC } &:nth-of-type(3) { background-color: #94F3B0 } &:nth-of-type(4) { background-color: #C2F8A1 } &:nth-of-type(5) { background-color: #FFEFAF } } .pin-leaf-checkbox:checked ~ .pin-star-leaf{ transition: transform 1s cubic-bezier(.8,-.5,.2,1.4); } .pin-leaf-checkbox:checked ~ .pin-star-leaf:nth-of-type(5){ transform: rotatez(35deg); } .pin-leaf-checkbox:checked ~ .pin-star-leaf:nth-of-type(4){ transform: rotatez(105deg); } .pin-leaf-checkbox:checked ~ .pin-star-leaf:nth-of-type(3){ transform: rotatez(180deg); } .pin-leaf-checkbox:checked ~ .pin-star-leaf:nth-of-type(2){ transform: rotatez(255deg); } .pin-leaf-checkbox:checked ~ .pin-star-leaf:nth-of-type(1){ transform: rotatez(325deg); } </style>
相关文章推荐
- CSS3美化单选按钮和复选按钮
- 利用CSS3打造一组质感细腻丝滑的按钮
- css3按钮
- 纯css3实现的switch开关按钮
- 一款纯css3实现的颜色渐变按钮
- 6种非常炫酷的CSS3按钮边框动画特效
- 五款漂亮的纯CSS3动画按钮的实例教程
- css3 呼吸动画按钮
- CSS3样式控制input按钮效果
- 36种漂亮的CSS3网页按钮Button样式
- jQuery+CSS3实现仿花瓣网固定顶部位置带悬浮效果的导航菜单
- CSS3演绎神奇按钮效果(HTML5)
- css3单选 复选按钮--代码分享
- 使用CSS3编写类似iOS中的复选框及带开关的按钮
- 分享10个实用的超绚CSS3按钮设计
- 分享40个超棒的CSS3按钮教程
- css3实现顶部社会化分享按钮示例
- CSS3 制作一个边框向周围散开的按钮效果
- CSS3 input[type=file] 样式美化,input上传按钮美化
- css3按钮练习