Skip to content

Johnnycyan/twitch-subathon-countdown

 
 

Repository files navigation

Improved Twitch Subathon Countdown

This is a Twitch Subathon Countdown originally by JayexDesigns.

The CSS Code is updated by Johnnycyan. The JS Files are updated by Johnnycyan, leabdd, and danilotitato to add functionalities. The electron GUI configurator is made by Johnnycyan.


Description

A subathon timer that increases when someone subscribes, donates money, donates bits or purchases streamloots chests.

Added is a Timer that gets saved (in localStorage) and can be reset.

When you open the index.html you get to chose between "Reset" or "Start".


Shortcuts

CTRL+ALT+P - Pause the Timer

CTRL+ALT+H - Enable/disable Happy Hour

CTRL+ALT+R - Enable/disable Random Hour

CTRL+ALT+1 - Manually add 1h to the timer

CTRL+ALT+2 - Manually add 1m to the timer

CTRL+ALT+3 - Manually add 1s to the timer

CTRL+ALT+7 - Manually subtract 1h from the timer

CTRL+ALT+8 - Manually subtract 1m from the timer

CTRL+ALT+0 - Manually subtract 1s from the timer

Shortcuts can be changed in config.js or the GUI configurator.


Preview


Configure

After cloning this repository you'll have to either manually edit the "config.js" file or on Windows double-click the "Run This to Configure.bat" file for a GUI editor.

The GUI editor includes tooltips for what each option does when you hover over them.

For manual editing I included a "config.js.example" file to show you what the variables you can change do.

Twitch

To get your Subs and Bits you just have to add your Channel Name.

Streamlabs Token

To get the token you'll have to go to the API settings tab of your Streamlabs dashboard then click on API Tokens, copy your socket API token and finally paste the code on the "streamlabs_token" variable in the "config.js" file.

StreamElements Token

To get the token you'll have to go to your StreamElements channels dashboard, then click on show secrets, copy the Overlay token and paste the code on the "streamelements_token" variable in the "config.js" file.

Streamloots Token

To get the token you'll have to go to your Streamloots creator dashboard, then to alerts & widgets, then go to alerts, then copy the last part of the alerts url and finally paste the code on the "streamloots_token" variable in the "config.js" file.

Initial Time

You can set the initial time of the timer by setting the hours, minutes and seconds to be added when the timer is created.

Maximum Time

You can set the maximum total time of the timer by setting the hours, minutes and seconds. The timer will never run for more time in total than this.

Random Happy Hour

If this is true, you can turn enable Happy or Random Hour with the Shortcut. If it is false, the feature is disabled and cant be enabled.

You have to set the Happy Hour time values manually.

Random Hour has a bell curve which can be edited in the config. It multiplies the normal time by a random amount for each sub.

If enabled randHappy it can randomly activate the Happy Hour. It will last for one hour, but can be turned off manually with the Shortkey.

In the Config you can set a specific Date and Time. At that a Happy Hour will happen. scheduleHappy needs to be turned on.

Bulk

This enables that multiple Subs get added to the timer at once.

For Example when a user gifts 10 Subs.

Full control on what to use

You can enable and disable if you want to add time for Subscriptions, Bits, Donations or Chests.

Other Values

Change the other values to set the amount of seconds that will be added for the subscriptions, donations... And the minimum donation amounts to trigger the countdown increase.

Usage

To add it to OBS you just have to drag the "index.html" file to the sources section or add a browser source that points to the "index.html" file.

Known Problems

Only Streamelements Token in config.js does not add time for Subscriptions. Emulate with the Overlay Editor does work.

About

This is a countdown timer template for Twitch streams

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 70.9%
  • HTML 22.0%
  • CSS 6.7%
  • Batchfile 0.4%