Skip to content

Instantly share code, notes, and snippets.

@maxx52
maxx52 / gulpfile.js
Created June 12, 2019 15:22
gulpfile for OpenCart projects
var syntax = 'sass', // Syntax: sass or scss;
gulpVersion = '4'; // Gulp version: 3 or 4
gmWatch = false; // ON/OFF GraphicsMagick watching "img/_src" folder (true/false). Linux install gm: sudo apt update; sudo apt install graphicsmagick
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
browserSync = require('browser-sync'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
@maxx52
maxx52 / myplugin.php
Created June 27, 2018 06:45
WP Plugin with admin panel template
<?php
/*
Plugin Name: MyPlugin
Plugin URI: http://maxx52.ru
Description: First Plugin
Version: 1.0
Autor: Maxx52
Autor URI: http://maxx52.ru
*/
@maxx52
maxx52 / common.js
Created May 11, 2018 09:58
hover effect for several items
$('.item-sites-img').hover(function() {
ths = $(this);
lnk = ths.closest('.item-sites-img').find('.item-sites-title p');
lnk.css('display', 'block');
}, function() {
lnk.css('display', 'none');
});
@maxx52
maxx52 / common.js
Last active May 11, 2018 09:57
custom toggle menu
$('.top-line').after('<div class="mobile-menu d-lg-none">');
$('.main-menu').clone().appendTo('.mobile-menu');
$('.mobile-menu-button').click(() => {
$('.mobile-menu').stop().slideToggle();
});
@maxx52
maxx52 / common.js
Created May 11, 2018 09:56
smooth scroll navigate
$("body").on('click', '[href*="#"]', function(e){
var fixed_offset = 1;
$('html,body').stop().animate({ scrollTop: $(this.hash).offset().top - fixed_offset }, 1000);
e.preventDefault();
});
@maxx52
maxx52 / common.js
Last active May 11, 2018 09:54
scroll to top button
$(window).scroll(function() {
if ($(this).scrollTop() > 100) {
if ($('#upbutton').is(':hidden')) {
$('#upbutton').css({opacity : 1}).fadeIn('slow');
}
} else { $('#upbutton').stop(true, false).fadeOut('fast'); }
});
$('#upbutton').click(function() {
$('html, body').stop().animate({scrollTop : 0}, 1000);
});
@maxx52
maxx52 / likely.sass
Created April 26, 2018 14:22
Likely style for article in one string
$likely-sz: 15px //Likely Font Size
.likely, .likely__widget
padding: 0
text-indent: 0 !important
list-style: none !important
font-weight: 400
font-family: Helvetica Neue,Arial,sans-serif
.likely
display: inline-block
@maxx52
maxx52 / main.sass
Created April 26, 2018 14:08
YouTube video for site responsive SASS
.video
position: relative
padding-bottom: 56.25%
padding-top: 25px
height: 0
iframe
border: none
position: absolute
top: 0
left: 0
@maxx52
maxx52 / ajax.js
Created March 30, 2017 17:13
ajax-request
$(document).ready(function() {
$('#plus_tr').click(function() {
var long = $('#long').val();
var diameter = $('.diameter').val();
var lot = $('.lot').val();
$.ajax({
type: "POST",
url: "sql.php",
data: {l:long,d:diameter},
success: function(data) {
@maxx52
maxx52 / button.sass
Created March 28, 2017 16:05 — 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