css3 实现明信片正背面翻转
<!DOCTYPE html>
<html lang="zh-cn" style="width: 100%;height: 100%;">
<head>
<meta charset="UTF-8">
<title>预览明信片</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="Houyuqing">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
<style>
.pre-top {
text-align: center;
padding-bottom: px;
line-height: ;
} .pre-top span {
font-size: px;
color: #fff;
padding: px;
} .pre-top span:nth-of-type() {
position: relative;
} .pre-top span:nth-of-type():after {
position: absolute;
content: '';
z-index: ;
width: px;
height: px;
top: px;
right: -px;
background: #fff;
} .preview {
height: %;
width: %;
box-sizing: border-box;
perspective: px;
} .preview figure {
margin: ;
height: %;
transform-style: preserve-3d;
transition: s transform;
} .figure1 {
transform: rotateY(.5turn);
} .preview figure img {
width: %;
height: %;
box-sizing: border-box;
border: px solid #fff;
box-shadow: px px px #a6a3a4;
} .preview figcaption {
position: absolute;
top: ;
left: ;
width: %;
height: %;
z-index: ;
background-image: url("../images/img-back.png");
background-size: cover;
transform: rotateY(.5turn) translateZ(px);
}
.preview figcaption h1 {
position: absolute;
} .fig-word {
font-size: px;
color: #000;
padding: px px;
}
</style>
</head>
<body class="word-back">
<div class="pre-top">
<span class="commRed span1">正面</span>
<span class="span2">背面</span>
</div>
<div class="preview">
<figure class="relative">
<img src="../images/11.jpg" alt="" class="">
<figcaption>
<p class="fig-word css11339c70851c62b">这是好友给你的悄悄哦这是好友给你的悄悄哦这是好友给你的悄悄哦这是好友给你的悄悄哦这是好友给你的悄悄哦这是好友给你的悄悄哦这是好友给你的悄悄哦</p>
</figcaption>
</figure>
</div>
<script src="../js/jquery.min.js"></script>
<script>
// 正面
$('.span1').click(function () {
$('figure').removeClass('figure1');//背面消失
$(this).addClass('commRed').siblings().removeClass('commRed');//加红色
});
// 背面
$('.span2').click(function () {
$('figure').addClass('figure1');//背面出现
$(this).addClass('commRed').siblings().removeClass('commRed');//加红色
});
// 点击页面转换正背面
$('.preview').click(function () {
if($('.span1').is('.commRed')){
$('figure').addClass('figure1');//背面出现
$('.span1').removeClass('commRed').siblings().addClass('commRed');//加红色
}else {
$('figure').removeClass('figure1');//背面消失
$('.span2').removeClass('commRed').siblings().addClass('commRed');//加红色
}
})
</script> </body>
</html>
.pre-top {
text-align: center;
padding-bottom: px;
line-height: ;
} .pre-top span {
font-size: px;
color: #fff;
padding: px;
} .pre-top span:nth-of-type() {
position: relative;
} .pre-top span:nth-of-type():after {
position: absolute;
content: '';
z-index: ;
width: px;
height: px;
top: px;
right: -px;
background: #fff;
} .preview {
height: %;
width: %;
box-sizing: border-box;
perspective: px;
} .preview figure {
margin: ;
height: %;
transform-style: preserve-3d;
transition: s transform;
} .figure1 {
transform: rotateY(.5turn);
} .preview figure img {
width: %;
height: %;
box-sizing: border-box;
border: px solid #fff;
box-shadow: px px px #a6a3a4;
} .preview figcaption {
position: absolute;
top: ;
left: ;
width: %;
height: %;
z-index: ;
background-image: url("../images/img-back.png");
background-size: cover;
transform: rotateY(.5turn) translateZ(px);
}
.preview figcaption h1 {
position: absolute;
}
css3 实现明信片正背面翻转的更多相关文章
- 一款纯css3实现的图片3D翻转幻灯片
之前介绍了好多款网页幻灯片,今天要给大家再带来一款纯css3实现的图片3D翻转幻灯片.这款幻灯片图片轮播采用了3D翻转的形式,效果非常不错.一起看下效果图: 在线预览 源码下载 实现的代码. ht ...
- 如何用CSS3来实现卡片的翻转特效
CSS3实现翻转(Flip)效果 动画效果 效果分析 当鼠标滑过包含块时,元素整体翻转180度,以实现“正”“反”面的切换. HTML分析 分析:.container,.flip为了实现动画效果做准备 ...
- 一款基于css3的散子3D翻转特效
css3使我们能够跳出2d空间,实现3维空间的动画效果,这里给出一个自动翻转的3d色子动画效果制作过程. 第一步,首先进行HTML的布局,对于3D效果,布局有一定的规律,代码如下: <body& ...
- 纯css3 transforms 3D文字翻开翻转3D开放式效果
详细内容请点击 在线预览立即下载 在本教程中,将基于CSS3创建的一个实现一个有趣的3D开放式效果.教程的目的是展示我们如何能带来一些生活上使用CSS3 . html: <ul class=&q ...
- css3 向上淡入 小图标翻转 360度旋转
代码 <!DOCTYPE HTML> <html> <style type="text/css"> div { border: 1px soli ...
- CSS3之图片3D翻转效果(网页效果--每日一更)
今天,带来的是纯CSS3的效果--图片3D翻转. 请看效果:亲,请点击这里 这个效果主要还是运用了CSS3的transform变形属性,与上个效果不同的是,这次并不是动画,所以没有采用animatio ...
- 一个纯CSS实现的卡片翻转效果
先上代码 <div id="box"> <div class="front">正面</div> <div class= ...
- BZOJ3526[Poi2014]Card——线段树合并
题目描述 有n张卡片在桌上一字排开,每张卡片上有两个数,第i张卡片上,正面的数为a[i],反面的数为b[i].现在,有m个熊孩子来破坏你的卡片了!第i个熊孩子会交换c[i]和d[i]两个位置上的卡片. ...
- 霍金:AI或许能根除疾病和贫穷,但也可能摧毁人类 | GMIC 2017
在我的一生中,我见证了社会深刻的变化.其中最深刻的,同时也是对人类影响与日俱增的变化,是人工智能的崛起.简单来说,我认为强大的人工智能的崛起,要么是人类历史上最好的事,要么是最糟的.我不得不说,是好是 ...
随机推荐
- C++ 类设计核查表
参考:https://www.jianshu.com/p/01601515ca31 <大规模C++程序设计> 函数接口: 1.运算符或非运算符函数? 2.自由或成员运算符? 3.虚函数或非 ...
- 廖雪峰Java11多线程编程-2线程同步-4wait和notify
wait和notify synchronized解决了多线程竞争的问题 我们可以在synchronized块中安全的对一个变量进行修改,但是它没有解决多线程协调的问题. 例如设计一个TaskQueue ...
- Mac配置maven环境命令
1.安装:解压下载好的maven的文件,解压到你想要的文件夹底下. 2.配置 1)打开终端输入命令 vim ~/.bash_profile (编辑环境变量配置文件) 2)按下i,进入编辑模式 3)在环 ...
- Django缓存机制以及使用redis缓存数据库
目录 Django 配置缓存机制 缓存系统工作原理 Django settings 中 默认cache 缓存配置 利用文件系统来缓存 使用Memcache来缓存: 使用Local-memory来缓存: ...
- nginx 解决问题
- Mybatis-构建 SqlSessionFactory
从 XML 中构建 SqlSessionFactory 每 一 个 MyBatis 的 应 用 程 序 都 以 一 个 SqlSessionFactory 对 象 的 实 例 为 核 心 . SqlS ...
- Django之模板语言(四) ------>Tags
案例1:单层for循环 # Django 模板语言测试代码 def template_test(request): name_list=["张三","李四",& ...
- tiler--python实现的有趣的自定义马赛克图像拼接工具
最近在github中发现了一个有趣的小工具,tiler github链接https://github.com/nuno-faria/tiler 具体介绍请直接去github,这里只分享一下它的使用方法 ...
- 提前关闭Scrapy爬虫的设置
Scrapy的CloseSpider扩展会在满足条件时自动终止爬虫程序.可以设置CLOSESPIDER_TIMEOUT(秒).CLOSESPIDER_ITEMCOUNT.CLOSESPIDER_PAG ...
- HBase 概念视图