Random



<!DOCTYPE html>

<html>

<head>

<title>Random</title>

</head>

<body>



<section>

<h2>Random</h2>

</section>



<script type="text/javascript">

function changeBg() {



const images = [

'url("back.jpg")',

'url("cover.jpg")',

'url("side.jpg")',



]



const section = document.querySelector('section')

const bg = images[Math.floor(Math.random()*images.length)];

section.style.backgroundImage = bg;

}

setInterval(changeBg, 1000)

</script>



<style type="text/css">

*{

margin: 0px;

padding: 0px;

font-family: arial;

box-sizing: border-box;

}



section{

position: absolute;

top: 0px;

left: 0px;

width: 100%;

height: 100vh;

background: url(cover.jpg);

display: flex;

justify-content: center;

align-items: center;

}

section h2{

font-size: 16vw;

color: #000;

background: #fff;

padding: 10px 40px;

mix-blend-mode: screen;

}

</style>

</body>

</html>

Comments

Popular posts from this blog

Right click disable

Moutain

Input Placeholder