You are viewing a single comment's thread from:

RE: Object Type - html

in #waivio-object-type16 days ago

@wiv01 added htmlContent (English):

<!DOCTYPE html>
<html lang=en>
<head>
<meta charset=UTF-8>
<meta name=viewport content=width=device-width, initial-scale=1.0>
<title>Hello World Site</title>
<style>
   body 
       font-family: Arial, sans-serif;
       text-align: center;
       margin-top: 100px;
       background-color: white;
       transition: background-color 0.3s ease;
   
   button 
       padding: 10px 20px;
       font-size: 16px;
       cursor: pointer;
   
</style>
</head>
<body>
   <h1>Hello, World!</h1>
   <button onclick=changeColor()>Change Background Color</button>

   <script>
       function changeColor() 
           const colors = ['#FFCDD2', '#C8E6C9', '#BBDEFB', '#FFF9C4', '#E1BEE7'];
           const randomColor = colors[Math.floor(Math.random() * colors.length)];
           document.body.style.backgroundColor = randomColor;
       
   </script>
</body>
</html>