Professional Documents
Culture Documents
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reflective Thinking</title>
<style>
body {
font-family: 'Arial', sans-serif;
text-align: center;
transition: background-color 0.5s;
margin: 0;
padding: 0;
}
h1 {
color: #333;
}
p {
color: #555;
}
button {
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
}
</style>
</head>
<body>
<h1>Reflective Thinking</h1>
<p>
Imagine you are a computer programmer. What kind of application would you
like to create, and how would it benefit people?
</p>
<script>
function changeBackgroundColor() {
const body = document.body;
const currentColor = window.getComputedStyle(body,
null).getPropertyValue('background-color');
const newColor = getRandomColor();
function getRandomColor() {
const letters = '0123456789ABCDEF';
let color = '#';
for (let i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
function isBrightColor(color) {
// Calculate brightness using relative luminance formula
const rgb = parseInt(color.substr(1), 16);
const r = (rgb >> 16) & 0xff;
const g = (rgb >> 8) & 0xff;
const b = (rgb >> 0) & 0xff;
const luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b;
return luminance > 128;
}
</script>
</body>
</html>