Poll-Manager/site/czechgamesedition.html
2022-02-17 11:57:07 -06:00

377 lines
No EOL
6.7 KiB
HTML

<!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>CGE Poll Manager</title>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js" async></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');
html, body {
background: #2c2f32;
color: white;
font-family: 'Roboto', sans-serif;
}
div#app {
display: flex;
flex-wrap: wrap;
}
div.poll-data {
margin: 5px;
padding: 10px;
background: #202225;
border-radius: 7px;
flex-grow: 1;
border-width: 2px;
border-style: solid;
border-color: transparent;
}
.poll-data > h4 {
margin: 0;
margin-bottom: 5px;
}
.poll-data.important {
border-color: red;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
<h2>CGE Poll Quick-Creator</h2>
<hr>
<div id="app">
<div
v-for="poll in polls"
class="poll-data"
:class="poll.important ? 'important' : ''"
>
<h4>{{poll.name}}</h4>
<p>
Duration: {{poll.data.duration}} seconds
<br>
Choices:
</p>
<ul>
<li v-for="choice in poll.data.choices">
{{choice.title}}
</li>
</ul>
<button
@click.stop="start_poll(poll.data)"
>
Start Poll
</button>
</div>
</div>
</body>
<script>
let app = new Vue({
el: "#app",
methods: {
async start_poll(poll_data) {
try {
let r = await axios.post("/polls/twitch/czechgamesedition/poll", poll_data);
alert("Poll should've been created successfully.");
} catch (err) {
console.error(err);
alert("Something went wrong starting the poll, check to see if one is made already.")
}
}
},
data: {
polls: [
{
name: "Wavelength Region Choice (FIRST POLL)",
important: true,
data: {
title: "Which Region?",
choices: [
{
title: "1"
},
{
title: "2"
},
{
title: "3"
},
{
title: "4"
},
],
duration: 45,
bits_voting_enabled: true,
bits_per_vote: 10,
channel_points_voting_enabled: true,
channel_points_per_vote: 200
}
},
{
name: "Wavelength Section Choice (NO TIE)",
important: true,
data: {
title: "Which Section?",
choices: [
{
title: "A"
},
{
title: "B"
},
],
duration: 45,
bits_voting_enabled: true,
bits_per_vote: 10,
channel_points_voting_enabled: true,
channel_points_per_vote: 200
}
},
{
name: "Wavelength Section Choice (12 TIE)",
data: {
title: "Which Section?",
choices: [
{
title: "1A"
},
{
title: "1B"
},
{
title: "2A"
},
{
title: "2B"
},
],
duration: 45,
bits_voting_enabled: true,
bits_per_vote: 10,
channel_points_voting_enabled: true,
channel_points_per_vote: 200
}
},
{
name: "Wavelength Section Choice (23 TIE)",
data: {
title: "Which Section?",
choices: [
{
title: "2A"
},
{
title: "2B"
},
{
title: "3A"
},
{
title: "3B"
},
],
duration: 45,
bits_voting_enabled: true,
bits_per_vote: 10,
channel_points_voting_enabled: true,
channel_points_per_vote: 200
}
},
{
name: "Wavelength Section Choice (34 TIE)",
data: {
title: "Which Section?",
choices: [
{
title: "3A"
},
{
title: "3B"
},
{
title: "4A"
},
{
title: "4B"
},
],
duration: 45,
bits_voting_enabled: true,
bits_per_vote: 10,
channel_points_voting_enabled: true,
channel_points_per_vote: 200
}
},
{
name: "Wavelength Section Choice (13 TIE)",
data: {
title: "Which Section?",
choices: [
{
title: "1A"
},
{
title: "1B"
},
{
title: "3A"
},
{
title: "3B"
},
],
duration: 45,
bits_voting_enabled: true,
bits_per_vote: 10,
channel_points_voting_enabled: true,
channel_points_per_vote: 200
}
},
{
name: "Wavelength Section Choice (14 TIE)",
data: {
title: "Which Section?",
choices: [
{
title: "1A"
},
{
title: "1B"
},
{
title: "4A"
},
{
title: "4B"
},
],
duration: 45,
bits_voting_enabled: true,
bits_per_vote: 10,
channel_points_voting_enabled: true,
channel_points_per_vote: 200
}
},
{
name: "Wavelength Section Choice (24 TIE)",
data: {
title: "Which Section?",
choices: [
{
title: "2A"
},
{
title: "2B"
},
{
title: "4A"
},
{
title: "4B"
},
],
duration: 45,
bits_voting_enabled: true,
bits_per_vote: 10,
channel_points_voting_enabled: true,
channel_points_per_vote: 200
}
},
{
name: "Wavelength Region Choice Tie-Breaker (123 TIE)",
data: {
title: "Which Region (Tie-Breaker)?",
choices: [
{
title: "1"
},
{
title: "2"
},
{
title: "3"
},
],
duration: 30,
bits_voting_enabled: true,
bits_per_vote: 10,
channel_points_voting_enabled: true,
channel_points_per_vote: 200
}
},
{
name: "Wavelength Region Choice Tie-Breaker (124 TIE)",
data: {
title: "Which Region (Tie-Breaker)?",
choices: [
{
title: "1"
},
{
title: "2"
},
{
title: "4"
},
],
duration: 30,
bits_voting_enabled: true,
bits_per_vote: 10,
channel_points_voting_enabled: true,
channel_points_per_vote: 200
}
},
{
name: "Wavelength Region Choice Tie-Breaker (134 TIE)",
data: {
title: "Which Region (Tie-Breaker)?",
choices: [
{
title: "1"
},
{
title: "3"
},
{
title: "4"
},
],
duration: 30,
bits_voting_enabled: true,
bits_per_vote: 10,
channel_points_voting_enabled: true,
channel_points_per_vote: 200
}
},
{
name: "Wavelength Region Choice Tie-Breaker (234 TIE)",
data: {
title: "Which Region (Tie-Breaker)?",
choices: [
{
title: "2"
},
{
title: "3"
},
{
title: "4"
}
],
duration: 30,
bits_voting_enabled: true,
bits_per_vote: 10,
channel_points_voting_enabled: true,
channel_points_per_vote: 200
}
},
]
}
});
</script>
</html>