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
/* | |
Благодаря этому, частоиспользуемые компоненты не нужно будет регистрировать каждый раз. | |
Они будут зарегестрированы глобально. | |
*/ | |
/* | |
1. Создаём файл _globals.js в папке components с содержимым: | |
*/ | |
import Vue from 'vue' |
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
<script> | |
export default { | |
name: 'Icon', | |
props: { | |
name: { | |
type: String, | |
required: true, | |
}, |
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 rem($px) { | |
@return ($px / 16) + rem; | |
} |
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 get(object, string) { | |
string = string.split('.') | |
string.forEach(el => object = object[el]) | |
return object | |
} | |
// Example | |
let hello = { | |
one: 'name', | |
two: { |
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
// функция возвращает либо true, либо false | |
function checkWebpFeature(callback) { | |
let img = new Image(); | |
img.onload = () => { | |
var result = (img.width > 0) && (img.height > 0); | |
callback(result); // если загрузилось :) | |
}; | |
img.onerror = () => { | |
callback(false); // если не загрузилось :( | |
}; |
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 getUrlVars() { | |
var vars = {}; | |
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { | |
vars[key] = value; | |
}); | |
return vars; | |
} | |
// https://example.com/?page=3&modal=wrap123 | |
// |
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 | |
$ip = $_SERVER['REMOTE_ADDR']; | |
include("SxGeo.php"); //одноимённый сайт, там скачиваем файл (первый в списке загрузок) | |
$SxGeo = new SxGeo('SxGeoCity.dat'); //этот файл с таким же заголовком, для определения города | |
$city = $SxGeo->getCity($ip); // возвращает с краткой информацией, без названия региона и временной зоны | |
$countryid = $SxGeo->getCountryId($ip); //возвращает номер страны | |
$country = $SxGeo->getCountry($ip); // возвращает двухзначный ISO-код страны | |
$region = $SxGeo->getCityFull($ip); // возвращает Область |
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
setInterval(() => {document.querySelector('.clicker-book__catcher').click();}, 100); | |
// https://www.mann-ivanov-ferber.ru/clicker/ |
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
$('a[href^="#"]').on('click', function(event) { | |
event.preventDefault(); | |
let sc = $(this).attr("href"), | |
dn = $(sc).offset().top; | |
$('html, body').animate({scrollTop: dn}, 1000); | |
}); |
NewerOlder