Last active
November 15, 2016 22:31
-
-
Save briangonzalez/b475731d03891f71ab4fdaf0bb0194e2 to your computer and use it in GitHub Desktop.
Revisions
-
briangonzalez revised this gist
Nov 15, 2016 . 3 changed files with 6 additions and 10 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,7 @@ body { margin: 12px 16px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12pt; background-color: #483b55; } .blur-loaded-image { @@ -10,6 +11,10 @@ body { background-size: cover; background-position: center; transition: all 500ms ease; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); } .blur { 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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1 @@ {{ blur-loaded-image rawSrc="https://dollarshaveclub.imgix.net/product-images/detail/BRS-2AL-CURRENT-5792000c12196c0cb90ad677680ca0e9.png" }} 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 charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1 @@ <div class='blur-loaded-image' style="background-image: url('{{ src }}')"></div> -
briangonzalez revised this gist
Nov 15, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ <br> {{outlet}} {{ blur-loaded-image rawSrc="https://dollarshaveclub.imgix.net/product-images/detail/BRS-2AL-CURRENT-5792000c12196c0cb90ad677680ca0e9.png" }} <br> <br> -
briangonzalez created this gist
Nov 15, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ import Ember from 'ember'; export default Ember.Component.extend({ classNameBindings: [ 'loaded:no-blur:blur' ], loaded: false, src: Ember.computed(function () { return `${this.get('rawSrc')}?w=10`; }), fetchLargeImage: Ember.on('didInsertElement', function () { const largeImage = new Image(); const rawSrc = this.get('rawSrc'); largeImage.onload = () => { this.set('loaded', true); this.set('src', rawSrc); }; largeImage.src = rawSrc; }) }); 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ body { margin: 12px 16px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12pt; } .blur-loaded-image { width: 500px; height: 500px; background-size: cover; background-position: center; transition: all 500ms ease; } .blur { filter: blur(30px); } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ <h1>Welcome to {{appName}}</h1> <br> <br> {{outlet}} {{ blur-loaded-image rawSrc="https://assets.imgix.net/examples/kingfisher.jpg" }} <br> <br> 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ Test <div class='blur-loaded-image' style="background-image: url('{{ src }}')"></div> 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ { "version": "0.10.6", "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.9.0", "ember-data": "2.9.0", "ember-template-compiler": "2.9.0", "ember-testing": "2.9.0" }, "addons": {} }