原生js实现一个图片裁剪效果代码
代码语言:html
所属分类:其他
代码描述:原生js实现一个图片裁剪效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
*, *::before, *::after {
font-family: inherit;
box-sizing: inherit;
margin: 0;
padding: 0;
}
html {
box-sizing: border-box;
font-family: 'Nunito Sans', sans-serif;
font-size: 62.5%;
}
html body {
font-size: 1.6rem;
margin: 0;
}
ul {
list-style: none;
}
a, a:link, a:visited {
text-decoration: none;
}
</style>
<style>
*, *::before, *::after {
margin: 0;
padding: 0;
box-sizing: inherit;
font-family: inherit;
}
html {
font-size: 62.5%;
overflow: hidden;
}
html body {
font-size: 1.6rem;
width: 100vw;
height: 100vh;
overflow: inherit;
background-color: #333;
display: -webkit-box;
display: flex;
-webkit-box-align: center;
align-items: center;
-webkit-box-pack: center;
justify-content: center;
}
.image-crop {
background-color: black;
position: relative;
overflow: hidden;
}
.image-crop figure {
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: contain;
}
.image-crop figure.blur {
-webkit-filter: blur(6px) brightness(0.33) saturate(0.5);
f.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0