css实现墙上挂画打开聚光灯效果代码

代码语言:html

所属分类:其他

代码描述:css实现墙上挂画打开聚光灯效果代码

代码标签: css 墙上 挂画 打开 聚光灯

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

 
<meta charset="UTF-8">
 

 
 
 
 
<style>
body
{
 
background: #ce8f3e;
 
display: flex;
 
flex-direction: row;
 
flex-wrap: wrap;
}
section
{
 
position: relative;
 
width: 450px;
 
height: 345px;
 
flex: 0 0 450px;
}
section
.switch {
 
display: none;
}
section
.lamp {
 
position: absolute;
 
width: 100%;
 
height: 100%;
 
--line-d: path('M40,105V240');
 
--pommel-cy: 240px;
 
--bulb-fill: #ccc;
 
--glow-fill: none;
}
section
.lamp use {
 
cursor: pointer;
}
.switch:checked + .lamp {
 
--line-d: path('M40,105V280');
 
--pommel-cy: 280px;
 
--bulb-fill: #ff0;
 
--glow-fill: url(#light);
}
section img
{
 
position: absolute;
 
top: 115px;
 
left: 130px;
 
width: 225px;
 
filter: brightness(30%);
}
section:has(:checked) img {
 
filter: drop-shadow(5px 5px 3px black);
}
</style>


</head>

<body>
 
<svg width="0" height="0">
 
<symbol id="lamp" viewBox="0 0 600 500">
    <radialGradien.........完整代码请登录后点击上方下载按钮下载查看

网友评论0