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
在我的一生中,我见证了社会深刻的变化.其中最深刻的,同时也是对人类影响与日俱增的变化,是人工智能的崛起.简单来说,我认为强大的人工智能的崛起,要么是人类历史上最好的事,要么是最糟的.我不得不说,是好是 ...
随机推荐
- idea-----Idea在不关闭project的情况下进行Import Project
Idea在不关闭project的情况下进行Import Project 引用:https://blog.csdn.net/qq_28198181/article/details/83069667
- CSS或HTML如何实现文字下面加点?
就像word里文字加着重号一样,在字的下面加一个点,用CSS怎么做?注意,我说的是下面加点,不是文字加粗或倾斜,请不要回答<strong>或<em>之类的. 把要着重加点的文字 ...
- PAT甲级——A1105 Spiral Matrix【25】
This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasi ...
- Jmeter安装与配置(第一篇)
Apache JMeter是Apache组织开发的基于Java的压力测试工具.用于对软件做压力测试,它最初被设计用于Web应用测试,但后来扩展到其他测试领域. 它可以用于测试静态和动态资源,例如静态文 ...
- 转载:Linux 安装Java
1.到官网下载 jdk-8u131-linux-x64.tar.gz 官网地址:http://www.Oracle.com/technetwork/java/javase/downloads/jdk8 ...
- webpack:Cannot find module 'extract-text-webpack-plugin'
问题: 在终端中使用此命令安装了extract-text-webpack-plugin,npm install -g extract-text-webpack-plugin并在webpack.conf ...
- spring boot项目搭建中遇到的问题
自己动手搭建一下spring boot的项目,中途遇到了几个问题,在这里记录一下! 一.关于数据库中的表设计的问题 1.设计表的时候一定要添加的两个字段created updated 创建时间与更新时 ...
- istringstream字符串流对象
1.读取字符串流对象 istringstream类用于执行C++风格的字符串流的输入操作. ostringstream类用于执行C++风格的字符串流的输出操作. strstream类同时可以支持C++ ...
- Spriongboot+quartz定时任务
y需求: 需要一个定时任务,比如 2019-5-10 10:00 执行一次期初库存推送的功能~ Spring自带的@Schedule() 的cron表达式不支持年份,所以考虑一下quartz定时任 ...
- 吴恩达《机器学习》课程总结(5)_logistic回归
Q1分类问题 回归问题的输出可能是很大的数,而在分类问题中,比如二分类,希望输出的值是0或1,如何将回归输出的值转换成分类的输出0,1成为关键.注意logistics回归又称 逻辑回归,但他是分类问题 ...