mirror of
https://github.com/amark/gun.git
synced 2025-06-07 14:46:44 +00:00
Merge branch 'master' into sea
This commit is contained in:
commit
c7547cb380
@ -123,6 +123,10 @@
|
|||||||
});
|
});
|
||||||
return;
|
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.map.setView(latlng, where.opt.zoom.level, {animate: true});
|
||||||
where.marker = where.marker || L.marker().setLatLng(latlng).addTo(where.map);
|
where.marker = where.marker || L.marker().setLatLng(latlng).addTo(where.map);
|
||||||
where.marker.setLatLng(latlng).update();
|
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;
|
return where;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<title>Party by Neon ERA</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="stylesheet" type="text/css" href="./style.css">
|
<link rel="stylesheet" type="text/css" href="./style.css">
|
||||||
<link href="https://fonts.googleapis.com/css?family=Alegreya+Sans:300italic" rel="stylesheet" type="text/css">
|
<link href="https://fonts.googleapis.com/css?family=Alegreya+Sans:300italic" rel="stylesheet" type="text/css">
|
||||||
@ -68,7 +69,7 @@
|
|||||||
width: 3em;
|
width: 3em;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="loud write shout rim">A social network you own & control.</div>
|
<div class="loud write shout rim">Party by NEON ERA.</div>
|
||||||
<div id="faces" class="flush faces">
|
<div id="faces" class="flush faces">
|
||||||
<div class="right" style="max-width: 20em;">
|
<div class="right" style="max-width: 20em;">
|
||||||
<input id="halias" class="write jot sap" placeholder="username">
|
<input id="halias" class="write jot sap" placeholder="username">
|
||||||
@ -508,6 +509,8 @@
|
|||||||
}
|
}
|
||||||
#draft .what {
|
#draft .what {
|
||||||
}
|
}
|
||||||
|
#draft .spoke {
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<p class="pad">Welcome!</p>
|
<p class="pad">Welcome!</p>
|
||||||
<!--
|
<!--
|
||||||
@ -520,7 +523,7 @@
|
|||||||
- take
|
- take
|
||||||
-->
|
-->
|
||||||
<form id="speak" class="mid row col">
|
<form id="speak" class="mid row col">
|
||||||
<div id="d0" class="draft gap tint sap" contenteditable="true" style="min-height: 1em;" data-text="Express yourself..."></div>
|
<div id="d0" class="draft spoke gap tint sap editable" contenteditable="true" style="min-height: 1em;" data-text="Express yourself..."></div>
|
||||||
<input type="submit" class="sap hide" value="speak!">
|
<input type="submit" class="sap hide" value="speak!">
|
||||||
</form>
|
</form>
|
||||||
<ul class="mid row col">
|
<ul class="mid row col">
|
||||||
@ -544,6 +547,9 @@
|
|||||||
});
|
});
|
||||||
window.user = S.user;
|
window.user = S.user;
|
||||||
$('#speak').on('submit', (e) => {
|
$('#speak').on('submit', (e) => {
|
||||||
|
/*var say = normalize($('#speak .draft'));
|
||||||
|
console.log(1, say.html());
|
||||||
|
return;*/
|
||||||
var say = $('#speak .draft').text();
|
var say = $('#speak .draft').text();
|
||||||
if(!say){ return }
|
if(!say){ return }
|
||||||
var ref = S.user.get('who').get('all').set({what: say});
|
var ref = S.user.get('who').get('all').set({what: say});
|
||||||
@ -669,7 +675,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$.as.route.page('person', () => {
|
$.as.route.page('person', () => {
|
||||||
if(!user.is){ return $.as.route('hi') }
|
if(!user.is){ return $.as.route('hi') }
|
||||||
var pub = location.hash.split('/').slice(-1)[0];
|
var pub = location.hash.split('/').slice(-1)[0];
|
||||||
@ -678,7 +683,6 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(document).upload(function resize(e, up){
|
$(document).upload(function resize(e, up){
|
||||||
console.log("WOAH");
|
|
||||||
if(e.err){ return }
|
if(e.err){ return }
|
||||||
var m = $($("#d"+e.id)[0] || $('#d0').clone(true,true).attr('id', 'd'+e.id).css('backgroundImage', '').appendTo('#draft')).addClass('pulse');
|
var m = $($("#d"+e.id)[0] || $('#d0').clone(true,true).attr('id', 'd'+e.id).css('backgroundImage', '').appendTo('#draft')).addClass('pulse');
|
||||||
if(up){ return up.shrink(e, resize, 1000) }
|
if(up){ return up.shrink(e, resize, 1000) }
|
||||||
@ -690,17 +694,8 @@
|
|||||||
backgroundSize: 'cover'
|
backgroundSize: 'cover'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
window.fun = function fun(e){ setTimeout(() => {
|
|
||||||
e = e || {}; var $img = $('<div class="joy"></div>')
|
|
||||||
.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);
|
|
||||||
</script>
|
</script>
|
||||||
|
<script async src="../../gun/lib/fun.js"></script>
|
||||||
|
<script async src="../../gun/lib/normalize.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
10
lib/fun.js
Normal file
10
lib/fun.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
window.fun = function fun(e){ setTimeout(() => {
|
||||||
|
e = e || {}; var $img = $('<div class="joy"></div>')
|
||||||
|
.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);
|
Loading…
x
Reference in New Issue
Block a user