mirror of
https://github.com/s00500/ESPUI.git
synced 2024-11-21 22:50:55 +00:00
Adding files for data upload feature
This commit is contained in:
parent
d7e5b5cde5
commit
fa4499c7ca
181
src/unminimizedData/sliders.js
Normal file
181
src/unminimizedData/sliders.js
Normal file
@ -0,0 +1,181 @@
|
||||
/* -----------------------------------------------------
|
||||
Material Design Sliders
|
||||
CodePen URL: https://codepen.io/rkchauhan/pen/xVGGpR
|
||||
By: Ravikumar Chauhan
|
||||
|
||||
Find me on:-
|
||||
* Twitter: https://twitter.com/rkchauhan01
|
||||
* Facebook: https://www.facebook.com/ravi032chauhan
|
||||
* GitHub: https://github.com/rkchauhan
|
||||
* CodePen: https://codepen.io/rkchauhan
|
||||
* UpLabs: http://uplabs.com/rkchauhan01
|
||||
|
||||
Thanks to:-
|
||||
* Google Material design - https://www.google.com/design/spec/material-design/introduction.html
|
||||
* Google Material Color - https://www.google.com/design/spec/style/color.html
|
||||
* Google Material Icons - https://design.google.com/icons/
|
||||
* Roboto Font - https://google.com/fonts/specimen/Roboto
|
||||
* jQuery - https://jquery.com
|
||||
-------------------------------------------------------- */
|
||||
$(document).ready(function() {
|
||||
|
||||
$('.rkmd-slider').rkmd_rangeSlider();
|
||||
change_slider_color();
|
||||
|
||||
});
|
||||
$(document).ready(function () {
|
||||
//your code here
|
||||
/* Range Slider Function */
|
||||
(function($) {
|
||||
|
||||
$.fn.rkmd_rangeSlider = function() {
|
||||
var self, slider_width, slider_offset, curnt, sliderContinuous, sliderDiscrete, range, slider;
|
||||
self = $(this);
|
||||
slider_width = self.outerWidth();
|
||||
slider_offset = self.offset().left;
|
||||
sliderDiscrete = $('.slider-discrete');
|
||||
|
||||
if(self.hasClass('slider-discrete') === true) {
|
||||
|
||||
sliderDiscrete.each(function(i, v) {
|
||||
curnt = $(this);
|
||||
curnt.append(sliderDiscrete_tmplt());
|
||||
range = curnt.find('input[type="range"]');
|
||||
slider = curnt.find('.slider');
|
||||
slider_fill = slider.find('.slider-fill');
|
||||
slider_handle = slider.find('.slider-handle');
|
||||
slider_label = slider.find('.slider-label');
|
||||
|
||||
var range_val = parseInt(range.val());
|
||||
slider_fill.css('width', range_val +'%');
|
||||
slider_handle.css('left', range_val +'%');
|
||||
slider_label.find('span').text(range_val);
|
||||
console.log(range_val);
|
||||
});
|
||||
}
|
||||
|
||||
self.on('mousedown', '.slider-handle', function(e) {
|
||||
if(e.button === 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var parents = $(this).parents('.rkmd-slider');
|
||||
var slider_width = parents.outerWidth();
|
||||
var slider_offset = parents.offset().left;
|
||||
var check_range = parents.find('input[type="range"]').is(':disabled');
|
||||
|
||||
if(check_range === true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(parents.hasClass('slider-discrete') === true) {
|
||||
$(this).addClass('is-active');
|
||||
}
|
||||
var handlers = {
|
||||
mousemove: function(e) {
|
||||
var slider_new_width = e.pageX - slider_offset;
|
||||
|
||||
if(slider_new_width <= slider_width && !(slider_new_width < '0')) {
|
||||
slider_move(parents, slider_new_width, slider_width);
|
||||
}
|
||||
},
|
||||
mouseup: function(e) {
|
||||
$(this).off(handlers);
|
||||
|
||||
if(parents.hasClass('slider-discrete') === true) {
|
||||
parents.find('.is-active').removeClass('is-active');
|
||||
}
|
||||
}
|
||||
};
|
||||
$(document).on(handlers);
|
||||
});
|
||||
|
||||
self.on('mousedown', '.slider', function(e) {
|
||||
if(e.button === 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var parents = $(this).parents('.rkmd-slider');
|
||||
var slider_width = parents.outerWidth();
|
||||
var slider_offset = parents.offset().left;
|
||||
var check_range = parents.find('input[type="range"]').is(':disabled');
|
||||
|
||||
if(check_range === true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var slider_new_width = e.pageX - slider_offset;
|
||||
if(slider_new_width <= slider_width && !(slider_new_width < '0')) {
|
||||
slider_move(parents, slider_new_width, slider_width);
|
||||
}
|
||||
|
||||
var handlers = {
|
||||
mouseup: function(e) {
|
||||
$(this).off(handlers);
|
||||
}
|
||||
};
|
||||
$(document).on(handlers);
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
function sliderDiscrete_tmplt() {
|
||||
var tmplt = '<div class="slider">' +
|
||||
'<div class="slider-fill"></div>' +
|
||||
'<div class="slider-handle"><div class="slider-label"><span>0</span></div></div>' +
|
||||
'</div>';
|
||||
|
||||
return tmplt;
|
||||
}
|
||||
|
||||
function slider_move(parents, newW, sliderW) {
|
||||
var slider_new_val = parseInt(Math.round(newW / sliderW * 100));
|
||||
|
||||
var slider_fill = parents.find('.slider-fill');
|
||||
var slider_handle = parents.find('.slider-handle');
|
||||
var range = parents.find('input[type="range"]');
|
||||
|
||||
slider_fill.css('width', slider_new_val +'%');
|
||||
slider_handle.css({
|
||||
'left': slider_new_val +'%',
|
||||
'transition': 'none',
|
||||
'-webkit-transition': 'none',
|
||||
'-moz-transition': 'none'
|
||||
});
|
||||
|
||||
range.val(slider_new_val);
|
||||
|
||||
if(parents.hasClass('slider-discrete') === true) {
|
||||
parents.find('.slider-handle span').text(slider_new_val);
|
||||
}
|
||||
}
|
||||
|
||||
}(jQuery));
|
||||
|
||||
|
||||
/* Change Slider Color
|
||||
function change_slider_color() {
|
||||
$('.color-box .show-box').on('click', function() {
|
||||
$(".color-box").toggleClass("open");
|
||||
});
|
||||
|
||||
$('.colors-list a').on('click', function() {
|
||||
var curr_color = $('main').data('slider-color');
|
||||
var color = $(this).data('slider-color');
|
||||
var new_colot = 'slider-' + color;
|
||||
|
||||
$('.rkmd-slider').each(function(i, v) {
|
||||
var findColor = $(this).hasClass(curr_color);
|
||||
|
||||
if(findColor) {
|
||||
$(this).removeClass(curr_color);
|
||||
$(this).addClass(new_colot);
|
||||
}
|
||||
|
||||
$('main').data('slider-color', new_colot);
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
*/
|
||||
});
|
@ -1,21 +0,0 @@
|
||||
const char INDEX[] PROGMEM = R"=====(
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
</html>
|
||||
)=====";
|
||||
|
||||
const char CSS_NORMALIZE[] PROGMEM = R"=====(
|
||||
<style></style>
|
||||
)=====";
|
||||
|
||||
const char CSS_STYLE[] PROGMEM = R"=====(
|
||||
<style></style>
|
||||
)=====";
|
||||
|
||||
const char JS_ZEPTO[] PROGMEM = R"=====(
|
||||
<script></script>
|
||||
)=====";
|
||||
|
||||
const char JS_CONTROLS[] PROGMEM = R"=====(
|
||||
<script></script>
|
||||
)=====";
|
3
src/uploadDataControls.h
Normal file
3
src/uploadDataControls.h
Normal file
@ -0,0 +1,3 @@
|
||||
const char JS_CONTROLS[] PROGMEM = R"=====(
|
||||
<script></script>
|
||||
)=====";
|
3
src/uploadDataIndex.h
Normal file
3
src/uploadDataIndex.h
Normal file
@ -0,0 +1,3 @@
|
||||
const char HTML_INDEX[] PROGMEM = R"=====(
|
||||
<script></script>
|
||||
)=====";
|
3
src/uploadDataNormalize.h
Normal file
3
src/uploadDataNormalize.h
Normal file
@ -0,0 +1,3 @@
|
||||
const char CSS_NORMALIZE[] PROGMEM = R"=====(
|
||||
img,legend{border:0}legend,td,th{padding:0}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,optgroup,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre,textarea{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}table{border-collapse:collapse;border-spacing:0}
|
||||
)=====";
|
3
src/uploadDataSliders.h
Normal file
3
src/uploadDataSliders.h
Normal file
@ -0,0 +1,3 @@
|
||||
const char JS_SLIDERS[] PROGMEM = R"=====(
|
||||
<script></script>
|
||||
)=====";
|
2
src/uploadDataStyle.h
Normal file
2
src/uploadDataStyle.h
Normal file
@ -0,0 +1,2 @@
|
||||
const char CSS_STYLE[] PROGMEM = R"=====(
|
||||
)=====";
|
4
src/uploadDataZepto.h
Normal file
4
src/uploadDataZepto.h
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user