Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Commit

Permalink
Merge pull request #74 from logik-works/header_video_stills
Browse files Browse the repository at this point in the history
Header video stills
  • Loading branch information
Leonid Medovyy authored Dec 5, 2018
2 parents 44bfc47 + 0736b0c commit 18ff9b2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion app/views/pages/about.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
- content_for :hero
= fragment 'hero'
video.video src[email protected]_video.url id='header_video' autoplay=false muted=true loop=true playsinline=true width='x' height='y' .overlay style="background-color: #{@page.overlay_color}"
video.video src[email protected]_video.url id='header_video' autoplay=true muted=true loop=true playsinline=true width='x' height='y'
.overlay style="background-color: #{@page.overlay_color}"
.content-holder
= container 'text'
= h1 class: 'center aligned inverted', text: @page.master_heading
Expand Down
2 changes: 1 addition & 1 deletion app/views/pages/home.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- content_for :hero
= fragment 'hero'
video.video src[email protected]_video.url id='header_video' autoplay=false muted=true loop=true playsinline=true width='x' height='y'
video.video src[email protected]_video.url id='header_video' autoplay=true muted=true loop=true playsinline=true width='x' height='y'
.overlay style="background-color: #{@homepage.overlay_color}"
.content-holder
= container 'text'
Expand Down
1 change: 1 addition & 0 deletions frontend/css/global.sass
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

// Video
.video
object-fit: cover
position: absolute
top: 0
left: 0
Expand Down
9 changes: 4 additions & 5 deletions frontend/js/header_video.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import MobileDetect from 'mobile-detect'
class HeaderVideo
setup : () ->
md = new MobileDetect(window.navigator.userAgent)
unless md.mobile()
video = document.querySelector('video#header_video')
video.play() if video


if md.mobile()
masthead = $('.masthead')
masthead.css('min-height', masthead.outerHeight())

export {HeaderVideo as default}
2 changes: 0 additions & 2 deletions frontend/packs/js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Turbolinks.start()
header_video = new HeaderVideo

ready = ->
console.log $('.demo.modal form input[name="email"]').val()

analytics.page()
header_video.setup()

Expand Down

0 comments on commit 18ff9b2

Please sign in to comment.