js+css实现照片挂在墙上摆动选择效果代码

代码语言:html

所属分类:画廊相册

代码描述:js+css实现照片挂在墙上摆动选择效果代码

代码标签: js css 照片 挂在 墙上 摆动 选择

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

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

<head>
 
<meta charset="UTF-8">

 
 
<style>
@import url("https://fonts.googleapis.com/css2?family=Open+Sans&family=Raleway&family=Poppins&display=swap");

body {
        display: flex;
        font-family: "Open Sans", sans-serif;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        margin: 0;
        background-color: #f0f0f0;
}

.badge {
        position: absolute;
        top: -5px;
        right: -25px;
        width: 20px;
        border-radius: 50%;
        background: #f00;
}

.photo[active] {
        /* transition: all 0.5s;
        transform: scale(1.3); */
        &:hover {
                /* transition: all 0.5s;
                transform: scale(1.6) rotate(-3deg); */
        }
}

.gallery {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
        max-width: 800px;
        padding: 10px;
        background-color: white;
        border-radius: 10px;
        box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
        background: linear-gradient(to left top, #888, #ddd);
}

.photo {
        text-align: center;
        opacity: 0.8;
        &:hover {
                transition: all 0.5s;
                /* transform: translateY(15px) scale(1.1) rotate(3deg); */
                opacity: 1;
                animation-play-state: paused;
                & figcaption {
                        transition: all 0.7s;
                        color: black;
                }
        }
}

.photo img {
        max-width: 100%;
        height: auto;
        border-radius: 5px;
        margin-bottom: 10px;
        background: white;
        padding: 10px 10px 35px;
        text-align: center;
        text-decoration: none;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
        transition: all 0.15s linear;
        z-index: 0;
        position: relative;
}

.photo figcaption {
        position: relative;
        left: 10px;
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0