Wallpaper creating using HTML CSS JS

 


Youtube link - click here

SOURCE CODE:

<!DOCTYPE html>
<html>

<head>
    <title>
        Wallpaper
    </title>
    <style>
        .container {
            width: 200px;
            height: 90vh;
            background-color: black;
            color: white;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-wrap: wrap;
            margin: 0px auto;
            padding: 20px;
            position: relative;
            box-shadow: 0px 0px 10px 5px grey;
        }
       
        #notch {
            width: 10px;
            height: 10px;
            border: 1px solid white;
            border-radius: 50%;
            position: absolute;
            top: 10px;
        }
       
        #text {
            width: auto;
            font-size: 40px;
            font-family: cursive;
            text-align: center;
            text-shadow: 3px 3px grey;
        }
       
        #time {
            font-size: 25px;
            text-align: center;
        }
       
        #circle {
            width: 200px;
            height: 200px;
            border: 3px solid white;
            border-radius: 50%;
            position: absolute;
            bottom: 40px;
        }
    </style>
</head>

<body>
    <div class="container" onclick="WhileClick()">
        <div id="notch"></div>
        <div id="text">It Was All A Dream</div>
        <div id="time"></div>
        <div id="circle"></div>
    </div>
    <script>
        var time;
        var colors = ['red', 'blue', 'green', 'yellow', 'violet', 'pink', 'grey'];
        var i = 0;
        var j = colors.length;
        setInterval(function() {
            time = new Date();
            document.getElementById("time").innerHTML = time.toLocaleString();
        })

        function WhileClick() {
            document.getElementById("text").style.textShadow = "3px 3px " + colors[i];
            document.getElementsByClassName('container')[0].style.boxShadow = "0px 0px 10px 5px " + colors[j];
            i++;
            j--;
            if (i == colors.length) {
                i = 0;
                j = colors.length;
            }
        }
    </script>
</body>

</html>



Post a Comment

Post a Comment (0)

Previous Post Next Post