Verified Commit 280db7e4 authored by Camil Staps's avatar Camil Staps 🚀

Add NL-FP 2018 banner

parent 35a69e03
......@@ -22,6 +22,23 @@ td, th {
padding-right: 1em;
}
.banner {
background-color: #d7e3f4;
border-color: #87aade;
border-style: solid;
border-width: 0 0 1px;
display: none;
padding: .5em 0;
position: relative;
text-align: center;
width: 100%;
}
.banner .hidelink {
position: absolute;
right: 1em;
}
.toggle-container .toggler {
cursor: pointer;
}
......
......@@ -61,3 +61,28 @@ function shortenURL(type, url, onUpdate) {
xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xmlHttp.send('type=' + type + '&url=' + encodeURIComponent(url));
}
var banners = document.getElementsByClassName('banner');
for (var i = 0; i < banners.length; i++) {
var banner = banners[i];
banner.dataset.index = i;
var id = banner.dataset.id;
var hidden = document.cookie.replace(/(?:(?:^|.*;\s*)hidden_banners\s*\=\s*([^;]*).*$)|^.*$/, "$1");
if (hidden.split(' ').indexOf(id) >= 0)
continue;
var until = new Date(banner.dataset.until);
if (until >= new Date())
banner.style.display = 'block';
var hidelink = document.createElement('a');
hidelink.classList.add('hidelink');
hidelink.setAttribute('href', '#');
hidelink.text = '(hide this banner)';
hidelink.onclick = function() {
banner.remove();
document.cookie = 'hidden_banners=' + hidden + ' ' + id;
}
banner.appendChild(hidelink);
}
......@@ -15,6 +15,9 @@
<link rel="stylesheet" href="frontend.css" type="text/css"/>
</head>
<body>
<div class="banner" data-id="nlfp2018" data-until="Fri, 05 Jan 2018 20:00:00 UTC">
On <strong>Friday, January 5, 2018</strong>, we will probably give a talk about Cloogle on the <a href="http://clean.cs.ru.nl/NL-FP_dag_2018" target="_blank">NL-FP day</a>.
</div>
<div id="header">
<div id="logo">
<a href="https://github.com/clean-cloogle/cloogle.org">
......
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