Netbyzz

#A024
Clickable hide image

HTML :

<!-- CODE = #A024 -->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>NETBYZZ A024</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <div class="container">
    <div class="title"><b>Don't click</b></div>
    <div class="bloc-1"></div>
    <div class="bloc-2"></div>
    <img src="https://2.bp.blogspot.com/-2qkhBZuTrTM/UtfPGOhAVGI/AAAAAAAABOM/BXd6dU1WJho/s1600/cute+dog+wallpapers+free+download+1.jpg" alt="" />
    <div class="lock"></div>
  </div>
  <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
  <script src="script.js"></script>
</body>
</html>

CSS :

@import url(https://fonts.googleapis.com/css?family=Roboto);

html {
    width: 100%;
    height: 100%;
    display: table;
    table-layout: fixed;
}

body {
    width: 100%;
    height: 100%;
    display: table-cell;
    vertical-align: middle;
    background: #f4f4f4;
}

.container {
    background: #e6e6e6;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

[class|="bloc"] {
    background: #1253c8;
    width: 100%;
    height: 50%;
    position: absolute;
    transition: all .5s ease;
}

.isOpen {
    /* opacity: .3; */
    transition: all .5s ease;
}

.bloc-1 {
    top: 0;
}

.bloc-1.isOpen {
    /* top: -50%; */
    height: 20%;
}

.bloc-2 {
    bottom: 0;
}

.bloc-2.isOpen {
    /* bottom: -50%; */
    height: 0;
}

.lock {
    background: #ffc107;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    position: absolute;
    bottom: 40px;
    right: 40px;
    margin: -20px;
    cursor: pointer;
}

.lock:active {
    width: 36px;
    height: 36px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.25);
    margin: -18px;
}

.title {
    color: #fff;
    font-family: 'Roboto', sans-serif;
    position: absolute;
    width: 100%;
    height: 20%;
    z-index: 1;
    text-align: center;
    top: 50%;
    font-size: 24px;
    margin-top: -10%;
    line-height: 60px;
    transition: all .5s ease;
}

.title.isOpen {
    top: 0;
    margin: 0;
}

JS :

$(".lock").click(function () {
  $('[class|="bloc"').toggleClass("isOpen");
  $(".title").toggleClass("isOpen");
});

Source Code