mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-03 08:28:31 +00:00
Add settings support. Make FFZ menu modular. Add support for chat row styles. Add support for dark twitch (disabled). Add support for SRL races. Update SRL race dialog. Everything.
This commit is contained in:
parent
c9bd39de8a
commit
b284bd0f8d
15 changed files with 2313 additions and 190 deletions
49
src/ui/dark.js
Normal file
49
src/ui/dark.js
Normal file
|
@ -0,0 +1,49 @@
|
|||
var FFZ = window.FrankerFaceZ,
|
||||
constants = require("../constants");
|
||||
|
||||
|
||||
// ---------------------
|
||||
// Settings
|
||||
// ---------------------
|
||||
|
||||
FFZ.settings_info.dark_twitch = {
|
||||
type: "boolean",
|
||||
value: false,
|
||||
|
||||
visible: function() { return ! this.has_bttv },
|
||||
|
||||
name: "Dark Twitch",
|
||||
help: "View the entire site with a dark theme.",
|
||||
|
||||
on_update: function(val) {
|
||||
document.querySelector(".app-main").classList.toggle("ffz-dark", val);
|
||||
if ( val )
|
||||
this._load_dark_css();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// ---------------------
|
||||
// Initialization
|
||||
// ---------------------
|
||||
|
||||
FFZ.prototype.setup_dark = function() {
|
||||
document.querySelector(".app-main").classList.toggle("ffz-dark", this.settings.dark_twitch);
|
||||
if ( this.settings.dark_twitch )
|
||||
this._load_dark_css();
|
||||
}
|
||||
|
||||
|
||||
FFZ.prototype._load_dark_css = function() {
|
||||
if ( this._dark_style )
|
||||
return;
|
||||
|
||||
this.log("Injecting FrankerFaceZ Dark Twitch CSS.");
|
||||
|
||||
var s = this._dark_style = document.createElement('link');
|
||||
|
||||
s.id = "ffz-dark-css";
|
||||
s.setAttribute('rel', 'stylesheet');
|
||||
s.setAttribute('href', constants.SERVER + "script/dark.css");
|
||||
document.head.appendChild(s);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue