Skip to content

Commit

Permalink
added social media counter (twitter and Facebook) + set one school to…
Browse files Browse the repository at this point in the history
… finished with reconstruction
  • Loading branch information
tursics committed Sep 16, 2016
1 parent 541dc19 commit c22f192
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 2 deletions.
33 changes: 33 additions & 0 deletions index.css
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,22 @@
font: normal normal normal 14px/1 FontAwesome;
padding: 0 10px 0 0;
}
#headerBox .social span {
display: none;
margin: 0 0 0 7px;
padding: 1px 3px;
border-radius: 4px;
background: #fff;
}
#headerBox .social span.active {
display: inline;
}
#headerBox .social .facebook span {
color: #3b5998;
}
#headerBox .social .twitter span {
color: #55acee;
}
@media (max-width: 40em) {
#headerBox {
line-height: 17px;
Expand Down Expand Up @@ -285,6 +301,23 @@
height: 1em;
overflow-y: hidden;
}
#receipt .finished {
display: none;
position: absolute;
background: rgba(114, 176, 38, .9);
color: #fff;
border: 2px solid #fff;
border-radius: 4px;
transform: rotate(-10deg);
font-family: 'Montserrat', sans-serif;
font-size: 13px;
padding: 1em;
margin: 2.5em 0 0 2em;
}
#receipt .finished i {
font-size: 2em;
vertical-align: middle;
}
#receiptClose {
background: #fff;
color: #555;
Expand Down
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
<a href="http://www.tursics.de/" target="_blank" title="Thomas Tursics"><img src="/assets/logotursics.png"><span> Thomas Tursics</span></a>
</div>
<div class="social">
<a class="facebook" href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fschulsanierung.tursics.de%2F" rel="popup" title="Bei Facebook teilen">teilen</a>
<a class="twitter" href="https://twitter.com/intent/tweet?text=Wie%20kaputt%20ist%20deine%20Schule?%20Finde%20es%20hier%20heraus&amp;url=http://schulsanierung.tursics.de/" rel="popup" title="Bei Twitter teilen">tweeten</a>
<a class="facebook" href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fschulsanierung.tursics.de%2F" rel="popup" title="Bei Facebook teilen">teilen<span></span></a>
<a class="twitter" href="https://twitter.com/intent/tweet?text=Wie%20kaputt%20ist%20deine%20Schule?%20Finde%20es%20hier%20heraus&amp;url=http://schulsanierung.tursics.de/" rel="popup" title="Bei Twitter teilen">tweeten<span></span></a>
</div>
<h1>Wo unsere Kinder lernen</h1>
<div>Viele Schulen in Berlin sind marode. Wie teuer die Sanierung<br>wirklich wird, können Sie auf dieser Karte erkunden.</div>
Expand Down Expand Up @@ -102,6 +102,7 @@ <h3>Wie kaputt ist Ihre Schule?</h3>
<div class="full bold">Priorität: <span id="recPrioritaetGesamt"></span></div>
<div class="empty"></div>
<div class="full">--------------------------------------------</div>
<div class="finished"><i class="fa fa-check-square-o" aria-hidden="true"></i> Sanierung abgeschlossen</div>
<div class="group groupClosed">
<div><span class="half">Fenster</span><span class="number"><span id="recFensterKosten"></span> EUR</span></div>
<div class="sub"><span class="half"><span id="recFensterFlaeche"></span> m² á <span id="recFensterKostenpauschale"></span> €/m²</span><span class="number"><span id="recFensterKosten_"></span> EUR</span></div>
Expand Down
23 changes: 23 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ function updateMapSelectItem(data) {
}

$('#receiptBox').css('display', 'block');
$('#receiptBox .finished').css('display', 1160202 === data.Gebaeudenummer ? 'block' : 'none');

// for (id in budget) {
// item = budget[id];
Expand Down Expand Up @@ -700,6 +701,27 @@ function selectPrinterLabel(name) {

// -----------------------------------------------------------------------------

function initSocialMedia() {
'use strict';

setTimeout(function () {
$.ajax('http://www.tursics.de/v5shariff.php?url=http://schulsanierung.tursics.de/')
.done(function (json) {
$('.social .facebook span').html(json.facebook);
if (json.facebook > 0) {
$('.social .facebook span').addClass('active');
}

$('.social .twitter span').html(json.twitter);
if (json.twitter > 0) {
$('.social .twitter span').addClass('active');
}
});
}, 1000);
}

// -----------------------------------------------------------------------------

function initMap(elementName, lat, lng, zoom) {
'use strict';

Expand All @@ -723,6 +745,7 @@ function initMap(elementName, lat, lng, zoom) {
createMarker(data);
initSearchBox(data);
selectPrinterLabel('school');
initSocialMedia();

// var budgetUrl = 'data/gebaeudesanierungen.json';
// $.getJSON(budgetUrl, function (budgetData) {
Expand Down

0 comments on commit c22f192

Please sign in to comment.