DEV Community

Cover image for Notice Board Realistic illusion using html css and javascript https://www.instagram.com/webstreet_code/
Prince
Prince

Posted on

Notice Board Realistic illusion using html css and javascript https://www.instagram.com/webstreet_code/

Follow us on instagram: https://www.instagram.com/webstreet_code/

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Notice Board</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Shadows+Into+Light&display=swap');

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

        .notice-board {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-around;
            align-items: center;
            width: 80%;
            height: 80vh;
            gap: 20px;
            padding: 20px;
            background-color: #54290a; /* Brown background */
            border: 10px solid #6b3e1b; /* Darker brown border */
            border-radius: 12px;
            box-shadow: 0 20px 35px rgba(0, 0, 0, 0.4);
        }

        .notice {
            width: 200px;
            height: 170px;
            background-color: #f5f5dc;
            padding: 15px;
            position: relative;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            border-radius: 10px;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            font-family: 'Shadows Into Light', cursive;
            font-size: 1.1rem;
            color: #333;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            transform: rotate(-5deg); /* Initial skew effect */
        }

        .notice:hover {
            transform: translateY(-8px) rotate(-3deg);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
        }

        .pin {
            position: absolute;
            top: -8px;
            left: 50%;
            transform: translateX(-50%);
            width: 18px;
            height: 18px;
            background-color: red;
            border-radius: 50%;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
            z-index: 1;
        }

        /* Adding unique skews and background colors for each notice */
        .notice:nth-child(1) {
            background-color: #FFECB3; /* Light Yellow */
            transform: rotate(-2deg);
        }

        .notice:nth-child(2) {
            background-color: #C8E6C9; /* Light Green */
            transform: rotate(2deg);
        }

        .notice:nth-child(3) {
            background-color: #FFCDD2; /* Light Pink */
            transform: rotate(-4deg);
        }

        .notice:nth-child(4) {
            background-color: #D1C4E9; /* Lavender */
            transform: rotate(3deg);
        }

    </style>
</head>
<body>
    <div class="notice-board">
        <div class="notice">
            <div class="pin"></div>
            <p>Meeting scheduled at 3 PM today. Don't miss it!</p>
        </div>
        <div class="notice">
            <div class="pin"></div>
            <p>Project submissions are due by Friday!</p>
        </div>
        <div class="notice">
            <div class="pin"></div>
            <p>Follow webstreet_code. 
                <img src="./webstreet.png" 
                style="width: 40px;height: 40px;
                 border-radius: 50%;" alt="">
            </p>
        </div>
        <div class="notice">
            <div class="pin"></div>
            <p>Team outing planned next month. RSVP soon!</p>
        </div>
    </div>
</body>
</html>

Enter fullscreen mode Exit fullscreen mode

Top comments (0)