diff --git a/.gitignore b/.gitignore index b09b90c..c3faecb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ images node_modules -data.db +tinypin.db .DS_Store \ No newline at end of file diff --git a/static/addpin-app.js b/static/addpin-app.js deleted file mode 100644 index e69de29..0000000 diff --git a/static/addpin.html b/static/addpin.html index f24e670..360901e 100644 --- a/static/addpin.html +++ b/static/addpin.html @@ -17,26 +17,16 @@ -
- - - + - - - - - - diff --git a/static/index.html b/static/index.html index ea76cf5..c4dfe53 100644 --- a/static/index.html +++ b/static/index.html @@ -24,7 +24,7 @@
- + @@ -44,7 +44,6 @@ - \ No newline at end of file diff --git a/static/reef.min.js b/static/reef.min.js new file mode 100644 index 0000000..03c3e83 --- /dev/null +++ b/static/reef.min.js @@ -0,0 +1,2 @@ +/*! Reef v7.6.6 | (c) 2021 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/reef */ +var Reef=function(){"use strict";var t=!1,e=function(){if(!window.DOMParser)return!1;var t=new DOMParser;try{t.parseFromString("x","text/html")}catch(t){return!1}return!0}(),n=function(t){return Array.prototype.slice.call(t)},r=function(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()},a=function(e){if(t)throw new Error(e)},o=function(t,e){var n=r(t);if("object"===n){var a={};for(var i in t)t.hasOwnProperty(i)&&(a[i]=o(t[i],e));return a}return"array"===n?t.map((function(t){return o(t,e)})):"string"!==n||e?t:t.replace(/[^\w-_. ]/gi,(function(t){return"&#"+t.charCodeAt(0)+";"})).replace(/javascript:/gi,"")},i=function(t){t.debounce&&window.cancelAnimationFrame(t.debounce),t.debounce=window.requestAnimationFrame((function(){t.render()}))},c=function(t){return{get:function(e,n){return["object","array"].indexOf(r(e[n]))>-1?new Proxy(e[n],c(t)):e[n]},set:function(e,n,r){return e[n]===r||(e[n]=r,i(t)),!0}}},u=function(t,e){var n=t.filter(e);return n.length<1?null:n[0]},l=["checked","selected","value"],s=function(t,e){e.forEach((function(e){t.style[e]=""}))},f=function(t,e){e.forEach((function(e){if("class"===e.att)t.className=e.value;else if("style"===e.att)!function(t,e){var n=function(t){return t.split(";").reduce((function(t,e){var n=e.indexOf(":");return n&&t.push({name:e.slice(0,n).trim(),value:e.slice(n+1).trim()}),t}),[])}(e),r=Array.prototype.filter.call(t.style,(function(e){return null===u(n,(function(n){return n.name===e&&n.value===t.style[e]}))}));s(t,r),function(t,e){e.forEach((function(e){t.style[e.name]=e.value}))}(t,n)}(t,e.value);else{if(e.att in t)try{t[e.att]=e.value,t[e.att]||0===t[e.att]||(t[e.att]="value"!==e.att||e.value)}catch(t){}try{t.setAttribute(e.att,e.value)}catch(t){}}}))},d=function(t,e){e.forEach((function(e){if("class"===e.att)t.className="";else if("style"===e.att)s(t,n(t.style));else{if(e.att in t)try{t[e.att]=""}catch(t){}try{t.removeAttribute(e.att)}catch(t){}}}))},h=function(t,e){return{att:t,value:e}},p=function(t,e){if(1!==t.nodeType)return[];var n=function(t,e){return Array.prototype.reduce.call(t.attributes,(function(t,n){return!(l.indexOf(n.name)<0||e&&"selected"===n.name)||n.name.length>7&&"default"===n.name.slice(0,7)||t.push(h(n.name,n.value)),t}),[])}(t,e);return function(t,e,n){l.forEach((function(n){e.push(h(n,t.getAttribute(n)))}))}(t,n),n},m=function(t){return 3===t.nodeType?"text":8===t.nodeType?"comment":t.tagName.toLowerCase()},v=function(t){return t.childNodes&&t.childNodes.length>0?null:t.textContent},y=function(t){1===t.nodeType&&(Array.prototype.forEach.call(t.attributes,(function(e){e.name.length<8||"default"!==e.name.slice(0,7)||(f(t,[h(e.name.slice(7).toLowerCase(),e.value)]),d(t,[h(e.name,e.value)]))})),t.childNodes&&Array.prototype.forEach.call(t.childNodes,(function(t){y(t)})))},g=function(t,e,r){var a=n(e.childNodes),o=n(t.childNodes),i=a.length-o.length;if(i>0)for(;i>0;i--)a[a.length-i].parentNode.removeChild(a[a.length-i]);o.forEach((function(t,n){if(!a[n])return y(t),void e.appendChild(t.cloneNode(!0));if(m(t)===m(a[n])){if(function(t,e){var n=p(t,!0),r=p(e),a=r.filter((function(t){return null===u(n,(function(e){return t.att===e.att}))})),o=n.filter((function(t){var e=u(r,(function(e){return t.att===e.att}));return null===e||e.value!==t.value}));f(e,o),d(e,a)}(t,a[n]),!(r.filter((function(e){return 3!==t.nodeType&&function(t,e){return Element.prototype.matches&&t.matches(e)||Element.prototype.msMatchesSelector&&t.msMatchesSelector(e)||Element.prototype.webkitMatchesSelector&&t.webkitMatchesSelector(e)}(t,e)})).length>0)){var o=v(t);if(o&&o!==v(a[n])&&(a[n].textContent=o),a[n].childNodes.length>0&&t.childNodes.length<1)a[n].innerHTML="";else{if(a[n].childNodes.length<1&&t.childNodes.length>0){var i=document.createDocumentFragment();return g(t,i,r),void a[n].appendChild(i)}t.childNodes.length>0&&g(t,a[n],r)}}}else a[n].parentNode.replaceChild(t.cloneNode(!0),a[n])}))},w=function(t,e){t&&t.forEach((function(t){if(t.attached.indexOf(e)>-1)return a(e.elem+" has attached nodes that it is also attached to, creating an infinite loop.");"render"in t&&t.render()}))},b=function(t,e){if(!(t||e&&e.lagoon))return a("You did not provide an element to make into a component.");if(!e||!e.template&&!e.lagoon)return a("You did not provide a template for this component.");var u=this,l=function(t,e){return t.setters?t.store?null:t.data:t.data&&!t.store?new Proxy(t.data,c(e)):null}(e,u),s=e.store,f=e.router,d=e.setters,h=e.getters;(u.debounce=null,Object.defineProperties(u,{elem:{value:t},template:{value:e.template},allowHTML:{value:e.allowHTML},lagoon:{value:e.lagoon},store:{value:s},attached:{value:[]},router:{value:f}}),Object.defineProperty(u,"data",{get:function(){return d?o(l,!0):l},set:function(t){return s||d||(l=new Proxy(t,c(u)),i(u)),!0}}),d&&!s&&Object.defineProperty(u,"do",{value:function(t){if(!d[t])return a("There is no setter with this name.");var e=n(arguments);e[0]=l,d[t].apply(u,e),i(u)}}),h&&!s&&Object.defineProperty(u,"get",{value:function(t){return h[t]?h[t](l):a("There is no getter with this name.")}}),f&&"addComponent"in f&&f.addComponent(u),s&&"attach"in s&&s.attach(u),e.attachTo)&&("array"===r(e.attachTo)?e.attachTo:[e.attachTo]).forEach((function(t){"attach"in t&&t.attach(u)}))};return b.Store=function(t){return t.lagoon=!0,new b(null,t)},b.emit=function(t,e,n){var r;if(!t||!e)return a("You did not provide an element or event name.");r=new CustomEvent(e,{bubbles:!0,detail:n}),t.dispatchEvent(r)},b.prototype.render=function(){if(this.lagoon)w(this.attached,this);else{if(!this.template)return a("No template was provided.");var t="string"===r(this.elem)?document.querySelector(this.elem):this.elem;if(!t)return a("The DOM element to render your template into was not found.");var i=o((this.store?this.store.data:this.data)||{},this.allowHTML),c="function"===r(this.template)?this.template(i,this.router?this.router.current:t,t):this.template;if(!(["string","number"].indexOf(r(c))<0)){var u=this.attached.map((function(t){return t.elem}));return g(function(t){if(e){var r=(new DOMParser).parseFromString(t,"text/html");return r.head&&r.head.childNodes&&r.head.childNodes.length>0&&n(r.head.childNodes).reverse().forEach((function(t){r.body.insertBefore(t,r.body.firstChild)})),r.body||document.createElement("body")}var a=document.createElement("div");return a.innerHTML=t,a}(c),t,u),b.emit(t,"render",i),w(this.attached,this),t}}},b.prototype.attach=function(t){"array"===r(t)?this.attached.push.apply(this.attached,t):this.attached.push(t)},b.prototype.detach=function(t){var e="array"===r(t)?t:[t],n=this;e.forEach((function(t){var e=n.attached.indexOf(t);e<0||n.attached.splice(e,1)}))},b.debug=function(e){t=!!e},b.clone=o,b._={trueTypeOf:r,err:a},b}(); \ No newline at end of file diff --git a/static/touch.js b/static/touch.js deleted file mode 100644 index 6ec6f4d..0000000 --- a/static/touch.js +++ /dev/null @@ -1,192 +0,0 @@ -// document.addEventListener('touchstart', (e) => { -// console.log("touchstart"); -// const touch = e.touches[0] || e.changedTouches[0]; -// window.lastY = touch.pageY; -// }); - -// document.addEventListener('touchmove', (e) => { -// console.log("touchmove"); -// // Check user isn't scrolling past content. If so, cancel move to prevent ios bouncing -// const touch = e.touches[0] || e.changedTouches[0]; -// y = touch.pageY; -// if (y < window.lastY && e.srcElement.scrollTop == (e.srcElement.scrollHeight - e.srcElement.clientHeight)) { -// console.log("user is trying to scroll down without anywhere to scroll to. Canceling propagation."); -// e.preventDefault(); -// } else if (y > window.lastY && e.srcElement.scrollTop == 0) { -// console.log("user is trying to scroll up without anywhere to scroll to. Canceling propagation."); -// e.preventDefault(); -// } -// }); - - -// window.scrollY = 1; -// document.addEventListener("scroll", (evt) => { -// console.log(evt); -// console.log(window.scrollY + "," + window.scrollX); -// console.log("body=" + document.body.scrollTop); -// console.log(document.getElementById("app").scrollTop); -// if (window.scrollY = 0 ){ -// console.log("bump"); -// window.scrollY = 1; -// } -// }); - -// document.addEventListener("scroll", (evt) => { -// console.log(window.scrollY); -// // if ( window.scrollY < 1 ){ -// // window.scrollY = 1; -// // } -// }); - - - - - -// PullToRefresh.init({ -// onRefresh() { -// window.location.reload(); -// } -// }); - - -// let startX = 0; -// let startY = 0; - -// let topPos = 0; - -// let lastX = 0; -// let lastY = 0; - - -// let pullCapped = false; - -// let setTop = (i) => { -// topPos = parseInt(i); -// if ( topPos > 200 ){ -// topPos = 200; -// pullCapped = true; -// div.style.backgroundColor = "green"; -// } else { -// pullCapped = false; -// div.style.backgroundColor = "blue"; -// } -// div.style.top = `${topPos-120}px`; -// console.log("set top=" + topPos); -// }; - -// document.addEventListener('touchstart', (evt)=>{ -// console.log("touch start", evt); -// startX = evt.touches[0].clientX; -// startY = evt.touches[0].clientY; -// }); - -// document.addEventListener('touchend', (evt) =>{ -// console.log("end"); -// startX = 0; -// startY = 0; -// div.style.transitionDuration = "0.2s"; -// div.style.top = "-80px"; - -// topPos = 0; - - -// setTimeout(() => { -// div.style.transitionDuration = "0"; -// }, 200); - - - - - - -// if ( pullCapped ){ -// window.location.reload(); -// } -// }); - -// document.addEventListener('touchcancel', (evt) =>{ -// console.log("cancel"); -// startX = 0; -// startY = 0; - -// div.style.top = "-80px"; - -// if ( pullCapped ){ -// window.location.reload(); -// } -// }); - -// document.addEventListener('touchmove', (evt) => { - -// let x = evt.touches[0].clientX; -// let y = evt.touches[0].clientY; - -// let diff = (y - startY); // / window.devicePixelRatio; - -// if ( window.scrollY == 0 || topPos > 0 ){ -// setTop(diff); -// } - -// // if ( diff > 0 ){ -// // addTop(diff) -// // } - -// console.log(diff); - -// // lastY = y; - -// // let diffY = y - startY; - -// // if ( y > lastY ){ - -// // if ( window.scrollY == 0 ){ - -// // let showPixels = diffY / window.devicePixelRatio; - -// // let pullHeight = showPixels - (80+25); -// // if ( pullHeight > 0 ){ -// // console.log("cap pull height"); -// // pullHeight = 0; -// // pullCapped = true; -// // } - -// // setTop(pullHeight); -// // } - -// // lastY = y; - -// // } else { - -// // let lastDiff = lastY-y; -// // console.log(lastDiff); - -// // } - - -// }); - -// let div = document.createElement("div"); -// div.style.position = "fixed"; -// div.style.height = "80px"; -// div.style.width = "100%"; -// div.style.top = "-80px"; -// div.style.zIndex = "99999"; -// div.style.backgroundColor = "blue"; -// // div.style.transitionProperty = 'top'; -// // div.style.transitionDuration = "0.2s"; - -// let content = document.createElement("div"); -// content.style="text-align: center"; -// content.style.marginTop= "20px"; - - -// let img = document.createElement("img"); -// img.src = "data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzMwMHB4JyB3aWR0aD0nMzAwcHgnICBmaWxsPSIjMDAwMDAwIiB4bWxuczp4PSJodHRwOi8vbnMuYWRvYmUuY29tL0V4dGVuc2liaWxpdHkvMS4wLyIgeG1sbnM6aT0iaHR0cDovL25zLmFkb2JlLmNvbS9BZG9iZUlsbHVzdHJhdG9yLzEwLjAvIiB4bWxuczpncmFwaD0iaHR0cDovL25zLmFkb2JlLmNvbS9HcmFwaHMvMS4wLyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDY0IDY0IiBlbmFibGUtYmFja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4eiI+PC9wYXRoPjwvZz48L3N2Zz4="; -// img.style.width="48px"; -// img.style.height="48px" - -// content.appendChild(img); -// div.appendChild(content); -// document.body.appendChild(div); - -// console.log("pixel ratio = " + window.devicePixelRatio); \ No newline at end of file