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
const body = document.body; | |
const nav = document.querySelector(".page-header nav"); | |
const menu = document.querySelector(".page-header .menu"); | |
const scrollUp = "scroll-up"; | |
const scrollDown = "scroll-down"; | |
let lastScroll = 0; | |
window.addEventListener("scroll", () => { | |
const currentScroll = window.pageYOffset; | |
if (currentScroll <= 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
<div className="parent"> | |
<h3 onClick={toggleView}>Утро</h3> | |
<div className="hidden-child"> | |
<p>Здравствуйте!</p> | |
</div> | |
</div> |
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
<head> | |
<!-- og --> | |
<meta property="og:title" content="<?$APPLICATION->ShowTitle()?>"> | |
<meta property="og:description" content='<?=$APPLICATION->ShowProperty("description");?>'/> | |
<meta property="og:type" content="website" /> | |
<meta property="og:image" content='<?=$APPLICATION->ShowProperty("ogimage","https://".$_SERVER['HTTP_HOST'].SITE_TEMPLATE_PATH."/img/og-new.jpg");?>' /> | |
<!-- og --> | |
</head> |
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
<?php | |
$file_big = "file-big.txt"; | |
$file_small = "file-small.txt"; | |
$file_clear = "file-clear.txt"; | |
function getLines($file) { | |
$f = fopen($file, 'r'); | |
try { | |
while ($line = fgets($f)) { |
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
<?php | |
$file_big = "file-big.txt"; | |
$file_small = "file-small.txt"; | |
$file_clear = "file-clear.txt"; | |
function getLines($file) { | |
$f = fopen($file, 'r'); | |
try { | |
while ($line = fgets($f)) { |
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
<div class="faq__list"> | |
<div class="faq__item open"> | |
<div class="faq__item-title"> | |
<div class="faq__item-quest"> | |
<p>Question</p> | |
</div> | |
</div> | |
<div class="faq__item-answer user-content"> | |
<p>Answer</p> | |
</div> |
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
$("[data-fancybox]").fancybox({ | |
lang : 'ru', | |
i18n : { | |
'ru' : { | |
CLOSE : 'Закрыть', | |
NEXT : 'Дальше', | |
PREV : 'Назад', | |
ERROR : 'Не удается загрузить. <br/> Попробуйте позднее.', | |
PLAY_START : 'Начать слайдшоу', | |
PLAY_STOP : 'Остановить слайдшоу', |
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
/************************************************** | |
Show Visible Elements | |
***************************************************/ | |
/** | |
* Проверяет элемент на попадание в видимую часть экрана. | |
* Для попадания достаточно, чтобы верхняя или нижняя границы элемента были видны. | |
*/ | |
function isVisible(elem) { | |
var coords = elem.getBoundingClientRect(); | |
var windowHeight = document.documentElement.clientHeight; |
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
if ($('.soc-sharing__copy').length) { | |
var copyLinkBtn = document.querySelector('.soc-sharing__copy'); | |
// Textarea for select text link, hidden | |
$('.soc-sharing__copy textarea').text(window.location); | |
copyLinkBtn.addEventListener('click', function(event) { | |
// Выборка ссылки | |
var newsLink = document.querySelector('.soc-sharing__copy textarea'); | |
newsLink.select(); | |
try { |
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
В .htaccess | |
RewriteEngine on | |
RewriteBase / | |
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP | |
RewriteRule ^([^.]+)\.html$ http://site.ru/$1 [R=301,L] | |
RewriteCond %{REQUEST_URI} !(\.[^./]+)$ | |
RewriteCond %{REQUEST_fileNAME} !-d | |
RewriteCond %{REQUEST_fileNAME} !-f | |
RewriteRule (.*) /$1.html [L] |
NewerOlder