Skip to content

Commit

Permalink
Update colors, settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
kpsuperplane committed Jul 27, 2017
1 parent 49d34a2 commit 302b153
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 92 deletions.
84 changes: 73 additions & 11 deletions opforumtools.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ requirejs.config({
}
});

require(['https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js', `css!${nativeAsset('spectre/dist/spectre.min')}`], (_) => {
require(['https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js', `css!${nativeAsset('spectre/dist/spectre.min')}`, `css!${nativeAsset('spectre/dist/spectre-icons.min')}`], (_) => {

class ConfigModule{
constructor(name, defaultConfig, _tools) {
this._config = null;
Expand All @@ -46,9 +47,8 @@ require(['https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js'
[this.name]: {
config: _.mapValues(this.defaultConfig, 'default')
}
}}, this._tools.getConfig())
).modules[this.name].config
; }
}}, this._tools.getConfig())).modules[this.name].config;
}
return this._config;
}
}
Expand All @@ -69,36 +69,98 @@ require(['https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js'
}
});
}
module(name, deps, defaultConfig, init) {
const ctx = new ConfigModule(name, defaultConfig, this);
define(name, deps, init.bind(ctx));
_addModule(name, manifest) {
this._modules[name] = manifest;
}
getModules() {
return this._modules;
}
module(name, deps, manifest, init) {
manifest.config = new ConfigModule(name, manifest.config, this);
this._addModule(name, manifest);
define(name, deps, init.bind(manifest.config));
}
init() {
require(_.keys(this.getConfig().modules));
}
constructor() {
this.debug = true;
this.config = null;
this._modules = {};
}
}

window.forumTools = new ForumTools();

