Add Cpt situation

parent 2380fe2d
{{ partial "head" . }} {{ partial "head" . }}
<link rel="stylesheet" type="text/css" href="/css/htw.css">
<body class="home-template"><div class="site-wrapper"> <body class="home-template"><div class="site-wrapper">
{{ partial "header" . }} {{ partial "header" . }}
{{ partial "cpt" . }}
<main id="site-main" class="site-main outer" role="main"> <main id="site-main" class="site-main outer" role="main">
<div class="inner"> <div class="inner">
<div class="post-feed"> <div class="post-feed">
...@@ -23,4 +23,6 @@ ...@@ -23,4 +23,6 @@
</main> </main>
{{ partial "footer" . }} {{ partial "footer" . }}
</div>{{ partial "js" . }}</body></html> </div>{{ partial "js" . }}
{{ partial "cptjs" . }}
</body></html>
<div id="capetown">
<div><b>Cape Town crisis</b></div>
<div><span class="cpttitle">0 day is: </span><span id="cpt0day" class="cptvalue"></span></div>
<div><span class="cpttitle">days before 0: </span><span id="cptdays" class="cptvalue"></span> </div>
<div><span class="cpttitle">citizen saving water: </span><span id="cptcitizen" class="cptvalue"></span></div>
<div><span class="cpttitle">Dams level: </span><span id="cptdams" class="cptvalue"></span></div>
</div>
<script language="javascript">
function updateCpt() {
$.ajax({
type: "GET",
url: "/cpt.xml",
dataType: "xml",
success: function(xml) {
var CptDate = $(xml).find("date").text();
var CptDays = $(xml).find("days").text();
var CptDams = $(xml).find("dams").text();
var CptPeople = $(xml).find("people").text();
$("#cptdays").text(CptDays);
$("#cptcitizen").text(CptPeople+"%");
$("#cptdams").text(CptDams+"%");
$("#cpt0day").text(CptDate);
}
});
};
$(document).ready(updateCpt());
</script>
{{ $paginator := .Paginate (where .Data.Pages.ByDate.Reverse "Type" "post")}}
{{ range $paginator.Pages }}
<article class="post-card post">
{{if .Params.image}}
<a class="post-card-image-link" href="{{ .Permalink }}">
<div class="post-card-image" style="background-image: url({{.Params.image | absURL}})"></div>
</a>
{{else}}
<a class="post-card-image-link" href="{{ .Permalink }}">
<div class="post-card-image" style="background-image: url({{$.Site.BaseURL}}defimg/{{ index (seq 7 | shuffle) 0 }}.jpg)"></div>
</a>
{{end}}
<div class="post-card-content">
<a class="post-card-content-link" href="{{ .Permalink }}">
<header class="post-card-header">
{{if .Params.tags }}<span class="post-card-tags">{{ range $index, $tag := .Params.tags }}
#{{$tag}} {{end}} </span>
{{ end }}
<h2 class="post-card-title">{{.Title}}</h2>
</header>
<section class="post-card-excerpt">
{{ if .Description }}
<p>{{ .Description | markdownify }}</p>
{{else}}
<p>{{ .Summary | plainify | safeHTML }}{{ if .Truncated }} ... {{end}} </p>
{{end}}
</section>
</a>
<footer class="post-card-meta">
<img class="author-profile-image" src="{{ (.Params.authorAvatar | default .Site.Params.authorAvatar) | absURL}}" alt="Author" />
<span class="post-card-author"><a href="/">{{.Params.author | default .Site.Params.author}}</a></span>
</footer>
</div>
</article>
{{ end }}
<xml>
<date>21/04/2018</date>
<days>90</days>
<dams>28.7</dams>
<people>39</people>
</xml>
#capetown {
background-color: white;
width: 180px;
height: 100px;
position: fixed;
top: 30px;
left: 30px;
border-radius: 10px;
text-align: center;
}
.cptvalue {
color: red;
}
@media (max-width: 900px) {
#capetown {
display: none;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment