svg的案例详解-
发布时间:08/01 来源:未知 浏览:
关键词:
svg的几个小案例
比来时常用到svg,闲的无聊的时候做了几个简略的小例子,但愿能帮到大家,svg会用了之后做动画和图片都利便了好多,接下来就看看小例子吧!!
1、例子一
css代码
html, body { width: 100%; height: 100%;}body { background: #131518;}#patt1 path { stroke: #ff509e;}#patt2 path { stroke: #95d13c;}#patt3 path { stroke: #00b6cb;}#patt4 path { stroke: #9753e1;}#mask1 rect { -webkit-animation: pulse 1.90476s infinite; animation: pulse 1.90476s infinite; -webkit-animation-timing-function: cubic-bezier(0.445, 0.05, 0.55, 0.95); animation-timing-function: cubic-bezier(0.445, 0.05, 0.55, 0.95);}#mask2 rect { x: 10; -webkit-animation: pulse 1.90476s infinite 0.47619s; animation: pulse 1.90476s infinite 0.47619s; -webkit-animation-timing-function: cubic-bezier(0.445, 0.05, 0.55, 0.95); animation-timing-function: cubic-bezier(0.445, 0.05, 0.55, 0.95);}#squiggle1, #squiggle2, #squiggle3, #squiggle4 { background-blend-mode: multiply;}@-webkit-keyframes pulse { 0% {x: 10; } 50% {x: -20; } 100% {x: -50; }} @keyframes pulse { 0% {x: 10; } 50% {x: -20; } 100% {x: -50; }}
html代码
例子二
css代码
.st0{fill:none;stroke:#000000;stroke-miterlimit:10;}.st1{fill:#7100BF;stroke:#000000;stroke-miterlimit:10;}.box{width: 600px;height: 600px;}
html代码
例子三
能够实现互动和滤镜结果
以上就是svg的案例详解的细致内容,更多请关注 百分百源码网 其它相干文章!