diff --git a/Cart/script.js b/Cart/script.js index 96ed52c0..1c4ded86 100644 --- a/Cart/script.js +++ b/Cart/script.js @@ -3,7 +3,6 @@ const btnAdd = document.getElementById("Add") const btnSub = document.getElementById("Sub") -// const quantity = document.getElementById("quantity") diff --git a/Front-with-React/VigyBag/Web UI Assets/Cart VB.png b/Front-with-React/VigyBag/Web UI Assets/Cart VB.png new file mode 100644 index 00000000..4b9f2392 Binary files /dev/null and b/Front-with-React/VigyBag/Web UI Assets/Cart VB.png differ diff --git a/Front-with-React/VigyBag/Web UI Assets/Contact.png b/Front-with-React/VigyBag/Web UI Assets/Contact.png new file mode 100644 index 00000000..40672721 Binary files /dev/null and b/Front-with-React/VigyBag/Web UI Assets/Contact.png differ diff --git a/Front-with-React/VigyBag/Web UI Assets/Home VB.png b/Front-with-React/VigyBag/Web UI Assets/Home VB.png new file mode 100644 index 00000000..90c7bd07 Binary files /dev/null and b/Front-with-React/VigyBag/Web UI Assets/Home VB.png differ diff --git a/Front-with-React/VigyBag/Web UI Assets/User Dashboard.png b/Front-with-React/VigyBag/Web UI Assets/User Dashboard.png new file mode 100644 index 00000000..d0c106f6 Binary files /dev/null and b/Front-with-React/VigyBag/Web UI Assets/User Dashboard.png differ diff --git a/cart/js/util.js b/cart/js/util.js deleted file mode 100644 index 8286f57b..00000000 --- a/cart/js/util.js +++ /dev/null @@ -1,175 +0,0 @@ -// Utility function -function Util () {}; - -/* - class manipulation functions -*/ -Util.hasClass = function(el, className) { - if (el.classList) return el.classList.contains(className); - else return !!el.className.match(new RegExp('(\\s|^)' + className + '(\\s|$)')); -}; - -Util.addClass = function(el, className) { - var classList = className.split(' '); - if (el.classList) el.classList.add(classList[0]); - else if (!Util.hasClass(el, classList[0])) el.className += " " + classList[0]; - if (classList.length > 1) Util.addClass(el, classList.slice(1).join(' ')); -}; - -Util.removeClass = function(el, className) { - var classList = className.split(' '); - if (el.classList) el.classList.remove(classList[0]); - else if(Util.hasClass(el, classList[0])) { - var reg = new RegExp('(\\s|^)' + classList[0] + '(\\s|$)'); - el.className=el.className.replace(reg, ' '); - } - if (classList.length > 1) Util.removeClass(el, classList.slice(1).join(' ')); -}; - -Util.toggleClass = function(el, className, bool) { - if(bool) Util.addClass(el, className); - else Util.removeClass(el, className); -}; - -Util.setAttributes = function(el, attrs) { - for(var key in attrs) { - el.setAttribute(key, attrs[key]); - } -}; - -/* - DOM manipulation -*/ -Util.getChildrenByClassName = function(el, className) { - var children = el.children, - childrenByClass = []; - for (var i = 0; i < el.children.length; i++) { - if (Util.hasClass(el.children[i], className)) childrenByClass.push(el.children[i]); - } - return childrenByClass; -}; - -/* - Animate height of an element -*/ -Util.setHeight = function(start, to, element, duration, cb) { - var change = to - start, - currentTime = null; - - var animateHeight = function(timestamp){ - if (!currentTime) currentTime = timestamp; - var progress = timestamp - currentTime; - var val = parseInt((progress/duration)*change + start); - // console.log(val); - element.setAttribute("style", "height:"+val+"px;"); - if(progress < duration) { - window.requestAnimationFrame(animateHeight); - } else { - cb(); - } - }; - - //set the height of the element before starting animation -> fix bug on Safari - element.setAttribute("style", "height:"+start+"px;"); - window.requestAnimationFrame(animateHeight); -}; - -/* - Smooth Scroll -*/ - -Util.scrollTo = function(final, duration, cb) { - var start = window.scrollY || document.documentElement.scrollTop, - currentTime = null; - - var animateScroll = function(timestamp){ - if (!currentTime) currentTime = timestamp; - var progress = timestamp - currentTime; - if(progress > duration) progress = duration; - var val = Math.easeInOutQuad(progress, start, final-start, duration); - window.scrollTo(0, val); - if(progress < duration) { - window.requestAnimationFrame(animateScroll); - } else { - cb && cb(); - } - }; - - window.requestAnimationFrame(animateScroll); -}; - -/* - Focus utility classes -*/ - -//Move focus to an element -Util.moveFocus = function (element) { - if( !element ) element = document.getElementsByTagName("body")[0]; - element.focus(); - if (document.activeElement !== element) { - element.setAttribute('tabindex','-1'); - element.focus(); - } -}; - -/* - Misc -*/ - -Util.getIndexInArray = function(array, el) { - return Array.prototype.indexOf.call(array, el); -}; - -Util.cssSupports = function(property, value) { - if('CSS' in window) { - return CSS.supports(property, value); - } else { - var jsProperty = property.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase();}); - return jsProperty in document.body.style; - } -}; - -/* - Polyfills -*/ -//Closest() method -if (!Element.prototype.matches) { - Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; -} - -if (!Element.prototype.closest) { - Element.prototype.closest = function(s) { - var el = this; - if (!document.documentElement.contains(el)) return null; - do { - if (el.matches(s)) return el; - el = el.parentElement || el.parentNode; - } while (el !== null && el.nodeType === 1); - return null; - }; -} - -//Custom Event() constructor -if ( typeof window.CustomEvent !== "function" ) { - - function CustomEvent ( event, params ) { - params = params || { bubbles: false, cancelable: false, detail: undefined }; - var evt = document.createEvent( 'CustomEvent' ); - evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ); - return evt; - } - - CustomEvent.prototype = window.Event.prototype; - - window.CustomEvent = CustomEvent; -} - -/* - Animation curves -*/ -Math.easeInOutQuad = function (t, b, c, d) { - t /= d/2; - if (t < 1) return c/2*t*t + b; - t--; - return -c/2 * (t*(t-2) - 1) + b; -}; \ No newline at end of file diff --git a/index.html b/index.html index 8a9c434b..891b8f42 100644 --- a/index.html +++ b/index.html @@ -225,7 +225,7 @@