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
| //css section | |
| .loader { | |
| background: none repeat scroll 0 0 #ffffff; | |
| bottom: 0; | |
| height: 100%; | |
| left: 0; | |
| position: fixed; | |
| right: 0; | |
| top: 0; | |
| width: 100%; |
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
| function heightDetect() { | |
| $('.main-head').css('height', $(window).height()); | |
| }; | |
| heightDetect(); | |
| $(window).resize(heightDetect); |
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
| var gulp = require('gulp'); | |
| var browserSync = require('browser-sync'); | |
| var reload = browserSync.reload; | |
| gulp.task('liveSync', function() { | |
| browserSync({ | |
| server: { | |
| baseDir: './' | |
| }, | |
| open: true, |
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
| Select filters button and call webToolsFilter('sortableElementClass') and pass sortable elements class. | |
| Example: | |
| HTML markup | |
| #filters button | |
| <ul class="works__filters"> | |
| <li class="active-filter" data-category="all">All</li> | |
| <li data-category="illustration">Illustration</li> | |
| <li data-category="graphics">Graphics</li> | |
| <li data-category="video">Video</li> | |
| <li data-category="web">Web</li> |
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
| /*Only use: | |
| arguments.length | |
| arguments[i] where i is always a valid integer index into the arguments, and can not be out of bound | |
| Never use arguments directly without .length or [i] | |
| STRICTLY fn.apply(y, arguments) is ok, nothing else is, e.g. .slice. Function#apply is special. | |
| Workaround for proxying is to create array in-line:*/ | |
| function doesntLeakArguments() { | |
| //.length is just an integer, this doesn't leak |
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
| function flatten(arr) { | |
| if (Array.isArray(arr)) { | |
| return arr.reduce(function(done,curr){ | |
| return done.concat(flatten(curr)); | |
| }, []); | |
| } else { | |
| return arr; | |
| } | |
| } |
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
| 1) Get all keys in object and works with them | |
| const keys = Objects.keys(myObject); | |
| keys.forEach(function(key) { | |
| console.log(`${key}: ${myObject[key}`) | |
| }); | |
| 2) Convert value to another notation | |
| const a = 'ff'; //value in hexidecimal | |
| const b = parseInt(a, 10); //convert it into decimal | |
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
| ---HTML--- | |
| <div class="screen"></div> | |
| ---CSS--- | |
| .screen { | |
| position: absolute; | |
| width: 100%; | |
| height: 100%; | |
| top: 0; | |
| left: 0; |
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
| ---HTML--- | |
| <div class="hexagon"> | |
| <div class="hexTop"></div> | |
| <div class="hexBottom"></div> | |
| </div> | |
| ---CSS--- | |
| .hexagon { |
OlderNewer