Skip to content

Commit

Permalink
Live stream popup fade effect; Live stream info has links to speakers…
Browse files Browse the repository at this point in the history
… of talks
  • Loading branch information
tdiam committed Mar 22, 2018
1 parent 7fa4500 commit 15a21d2
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 17 deletions.
3 changes: 2 additions & 1 deletion app/Http/Controllers/CurrentEventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ private function getCurr($events) {
$coll = $events -> where('hour', '<=', $this->now);
$last = $coll -> pop();
$prevToLast = $coll -> last();
# if there are many events happening at the exact same time, choose the one that is not a general event
while(!is_null($last) && $coll -> isNotEmpty() && $last -> hour == $prevToLast -> hour) {
if($last -> type != "general" && $prevToLast -> type == "general") {
$coll -> pop();
Expand All @@ -30,7 +31,7 @@ private function getNext($events) {
}

public function __construct() {
$this->now = '15:35';#date('H:i');
$this->now = date('H:i');
}

public function index(Request $request) {
Expand Down
4 changes: 4 additions & 0 deletions public/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -13771,6 +13771,10 @@ article.home #hero.live .liveInfo p {
margin-bottom: 0;
}

article.home #hero.live .liveInfo a {
color: inherit;
}

article.home #hero.live .liveInfo .container-fluid {
margin-bottom: 1.2em;
}
Expand Down
21 changes: 15 additions & 6 deletions public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -36606,12 +36606,18 @@ $(function () {

if (!$("#hero.live").hasClass("popup") && !$("#hero.live").hasClass("no-popup") && sT > liveOffsetY + liveH / 2) {

$("#hero.live .liveInfo").css("padding-bottom", liveH);
$("#hero.live").addClass("popup");
$("#hero.live .live-container").fadeOut(400, function () {
$("#hero.live .liveInfo").css("padding-bottom", liveH);
$("#hero.live").addClass("popup");
$(this).fadeIn();
});
} else if ($("#hero.live").hasClass("popup") && sT <= liveOffsetY + liveH / 2) {

$("#hero.live .liveInfo").css("padding-bottom", 0);
$("#hero.live").removeClass("popup");
$("#hero.live .live-container").fadeOut(400, function () {
$("#hero.live .liveInfo").css("padding-bottom", 0);
$("#hero.live").removeClass("popup");
$(this).fadeIn();
});
}
}
}));
Expand All @@ -36620,8 +36626,11 @@ $(function () {

if ($("#hero.live").hasClass("popup")) {

$("#hero.live .liveInfo").css("padding-bottom", 0);
$("#hero.live").removeClass("popup").addClass("no-popup");
$("#hero.live .live-container").fadeOut(400, function () {
$("#hero.live .liveInfo").css("padding-bottom", 0);
$("#hero.live").removeClass("popup").addClass("no-popup");
$(this).fadeIn();
});
}
});

Expand Down
21 changes: 15 additions & 6 deletions resources/assets/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@ $(function(){
&& !$("#hero.live").hasClass("no-popup")
&& sT > liveOffsetY + liveH / 2) {

$("#hero.live .liveInfo").css("padding-bottom", liveH)
$("#hero.live").addClass("popup")
$("#hero.live .live-container").fadeOut(400, function() {
$("#hero.live .liveInfo").css("padding-bottom", liveH)
$("#hero.live").addClass("popup")
$(this).fadeIn()
})

} else if($("#hero.live").hasClass("popup")
&& sT <= liveOffsetY + liveH / 2) {

$("#hero.live .liveInfo").css("padding-bottom", 0)
$("#hero.live").removeClass("popup")
$("#hero.live .live-container").fadeOut(400, function() {
$("#hero.live .liveInfo").css("padding-bottom", 0)
$("#hero.live").removeClass("popup")
$(this).fadeIn()
})

}

Expand All @@ -38,8 +44,11 @@ $(function(){

if($("#hero.live").hasClass("popup")) {

$("#hero.live .liveInfo").css("padding-bottom", 0)
$("#hero.live").removeClass("popup").addClass("no-popup")
$("#hero.live .live-container").fadeOut(400, function() {
$("#hero.live .liveInfo").css("padding-bottom", 0)
$("#hero.live").removeClass("popup").addClass("no-popup")
$(this).fadeIn()
})

}

Expand Down
3 changes: 3 additions & 0 deletions resources/assets/sass/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,9 @@ article.home {
h5, h6, p {
margin-bottom: 0;
}
a {
color: inherit;
}
.container-fluid {
margin-bottom: 1.2em;
}
Expand Down
8 changes: 4 additions & 4 deletions resources/views/api/currentEvent.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
{% if next is not null %}
<div class="col col-6">
<h4>{{ trans('general.home.live.curr') }}</h4>
<h5>{{ curr.event_title | raw }}</h5>
<h5>{{ curr.event_title_link | raw }}</h5>
<h6>{{ curr.event_prev | markdown }}</h6>
</div>
{% else %}
<div class="col col-12">
<h4>{{ trans('general.home.live.curr') }}</h4>
<h5>{{ curr.event_title | raw }}</h5>
<h5>{{ curr.event_title_link | raw }}</h5>
{{ curr.event_prev | markdown }}
</div>
{% endif %}
Expand All @@ -21,13 +21,13 @@
{% if curr is not null %}
<div class="col col-6">
<h4>{{ trans('general.home.live.next') }}</h4>
<h5>{{ next.event_title | raw }}</h5>
<h5>{{ next.event_title_link | raw }}</h5>
<h6>{{ next.event_prev | markdown }}</h6>
</div>
{% else %}
<div class="col col-12">
<h4>{{ trans('general.home.live.next') }}</h4>
<h5>{{ next.event_title | raw }}</h5>
<h5>{{ next.event_title_link | raw }}</h5>
<h6>{{ next.event_prev | markdown }}</h6>
</div>
{% endif %}
Expand Down

0 comments on commit 15a21d2

Please sign in to comment.