使用纯CSS生成的照相机效果, 相关CSS代码如下:

.container {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
border-radius: 5px;
box-shadow: 0px 30px 50px -20px rgba(0, 0, 0, 0.7);
-webkit-animation: 5s angle infinite;
animation: 5s angle infinite;
}
.camera-top,
.camera-mid,
.camera-bottom {
width: 360px;
}
.camera-top {
height: 60px;
background: -webkit-linear-gradient(left, #e2e2e2 0%, #f5f5f5 10%, #f5f5f5 90%, #e2e2e2 100%);
background: linear-gradient(to right, #e2e2e2 0%, #f5f5f5 10%, #f5f5f5 90%, #e2e2e2 100%);
border: 1px solid #DCDCDC;
border-top-left-radius: 5px;
}
.camera-top:before {
display: block;
content: '';
position: absolute;
top: -20px;
right: 0;
width: 210px;
height: 20px;
background: -webkit-linear-gradient(left, #f5f5f5 0%, #f5f5f5 174px, #e2e2e2 100%);
background: linear-gradient(to right, #f5f5f5 0%, #f5f5f5 174px, #e2e2e2 100%);
border: 1px solid #DCDCDC;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-bottom: none;
box-shadow: inset 0 15px 15px -15px #FDFDFD;
}
.camera-top .zoom {
position: absolute;
top: -15px;
left: 30px;
width: 42px;
height: 9px;
background: -webkit-linear-gradient(left, #b0b0b0 0%, #e2e2e2 30%, #e2e2e2 50%, #e2e2e2 70%, #b0b0b0 100%);
background: linear-gradient(to right, #b0b0b0 0%, #e2e2e2 30%, #e2e2e2 50%, #e2e2e2 70%, #b0b0b0 100%);
border: 1px solid #A3A3A3;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
box-shadow: inset 0 15px 15px -15px #FDFDFD;
}
.camera-top .zoom:before {
display: block;
content: '';
position: relative;
top: -6px;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
width: 20px;
height: 4px;
background: -webkit-linear-gradient(left, #b0b0b0 0%, #e2e2e2 50%, #b0b0b0 100%);
background: linear-gradient(to right, #b0b0b0 0%, #e2e2e2 50%, #b0b0b0 100%);
border: 1px solid #A3A3A3;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
.camera-top .zoom:after {
display: block;
content: '';
position: relative;
top: 3px;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
width: 46px;
height: 4px;
background: -webkit-linear-gradient(left, #b0b0b0 0%, #e2e2e2 30%, #e2e2e2 50%, #e2e2e2 70%, #b0b0b0 100%);
background: linear-gradient(to right, #b0b0b0 0%, #e2e2e2 30%, #e2e2e2 50%, #e2e2e2 70%, #b0b0b0 100%);
border: 1px solid #A3A3A3;
border-bottom: none;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
}
.camera-top .mode-changer {
position: absolute;
top: -20px;
left: 82px;
width: 60px;
height: 16px;
background: -webkit-linear-gradient(left, #b0b0b0 0%, #e2e2e2 30%, #e2e2e2 50%, #e2e2e2 70%, #b0b0b0 100%);
background: linear-gradient(to right, #b0b0b0 0%, #e2e2e2 30%, #e2e2e2 50%, #e2e2e2 70%, #b0b0b0 100%);
border: 1px solid #A3A3A3;
border-radius: 3px;
box-shadow: inset 0 15px 15px -15px #FDFDFD;
}
.camera-top .mode-changer:after {
display: block;
content: '';
position: absolute;
top: 16px;
left: 50%;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
width: 50px;
height: 2px;
background: -webkit-linear-gradient(left, #b0b0b0 0%, #e2e2e2 30%, #e2e2e2 50%, #e2e2e2 70%, #b0b0b0 100%);
background: linear-gradient(to right, #b0b0b0 0%, #e2e2e2 30%, #e2e2e2 50%, #e2e2e2 70%, #b0b0b0 100%);
border: 1px solid #A3A3A3;
border-bottom: none;
}
.camera-top .sides {
width: 100%;
}
.camera-top .sides:before,
.camera-top .sides:after {
display: block;
content: '';
position: absolute;
top: 24px;
width: 8px;
height: 30px;
background: -webkit-linear-gradient(top, #828181 0%, #696767 10%, #4f4d4d 50%, #403e3f 100%);
background: linear-gradient(to bottom, #828181 0%, #696767 10%, #4f4d4d 50%, #403e3f 100%);
border: 1px solid #3E3C3D;
border-radius: 2px;
box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.5);
}
.camera-top .sides:before {
left: -4px;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
.camera-top .sides:after {
right: -4px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
.camera-top .range-finder {
position: absolute;
top: 10px;
left: 105px;
width: 30px;
height: 20px;
background: #3E3C3D;
border-radius: 3px;
box-shadow: inset 0 0 5px 3px #333132;
}
.camera-top .range-finder:before {
display: block;
content: '';
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
width: 12px;
height: 12px;
background: #797878;
border-radius: 100%;
}
.camera-top .focus {
position: absolute;
top: -14px;
left: 156px;
width: 15px;
height: 15px;
background: #3F3D3E;
border-radius: 100%;
box-shadow: inset 0 0 4px 3px #2D2B2B, inset 0 4px 5px 0 #F5F5F5, inset 0 -3px 4px -2px #A3A2A2;
}
.camera-top .red {
position: absolute;
top: 5px;
left: 165px;
width: 30px;
height: 30px;
background: #DC2839;
border-radius: 100%;
}
.camera-top .view-finder {
position: absolute;
left: 210px;
width: 48px;
height: 30px;
background: -webkit-radial-gradient(center ellipse, #828181 0%, #403e3f 85%, #403e3f 100%);
background: radial-gradient(ellipse at center, #828181 0%, #403e3f 85%, #403e3f 100%);
border: 3px solid #312F2F;
border-radius: 4px;
box-shadow: inset 0 8px 8px -8px #FDFDFD;
}
.camera-top .flash {
position: absolute;
top: -6px;
right: 20px;
width: 58px;
height: 46px;
background: -webkit-radial-gradient(center ellipse, #828181 0%, #403e3f 70%, #403e3f 100%);
background: radial-gradient(ellipse at center, #828181 0%, #403e3f 70%, #403e3f 100%);
border: 2px solid #312F2F;
border-radius: 3px;
box-shadow: inset 0 8px 8px -8px #FDFDFD;
}
.camera-top .flash:before,
.camera-top .flash:after {
display: block;
content: '';
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.camera-top .flash:before {
width: 90%;
height: 70%;
background: -webkit-radial-gradient(center ellipse, #696767 0%, #1e1e1e 50%, #1e1e1e 100%);
background: radial-gradient(ellipse at center, #696767 0%, #1e1e1e 50%, #1e1e1e 100%);
}
.camera-top .flash:after {
width: 16px;
height: 14px;
background: #797979;
border-top-left-radius: 8px 2px;
border-top-right-radius: 8px 2px;
border-bottom-left-radius: 8px 2px;
border-bottom-right-radius: 8px 2px;
}
.camera-top .flash .light {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
width: 20px;
height: 20px;
background: -webkit-radial-gradient(center ellipse, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
background: radial-gradient(ellipse at center, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
border-radius: 100%;
z-index: 2;
-webkit-animation: 1s flash infinite;
animation: 1s flash infinite;
}
.camera-mid {
position: relative;
height: 130px;
background: -webkit-linear-gradient(left, #e4e4e4 0%, #fafafa 10%, #fafafa 90%, #e4e4e4 100%);
background: linear-gradient(to right, #e4e4e4 0%, #fafafa 10%, #fafafa 90%, #e4e4e4 100%);
border: 1px solid #DCDCDC;
border-top: none;
border-bottom: none;
box-shadow: inset 0 15px 15px -15px #FDFDFD;
}
.camera-mid .sensor {
position: absolute;
top: 40px;
left: 105px;
width: 30px;
height: 30px;
background: #545252;
border: 2px solid #545252;
border-radius: 100%;
box-shadow: inset 0 12px 12px -10px #FDFDFD, 0 2px 5px 1px rgba(0, 0, 0, 0.3);
}
.camera-mid .sensor:before,
.camera-mid .sensor:after {
display: block;
content: '';
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.camera-mid .sensor:before {
width: 20px;
height: 20px;
background: -webkit-linear-gradient(top, #E9E9E9 0%, #BDBDBD 100%);
background: linear-gradient(to bottom, #E9E9E9 0%, #BDBDBD 100%);
border-radius: 100%;
}
.camera-mid .sensor:after {
width: 12px;
height: 12px;
background: #FAFAFA;
border-radius: 100%;
box-shadow: 0 2px 3px 0 #747474;
}
.camera-mid .lens {
position: absolute;
top: -20px;
left: 130px;
width: 155px;
height: 155px;
background: -webkit-radial-gradient(center ellipse, #000000 0%, #000000 15%, #272525 30%, #403e3f 30%, #403e3f 31%, #403e3f 40%, #e9ebec 41%, #e9ebec 44%, #b0b1b2 48%, #e8e9ea 50%, #e8e9ea 60%, #f7f8f8 60%, #787979 65%, #ffffff 66%, #ffffff 100%);
background: radial-gradient(ellipse at center, #000000 0%, #000000 15%, #272525 30%, #403e3f 30%, #403e3f 31%, #403e3f 40%, #e9ebec 41%, #e9ebec 44%, #b0b1b2 48%, #e8e9ea 50%, #e8e9ea 60%, #f7f8f8 60%, #787979 65%, #ffffff 66%, #ffffff 100%);
border: 1px solid #B6B7B8;
border-radius: 100%;
box-sizing: border-box;
box-shadow: 0 7px 15px -2px rgba(0, 0, 0, 0.4), inset 0 -2px 15px -2px rgba(0, 0, 0, 0.2), inset 0 7px 15px -2px #FFF;
}
.camera-mid .lens:before {
display: block;
content: '';
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
width: 25px;
height: 25px;
background: rgba(0, 0, 0, 0.7);
border-radius: 100%;
box-shadow: inset 0 5px 3px -2px rgba(255, 255, 255, 0.5), inset 0 -5px 20px -8px rgba(255, 255, 255, 0.5);
}
.camera-bottom {
height: 16px;
background: -webkit-linear-gradient(left, #e2e2e2 0%, #f5f5f5 10%, #f5f5f5 90%, #e2e2e2 100%);
background: linear-gradient(to right, #e2e2e2 0%, #f5f5f5 10%, #f5f5f5 90%, #e2e2e2 100%);
border: 1px solid #DCDCDC;
border-bottom: none;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
box-shadow: inset 0 15px 15px -15px #FDFDFD, inset 0 -12px 12px -10px #797979;
}
@-webkit-keyframes flash {
0% {
width: 0;
height: 0;
}
20% {
width: 200px;
height: 200px;
}
25% {
width: 0;
height: 0;
}
45% {
width: 200px;
height: 200px;
}
50% {
width: 0;
height: 0;
}
100% {
width: 0;
height: 0;
}
}
@keyframes flash {
0% {
width: 0;
height: 0;
}
20% {
width: 200px;
height: 200px;
}
25% {
width: 0;
height: 0;
}
45% {
width: 200px;
height: 200px;
}
50% {
width: 0;
height: 0;
}
100% {
width: 0;
height: 0;
}
}
@-webkit-keyframes angle {
0% {
-webkit-transform: translate(-50%, -50%) rotate(0deg);
transform: translate(-50%, -50%) rotate(0deg);
box-shadow: 0px 30px 50px -20px rgba(0, 0, 0, 0.7);
}
25% {
-webkit-transform: translate(-50%, -50%) rotate(2deg);
transform: translate(-50%, -50%) rotate(2deg);
box-shadow: 10px 30px 50px -20px rgba(0, 0, 0, 0.7);
}
75% {
-webkit-transform: translate(-50%, -50%) rotate(-2deg);
transform: translate(-50%, -50%) rotate(-2deg);
box-shadow: -10px 30px 50px -20px rgba(0, 0, 0, 0.7);
}
100% {
-webkit-transform: translate(-50%, -50%) rotate(0deg);
transform: translate(-50%, -50%) rotate(0deg);
box-shadow: 0px 30px 50px -20px rgba(0, 0, 0, 0.7);
}
}
@keyframes angle {
0% {
-webkit-transform: translate(-50%, -50%) rotate(0deg);
transform: translate(-50%, -50%) rotate(0deg);
box-shadow: 0px 30px 50px -20px rgba(0, 0, 0, 0.7);
}
25% {
-webkit-transform: translate(-50%, -50%) rotate(2deg);
transform: translate(-50%, -50%) rotate(2deg);
box-shadow: 10px 30px 50px -20px rgba(0, 0, 0, 0.7);
}
75% {
-webkit-transform: translate(-50%, -50%) rotate(-2deg);
transform: translate(-50%, -50%) rotate(-2deg);
box-shadow: -10px 30px 50px -20px rgba(0, 0, 0, 0.7);
}
100% {
-webkit-transform: translate(-50%, -50%) rotate(0deg);
transform: translate(-50%, -50%) rotate(0deg);
box-shadow: 0px 30px 50px -20px rgba(0, 0, 0, 0.7);
}
}
 

在线预览:  http://igeekbar.com/igclass/code/af644b88-36ea-4987-ac87-19dbef222f34.htm

前端特效: 使用CSS生成的闪光照相机效果的更多相关文章

  1. 前端Html和Css面试题

    前端Html和Css面试题Html篇:1.你做的页面在哪些流览器测试过?这些浏览器的内核分别是什么? IE: trident内核 Firefox:gecko内核 Safari:webkit内核 Ope ...

  2. 前端html、CSS快速编写代码插件-Emmet使用方法技巧详解

    前端html.CSS快速编写代码插件-Emmet使用方法技巧详解   Emmet的前身是大名鼎鼎的Zen coding,如果你从事Web前端开发的话,对该插件一定不会陌生.它使用仿CSS选择器的语法来 ...

  3. 李洪强和你一起学习前端之(6)css行高,盒模型,外边距

    李洪强和你一起学习前端之(6)css行高,盒模型,外边距 复习昨天的知识 1.1css书写位置: 内嵌式写法 外联式写法 <link href = "1.css" rel = ...

  4. Web前端篇:CSS常用格式化排版、盒模型、浮动、定位、背景边框属性

    目录 Web前端篇:CSS常用格式化排版.盒模型.浮动.定位.背景边框属性 1.常用格式化排版 2.CSS盒模型 3.浮动 4.定位 5.背景属性和边框属性 6.网页中规范和错误问题 7.显示方式 W ...

  5. 前端第二篇---前端基础之CSS

    前端第二篇---前端基础之CSS 目录 一.css介绍 二.css语法 三.css的几种引入方式 四.css选择器 五.css属性相关 六.盒子模型 拓展 一.css介绍 CSS(Cascading  ...

  6. 前端开发:css基础知识之盒模型以及浮动布局。

    前端开发:css基础知识之盒模型以及浮动布局 前言 楼主的蛮多朋友最近都在学习html5,他们都会问到同一个问题 浮动是什么东西?  为什么这个浮动没有效果?  这个问题楼主已经回答了n遍.今天则是把 ...

  7. 前端之DIV+CSS布局

    刚开始学习javaweb,首先定位学习后端,可是随着学习的深入和项目的进行,越来越发现前端知识的欠缺,之前也随着视频看过,随着时间的流逝,具体的应用也随之忘记了. 而现在开始自己练习项目,发现前端知识 ...

  8. 2.前端笔记之css

    title: 1.前端笔记之CSS date: 2016-04-05 23:05:51 tags: 前端 categories: w3c --- 作者:刘耀 **出处:http://www.liuya ...

  9. 前端必会css整理

    1.设置css样式的三种方式?         外部样式表,引入一个外部css文件         内部样式表,将css代码放在<head>标签内部         内联样式,将css样式 ...

随机推荐

  1. Java Web乱码分析及解决方式(一)——GET请求乱码

    引言:     在进行Web開始时.乱码是我们最常常遇到也是最主要的问题.有经验的程序员非常easy能解决,刚開始学习的人则easy被泥潭困住. 并且非常多时候.我们即使攻克了乱码问题也是不明就里.往 ...

  2. 支持xp风格的manifest

    MSDN 和一些网站上的manifest 有问题 ,  自己修改了一下加上Microsoft.VC80.DebugCRT 和 Microsoft.VC80.DebugMFC 就可以了.如果是relea ...

  3. CAD二次开发起步

    1 环境搭建(VS 2017 + CAD 2019) CAD版本一般要比VS版本晚两年以上,比如我现在使用VS2017,则CAD要用2019版,至于CAD2018能不能用没试验过,有兴趣的小伙伴可以试 ...

  4. git合并的时候,冲突问题Merging is not possible because you have unmerged files

    在做项目工作的时候,同事修改了代码一个cpp代码,我同样也修改了代码,两人代码冲突了,提交之后,他代码git自动合并,并提示: [master| MERGEING]$ git merge my_new ...

  5. 好汉两个半第十二季/全集Two and a Half Men迅雷下载

    本季Two And A Half Men Season 12 (2014)看点:<好汉两个半>的“半个”是因为第一季播出时杰克年纪太小,只能算半个.故事就在这三个主角和他们周围的女人中发生 ...

  6. ExtJS 4.2 教程-07:Ext.Direct

    转载自起飞网,原文地址:http://www.qeefee.com/extjs-course-7-Ext-Direct ExtJS 4.2 教程-01:Hello ExtJS ExtJS 4.2 教程 ...

  7. 架构模式逻辑层模式之:表模块(Table Model)

    表模块和领域模型比,有两个显著区别: 1:表模块中的类和数据库表基本一一对应,而领域模型则无此要求: 2:表模块中的类的对象处理表中的所有记录,而领域模型的一个对象代表表中的一行记录: 一般情况下,我 ...

  8. [转]RSA,DSA等加解密算法介绍

    From : http://blog.sina.com.cn/s/blog_a9303fd90101cgw4.html 1)      MD5/SHA MessageDigest是一个数据的数字指纹. ...

  9. 前端框架amaze ui

    支持jquery.react 支持web.移动端 http://t.amazeui.org/#/docs/getting-started?_k=syk56p http://dingtalk.amaze ...

  10. MD5加密算法中的加盐值 ,和彩虹表攻击 防止彩虹表撞库

    一.什么是彩虹表? 彩虹表(Rainbow Tables)就是一个庞大的.针对各种可能的字母组合预先计算好的哈希值的集合,不一定是针对MD5算法的,各种算法的都有,有了它可以快速的破解各类密码.越是复 ...