<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>世界最伟大程序</title>
<style>
body {
background: linear-gradient(to right, red, yellow);
height: 100vh;
margin: 0;
}
</style>
</head>
<body>
<script>
document.body.addEventListener('click', function()
{
var currentBackground = window.getComputedStyle(document.body, null).backgroundImage;
if (currentBackground.includes('to right')) {
document.body.style.background = 'linear-gradient(to left, red, yellow)';
} else {
document.body.style.background = 'linear-gradient(to right, red, yellow)';
}
});
</script>
</body>
</html>