Skip to content

Instantly share code, notes, and snippets.

@Elvinz
Elvinz / component.php
Created April 26, 2021 14:02 — forked from Mons1eurEnzo/component.php
Подключаем Recaptcha 2 к Bitrix
//Шаг 2 - в компоненте добавляем проверку:
<?
$recaptcha = new \ReCaptcha\ReCaptcha(RE_SEC_KEY);
$resp = $recaptcha->verify($_REQUEST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
if (!$resp->isSuccess()){
foreach ($resp->getErrorCodes() as $code) {
echo "Ошибка! Проверка не пройдена.";
echo $code;
return;
@Elvinz
Elvinz / index.html
Created October 8, 2020 13:18
@keyframers 1.7.0 | Oceanic Overlays
<a href="https://youtu.be/kd_zuEYCDck" target="_blank" data-keyframers-credit style="color: #000"></a>
<script src="https://codepen.io/shshaw/pen/QmZYMG.js"></script>
<input type="radio" name="scene" id="scene-1" value="1" checked />
<input type="radio" name="scene" id="scene-2" value="2" />
<input type="radio" name="scene" id="scene-3" value="3" />
<input type="radio" name="scene" id="scene-4" value="4" />
<main id="site">
<header class="top-nav">
@Elvinz
Elvinz / index.html
Created October 7, 2020 04:24
@keyframers 1.7.0 | Oceanic Overlays
<a href="https://youtu.be/kd_zuEYCDck" target="_blank" data-keyframers-credit style="color: #000"></a>
<script src="https://codepen.io/shshaw/pen/QmZYMG.js"></script>
<input type="radio" name="scene" id="scene-1" value="1" checked />
<input type="radio" name="scene" id="scene-2" value="2" />
<input type="radio" name="scene" id="scene-3" value="3" />
<input type="radio" name="scene" id="scene-4" value="4" />
<main id="site">
<header class="top-nav">
@Elvinz
Elvinz / README.md
Created June 24, 2020 09:07 — forked from Itachi261092/README.md
[1C-Bitrix / 1С-Битрикс] AJAX Custom Preloader / Кастомный прелоадер стандартного аякса

Кастомный ajax preloader на 1С-Битрикс.

Сам прелоадер честно стырен отсюда, но его можно заменить любым понравившимся кодом.

Ставится легко и просто. В принципе, все файлы понятно названы и проблем не должно возникнуть.

В футер перед /body ставим вызов включаемой области. Скрипт я обычно копирую вниз включаемой области. Весь код в ней - это хтмл код прелоадера.

CSS можно скопировать в template_styles, а можно подключить отдельно в header.php шаблона сайта.

namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin
selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
animation: "fade", //String: Select your animation type, "fade" or "slide"
easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical"
reverse: false, //{NEW} Boolean: Reverse the animation direction
animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode
startAt: 0, //Integer: The slide that the slider should start on. Array nota
<?if (!empty($arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"])):?>
<?foreach($arResult["PROPERTIES"]["MORE_PHOTO"]["VALUE"] as $photo):?>
<img src="<?=CFile::GetPath($photo)?>" />
<?endforeach?>
<?endif?>
//Пояснения: MORE_PHOTO — это код нашего свойства информационного блока в Битрикс. GetPath это метод класса CFile, который просто возвращает путь к нашему изображению — зарегистрированному файлу. И выводить элементы лучше из массива $arResult[«DISPLAY_PROPERTIES»] — давайте уважать редакторов контента =)
//Если нам нужно сразу отмасштабировать изображение…
@Elvinz
Elvinz / init.php
Created June 1, 2020 11:38
Уведомления об изменениях элементов инфоблоков
// В файл /bitrix/php_interface/init.php надо добавить код (создайте файл, если его нет):
<?
AddEventHandler("iblock", "OnAfterIBlockElementAdd", "IBlockNotifyHandler");
AddEventHandler("iblock", "OnAfterIBlockElementUpdate", "IBlockNotifyHandler");
AddEventHandler("iblock", "OnBeforeIBlockElementDelete", "IBlockNotifyHandler");
function IBlockNotifyHandler(&$arFields)
{
if (is_array($arFields))
$f = $arFields;
<link href="https://fonts.googleapis.com/css2?family=Parisienne&display=swap" rel="stylesheet">
<button class="rainbow noselect">Rainbow</button>
@Elvinz
Elvinz / index.html
Created May 31, 2020 10:23
Vertical Progressbar on Scrolling
<!-- You need to insert the Div-Tag with the ID "progressbar" -->
<div id="progressbar"></div>
<!-- Below here are just some Content you mustn't use -->
<div class="content">
<h1>Vertical Progress-Bar</h1>
<p>
Example on how to add a vertical Progress-Bar that makes progress on Scrolling.<br/>
Try to Scroll on this site to let the magic happen...
</p>
@Elvinz
Elvinz / index.html
Created May 31, 2020 09:21
Particles background using Particles.js
<div id="particles-js"></div>
<div class="text">
<h1>Particles Background</h1>
<p>Using <a href="https://github.com/VincentGarreau/particles.js/">ParticlesJS</a> and well.. that's about it, actually ¯\_(ツ)_/¯</p>
</div>