This file contains 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
$errors->put('test-error-cat', new Illuminate\Support\MessageBag (["test-error" => [0 => 'error message'],':message'])); | |
$errors->put('test-error-cat', | |
new Illuminate\Support\MessageBag ( | |
[ | |
"test-error" => [0 => 'error message'], | |
':message' | |
] | |
) | |
); |
This file contains 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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule ^(.*)$ public/$1 [L] | |
</IfModule> |
This file contains 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
//via https://stackoverflow.com/questions/8264528/image-preloader-javascript-that-supports-events/8265310#8265310 | |
function preloadImages(srcs, imgs, callback) { | |
var img; | |
var remaining = srcs.length; | |
for (var i = 0; i < srcs.length; i++) { | |
img = new Image(); | |
img.onload = function() { | |
--remaining; | |
if (remaining <= 0) { |
This file contains 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
Плавающая шапка появляется при скролле сайта вверх после n скролов | |
// =========== FLOATING HEADER | |
var pageYPos = window.pageYOffset; | |
var scrollUpTime = 0; | |
$(document).on('scroll',function(e){ | |
let scrollDirection = ( (window.pageYOffset - pageYPos) > 0 ) ? 'down' : 'up'; | |
pageYPos = window.pageYOffset; | |
scrollUpTime++; | |
if ( scrollDirection === 'up' && window.pageYOffset < 700 ) { | |
$('#floating-header').fadeOut(300, function(){ |
This file contains 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 { | |
color: #fff; | |
font-size: 10px; | |
line-height: 1.2; | |
background-color: #aeaeae; | |
} | |
html,body { | |
overflow-x:hidden; | |
color:#fff; | |
line-height: 1.2; |
This file contains 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
// Restricts input for the given textbox to the given inputFilter. | |
function setInputFilter(textbox, inputFilter) { | |
["input", "keydown", "keyup", "mousedown", "mouseup", "select", "contextmenu", "drop"].forEach(function(event) { | |
textbox.addEventListener(event, function() { | |
if (inputFilter(this.value)) { | |
this.oldValue = this.value; | |
this.oldSelectionStart = this.selectionStart; | |
this.oldSelectionEnd = this.selectionEnd; | |
} else if (this.hasOwnProperty("oldValue")) { | |
this.value = this.oldValue; |
This file contains 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
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " "); |
This file contains 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
Strict: | |
if($(window).scrollTop() + $(window).height() == $(document).height()) | |
Near: | |
if($(window).scrollTop() + $(window).height() > $(document).height() - 100) |
This file contains 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 class="dynamic-padding"> | |
<div data-order="1"class="hide hidden-content"> </div> | |
<div data-order="2"class="hide hidden-content"> </div> | |
<div data-order="3"class="hide hidden-content"> </div> | |
<div data-order="4"class="hide hidden-content"> </div> | |
<div data-order="5" data-last="true" class="hide hidden-content"> </div> | |
<footer class="dynamic-hidden"> </footer> | |
</body> | |
<script> |
This file contains 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
// img cover | |
var imageCoverFunc = function() { | |
//set size | |
var th = $(this).height(),//box height | |
tw = $(this).width(),//box width | |
im = $(this).children('img'),//image | |
ih = im.height(),//inital image height | |
iw = im.width();//initial image width | |
if ((th/tw) > (ih/iw)){ |
NewerOlder