yunzi7's picture
merge
c90fe2b
raw
history blame
1.2 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Random Topic Recommendation</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-family: Arial, sans-serif;
}
h1 {
font-size: 2em;
color: #333;
}
</style>
</head>
<body>
<h1 id="topic">์ฃผ์ œ๊ฐ€ ์—ฌ๊ธฐ์— ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค</h1>
<script>
// ์ฃผ์ œ ์—…๋ฐ์ดํŠธ ํ•จ์ˆ˜
function updateTopic() {
fetch('/get_topic')
.then(response => response.json())
.then(data => {
document.getElementById('topic').textContent = data.topic;
})
.catch(error => console.error('Error fetching topic:', error));
}
// ํŽ˜์ด์ง€๊ฐ€ ๋กœ๋“œ๋  ๋•Œ ์ฃผ์ œ ์—…๋ฐ์ดํŠธ
updateTopic();
// 20์ดˆ๋งˆ๋‹ค ์ฃผ์ œ ์—…๋ฐ์ดํŠธ
setInterval(updateTopic, 20000);
</script>
</body>
</html>