欢迎来到模板无忧!织梦模板,dede模板下载,织梦cms模板,免费网站模板下载站

模板无忧

图片边框运动动画达成

企业模板

<!DOCTYPE html>

怎么样达成图片的边框运动,这点在一些手机端的成效的常常应用,下面是图标边框运动达成代码:

<html lang="en" class="no-js">

<meta charset="UTF-8" />

<head>

<meta name="viewport" content="width=device-width, initial-scale=1">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="description" content="Border Animation Effect: Recreating the effect seen on carlphilippebrenner.com with SVG" />

<title>Border Animation Effect with SVG</title>

<!--<link rel="stylesheet" type="text/css" href="css/demo.css" />-->

<meta name="keywords" content="svg, border effect, animated border, line, grid item, hover, css" />

<style>

<!--<link rel="stylesheet" type="text/css" href="css/component.css" />-->

@font-face {

@import url(http://fonts.useso.com/css?family=Lato:300,400,700|Ruthie);

font-style: normal;

font-weight: normal;

src: url('../fonts/codropsicons/codropsicons.eot');

font-family: 'codropsicons';

}

src: url('../fonts/codropsicons/codropsicons.eot?#iefix') format('embedded-opentype'), url('../fonts/codropsicons/codropsicons.woff') format('woff'), url('../fonts/codropsicons/codropsicons.ttf') format('truetype'), url('../fonts/codropsicons/codropsicons.svg#codropsicons') format('svg');

*,

*:before {

*:after,

-moz-box-sizing: border-box;

-webkit-box-sizing: border-box;

}

box-sizing: border-box;

.clearfix:before,

content: '';

.clearfix:after {

}

display: table;

.clearfix:after {

}

clear: both;

body {

color: #ecf0f1;

background: #2c3e50;

line-height: 1.25;

font-size: 100%;

}

font-family: 'Lato', Arial, sans-serif;

a {

text-decoration: none;

color: #95a5a6;

}

outline: none;

a:hover,

color: #fff;

a:focus {

}

margin: 0 auto;

.codrops-header {

text-align: center;

padding: 2em;

}

margin: 0;

.codrops-header h1 {

font-size: 2.5em;

font-weight: 300;

}

display: block;

.codrops-header h1 span {

font-size: 0.6em;

padding: 0 0 0.6em 0.1em;

}

opacity: 0.7;

/* To Navigation Style */

width: 100%;

.codrops-TOP {

font-weight: 700;

text-transform: uppercase;

line-height: 2.2;

font-size: 0.69em;

}

display: inline-block;

.codrops-TOP a {

text-decoration: none;

padding: 0 1em;

}

letter-spacing: 1px;

.codrops-TOP span.right {

}

float: right;

.codrops-TOP span.right a {

float: left;

display: block;

}

margin: 0 4px;

.codrops-icon:before {

font-weight: normal;

text-transform: none;

font-variant: normal;

font-style: normal;

line-height: 1;

font-family: 'codropsicons';

-webkit-font-smoothing: antialiased;

speak: none;

}

content: "\e001";

.codrops-icon-drop:before {

}

content: "\e004";

.codrops-icon-prev:before {

}

padding: 4em 2em;

section {

}

text-align: center;

section h2 {

font-size: 2em;

font-weight: 300;

}

padding: 1em 0;

.codrops-header+section {

}

padding-TOP: 1.5em;

.related p {

}

font-size: 1.5em;

.related>a {

display: inline-block;

background: rgba(0, 0, 0, 0.05);

margin: 20px 10px;

text-align: center;

-webkit-transition: color 0.3s, background-color 0.3s;

padding: 25px;

}

transition: color 0.3s, background-color 0.3s;

.related a:hover {

}

background-color: rgba(0, 0, 0, 0.4);

.related a img {

opacity: 0.8;

max-width: 100%;

transition: opacity 0.3s;

-webkit-transition: opacity 0.3s;

}

.related a:active img {

.related a:hover img,

}

opacity: 1;

.related a h3 {

padding: 0.5em 0 0.3em;

margin: 0;

text-align: left;

max-width: 300px;

}

.codrops-icon span {

@media screen and (max-width: 25em) {

}

display: none;

}

width: 300px;

.box {

position: relative;

height: 460px;

display: inline-block;

background: rgba(255, 255, 255, 1);

cursor: pointer;

margin: 0 10px;

box-shadow: inset 0 0 0 3px #2c3e50;

color: #2c3e50;

transition: background 0.4s 0.5s;

-webkit-transition: background 0.4s 0.5s;

}

background: rgba(255, 255, 255, 0);

.box:hover {

transition-delay: 0s;

-webkit-transition-delay: 0s;

}

font-family: "Ruthie", cursive;

.box h3 {

line-height: 370px;

font-size: 180px;

font-weight: 400;

margin: 0;

}

width: 100%;

.box span {

font-weight: 400;

display: block;

letter-spacing: 1px;

text-transform: uppercase;

padding: 5px;

font-size: 13px;

}

.box span {

.box h3,

transition: color 0.4s 0.5s;

-webkit-transition: color 0.4s 0.5s;

}

.box:hover span {

.box:hover h3,

-webkit-transition-delay: 0s;

color: #fff;

}

transition-delay: 0s;

.box svg {

TOP: 0;

position: absolute;

}

left: 0;

.box svg line {

stroke: #ecf0f1;

stroke-width: 3;

-webkit-transition: all .8s ease-in-out;

fill: none;

}

transition: all .8s ease-in-out;

.box:hover svg line {

transition-delay: 0.1s;

-webkit-transition-delay: 0.1s;

}

.box svg line.bottom {

.box svg line.TOP,

}

stroke-dasharray: 330 240;

.box svg line.left,

stroke-dasharray: 490 400;

.box svg line.right {

}

-webkit-transform: translateX(-600px);

.box:hover svg line.TOP {

}

transform: translateX(-600px);

.box:hover svg line.bottom {

transform: translateX(600px);

-webkit-transform: translateX(600px);

}

-webkit-transform: translateY(920px);

.box:hover svg line.left {

}

transform: translateY(920px);

.box:hover svg line.right {

transform: translateY(-920px);

-webkit-transform: translateY(-920px);

/* Alternatives */

}

/* Color */

box-shadow: inset 0 0 0 10px #2c3e50;

.demo-2 .box {

}

.demo-2 .box:hover span {

.demo-2 .box:hover h3,

}

color: #fe6f83;

.demo-2 .box svg line {

}

stroke-width: 8;

.demo-2 .box:hover svg line {

}

stroke: #fe6f83;

/* Frame */

background: rgba(0, 0, 0, 0);

.demo-3 .box {

box-shadow: none;

color: #fff;

transition: background 0.3s;

-webkit-transition: background 0.3s;

}

background: rgba(0, 0, 0, 0.4);

.demo-3 .box:hover {

}

.demo-3 .box span {

.demo-3 .box h3,

transition: none;

-webkit-transition: none;

}

-webkit-transition: all .5s;

.demo-3 .box svg line {

}

transition: all .5s;

.demo-3 .box:hover svg line {

-webkit-transition-delay: 0s;

stroke-width: 10;

}

transition-delay: 0s;

.demo-3 .box:hover svg line.TOP {

transform: translateX(-300px);

-webkit-transform: translateX(-300px);

}

-webkit-transform: translateX(300px);

.demo-3 .box:hover svg line.bottom {

}

transform: translateX(300px);

.demo-3 .box:hover svg line.left {

transform: translateY(460px);

-webkit-transform: translateY(460px);

}

-webkit-transform: translateY(-460px);

.demo-3 .box:hover svg line.right {

}

transform: translateY(-460px);

/* Spin */

box-shadow: none;

.demo-4 .box {

-webkit-transition: none;

background: rgba(0, 0, 0, 0.4);

color: #fff;

transition: none;

}

.demo-4 .box span {

.demo-4 .box h3,

transform: scale(0.9);

-webkit-transform: scale(0.9);

backface-visibility: hidden;

-webkit-backface-visibility: hidden;

transition: transform 0.5s;

-webkit-transition: -webkit-transform 0.5s;

}

.demo-4 .box:hover span {

.demo-4 .box:hover h3,

transform: scale(1);

-webkit-transform: scale(1);

}

stroke-width: 30;

.demo-4 .box svg line {

transition: all .4s;

-webkit-transition: all .4s;

}

-webkit-transition-delay: 0s;

.demo-4 .box:hover svg line {

}

transition-delay: 0s;

.demo-4 .box:hover svg line {

}

stroke-width: 0;

.demo-4 .box svg line.TOP,

stroke-dasharray: 300;

.demo-4 .box svg line.bottom {

}

.demo-4 .box svg line.right {

.demo-4 .box svg line.left,

}

stroke-dasharray: 460;

.demo-4 .box:hover svg line.TOP {

transform: translateX(-300px);

-webkit-transform: translateX(-300px);

}

-webkit-transform: translateX(300px);

.demo-4 .box:hover svg line.bottom {

}

transform: translateX(300px);

.demo-4 .box:hover svg line.left {

transform: translateY(460px);

-webkit-transform: translateY(460px);

}

-webkit-transform: translateY(-460px);

.demo-4 .box:hover svg line.right {

}

transform: translateY(-460px);

<!--[if IE]>

</style>

<![endif]-->

<script src="http://html5shiv.谷歌code.com/svn/trunk/html5.js"></script>

</head>

<p class="container">

<body>

<h1>Border Animation Effect <span>Recreating the effect seen on <a href="http://carlphilippebrenner.com/">carlphilippebrenner.com</a> with SVG</span></h1>

<header class="codrops-header">

</header>

<p>Highly experimental, tested in Google Chrome and Firefox</p>

<p class="grid">

<section class="demo-1">

<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">

<p class="box">

<line class="left" x1="0" y1="460" x2="0" y2="-920" />

<line class="TOP" x1="0" y1="0" x2="900" y2="0" />

<line class="right" x1="300" y1="0" x2="300" y2="1380" />

<line class="bottom" x1="300" y1="460" x2="-600" y2="460" />

<h3>D</h3>

</svg>

<span>Broccoli, Asparagus, Curry</span>

<span>2012</span>

<p class="box">

</p>

<line class="TOP" x1="0" y1="0" x2="900" y2="0" />

<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">

<line class="bottom" x1="300" y1="460" x2="-600" y2="460" />

<line class="left" x1="0" y1="460" x2="0" y2="-920" />

</svg>

<line class="right" x1="300" y1="0" x2="300" y2="1380" />

<span>2013</span>

<h3>A</h3>

</p>

<span>Arugula, Chickweed</span>

<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">

<p class="box">

<line class="left" x1="0" y1="460" x2="0" y2="-920" />

<line class="TOP" x1="0" y1="0" x2="900" y2="0" />

<line class="right" x1="300" y1="0" x2="300" y2="1380" />

<line class="bottom" x1="300" y1="460" x2="-600" y2="460" />

<h3>S</h3>

</svg>

<span>Strawberry, Lemon</span>

<span>2014</span>

</p>

</p>

</section>

<!-- /grid -->

<h2>Color animation</h2>

<section class="demo-2">

<p class="box">

<p class="grid">

<line class="TOP" x1="0" y1="0" x2="900" y2="0" />

<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">

<line class="bottom" x1="300" y1="460" x2="-600" y2="460" />

<line class="left" x1="0" y1="460" x2="0" y2="-920" />

</svg>

<line class="right" x1="300" y1="0" x2="300" y2="1380" />

<span>2012</span>

<h3>J</h3>

</p>

<span>Walnut, Pineapple</span>

<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">

<p class="box">

<line class="left" x1="0" y1="460" x2="0" y2="-920" />

<line class="TOP" x1="0" y1="0" x2="900" y2="0" />

<line class="right" x1="300" y1="0" x2="300" y2="1380" />

<line class="bottom" x1="300" y1="460" x2="-600" y2="460" />

<h3>I</h3>

</svg>

<span>Curry, Beancurd</span>

<span>2013</span>

<p class="box">

</p>

<line class="TOP" x1="0" y1="0" x2="900" y2="0" />

<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">

<line class="bottom" x1="300" y1="460" x2="-600" y2="460" />

<line class="left" x1="0" y1="460" x2="0" y2="-920" />

</svg>

<line class="right" x1="300" y1="0" x2="300" y2="1380" />

<span>2014</span>

<h3>C</h3>

</p>

<span>Lettuce, Asparagus</span>

<!-- /grid -->

</p>

<section class="demo-3">

</section>

<p class="grid">

<h2>Frame</h2>

<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">

<p class="box">

<line class="left" x1="0" y1="460" x2="0" y2="-920" />

<line class="TOP" x1="0" y1="0" x2="900" y2="0" />

<line class="right" x1="300" y1="0" x2="300" y2="1380" />

<line class="bottom" x1="300" y1="460" x2="-600" y2="460" />

<h3>B</h3>

</svg>

<span>Marmalade, Honey</span>

<span>2012</span>

<p class="box">

</p>

<line class="TOP" x1="0" y1="0" x2="900" y2="0" />

<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">

<line class="bottom" x1="300" y1="460" x2="-600" y2="460" />

<line class="left" x1="0" y1="460" x2="0" y2="-920" />

</svg>

<line class="right" x1="300" y1="0" x2="300" y2="1380" />

<span>2013</span>

<h3>U</h3>

</p>

<span>Beans, Chickweed</span>

<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">

<p class="box">

<line class="left" x1="0" y1="460" x2="0" y2="-920" />

<line class="TOP" x1="0" y1="0" x2="900" y2="0" />

<line class="right" x1="300" y1="0" x2="300" y2="1380" />

<line class="bottom" x1="300" y1="460" x2="-600" y2="460" />

<h3>Q</h3>

</svg>

<span>Broccoli, Lettuce</span>

<span>2014</span>

</p>

</p>

</section>

<!-- /grid -->

<h2>Border spin</h2>

<section class="demo-4">

<p class="box">

<p class="grid">

<line class="TOP" x1="0" y1="0" x2="900" y2="0" />

<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">

<line class="bottom" x1="300" y1="460" x2="-600" y2="460" />

<line class="left" x1="0" y1="460" x2="0" y2="-920" />

</svg>

<line class="right" x1="300" y1="0" x2="300" y2="1380" />

<span>2012</span>

<h3>C</h3>

</p>

<span>Berry, Spinach</span>

<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">

<p class="box">

<line class="left" x1="0" y1="460" x2="0" y2="-920" />

<line class="TOP" x1="0" y1="0" x2="900" y2="0" />

<line class="right" x1="300" y1="0" x2="300" y2="1380" />

<line class="bottom" x1="300" y1="460" x2="-600" y2="460" />

<h3>A</h3>

</svg>

<span>Arugula, Chickweed</span>

<span>2013</span>

<p class="box">

</p>

<line class="TOP" x1="0" y1="0" x2="900" y2="0" />

<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">

<line class="bottom" x1="300" y1="460" x2="-600" y2="460" />

<line class="left" x1="0" y1="460" x2="0" y2="-920" />

</svg>

<line class="right" x1="300" y1="0" x2="300" y2="1380" />

<span>2014</span>

<h3>J</h3>

</p>

<span>Broccoli, Asparagus, Lettuce</span>

<!-- /grid -->

</p>

</p>

</section>

</body>

<!-- /container -->

</html>


希望以上内容可以解决您的问题!
如有其他问题欢迎大家一起交流学习!
作者:模板无忧 来源:www.nsxcb.cn 关注: 时间:2021-04-30 06:00
版权声明:凡注明来源为http://www.nsxcb.cn的均为本站原创,转载请注明来源。
本文网址:http://www.nsxcb.cn/CSS/CSS3/20210430/12427.html
凡本站提供教程均已验证教程的准确性。
相关教程
在线客服

织梦模板 整站模板 新手教程 使用技巧