Last active
June 28, 2016 15:46
-
-
Save davidpett/a18d87648c689880a943a9e91396bd00 to your computer and use it in GitHub Desktop.
bg video
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const { | |
computed, | |
get | |
} = Ember; | |
export default Ember.Component.extend({ | |
className: 'my-component', | |
background: null, | |
backgroundStyle: computed('background', function() { | |
let arr = []; | |
let background = get(this, 'background'); | |
if (background) { | |
arr.push(`background-image: url(https://dl.dropboxusercontent.com/u/1640776/test/${background}.png)`); | |
} | |
return arr.join('; ').htmlSafe(); | |
}), | |
isMobileDevice: computed(function() { | |
return /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent); | |
}) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.my-component { | |
display: block; | |
height: 100vh; | |
width: 100%; | |
} | |
.bg { | |
background-position: center center; | |
background-repeat: no-repeat; | |
background-size: cover; | |
bottom: 0; | |
display: block; | |
left: 0; | |
overflow: hidden; | |
position: absolute; | |
right: 0; | |
top: 0; | |
} | |
.bg-video { | |
height: auto; | |
left: 50%; | |
min-width: 100%; | |
min-height: 100%; | |
position: absolute; | |
top: 50%; | |
transform: translate(-50%, -50%); | |
width: auto; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.10.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.6.0", | |
"ember-data": "2.6.1", | |
"ember-template-compiler": "2.6.0" | |
}, | |
"addons": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment