socialize/index.html
2021-08-23 11:31:11 +02:00

113 lines
3.6 KiB
HTML

<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>socialize</title>
<link rel="icon" type="image/png" href="./favicon.png" />
<style>
body {
background-color: #edecd8;
}
#container {
left: 0px;
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 100%;
}
#footer {
bottom: 0px;
left: 0px;
position: absolute;
width: 100%;
}
#question {
color: #52768a;
display: block;
font-family: serif;
font-size: 200%;
margin: 0px 20px 15px 20px;
text-align: center;
vertical-align: middle;
}
#new-question {
opacity: 0;
transition: opacity 1s ease-in 0.5s;
}
a {
color: #bbb8ae;
display: block;
font-family: sans-serif;
padding: 10px;
text-align: center;
text-decoration: none;
vertical-align: middle;
}
</style>
</head>
<body>
<div id="container">
<p id="question">Please enable JavaScript.</p>
<a id="new-question" href="">new question</a>
</div>
<div id="footer">
<a href="">about</a>
</div>
<script>
// Questions
const questions = [
"Are you a cat person or a dog person?",
"Are you a lasagne or a tortellini person?",
"Did you know that nutmeg has a halucinogenic effect?",
"Did you know that the stripes of a zebra protect it from mosquitoes?",
"Do you like being asked stupid questions?",
"Do you sympathize more with the Empire or the Rebels?",
"Do you think conversation starter questions are stupid?",
"What did you miss most during the Covid-19 pandemic?",
"What do you normally do for fun?",
"What is the dumbest way you have been injured?",
"What is the most useless talent you have?",
"What is the worst purchase you have ever made?",
"What is your animal of the day?",
"What is your favourite Austin Powers movie?",
"What is your favourite Gilmore Girls episode?",
"What is your favourite beer brewery?",
"What is your favourite drink?",
"What is your favourite food?",
"What is your hidden talent?",
"What is your net income?",
"What is your preferred spaghetti sauce?",
"What will finally break the internet?",
"What would you name your boat if you had one?",
"What would you name your spaceship if you had one?",
"Which fruit describes you best?",
"Would you rather be always 15 minutes late or always 30 minutes early?",
"Would you rather have drill-hands or rollerblade-feet?",
"Would you take the red pill or the blue pill?",
];
// Get random question
let question = questions[Math.floor(Math.random() * questions.length)];
// Sleep function
const sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay));
// Function which types the question
const typeQuestion = async () => {
for (let i = 0; i <= question.length; i++) {
document.getElementById("question").innerHTML = question.slice(0, i);
await sleep(50);
}
document.getElementById("new-question").style.opacity = "1";
}
typeQuestion();
</script>
</body>
</html>