Draggables手机壳颜色拖拽颜色更换效果代码
代码语言:html
所属分类:拖放
代码描述:Draggables手机壳颜色拖拽颜色更换效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
box-sizing: border-box;
}
body {
overflow-x: hidden;
}
color-sidebar {
display: block;
position: absolute;
top: 0;
left: 0;
padding: 10px;
z-index: 2;
touch-action: none;
}
color-picker {
display: block;
position: relative;
}
color-item,
color-draggable {
display: block;
border-radius: 50%;
visibility: hidden;
opacity: 0;
box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.26);
cursor: move;
cursor: -webkit-grab;
cursor: grab;
}
color-item {
position: relative;
margin: 10px 10px 0 10px;
width: 40px;
height: 40px;
min-width: 40px;
min-height: 40px;
}
color-draggable {
top: 0;
left: 0;
width: 100%;
height: 100%;
position: absolute;
}
color-draggable.dragging {
cursor: -webkit-grabbing;
cursor: grabbing;
}
.phone-content {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding-left: 31px;
background: linear-gradient(white, #f2f2f2);
}
phone-container {
display: block;
position: relative;
width: 56.3555347092vmin;
padding-top: 159.7003745318%;
visibility: hidden;
opacity: 0;
}
#phone-svg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: visible !important;
}
#phone-mask-path {
fill: #fff;
stroke: #fff;
stroke-width: 4;
}
#phone-outline {
fill: white;
stroke: white;
stroke-width: 3;
vector-effect: non-scaling-stroke;
opacity: 0;
stroke: rgba(0, 0, 0, 0.2);
}
</style>
</head>
<body >
<section class="phone-content">
<phone-container>
<svg id="phone-svg" viewBox="0 0 1335 2132">
<filter id="drop-shadow" x="-100%" y="-100%" width="300%" height="300%">
<feGaussianBlur id="shadow-blur" in="SourceAlpha" stdDeviation="50"/>
<feOffset dx="0" dy="0" result="offsetblur"/>
<feFlood id="shadow-color" flood-color="#fff"/>
<feComposite in2="offsetblur" operator="in"/>
<feMerge>
<feMergeNode/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>
<mask id="phone-mask" maskUnits="userSpaceOnUse">
<path id="phone-mask-path" d="M390.001733,1932.5 C390.001733,1932.5 565.999988,1931.5 586.05712,1931.5 C606.114252,1931.5 6.........完整代码请登录后点击上方下载按钮下载查看
网友评论0