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
var nav_offset = $('nav').offset().top, | |
nav_height = $('nav').outerHeight(true); | |
$('nav').after($('<div>').addClass('padding').css('height', nav_height)); | |
$(window).scroll(function(){ | |
if ($(this).scrollTop() > nav_offset){ | |
$('nav').addClass('fixed') | |
} else { | |
$('nav').removeClass('fixed') | |
} | |
}); |
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
<?php | |
$this->response->script[] = 'https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/3.0.1/isotope.pkgd.min.js'; | |
?> | |
<div id="filters" class="button-group"> | |
<button class="button is-checked" data-filter="*">Все</button> | |
<?php foreach ($result['tags'] as $tag){ ?> | |
<button class="button" data-filter=".<?=convertToAscii($tag);?>"><?=$tag;?></button> | |
<?php } ?> | |
</div> |
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
$(document).ready(function(){ | |
$('.stars').each(function(){ | |
var input = $(this), stars = $('<div class="stars-visible"><span></span><span></span><span></span><span></span><span></span></div>') | |
stars.find('span').click(function(){ | |
$(this).addClass('active').siblings().removeClass('active') | |
input.val(5-$(this).index()) | |
}) | |
input.hide().before(stars) | |
}) | |
}) |
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
<?php | |
$app->on('after.module', 'pages/view/*', function() use($app){ | |
$parts = explode('/', $app->response->data['fullpath']); | |
$themes = str_replace(DIR_TEMPLATE, '', glob(DIR_TEMPLATE . '*', GLOB_ONLYDIR)); | |
if (in_array($parts[0], $themes)) { | |
$conf = $app->config_site; | |
$conf['template'] = $parts[0]; | |
$app->config_site = $conf; | |
} |
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
<?php | |
$app->on('before.module', '*', function() use($app){ | |
$app->response->context['sites'] = array( | |
'title' => 'Сайты', | |
'link' => '', | |
'children' => array(), | |
); | |
$allsites = $app->cache->get('allsites'); | |
if (!$allsites){ |
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
Object.defineProperty(Array.prototype, 'chunk', {value: function(n) { | |
return Array.from(Array(Math.ceil(this.length/n)), (_,i)=>this.slice(i*n,i*n+n)); | |
}}); | |
$(window).load(function(){ | |
$.each($('.hit-info a').toArray().chunk(4), function(index, els) { | |
var maxheight = 0; | |
$(els).each(function(){ | |
var height = $(this).outerHeight() | |
if(height > maxheight) { | |
maxheight = height; |
NewerOlder