diff --git a/examples/move/index.html b/examples/move/index.html index ff51f0bb..fe3629f6 100644 --- a/examples/move/index.html +++ b/examples/move/index.html @@ -123,6 +123,10 @@ }); return; } + var z = 12; + var x = lng2tile(latlng.lng, z); + var y = lat2tile(latlng.lat, z); + console.log(x, y); // where.map.setView(latlng, where.opt.zoom.level, {animate: true}); where.marker = where.marker || L.marker().setLatLng(latlng).addTo(where.map); where.marker.setLatLng(latlng).update(); @@ -145,6 +149,9 @@ }); } + function lng2tile(lng,z) { return (Math.floor((lng+180)/360*Math.pow(2,z))) } + function lat2tile(lat,z) { return (Math.floor((1-Math.log(Math.tan(lat*Math.PI/180) + 1/Math.cos(lat*Math.PI/180))/Math.PI)/2 *Math.pow(2,z))) } + return where; } diff --git a/examples/social.html b/examples/party.html similarity index 96% rename from examples/social.html rename to examples/party.html index 0097038d..56573277 100644 --- a/examples/social.html +++ b/examples/party.html @@ -1,6 +1,7 @@ + Party by Neon ERA @@ -68,7 +69,7 @@ width: 3em; } -
A social network you own & control.
+
Party by NEON ERA.
@@ -508,6 +509,8 @@ } #draft .what { } + #draft .spoke { + }

Welcome!

-
+
+ + \ No newline at end of file diff --git a/lib/fun.js b/lib/fun.js new file mode 100644 index 00000000..83214b9b --- /dev/null +++ b/lib/fun.js @@ -0,0 +1,10 @@ +window.fun = function fun(e){ setTimeout(() => { + e = e || {}; var $img = $('
') + .css({position: 'fixed', width: 100, + top: (e.y || e.clientY || (Math.random() * $(window).height()))-50, + left: (e.x || e.clientX || e.pageX || (Math.random() * $(window).width()))-50, + transform: 'rotate('+(Math.random() * 360)+'deg)' + }).appendTo('body'); + setTimeout(() => { $img.remove() },800); +},10)}; +$(document).on('keyup', fun).on('touchstart', fun).on('mousedown', fun); \ No newline at end of file