mirror of
https://github.com/voc/streaming-website
synced 2024-11-10 06:34:17 +00:00
Countdown in closed-View
This commit is contained in:
parent
88fa2b84ef
commit
91a548285c
5 changed files with 42 additions and 0 deletions
|
@ -5,4 +5,17 @@ body.closed {
|
|||
h1, h2, p {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.countdown {
|
||||
display: block;
|
||||
text-align: center;
|
||||
|
||||
color: @gray-light;
|
||||
font-size: @font-size-h3;
|
||||
|
||||
&::before,
|
||||
&::after {
|
||||
content: ' – ';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
7
assets/js/lib/moment.min.js
vendored
Normal file
7
assets/js/lib/moment.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -539,3 +539,23 @@ $(function() {
|
|||
$(this).select();
|
||||
});
|
||||
});
|
||||
|
||||
// closed-countdown
|
||||
$(function() {
|
||||
var
|
||||
$el = $('.closed .countdown'),
|
||||
dt = moment($el.data('dt'));
|
||||
|
||||
$el.attr('title', 'on '+dt.format('dddd, MMM Do YYYY'))
|
||||
function update() {
|
||||
setTimeout(update, 5000);
|
||||
|
||||
var now = moment('2015-03-31');
|
||||
|
||||
if(dt.dayOfYear() == now.dayOfYear() && dt.year() == now.year())
|
||||
$el.text('today');
|
||||
else
|
||||
$el.text( dt.from(now) );
|
||||
}
|
||||
update();
|
||||
});
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
<? if($next): ?>
|
||||
<h2>See you soon at <?=h($next['name'])?></h2>
|
||||
<span class="countdown" data-dt="<?=h($next['start_date'])?>"></span>
|
||||
<? endif ?>
|
||||
|
||||
<p>
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
<script type="text/javascript" src="assets/js/lib/jquery.scrollTo.min.js"></script>
|
||||
<script type="text/javascript" src="assets/js/lib/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="assets/js/lib/bootstrap-datepicker.min.js"></script>
|
||||
<script type="text/javascript" src="assets/js/lib/moment.min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="assets/mejs/mediaelement-and-player.min.js"></script>
|
||||
<script type="text/javascript" src="assets/js/lustiges-script.js"></script>
|
||||
|
|
Loading…
Reference in a new issue