Skip to content

Commit

Permalink
add templates
Browse files Browse the repository at this point in the history
  • Loading branch information
otothea committed Jan 27, 2020
1 parent 0dec69a commit f191553
Show file tree
Hide file tree
Showing 5 changed files with 254 additions and 0 deletions.
39 changes: 39 additions & 0 deletions docs/ejs_templates/events.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
:orphan:

Default EJS Template for Events Overlay
=======================================

::

event = {
thumbnail?: string; // URL for the thumbnail
isVideo: boolean; // If true then the thumbnail url is a video. If false then it is an image
text: string; // Text for the event
subText?: string; // Subtext for the event
}

::

<% if (event) { %>
<% if (event.thumbnail) { %>
<% if (isVideo) { %>
<video
src="<%= event.thumbnail %>"
autoPlay
loop
/>
<% } else { %>
<img src="<%= event.thumbnail %>" />
<% } %>
<% } %>
<% if (event.text) { %>
<span class="text">
<%= event.text %>
</span>
<% } %>
<% if (event.subText) { %>
<small class="text">
<%= event.subText %>
</small>
<% } %>
<% } %>
73 changes: 73 additions & 0 deletions docs/ejs_templates/giveaway.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
:orphan:

Default EJS Template for Giveaway Overlay
=========================================

::

giveaway = {
currencyName: string; // Name of the currency for the account
prefix: string; // The command prefix for the account
title: string; // Title of the giveaway
rules?: string; // Rules of the giveaway
closed: boolean; // If true then users cannot enter the giveaway
cost: number; // The cost to enter the giveaway
allowMultipleEntries: boolean; // If true then users can enter the giveaway multiple times
maxEntries: number; // The maximum number of entries per user
giveawayEntries: Array<{
username: string; // The name of the user that entered the giveaway
winner: boolean; // If true this user has been selected as a winner
}>;
winningEntries: Array<{
username: string; // The name of the user that entered the giveaway
winner: boolean; // If true this user has been selected as a winner
}>;
}

::

<div class="row flex-none">
<h4 class="flex"><%= giveaway.title.toUpperCase() %></h4>
</div>
<% if (giveaway.rules) { %>
<div class="flex-none rules">
<strong>Rules:</strong> <%= giveaway.rules %>
</div>
<% } %>
<div class="flex-none">
<% for (const entry of giveaway.winningEntries) { %>
<h2><%= entry.username %> wins!</h2>
<% } %>
</div>
<% if (!giveaway.closed) { %>
<div class="flex-none instructions">
<span class="text">
<span>type <strong class"success">"<%= giveaway.prefix %>enter"</strong> in chat to enter the giveaway</span>
</span>
<% if (!giveaway.closed && giveaway.cost > 0) { %>
<span class="text">
<br />
cost to enter: <strong><%= giveaway.cost %> <%= giveaway.currencyName %></strong>
</span>
<% } %>
<% if (!giveaway.closed && giveaway.allowMultipleEntries) { %>
<span class="text">
<br />
max entries per user: <strong><%= giveaway.maxEntries || 'unlimited' %></strong>
</span>
<% } %>
</div>
<% } %>
<div class="column scroll hide-scrollbar entries">
<% let i = 0; for (const entry of giveaway.giveawayEntries) { i++; %>
<div class="message">
<span class="name"><%= i + 1 %>.</span>
<span class="text">
<%= entry.username %> <% if (entry.winner) { %><span class="fa fa-trophy"></span><% } %>
</span>
</div>
<% } %>
</div>
<% if (giveaway.closed) { %>
<small class="error">entry is closed</small>
<% } %>
63 changes: 63 additions & 0 deletions docs/ejs_templates/poll.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
:orphan:

Default EJS Template for Poll Overlay
=====================================

::