// GUI Configuration Module
forumTools.module('configurator', ['Vue'], {}, function(Vue){
forumTools.module('configurator', ['Vue'], {
name: "Configurator",
config: {}
}, function(Vue){

const navItem = $(`<li role="presentation" class="dropdown">
<a href="javascript:void(0);" v-on:click="toggle">Tools</a>
</li>`);
const configMenu = $(`
<div class="fsc" style="position: absolute;">
<div class="modal" v-bind:class="{active:active}">
<div class="modal-overlay"></div>
<div class="modal-container">
<div class="modal-header" style="border-bottom-style: none;">
<button class="btn btn-clear float-right" v-on:click="toggle()"></button>
<div class="modal-title">OnePlus Forum Tools 2.0</div>
</div>
<div class="modal-body">
<div class="content">
<div class="container" style="max-width:62rem;min-width:62rem;margin: -2.5rem -1.5rem -1.5rem -1.5rem;">
<div class="columns">
<div class="column col-3">
<ul class="menu" style="padding: 0; box-shadow: none; min-width: 0;">
<li class="menu-item">
<a href="#" class="active">Home</a>
</li>
<li class="divider" data-content="PLUGINS"></li>
<li class="menu-item" v-for="(module, key) of modules">
<a href="#">{{module.name}}</a>
</li>
</ul>
</div>
<div class="column col-9">
<h4>Hi there! Welcome to forum tools</h4>
<p>This script exists because @Baymax wanted it. @kp1234 came to the rescue. Use it to install plugins into the forum. Yay!</p>
<div class="empty">
<h4 class="empty-title">Need something?</h4>
<div class="empty-action">
<button class="btn btn-primary">Install a plugin</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer"></div>
</div>
</div>
</div>`);
$('.sticky-wrapper').css({'position': 'relative', 'z-index': '100'});
$('#header-nav-top .nav:first').append(navItem);
$('#header-nav-top .row:first').css('z-index', '2');
$('#header-nav-top').append(configMenu);
var app = new Vue({
el: navItem[0],
data: {},
el: configMenu[0],
data: {
active: false,
modules: forumTools.getModules()
},
methods: {
toggle: function() {
alert("I do nothing");
this.active = !this.active;
}
}
});
navItem.click(() => app.toggle());

});

forumTools.init();
Expand Down
48 changes: 24 additions & 24 deletions spectre/dist/spectre-exp.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,23 @@
width: 2.8rem;
}
.fsc .calendar .calendar-date .date-item.date-today {
border-color: #e4e6f6;
color: #5764c6;
border-color: #ffa9b7;
color: #eb0028;
}
.fsc .calendar .calendar-date .date-item:focus {
box-shadow: 0 0 0 .2rem rgba(87, 100, 198, .15);
box-shadow: 0 0 0 .2rem rgba(235, 0, 40, .15);
}
.fsc .calendar .calendar-date .date-item:focus,
.fsc .calendar .calendar-date .date-item:hover {
background: #fbfbfe;
border-color: #e4e6f6;
color: #5764c6;
background: #ffc7d1;
border-color: #ffa9b7;
color: #eb0028;
text-decoration: none;
}
.fsc .calendar .calendar-date .date-item:active,
.fsc .calendar .calendar-date .date-item.active {
background: #4c59c2;
border-color: #3e4cb6;
background: #dc0025;
border-color: #c20021;
color: #fff;
}
.fsc .calendar .calendar-date .date-item.badge::after {
Expand All @@ -122,7 +122,7 @@
position: relative;
}
.fsc .calendar .calendar-range::before {
background: #eff1fa;
background: #ffb8c4;
content: "";
height: 2.8rem;
left: 0;
Expand All @@ -139,7 +139,7 @@
right: 50%;
}
.fsc .calendar .calendar-range .date-item {
color: #5764c6;
color: #eb0028;
}
.fsc .calendar.calendar-lg .calendar-body {
padding: 0;
Expand Down Expand Up @@ -185,9 +185,9 @@
padding: .5rem;
}
.fsc .calendar.calendar-lg .calendar-event {
background: #eff1fa;
background: #ffb8c4;
border-radius: .2rem;
color: #5764c6;
color: #eb0028;
display: block;
font-size: 1.2rem;
margin: .2rem auto;
Expand Down Expand Up @@ -434,7 +434,7 @@
.fsc .filter .filter-tag#tag-roleplaying:checked ~ .filter-nav .chip[for="tag-roleplaying"],
.fsc .filter .filter-tag#tag-shooter:checked ~ .filter-nav .chip[for="tag-shooter"],
.fsc .filter .filter-tag#tag-sports:checked ~ .filter-nav .chip[for="tag-sports"] {
background: #5764c6;
background: #eb0028;
color: #fff;
}
.fsc .filter .filter-tag#tag-action:checked ~ .filter-body .column:not([data-tag~="tag-action"]),
Expand Down Expand Up @@ -607,7 +607,7 @@
background: #f0f1f4;
border: 0;
border-radius: .2rem;
color: #5764c6;
color: #eb0028;
height: .4rem;
position: relative;
width: 100%;
Expand All @@ -617,16 +617,16 @@
border-radius: .2rem;
}
.fsc .progress::-webkit-progress-value {
background: #5764c6;
background: #eb0028;
border-radius: .2rem;
}
.fsc .progress::-moz-progress-bar {
background: #5764c6;
background: #eb0028;
border-radius: .2rem;
}
.fsc .progress:indeterminate {
animation: progress-indeterminate 1.5s linear infinite;
background: #f0f1f4 linear-gradient(to right, #5764c6 30%, #f0f1f4 30%) top left / 150% 150% no-repeat;
background: #f0f1f4 linear-gradient(to right, #eb0028 30%, #f0f1f4 30%) top left / 150% 150% no-repeat;
}
.fsc .progress:indeterminate::-moz-progress-bar {
background: transparent;
Expand All @@ -649,12 +649,12 @@
width: 100%;
}
.fsc .slider:focus {
box-shadow: 0 0 0 .2rem rgba(87, 100, 198, .15);
box-shadow: 0 0 0 .2rem rgba(235, 0, 40, .15);
outline: none;
}
.fsc .slider::-webkit-slider-thumb {
-webkit-appearance: none;
background: #5764c6;
background: #eb0028;
border: 0;
border-radius: 50%;
height: 1.2rem;
Expand All @@ -663,15 +663,15 @@
width: 1.2rem;
}
.fsc .slider::-moz-range-thumb {
background: #5764c6;
background: #eb0028;
border: 0;
border-radius: 50%;
height: 1.2rem;
transition: transform .2s ease;
width: 1.2rem;
}
.fsc .slider::-ms-thumb {
background: #5764c6;
background: #eb0028;
border: 0;
border-radius: 50%;
height: 1.2rem;
Expand Down Expand Up @@ -723,7 +723,7 @@
width: 100%;
}
.fsc .slider::-ms-fill-lower {
background: #5764c6;
background: #eb0028;
}
.fsc .timeline .timeline-item {
display: flex;
Expand Down Expand Up @@ -758,7 +758,7 @@
width: 2.4rem;
}
.fsc .timeline .timeline-item .timeline-icon::before {
border: .2rem solid #5764c6;
border: .2rem solid #eb0028;
border-radius: 50%;
content: "";
display: block;
Expand All @@ -769,7 +769,7 @@
width: .8rem;
}
.fsc .timeline .timeline-item .timeline-icon.icon-lg {
background: #5764c6;
background: #eb0028;
font-size: 1.6rem;
line-height: 2rem;
}
Expand Down
Loading

0 comments on commit 302b153

Please sign in to comment.