adds static files to server

This commit is contained in:
Raphael Maenle 2020-05-11 21:00:00 +00:00
parent 76a8b97ae4
commit a4265a44f5
10 changed files with 433 additions and 1 deletions

1
.gitignore vendored
View File

@ -146,4 +146,3 @@ cython_debug/
# static files generated from Django application using `collectstatic` # static files generated from Django application using `collectstatic`
media media
static

View File

@ -0,0 +1,103 @@
/*!
*
* ColorPick jQuery plugin
* https://github.com/philzet/ColorPick.js
*
* Copyright (c) 2017-2019 Phil Zet (a.k.a. Phil Zakharchenko)
* Licensed under the MIT License
*
*/
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 400;
src: local("Open Sans"), local("OpenSans"),
url(https://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3bO3LdcAZYWl9Si6vvxL-qU.woff)
format("woff");
}
@font-face {
font-family: "Open Sans";
font-style: normal;
font-weight: 700;
src: local("Open Sans Bold"), local("OpenSans-Bold"),
url(https://fonts.gstatic.com/s/opensans/v13/k3k702ZOKiLJc3WVjuplzKRDOzjiPcYnFooOUGCOsRk.woff)
format("woff");
}
#colorPick * {
-webkit-transition: all linear 0.2s;
-moz-transition: all linear 0.2s;
-ms-transition: all linear 0.2s;
-o-transition: all linear 0.2s;
transition: all linear 0.2s;
}
#colorPick {
background: rgba(255, 255, 255, 0.85);
-webkit-backdrop-filter: blur(15px);
position: absolute;
border-radius: 5px;
box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2);
padding: 15px;
font-family: "Open Sans", sans-serif;
width: 140px;
}
#colorPick span {
font-size: 9pt;
text-transform: uppercase;
font-weight: bold;
color: #bbb;
margin-bottom: 5px;
display: block;
clear: both;
}
.customColorHash {
border-radius: 5px;
height: 23px;
width: 122px;
margin: 1px 4px;
padding: 0 4px;
border: 1px solid #babbba;
outline: none;
}
.customColorHash.error {
border-color: #ff424c;
color: #ff424c;
}
.colorPickButton {
border-radius: 5px;
width: 20px;
height: 20px;
margin: 0px 3px;
cursor: pointer;
display: inline-block;
border: thin solid #eee;
}
.colorPickButton:hover {
transform: scale(1.1);
}
.colorPickDummy {
background: #fff;
border: 1px dashed #bbb;
}
.colorPickSelector {
border-radius: 12px;
width: 24px;
height: 24px;
cursor: pointer;
-webkit-transition: all linear .2s;
-moz-transition: all linear .2s;
-ms-transition: all linear .2s;
-o-transition: all linear .2s;
transition: all linear .2s;
}
.colorPickSelector:hover { transform: scale(1.1); }

View File

@ -0,0 +1,26 @@
/*!
*
* ColorPick jQuery plugin
* https://github.com/philzet/ColorPick.js
*
* Copyright (c) 2017-2019 Phil Zet (a.k.a. Phil Zakharchenko)
* Licensed under the MIT License
*
*/
#colorPick {
background: rgba(0, 0, 0, 0.85);
}
#colorPick span {
color: rgba(255, 255, 255, 0.6);
}
.customColorHash {
border: 1px solid rgba(255, 255, 255, 0.2);
}
.colorPickDummy {
background: rgba(255, 255, 255, 0.2);
border: 1px dashed rgba(255, 255, 255, 0.2);
}

10
server/static/css/colorPick.min.css vendored Normal file
View File

