upgrade mapbox, localize jquery.scrollTo

This commit is contained in:
David 2022-03-19 15:32:00 -04:00
parent 202631eeb9
commit a52daa929e
2 changed files with 498 additions and 428 deletions

View File

@ -1,31 +1,67 @@
<!DOCTYPE html><html lang="en"><head> <!DOCTYPE html>
<meta charset="utf-8"> <html lang="en">
<meta http-equiv="x-ua-compatible" content="ie=edge"> <head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<title> <title>
Independent Bookstores in New York City - Best Community Bookstores in NYC Independent Bookstores in New York City - Best Community Bookstores in NYC
</title> </title>
<meta name="google-site-verification" content="hEfog9h0E3JQW91ZUZM5ayPb6DND0WbUa2_W8yTIuVw"> <meta
<link rel="icon" type="image/png" href="/img/favicon.png"> name="google-site-verification"
<link rel="apple-touch-icon" href="/img/social.jpg"> content="hEfog9h0E3JQW91ZUZM5ayPb6DND0WbUa2_W8yTIuVw"
<script type="text/javascript" src="js/jquery.3.6.0.js"></script> />
<script type="text/javascript" src="js/mustache.4.1.0.js"></script> <link rel="icon" type="image/png" href="/img/favicon.png" />
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-scrollTo/2.1.0/jquery.scrollTo.min.js"></script> <link rel="apple-touch-icon" href="/img/social.jpg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <script type="text/javascript" src="/js/jquery.3.6.0.js"></script>
<script src="https://api.mapbox.com/mapbox-gl-js/v0.34.0/mapbox-gl.js"></script> <script type="text/javascript" src="/js/mustache.4.1.0.js"></script>
<link href="https://api.mapbox.com/mapbox-gl-js/v0.34.0/mapbox-gl.css" rel="stylesheet"> <script type="text/javascript" src="/js/jquery.scrollTo.2.1.3.js"></script>
<link href="https://fonts.googleapis.com/css?family=Acme|Lato&amp;display=swap" rel="stylesheet"> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link media="screen" rel="stylesheet" type="text/css" href="css/site.css"> <script src="https://api.mapbox.com/mapbox-gl-js/v2.7.0/mapbox-gl.js"></script>
<meta property="title" name="title" content="Independent Bookstores in New York City - Best Community Bookstores in NYC"> <link
<meta property="description" name="description" content="A guide to and map of every independent bookstore in New York City. We have a complete list of community bookstores in NYC with locations and descriptions."> href="https://api.mapbox.com/mapbox-gl-js/v2.7.0/mapbox-gl.css"
<meta name="twitter:card" content="summary"> rel="stylesheet"
<meta name="twitter:site" content="www.nycbookstores.org"> />
<meta name="twitter:title" content="NYC Bookstores"> <link
<meta name="twitter:description" content="A Guide To The Many Independent Bookstores Of New York City"> href="https://fonts.googleapis.com/css?family=Acme|Lato&amp;display=swap"
<meta name="twitter:image" content="https://www.nycbookstores.org/img/social.jpg"> rel="stylesheet"
<meta property="og:url" content="https://www.nycbookstores.org/"> />
<meta property="og:title" content="NYC Bookstores"> <link
<meta property="og:description" content="A Guide To The Many Independent Bookstores Of New York City"> media="screen"
<meta property="og:image" content="https://www.nycbookstores.org/img/social.jpg"> rel="stylesheet"
type="text/css"
href="/css/site.css"
/>
<meta
property="title"
name="title"
content="Independent Bookstores in New York City - Best Community Bookstores in NYC"
/>
<meta
property="description"
name="description"
content="A guide to and map of every independent bookstore in New York City. We have a complete list of community bookstores in NYC with locations and descriptions."
/>
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="www.nycbookstores.org" />
<meta name="twitter:title" content="NYC Bookstores" />
<meta
name="twitter:description"
content="A Guide To The Many Independent Bookstores Of New York City"
/>
<meta
name="twitter:image"
content="https://www.nycbookstores.org/img/social.jpg"
/>
<meta property="og:url" content="https://www.nycbookstores.org/" />
<meta property="og:title" content="NYC Bookstores" />
<meta
property="og:description"
content="A Guide To The Many Independent Bookstores Of New York City"
/>
<meta
property="og:image"
content="https://www.nycbookstores.org/img/social.jpg"
/>
</head> </head>
<body> <body>
<div id="wrapper"> <div id="wrapper">
@ -35,10 +71,16 @@
<li><h2>The Many Independent Bookstores of New York City</h2></li> <li><h2>The Many Independent Bookstores of New York City</h2></li>
<li><a id="viewInfo">info</a></li> <li><a id="viewInfo">info</a></li>
<li> <li>
<a href="https://git.yetaga.in/alazyreader/nyc-bookstores/" target="_blank">git</a> <a
href="https://git.yetaga.in/alazyreader/nyc-bookstores/"
target="_blank"
>git</a
>
</li> </li>
<li> <li>
<a href="https://www.twitter.com/alazyreader" target="_blank">@alazyreader</a> <a href="https://www.twitter.com/alazyreader" target="_blank"
>@alazyreader</a
>
</li> </li>
</ul> </ul>
</div> </div>
@ -47,10 +89,18 @@
<div id="info"> <div id="info">
<p> <p>
New York City loves its independent bookstores. It New York City loves its independent bookstores. It
<a href="https://www.nytimes.com/2006/10/15/nyregion/thecity/15book.html" target="_blank">eulogizes those that have faded</a> <a
href="https://www.nytimes.com/2006/10/15/nyregion/thecity/15book.html"
target="_blank"
>eulogizes those that have faded</a
>
and celebrates when new ventures are launched. And while the and celebrates when new ventures are launched. And while the
historic historic
<a href="https://untappedcities.com/2015/08/26/4th-avenue-the-history-of-nycs-book-row/" target="_blank">Book Row may have passed away in the 80s</a>, there are still many indie bookstores dotting the map, across all <a
href="https://untappedcities.com/2015/08/26/4th-avenue-the-history-of-nycs-book-row/"
target="_blank"
>Book Row may have passed away in the 80s</a
>, there are still many indie bookstores dotting the map, across all
five boroughs. Here, I have attempted to collect all of the five boroughs. Here, I have attempted to collect all of the
currently-open general-interest independent booksellers in NYC. Any currently-open general-interest independent booksellers in NYC. Any
store with regular-ish hours (excluding religious booksellers and store with regular-ish hours (excluding religious booksellers and
@ -69,7 +119,13 @@
please let me know by please let me know by
<a href="mailto:delta.mu.alpha@gmail.com" target="_blank">email</a> <a href="mailto:delta.mu.alpha@gmail.com" target="_blank">email</a>
or or
<a href="https://www.twitter.com/alazyreader" target="_blank">twitter</a>. Orignally based on the "<a href="https://github.com/jlord/hack-spots" target="_blank">Hack Spots</a>" website by <a href="https://www.twitter.com/alazyreader" target="_blank"
>twitter</a
>. Orignally based on the "<a
href="https://github.com/jlord/hack-spots"
target="_blank"
>Hack Spots</a
>" website by
<a href="https://www.twitter.com/jllord" target="_blank">@jllord</a> <a href="https://www.twitter.com/jllord" target="_blank">@jllord</a>
(although I don't believe any of the actual underlying code still (although I don't believe any of the actual underlying code still
survives at this point). survives at this point).
@ -87,7 +143,8 @@
<div class="container"> <div class="container">
<div id="Stores"> <div id="Stores">
<table> <table>
<tbody><tr> <tbody>
<tr>
<th class="tHeader">Name</th> <th class="tHeader">Name</th>
<th class="tHeader">Address</th> <th class="tHeader">Address</th>
</tr> </tr>
@ -232,7 +289,9 @@
<td>99 St. Mark's Place, New York</td> <td>99 St. Mark's Place, New York</td>
</tr> </tr>
<tr id="" class="spotRow"> <tr id="" class="spotRow">
<td class="name">Every Thing Goes Book Cafe and Neighborhood Stage</td> <td class="name">
Every Thing Goes Book Cafe and Neighborhood Stage
</td>
<td>208 Bay St, Staten Island</td> <td>208 Bay St, Staten Island</td>
</tr> </tr>
<tr id="" class="spotRow"> <tr id="" class="spotRow">
@ -244,7 +303,9 @@
<td>686 Fulton St, Brooklyn</td> <td>686 Fulton St, Brooklyn</td>
</tr> </tr>
<tr id="" class="spotRow"> <tr id="" class="spotRow">
<td class="name">Greenlight Bookstore (Prospect Lefferts Gardens)</td> <td class="name">
Greenlight Bookstore (Prospect Lefferts Gardens)
</td>
<td>632 Flatbush Ave, Brooklyn</td> <td>632 Flatbush Ave, Brooklyn</td>
</tr> </tr>
<tr id="" class="spotRow"> <tr id="" class="spotRow">
@ -384,7 +445,9 @@
<td>939 Lexington Ave, New York</td> <td>939 Lexington Ave, New York</td>
</tr> </tr>
<tr id="" class="spotRow"> <tr id="" class="spotRow">
<td class="name">Shakespeare &amp; Company (Upper West Side)</td> <td class="name">
Shakespeare &amp; Company (Upper West Side)
</td>
<td>2020 Broadway, New York</td> <td>2020 Broadway, New York</td>
</tr> </tr>
<tr id="" class="spotRow"> <tr id="" class="spotRow">
@ -479,7 +542,8 @@
<td class="name">Yu and Me Books</td> <td class="name">Yu and Me Books</td>
<td>44 Mulberry St, New York</td> <td>44 Mulberry St, New York</td>
</tr> </tr>
</tbody></table> </tbody>
</table>
</div> </div>
</div> </div>
</div> </div>
@ -754,6 +818,5 @@
ga("create", "UA-100418882-1", "auto"); ga("create", "UA-100418882-1", "auto");
ga("send", "pageview"); ga("send", "pageview");
</script> </script>
</body>
</html>
</body></html>

View File

@ -0,0 +1,7 @@
/**
* Copyright (c) 2007 Ariel Flesler - aflesler gmail com | https://github.com/flesler
* Licensed under MIT
* @author Ariel Flesler
* @version 2.1.3
*/
;(function(factory){'use strict';if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else if(typeof module!=='undefined'&&module.exports){module.exports=factory(require('jquery'))}else{factory(jQuery)}})(function($){'use strict';var $scrollTo=$.scrollTo=function(target,duration,settings){return $(window).scrollTo(target,duration,settings)};$scrollTo.defaults={axis:'xy',duration:0,limit:true};function isWin(elem){return!elem.nodeName||$.inArray(elem.nodeName.toLowerCase(),['iframe','#document','html','body'])!==-1}function isFunction(obj){return typeof obj==='function'}$.fn.scrollTo=function(target,duration,settings){if(typeof duration==='object'){settings=duration;duration=0}if(typeof settings==='function'){settings={onAfter:settings}}if(target==='max'){target=9e9}settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.duration;var queue=settings.queue&&settings.axis.length>1;if(queue){duration/=2}settings.offset=both(settings.offset);settings.over=both(settings.over);return this.each(function(){if(target===null){return}var win=isWin(this),elem=win?this.contentWindow||window:this,$elem=$(elem),targ=target,attr={},toff;switch(typeof targ){case 'number':case 'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=win?$(targ):$(targ,elem);case 'object':if(targ.length===0){return}if(targ.is||targ.style){toff=(targ=$(targ)).offset()}}var offset=isFunction(settings.offset)&&settings.offset(elem,targ)||settings.offset;$.each(settings.axis.split(''),function(i,axis){var Pos=axis==='x'?'Left':'Top',pos=Pos.toLowerCase(),key='scroll'+Pos,prev=$elem[key](),max=$scrollTo.max(elem,axis);if(toff){attr[key]=toff[pos]+(win?0:prev-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(targ.css('margin'+Pos),10)||0;attr[key]-=parseInt(targ.css('border'+Pos+'Width'),10)||0}attr[key]+=offset[pos]||0;if(settings.over[pos]){attr[key]+=targ[axis==='x'?'width':'height']()*settings.over[pos]}}else{var val=targ[pos];attr[key]=val.slice&&val.slice(-1)==='%'?parseFloat(val)/100*max:val}if(settings.limit&&/^\d+$/.test(attr[key])){attr[key]=attr[key]<=0?0:Math.min(attr[key],max)}if(!i&&settings.axis.length>1){if(prev===attr[key]){attr={}}else if(queue){animate(settings.onAfterFirst);attr={}}}});animate(settings.onAfter);function animate(callback){var opts=$.extend({},settings,{queue:true,duration:duration,complete:callback&&function(){callback.call(elem,targ,settings)}});$elem.animate(attr,opts)}})};$scrollTo.max=function(elem,axis){var Dim=axis==='x'?'Width':'Height',scroll='scroll'+Dim;if(!isWin(elem)){return elem[scroll]-$(elem)[Dim.toLowerCase()]()}var size='client'+Dim,doc=elem.ownerDocument||elem.document,html=doc.documentElement,body=doc.body;return Math.max(html[scroll],body[scroll])-Math.min(html[size],body[size])};function both(val){return isFunction(val)||$.isPlainObject(val)?val:{top:val,left:val}}$.Tween.propHooks.scrollLeft=$.Tween.propHooks.scrollTop={get:function(t){return $(t.elem)[t.prop]()},set:function(t){var curr=this.get(t);if(t.options.interrupt&&t._last&&t._last!==curr){return $(t.elem).stop()}var next=Math.round(t.now);if(curr!==next){$(t.elem)[t.prop](next);t._last=this.get(t)}}};return $scrollTo});