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
#parallax | |
.layer(data-depth="0.6") | |
.some-space | |
h1 PARALLAX | |
.layer(data-depth="0.4") | |
#particles-js | |
.layer(data-depth="0.3") |
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
<!-- particles.js container --> <div id="particles-js"></div> <!-- stats - count particles --> <div class="count-particles"> <span class="js-count-particles">--</span> particles </div> <!-- particles.js lib - https://github.com/VincentGarreau/particles.js --> <script src="http://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script> <!-- stats.js lib --> <script src="http://threejs.org/examples/js/libs/stats.min.js"></script> |
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
<canvas id="scene"></canvas> |
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
$('.order').click(function(){ | |
var ide = $(this).parent().find('input:hidden').val(); | |
$.ajax({ | |
type: "POST", | |
data: 'action=ADD2BASKET&ajax_basket=Y&id='+ide, | |
url: '/', | |
success: function(data){ | |
data = data.split('\'').join('\u0022'); | |
var obj = JSON && JSON.parse(data) || $.parseJSON(data); | |
if (obj.STATUS == 'OK'){ |
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
<? | |
define("LOG_FILENAME", $_SERVER["DOCUMENT_ROOT"]."/log.txt"); | |
//define('siteType', 'dev'); | |
//Определяем мобильные устройства библиотекой http://mobiledetect.net/ | |
require_once 'include/Mobile_Detect.php'; | |
$detect = new Mobile_Detect; | |
//Все мобилные устройства кроме планшетов | |
if( $detect->isMobile() && !$detect->isTablet() ){ |
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() { | |
var script, | |
scripts = document.getElementsByTagName('script')[0]; | |
function load(url) { | |
script = document.createElement('script'); | |
script.async = true; | |
script.src = url; | |
scripts.parentNode.insertBefore(script, scripts); |
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
Итак, за основу я взял метод ResizeImageGet. Почему? Потому что именно он делает копию картинки, а не воздействует на оригинал. И именно он внутри себя обращается к методу CFile::ResizeImageFile, который уже может наложить водяной знак. | |
Для начала создаем класс с одним статическим методом: | |
class CFileWater extends CAllFile | |
{ | |
public static $watermark = array( | |
'position' => 'mc',//допустимые http://prntscr.com/c3hc9i | |
'type' => 'file', | |
'size' => 'real', | |
'alpha_level' => 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
Для этого в header.php шаблона сайта добавляем следующий скрипт, предварительно подключив jQuery: | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
$(document).ready( | |
function(){ | |
function getBasketHTML(html) | |
{ | |
txt = html.split('<!--start--><div id="bid">'); | |
txt = txt[2]; | |
txt = txt.split('</div><!--end-->'); |
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
Усовершенствованные методы буферизации в шаблоне позволяют более не использовать CBitrixComponentTemplate::EndViewTarget() ввиду того, что конец шаблона вызывает завершение буферизации автоматически. | |
Описанные ниже способы по своей сути похожи на Включаемые области. Только Включаемая область это файл подключаемый в шаблоне сайта, а указанные методы - это область, которая формируется в коде шаблона. | |
Можно использовать как в шаблоне сайта, так и в шаблоне компонента. | |
Теперь есть поддержка стандартного кеширования в компонентах. | |
template.php: | |
<?$this->SetViewTarget("sidebar");?> |
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
Создать свой шаблон компонента постраничной навигации bitrix:system.pagenavigation | |
<?if($arResult["NavPageCount"] > 1):?> | |
<?if ($arResult["NavPageNomer"]+1 <= $arResult["nEndPage"]):?> | |
<? | |
$plus = $arResult["NavPageNomer"]+1; | |
$url = $arResult["sUrlPathParams"] . "PAGEN_1=" . $plus | |
?> | |
<div class="load_more" data-url="<?=$url?>"> | |
Показать еще | |
</div> |