This file contains 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 doesElemExist(elemName) { | |
return $(elemName).length > 0 ? true : false; | |
} |
This file contains 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
var gulp = require("gulp"), | |
browserSync = require("browser-sync"), | |
plugins = require("gulp-load-plugins")(); | |
plugins.del = require("del"); | |
var path = { | |
dest: { | |
pug: 'dist', | |
sass: 'dist/css', | |
js: 'dist/js', |
This file contains 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
{ | |
"name": "gulpfile", | |
"version": "1.0.0", | |
"main": "index.js", | |
"author": "Maksim Gorodov <Silencer.Web@mail.ru>", | |
"license": "MIT", | |
"dependencies": { | |
"autoprefixer": "^7.1.1", | |
"browser-sync": "^2.18.12", | |
"css-mqpacker": "^6.0.1", |
This file contains 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
var _document = $(document); | |
_document.on("click", ".tabs__menu-link", function (e) { | |
e.preventDefault(); | |
var _this = $(this), | |
tabs = _this.closest(".tabs"), | |
allTabsMenuItems = tabs.find(".tabs__menu-item"), | |
allTabsContentItems = tabs.find(".tabs__content-item"); | |
allTabsMenuItems.removeClass("tabs__menu-item_active"); |
This file contains 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
var _document = $(document), | |
_window = $(window), | |
body = $("body"); | |
var modals = function () { | |
var overlay = $(".overlay"), | |
modalsWrapper = $(".modals-wrapper"), | |
modal = $(".modal"), | |
setTimeout; |
This file contains 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
[Here is a site][1], in it a canvas (airplane), which lags when scrolling, appear artifacts, and in different ways, depending on what you scroll - with the mouse wheel or scrollbar. If you comment out parallax or video at the beginning, nothing changes. During the scrolling of calls to the house does not happen. Lags either from behind the airplane script, or because of a clearRect. How can I optimize and get rid of artifacts? The code on the [codepen][2]. | |
P.S. Artifacts do not appear on the [codepen][2], they are only on the [site][1]! | |
JS-code: | |
var scrolled; | |
var positionsArr = []; | |
var commonHeight = 0; | |
var canvas = document.querySelector('#canvas'); |
This file contains 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
var img = new Image(); | |
var canvas = document.createElement('canvas'); | |
var ctx = canvas.getContext('2d'); | |
img.src = imageUrl; | |
img.onload = function () { | |
canvas.width = img.width; | |
canvas.height = 100; | |
ctx.drawImage(img, 0, 0); | |
img.style.display = 'none'; |
This file contains 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
import React from 'react'; | |
import Form from '../../components/Form'; | |
import BooksList from '../../components/BooksList'; | |
class App extends React.Component { | |
state = { | |
books: [ | |
{ | |
title: 'JavaScript and jQuery', |
This file contains 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
import React from 'react'; | |
import styled from 'styled-components'; | |
function Checkbox(props) { | |
return ( | |
<div className={ props.className } onClick={ () => props.toggle(props.name) }> | |
<input id={ props.name } type="checkbox" checked={ props.checked }/> | |
{ props.text } | |
<span onClick={ props.uncheckAll }>Только</span> | |
</div> |
OlderNewer