poll = {
currencyName: string; // Name of the currency for the account
prefix: string; // The command prefix for the account
title: string; // Title of the poll
closed: boolean; // If true then users cannot vote in the poll
pollOptions: Array<{
key: string; // The key used to vote on this option
value: string; // The name of the option
percent: number; // The percent of the total vote this option has
totalBets: number; // The total amount that has been bet on this option
pollVotes: Array<{}>; // Votes cast in this poll
}>;
winningOption: {
key: string; // The key used to vote on this option
value: string; // The name of the option
percent: number; // The percent of the total vote this option has
totalBets: number; // The total amount that has been bet on this option
pollVotes: Array<{}>; // Votes cast in this poll
};
}

::

<div class="row flex-none">
<h4 class="flex"><%= poll.title.toUpperCase() %></h4>
</div>
<div class="flex-none">
<% if (poll.winningOption) { %>
<h2>
#<%= poll.winningOption.key%> <%= poll.winningOption.value%> wins!
</h2>
<% } %>
</div>
<div class="column scroll hide-scrollbar options">
<% for (option of poll.pollOptions) { %>
<div class="message">
<span class="name">
<%= option.key %>. <%= option.value %>
</span>
<span class="text">
<% if (!poll.closed) { %>
<span>(type <strong class="success">"<%= poll.prefix %>vote <%= option.key %> [bet]"</strong> in chat to vote)</span>
<% } %>
</span>
</div>
<div class="bar">
<div class="fill" style="width: <%= option.percent %>%"></div>
<div class="text">
<%= option.pollVotes.length %> votes (<%= option.percent %>%) (<%= option.totalBets.toLocaleString() %> <%= poll.currencyName %> bet)
</div>
</div>
<% } %>
</div>
<% if (poll.closed) { %>
<small class="error">voting is closed</small>
<% } %>
52 changes: 52 additions & 0 deletions docs/ejs_templates/queue.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
:orphan:

Default EJS Template for Queue Overlay
======================================

::

queue = {
enabled: boolean; // If true then the queue is enabled
prefix: string; // The command prefix for the account
current: Array<{
name: string; // The name of the user in the queue
message?: string; // The message attached to the user in the queue
}>;
next: Array<{
name: string; // The name of the user in the queue
message?: string; // The message attached to the user in the queue
}>;
}

::

<% if (queue.enabled) { %>
<div class="flex-none instructions">
<span class="text">
<span>
type "<strong><%= queue.prefix %>queue join</strong>" in chat to enter the queue
</span>
</span>
</div>
<% } %>
<div class="column scroll hide-scrollbar queue">
<% if (queue.current.length > 0) { %><h3>CURRENT</h3><% } %>
<% let i = 0; for (const queueItem of queue.current) { i++; %>
<div class="message">
<span class="text">
<%= queueItem.name %>
<%= queueItem.message ? ` - ${queueItem.message}` : '' %>
</span>
</div>
<% } %>
<% if (queue.next.length > 0) { %><h3>QUEUE</h3><% } %>
<% i = 0; for (const queueItem of queue.next) { i++; %>
<div class="message">
<span class="name"><%= i + 1 %>.</span>
<span class="text">
<%= queueItem.name %>
<%= queueItem.message ? ` - ${queueItem.message}` : '' %>
</span>
</div>
<% } %>
</div>
27 changes: 27 additions & 0 deletions docs/ejs_templates/voice.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
:orphan:

Default EJS Template for Voice Overlay
======================================

::

speakers = Array<{
image: string; // URL to the users thumbnail
displayName: string; // Name of user speaking
color: string; // The color of the user as a hex string (based on Discord role)
}>

::

<% speakers.map(speaker => { %>
<div class="row flex-none message">
<% if (speaker.image) { %>
<span class="name">
<img class="avatar" src="<%= speaker.image %>" />
</span>
<% } %>
<span class="text" style="color: <%= speaker.color %>;">
{speaker.displayName}
</span>
</div>
<% } %>

0 comments on commit f191553

Please sign in to comment.