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
在我的一生中,我见证了社会深刻的变化.其中最深刻的,同时也是对人类影响与日俱增的变化,是人工智能的崛起.简单来说,我认为强大的人工智能的崛起,要么是人类历史上最好的事,要么是最糟的.我不得不说,是好是 ...
随机推荐
- node vue 微信公众号(三)启用本地服务器
1.下载nginx http://nginx.org/en/download.html 2.启动服务 3.配置natapp服务,并启动
- day08 网络设置、软件包管理
网络设置 ifconfig //最小化安装时不可用,需要安装安装包,命令为查看网卡信息 yum install net-tools mtu 网卡的最大发送字节 iptables -F 清掉防火墙配置 ...
- day04 - linux常用命令、目录说明以及ubuntu解锁root用户,安装tree命令
echo abcdefg >> aa.txt //向aa.txt文件末尾追加 abcdefg 字符串 1 基础命令: clear //清屏 whoami //查看当前所登录的用户 who ...
- SQLite C++ Wrapper 是一个 C++ 语言对 SQLite 的最小封装包。
SQLite C++ Wrapper 是一个 C++ 语言对 SQLite 的最小封装包. 示例代码1: #include <string> #include <iostream ...
- python随机数(转载)
随机生成 0 到 1 之间的浮点数 random.random() 方法会返回 [0.0, 1.0) 之间的浮点数,注意,这是一个左闭右开的区间,随机数可能会是 0 但不可能为 1 . 随机生成 a ...
- 转:Eclipse中设置编码的方式
来源:http://blog.csdn.net/jianw2007/article/details/3930915 如果要使插件开发应用能有更好的国际化支持,能够最大程度的支持中文输出,则最好使 Ja ...
- 06_Spring JDBCTemplate
Spring对不同持久化技术的支持 ORM持久化技术 模板类 JDBC org.springframework.jdbc.core.JdbcTemplate Hibernate3.0 org.spri ...
- 2019-8-26-当-ASP.NET-Core-链接找不到时可能的原因
title author date CreateTime categories 当 ASP.NET Core 链接找不到时可能的原因 lindexi 2019-08-26 18:52:28 +0800 ...
- HBase+Redis
- charles for https
To remotely capture http or https traffic with charles you will need to do the following: HOST - Mac ...