Skip to content

Instantly share code, notes, and snippets.

View hopea114y's full-sized avatar

Siarhei Hatsuk hopea114y

View GitHub Profile
@hopea114y
hopea114y / Meta Tags templates
Last active April 26, 2018 11:34
Meta Tags templates for SEO
// Default (based on bitrix) create 26.04.2018 by hopea114y - https://vk.com/hopea114y
// Title
<title><?php
if ($_SERVER['REQUEST_URI'] == '/URL/URL/') {
echo 'TITLE';
}
elseif ($_SERVER['REQUEST_URI'] == '/URL/URL/') {
echo 'TITLE';
@hopea114y
hopea114y / Google Maps API with custom marker
Last active March 31, 2018 11:25
Google Maps API - custom marker (any img)
// initMap() - функция инициализации карты
function initMap() {
// Скрываем стандартные метки
directionsDisplay = new google.maps.DirectionsRenderer({suppressMarkers: true});
// Координаты центра на карте
var centerLatLng = new google.maps.LatLng(52.214321, 24.027835);
// Координаты метки на карте
var point = new google.maps.LatLng(52.214321, 24.027835);
// Обязательные опции с которыми будет проинициализированна карта
var mapOptions = {
@hopea114y
hopea114y / Google Maps API
Last active March 28, 2018 18:21
Connecting Google Maps API on the any sites
// initMap() - функция инициализации карты
function initMap() {
// Координаты центра на карте
var centerLatLng = new google.maps.LatLng(52.086576, 23.704269);
// Координаты метки на карте
var point = new google.maps.LatLng(52.086525, 23.703963);
// Обязательные опции с которыми будет проинициализированна карта
var mapOptions = {
center: centerLatLng, // Координаты центра мы берем из переменной centerLatLng
zoom: 17 // Зум по умолчанию. Возможные значения от 0 до 21
@hopea114y
hopea114y / Сheck for a number (JavaScript)
Last active October 20, 2017 09:05
Function for check a number (ignor string, space, boolean, logical values and infinity).
function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n)
}
@hopea114y
hopea114y / 'On BOTTOM' button JQ code.
Last active October 20, 2017 09:06
Code button leading down.
$('.on-bottom').click(function(event) {
event.preventDefault();
var n = $(document).height();
$('html, body').animate({ scrollTop: 1000 }, 600);
})
@hopea114y
hopea114y / 'On TOP' button JQ code.
Last active October 20, 2017 09:05
Code button leading up.
$(window).scroll(function () {
if ($(this).scrollTop() > $(this).height()) {
$('.top').addClass('active');
}
else {
$('.top').removeClass('active');
}
});
$('.top').click(function () {
@hopea114y
hopea114y / button.sass
Created March 27, 2017 16:31 — forked from agragregra/button.sass
Button Sass Styles (Universal Starter)
.button
display: inline-block
border: none
color: #fff
text-decoration: none
background-color: $accent
padding: 15px 45px
font-size: 13px
text-transform: uppercase
font-weight: 600
@hopea114y
hopea114y / gulpfile.js
Created March 20, 2017 16:07
gulp browser-sync settings
gulp.task('browser-sync', function () {
browserSync({
server: {
baseDir: ''
},
notify: false
});
});
@hopea114y
hopea114y / Form
Created March 2, 2017 06:25
Test form
<form action="">
<input type="text" name="Name" placeholder="Name"><br>
<input type="password" name="Password" placeholder="Password"><br>
<input type="checkbox" name="Remember" value="1">Remember me <br>
Your sex<input type="radio" value="Man" name="sex"> Man <input type="radio" value="Women" name="sex"> Woman <br>
<input type="submit" name="Find" value="Find">
</form>