Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Groene pinnen en speciale popup voor online bibs #46

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/img/Online.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/green-marker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 29 additions & 18 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,18 @@
<h3>{{name}} ({{capacity}} pl.)</h3>
{{#if wheelchair}}<img src="img/Wheelchair_symbol.svg" class="wheelchair" style="width:30px;height:30px;">{{/if}}
{{#if wifi}}<img src="img/Logo_WiFi.svg" class="wifi" style="width:40px;height:20px;">{{/if}}
{{#if online}}<img src="img/Online.png" class="wifi" style="width:50px;height:50px;">{{/if}}
<img src="img/{{type}}.png" class="type">
<div class="location">Locatie: {{address}}</div>
<div class="period">{{#if period.start}}
Periode: {{date period.start}} tot {{date period.end}}
{{else}}
Open gedurende het hele jaar.
{{/if}}
<div class="location">{{#if online}}Link: <a href={{address}}>{{address}}</a>{{else}}Locatie: {{address}}{{/if}}</div>
{{#if online}}
{{else}}
<div class="period">{{#if period.start}}
Periode: {{date period.start}} tot {{date period.end}}
{{else}}
Open gedurende het hele jaar.
{{/if}}
</div>
<h4>Openingsuren</h4>
<table class="desktop">
<table class="desktop">
<tr>
<td>Maandag</td>
<td>Dinsdag</td>
Expand All @@ -55,15 +57,18 @@ <h4>Openingsuren</h4>
<td>Zaterdag</td>
<td>Zondag</td>
</tr><tr>
<td>{{#if hours.monday}}{{hours.monday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.tuesday}}{{hours.tuesday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.wednesday}}{{hours.wednesday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.thursday}}{{hours.thursday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.friday}}{{hours.friday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.saturday}}{{hours.saturday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.sunday}}{{hours.sunday}}{{else}}Gesloten{{/if}}</td>
</tr>
<td>{{#if hours.monday}}{{hours.monday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.tuesday}}{{hours.tuesday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.wednesday}}{{hours.wednesday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.thursday}}{{hours.thursday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.friday}}{{hours.friday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.saturday}}{{hours.saturday}}{{else}}Gesloten{{/if}}</td>
<td>{{#if hours.sunday}}{{hours.sunday}}{{else}}Gesloten{{/if}}</td>
</tr>
</table>

<h4>Openingsuren</h4>

<table class="mobile">
<tr>
<td>Maandag</td>
Expand All @@ -88,8 +93,10 @@ <h4>Openingsuren</h4>
<td>{{#if hours.sunday}}{{hours.sunday}}{{else}}Gesloten{{/if}}</td>
</tr>
</table>
{{/if}}
{{#if extra}}{{{extra}}}{{/if}}
</div>

</script>

<script id="info-template" type="text/x-handlebars-template">
Expand All @@ -112,11 +119,15 @@ <h4>Openingsuren</h4>
</div>
<div style="width: 125px; height: 18px; padding-top: 5px; padding-left: 5px;">
<div style="height: 10px; width: 10px; background: rgb(36, 126, 202); margin-top: 1px; margin-left: 5px;"></div>
<span style="position: absolute; left: 25px; top: 30px;">Enkel week</span>
<span style="position: absolute; left: 25px; top: 29px;">Enkel week</span>
</div>
<div style="width: 125px; height: 18px; padding-top: 5px; padding-left: 5px;">
<div style="height: 10px; width: 10px; background: rgb(120,120,120); margin-top: 1px; margin-left: 5px;"></div>
<span style="position: absolute; left: 25px; top: 55px;">Opent binnenkort</span>
<span style="position: absolute; left: 25px; top: 53px;">Opent binnenkort</span>
</div>
<div style="width: 125px; height: 18px; padding-top: 5px; padding-left: 5px;">
<div style="height: 10px; width: 10px; background: rgb(124,252,120); margin-top: 1px; margin-left: 5px;"></div>
<span style="position: absolute; left: 25px; top: 77px;">Online</span>
</div>
<div style="width: 140px; height: 18px; padding-top: 5px; padding-left: 5px;" class="holiday">
<div style="height: 10px; width: 10px; background: rgb(121, 230, 121); margin-top: 0px; margin-left: 5px;"></div>
Expand Down
12 changes: 12 additions & 0 deletions src/js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@ $(document).ready(function() {
iconUrl: "img/grey-marker.png"
}
});
var GreenIcon = L.Icon.Default.extend({
options: {
iconUrl: "img/green-marker.png"
}
});

var blueIcon = new BlueIcon();
var redIcon = new RedIcon();
var christmasIcon = new ChristmasIcon();
var greyIcon = new GreyIcon();
var greenIcon = new GreenIcon();

var now = new Date();
var christmasSeason =
Expand All @@ -37,6 +43,8 @@ $(document).ready(function() {

function onEachFeature(feature, layer) {
if (feature.properties) {
var prop = feature.properties;
prop["online"] = feature.properties.address.substring(0,5)==="https";
layer.bindPopup(popuptemplate(feature.properties), {
showOnMouseOver: true
});
Expand All @@ -60,6 +68,10 @@ $(document).ready(function() {
icon = blueIcon;
iconDescription = "blue";
}
if (feature.properties.address.substring(0,5)==="https") {
icon = greenIcon;
iconDescription = "green";
}
}
return new HoverMarker(latlng, { icon: icon, riseOnHover: true});
}
Expand Down