@ -0,0 +1,10 @@
/*!
*
* ColorPick jQuery plugin
* https://github.com/philzet/ColorPick.js
*
* Copyright (c) 2017-2019 Phil Zet (a.k.a. Phil Zakharchenko)
* Licensed under the MIT License
*
*/
@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:local('Open Sans'),local('OpenSans'),url(http://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3bO3LdcAZYWl9Si6vvxL-qU.woff) format('woff')}@font-face{font-family:'Open Sans';font-style:normal;font-weight:700;src:local('Open Sans Bold'),local('OpenSans-Bold'),url(http://fonts.gstatic.com/s/opensans/v13/k3k702ZOKiLJc3WVjuplzKRDOzjiPcYnFooOUGCOsRk.woff) format('woff')}#colorPick *{-webkit-transition:all linear .2s;-moz-transition:all linear .2s;-ms-transition:all linear .2s;-o-transition:all linear .2s;transition:all linear .2s}#colorPick{background:rgba(255,255,255,.85);-webkit-backdrop-filter:blur(15px);position:absolute;border-radius:5px;box-shadow:0 3px 8px rgba(0,0,0,.2);padding:15px;font-family:"Open Sans",sans-serif;width:140px}#colorPick span{font-size:9pt;text-transform:uppercase;font-weight:700;color:#bbb;margin-bottom:5px;display:block;clear:both}.customColorHash{border-radius:5px;height:23px;width:122px;margin:1px 4px;padding:0 4px;border:1px solid #babbba;outline:0}.customColorHash.error{border-color:#ff424c;color:#ff424c}.colorPickButton{border-radius:5px;width:20px;height:20px;margin:0 3px;cursor:pointer;display:inline-block;border:thin solid #eee}.colorPickButton:hover{transform:scale(1.1)}.colorPickDummy{background:#fff;border:1px dashed #bbb}

118
server/static/css/main.css Normal file
View File

@ -0,0 +1,118 @@
.logins {
height: 100px;
width: 500px;
margin: 5px;
}
.login_google {
width: 200px;
}
.login_email {
width: 200px;
}
/* The sidebar menu */
.sidenav {
height: 100%; /* Full-height: remove this if you want "auto" height */
width: 160px; /* Set the width of the sidebar */
position: fixed; /* Fixed Sidebar (stay in place on scroll) */
z-index: 1; /* Stay on top */
top: 0; /* Stay at the top */
left: 0;
background-color: #111; /* Black */
overflow-x: hidden; /* Disable horizontal scroll */
padding-top: 20px;
}
/* The navigation menu links */
.sidenav a {
padding: 6px 8px 6px 16px;
text-decoration: none;
font-size: 25px;
color: #818181;
display: block;
}
/* When you mouse over the navigation links, change their color */
.sidenav a:hover {
color: #f1f1f1;
}
/* Style page content */
.main {
margin-left: 160px; /* Same as the width of the sidebar */
padding: 30px 10px;
}
/* On smaller screens, where height is less than 450px, change the style of the sidebar (less padding and a smaller font size) */
@media screen and (max-height: 450px) {
.sidenav {padding-top: 15px;}
.sidenav a {font-size: 18px;}
}
/* slider */
/* The switch - the box around the slider */
.switch {
position: relative;
display: inline-block;
width: 38px;
height: 24px;
}
/* Hide default HTML checkbox */
.switch input {
opacity: 0;
width: 0;
height: 0;
}
/* The slider */
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #2196F3;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 18px;
width: 18px;
right: 3px;
bottom: 3px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider {
background-color: #ccc;
}
input:focus + .slider {
box-shadow: 0 0 1px #ccc;
}
input:checked + .slider:before {
-webkit-transform: translateX(-13px);
-ms-transform: translateX(-13px);
transform: translateX(-13px);
}
/* Rounded sliders */
.slider.round {
border-radius: 24px;
}
.slider.round:before {
border-radius: 50%;
}

View File

@ -0,0 +1,163 @@
/*!
*
* ColorPick jQuery plugin
* https://github.com/philzet/ColorPick.js
*
* Copyright (c) 2017-2019 Phil Zet (a.k.a. Phil Zakharchenko)
* Licensed under the MIT License
*
*/
(function( $ ) {
$.fn.colorPick = function(config) {
return this.each(function() {
new $.colorPick(this, config || {});
});
};
$.colorPick = function (element, options) {
options = options || {};
this.options = $.extend({}, $.fn.colorPick.defaults, options);
if(options.str) {
this.options.str = $.extend({}, $.fn.colorPick.defaults.str, options.str);
}
$.fn.colorPick.defaults = this.options;
this.color = this.options.initialColor.toUpperCase();
this.element = $(element);
var dataInitialColor = this.element.data('initialcolor');
if (dataInitialColor) {
this.color = dataInitialColor;
this.appendToStorage(this.color);
}
var uniquePalette = [];
$.each($.fn.colorPick.defaults.palette.map(function(x){ return x.toUpperCase() }), function(i, el){
if($.inArray(el, uniquePalette) === -1) uniquePalette.push(el);
});
this.palette = uniquePalette;
return this.element.hasClass(this.options.pickrclass) ? this : this.init();
};
$.fn.colorPick.defaults = {
'initialColor': '#3498db',
'paletteLabel': 'Default palette:',
'allowRecent': true,
'recentMax': 5,
'allowCustomColor': false,
'palette': ["#1abc9c", "#16a085", "#2ecc71", "#27ae60", "#3498db", "#2980b9", "#9b59b6", "#8e44ad", "#34495e", "#2c3e50", "#f1c40f", "#f39c12", "#e67e22", "#d35400", "#e74c3c", "#c0392b", "#ecf0f1", "#bdc3c7", "#95a5a6", "#7f8c8d"],
'onColorSelected': function() {
this.element.css({'backgroundColor': this.color, 'color': this.color});
}
};
$.colorPick.prototype = {
init : function(){
var self = this;
var o = this.options;
$.proxy($.fn.colorPick.defaults.onColorSelected, this)();
this.element.click(function(event) {
event.preventDefault();
self.show(event.pageX, event.pageY);
$('.customColorHash').val(self.color);
$('.colorPickButton').click(function(event) {
self.color = $(event.target).attr('hexValue');
self.appendToStorage($(event.target).attr('hexValue'));
self.hide();
$.proxy(self.options.onColorSelected, self)();
return false;
});
$('.customColorHash').click(function(event) {
return false;
}).keyup(function (event) {
var hash = $(this).val();
if (hash.indexOf('#') !== 0) {
hash = "#"+hash;
}
if (/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hash)) {
self.color = hash;
self.appendToStorage(hash);
$.proxy(self.options.onColorSelected, self)();
$(this).removeClass('error');
} else {
$(this).addClass('error');
}
});
return false;
}).blur(function() {
self.element.val(self.color);
$.proxy(self.options.onColorSelected, self)();
self.hide();
return false;
});
$(document).on('click', function(event) {
self.hide();
return true;
});
return this;
},
appendToStorage: function(color) {
if ($.fn.colorPick.defaults.allowRecent === true) {
var storedColors = JSON.parse(localStorage.getItem("colorPickRecentItems"));
if (storedColors == null) {
storedColors = [];
}
if ($.inArray(color, storedColors) == -1) {
storedColors.unshift(color);
storedColors = storedColors.slice(0, $.fn.colorPick.defaults.recentMax)
localStorage.setItem("colorPickRecentItems", JSON.stringify(storedColors));
}
}
},
show: function(left, top) {
$("#colorPick").remove();
$("body").append('<div id="colorPick" style="display:none;top:' + top + 'px;left:' + left + 'px"><span>'+$.fn.colorPick.defaults.paletteLabel+'</span></div>');
jQuery.each(this.palette, function (index, item) {
$("#colorPick").append('<div class="colorPickButton" hexValue="' + item + '" style="background:' + item + '"></div>');
});
if ($.fn.colorPick.defaults.allowCustomColor === true) {
$("#colorPick").append('<input type="text" style="margin-top:5px" class="customColorHash" />');
}
if ($.fn.colorPick.defaults.allowRecent === true) {
$("#colorPick").append('<span style="margin-top:5px">Recent:</span>');
if (JSON.parse(localStorage.getItem("colorPickRecentItems")) == null || JSON.parse(localStorage.getItem("colorPickRecentItems")) == []) {
$("#colorPick").append('<div class="colorPickButton colorPickDummy"></div>');
} else {
jQuery.each(JSON.parse(localStorage.getItem("colorPickRecentItems")), function (index, item) {
$("#colorPick").append('<div class="colorPickButton" hexValue="' + item + '" style="background:' + item + '"></div>');
if (index == $.fn.colorPick.defaults.recentMax-1) {
return false;
}
});
}
}
$("#colorPick").fadeIn(200);
},
hide: function() {
$( "#colorPick" ).fadeOut(200, function() {
$("#colorPick").remove();
return this;
});
},
};
}( jQuery ));

