Skip to content

Commit

Permalink
Updating driftermap
Browse files Browse the repository at this point in the history
Removing twitter button, auto-reloading, and fixing syncing of greying and tx icon
  • Loading branch information
erikvansebille committed Nov 19, 2023
1 parent 9381b2b commit fdc720b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
35 changes: 16 additions & 19 deletions driftermap.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
<meta http-equiv="Cache-Control" content="no-store" />
<title>Surface Drifter Map</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
setInterval(function(){ reload_page(); },60*60*1000);
});
function reload_page()
{
window.location.reload(true);
}
</script>
<style type="text/css">
body {
margin: auto; height: 100vh; font-family: 'Merriweather'; pointer-events: none;
Expand Down Expand Up @@ -144,19 +153,19 @@
.correct-modal {
display: none;
position: fixed;
z-index: 1;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.4);
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.4);
}

.correct-content {
background-color: #fefefe;
margin: 15% auto;
margin: 15% auto;
padding: 20px;
border: 1px solid #888;
width: 60%;
Expand Down Expand Up @@ -198,18 +207,6 @@
<div class="date" id="date">Drifters on</div>
<div class="map" id="map"></div>
<ul class="social links social-share-links__list social-share-links__list--inline">
<li class="social-share-links__list-item">
<div class="social-link twitter">
<a target="_blank" class="social-share-links__link social-share-links__link--twitter js-no-external-icon" title="Deel op Twitter" rel="noopener">
<svg aria-hidden="true" focusable="false" class="social-share-links__link-icon">
<use xlink:href="drifters/sprite.svg?v=1611727326#twitter"></use>
</svg>
<svg aria-hidden="true" focusable="false" class="social-share-links__arrow-icon">
<use xlink:href="drifters/sprite.svg?v=1611727326#arrow-right"></use>
</svg>
</a>
</div>
</li>
<li class="social-share-links__list-item">
<div class="social-link linkedin">
<a target="_blank" class="social-share-links__link social-share-links__link--linkedin js-no-external-icon" title="Deel op LinkedIn" rel="noopener">
Expand Down
7 changes: 3 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ class DrifterApp {

let hourdiff = Math.floor((drawdate - t) / (60*60*1000))
let src = "marker.svg"
if (hourdiff > 9) {
if (hourdiff > 6) {
src = "marker_notx.svg"
}
let mark = this.createMarker(colour, lat, lng, opacity, zindex, src);
Expand Down Expand Up @@ -460,7 +460,7 @@ class DrifterApp {
if (hourdiff > 24) {
this.content.innerHTML = `<p><b>Name:</b> ${name}<br><b>Coordinates:</b> ${hdms}<br><b>Last contact:</b> ${Math.floor(hourdiff/24)} days ago`;
}
else if (hourdiff > 9) { // nine hours 'grace period'
else if (hourdiff > 6) { // six hours 'grace period'
this.content.innerHTML = `<p><b>Name:</b> ${name}<br><b>Coordinates:</b> ${hdms}<br><b>Last contact:</b> ${hourdiff} hours ago`;
}
else {
Expand Down Expand Up @@ -527,7 +527,7 @@ class DrifterApp {

stepAnimate() {
const deselectDead = true;
const deathTimeout = 2 * this.anim_s;
const deathTimeout = 7 * 3600 * 1000;

if (this.animating) {
let trimmed = {};
Expand Down Expand Up @@ -630,7 +630,6 @@ class DrifterApp {
}

setupSocialButtons() {
$(".twitter")[0].onclick = e => window.open(`https://twitter.com/share?url=${this.generateQueryURL(true)}`);
$(".linkedin")[0].onclick = e => window.open(`https://www.linkedin.com/shareArticle?mini=true&url=${this.generateQueryURL(true)}`);
$(".facebook")[0].onclick = e => window.open(`https://www.facebook.com/sharer.php?u=${this.generateQueryURL(true)}&t=${this.generateQueryURL(true)}`);
$(".download")[0].onclick = e => window.open(DATA_URL + data_source);
Expand Down

0 comments on commit fdc720b

Please sign in to comment.