small ad for the c3nav android app

This commit is contained in:
Laura Klünder 2018-12-24 00:27:43 +01:00
parent 1ec40b50ce
commit 4f4543d19f
4 changed files with 62 additions and 14 deletions

View file

@ -1075,6 +1075,34 @@ ul.messages li.alert-danger {
background-color:#FFEEEE;
}
.app-ads {
position:absolute;
z-index: 10;
bottom:0;
right:0;
left:0;
padding:0;
text-align: center;
display:none;
}
.app-ads div {
background-color: #ffffff;
-webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
border-radius: 2px;
overflow: hidden;
display: inline-block;
margin: 0 10px 25px;
padding: 10px;
vertical-align: middle;
}
.app-ads .close {
float: right;
color: inherit;
line-height: 16px;
margin-left: 10px;
}
#messages {
z-index: 5;
position: absolute;

View file

@ -50,6 +50,16 @@ c3nav = {
);
});
if ((!localStorage || !localStorage.getItem('hideAppAds')) && navigator.userAgent.toLowerCase().indexOf("android") > -1) {
$('.app-ads').show();
$('.app-ads .close').click(function() {
localStorage.setItem('hideAppAds', true);
$('.app-ads').remove();
});
} else {
$('.app-ads').remove();
}
if (window.mobileclient) {
var $body = $('body');
$body.addClass('mobileclient');

View file

@ -144,6 +144,12 @@
</section>
</div>
</section>
<div class="app-ads">
<div id="android-app-ad">
<a href="#" class="close"><i class="material-icons">close</i></a>
<a href="https://play.google.com/store/apps/details?id=de.c3nav.droid">{% trans 'Get the c3nav Android app!' %}</a>
</div>
</div>
{% else %}
<a id="embed-logo" class="embed-link" target="_blank">{% if header_logo %}<img src="{% static header_logo %}">{% else %}<span>c3nav</span>{% endif %}</a>
<a id="embed-open" class="embed-link" target="_blank">{% trans 'open in c3nav' %}</a>