10
server/static/js/colorPick.min.js vendored Normal file
View File

@ -0,0 +1,10 @@
/*!
*
* ColorPick jQuery plugin
* https://github.com/philzet/ColorPick.js
*
* Copyright (c) 2017-2019 Phil Zet (a.k.a. Phil Zakharchenko)
* Licensed under the MIT License
*
*/
!function(o){o.fn.colorPick=function(e){return this.each(function(){new o.colorPick(this,e||{})})},o.colorPick=function(e,t){t=t||{},this.options=o.extend({},o.fn.colorPick.defaults,t),t.str&&(this.options.str=o.extend({},o.fn.colorPick.defaults.str,t.str)),o.fn.colorPick.defaults=this.options,this.color=this.options.initialColor.toUpperCase(),this.element=o(e);var c=this.element.data("initialcolor");c&&(this.color=c,this.appendToStorage(this.color));var l=[];return o.each(o.fn.colorPick.defaults.palette.map(function(o){return o.toUpperCase()}),function(e,t){-1===o.inArray(t,l)&&l.push(t)}),this.palette=l,this.element.hasClass(this.options.pickrclass)?this:this.init()},o.fn.colorPick.defaults={initialColor:"#3498db",paletteLabel:"Default palette:",allowRecent:!0,recentMax:5,allowCustomColor:!1,palette:["#1abc9c","#16a085","#2ecc71","#27ae60","#3498db","#2980b9","#9b59b6","#8e44ad","#34495e","#2c3e50","#f1c40f","#f39c12","#e67e22","#d35400","#e74c3c","#c0392b","#ecf0f1","#bdc3c7","#95a5a6","#7f8c8d"],onColorSelected:function(){this.element.css({backgroundColor:this.color,color:this.color})}},o.colorPick.prototype={init:function(){var e=this;this.options;return o.proxy(o.fn.colorPick.defaults.onColorSelected,this)(),this.element.click(function(t){return t.preventDefault(),e.show(t.pageX,t.pageY),o(".customColorHash").val(e.color),o(".colorPickButton").click(function(t){return e.color=o(t.target).attr("hexValue"),e.appendToStorage(o(t.target).attr("hexValue")),e.hide(),o.proxy(e.options.onColorSelected,e)(),!1}),o(".customColorHash").click(function(o){return!1}).keyup(function(t){var c=o(this).val();0!==c.indexOf("#")&&(c="#"+c),/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(c)?(e.color=c,e.appendToStorage(c),o.proxy(e.options.onColorSelected,e)(),o(this).removeClass("error")):o(this).addClass("error")}),!1}).blur(function(){return e.element.val(e.color),o.proxy(e.options.onColorSelected,e)(),e.hide(),!1}),o(document).on("click",function(o){return e.hide(),!0}),this},appendToStorage:function(e){if(!0===o.fn.colorPick.defaults.allowRecent){var t=JSON.parse(localStorage.getItem("colorPickRecentItems"));null==t&&(t=[]),-1==o.inArray(e,t)&&(t.unshift(e),t=t.slice(0,o.fn.colorPick.defaults.recentMax),localStorage.setItem("colorPickRecentItems",JSON.stringify(t)))}},show:function(e,t){o("#colorPick").remove(),o("body").append('<div id="colorPick" style="display:none;top:'+t+"px;left:"+e+'px"><span>'+o.fn.colorPick.defaults.paletteLabel+"</span></div>"),jQuery.each(this.palette,function(e,t){o("#colorPick").append('<div class="colorPickButton" hexValue="'+t+'" style="background:'+t+'"></div>')}),!0===o.fn.colorPick.defaults.allowCustomColor&&o("#colorPick").append('<input type="text" style="margin-top:5px" class="customColorHash" />'),!0===o.fn.colorPick.defaults.allowRecent&&(o("#colorPick").append('<span style="margin-top:5px">Recent:</span>'),null==JSON.parse(localStorage.getItem("colorPickRecentItems"))||JSON.parse(localStorage.getItem("colorPickRecentItems"))==[]?o("#colorPick").append('<div class="colorPickButton colorPickDummy"></div>'):jQuery.each(JSON.parse(localStorage.getItem("colorPickRecentItems")),function(e,t){if(o("#colorPick").append('<div class="colorPickButton" hexValue="'+t+'" style="background:'+t+'"></div>'),e==o.fn.colorPick.defaults.recentMax-1)return!1})),o("#colorPick").fadeIn(200)},hide:function(){o("#colorPick").fadeOut(200,function(){return o("#colorPick").remove(),this})}}}(jQuery);

View File

2
server/static/js/jquery-3.5.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -54,6 +54,7 @@
} }
// Todo getting the element id is currently done over [0] [#02] // Todo getting the element id is currently done over [0] [#02]
this.element.css({'backgroundColor': this.color, 'color': this.color}); this.element.css({'backgroundColor': this.color, 'color': this.color});
post("color", this.element[0].id, this.color); post("color", this.element[0].id, this.color);
} }
}); });