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
const scroll = fromEvent(window, 'scroll'); | |
scroll.subscribe(showSection); | |
function showSection() { | |
const sectionObs = section => { | |
const interSection = new IntersectionObserver(entrie => { | |
entrie[0].intersectionRatio > 0.15 ? | |
!section.classList.contains('active') && section.classList.add('active') | |
: section.classList.remove('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
@mixin grid() { | |
display: flex; | |
flex-wrap: wrap; | |
@supports (grid-area: auto) { | |
display: grid; | |
grid-gap: 16px 16px; | |
} | |
} |
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
const body = document.body; | |
const content = document.querySelector('.js-content'); | |
const blocks = document.querySelectorAll('.block-scroll'); | |
const updateOffset = () => { | |
requestAnimationFrame(updateOffset); | |
body.style.setProperty('--y', content.scrollTop); | |
updateProps(); | |
}; |
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
<template> | |
<div ref="map" class="map"> | |
<button @click="toggleFilters" class="map__button-filters" :class="isClassIsFiltersOpen"> | |
<img v-if="isShowFilters" class="map__icon-filters" src="/images/order/img/filter_active.svg"> | |
<img v-else class="map__icon-filters" src="/images/order/img/filter.svg"> | |
{{isShowFilters ? 'Скрыть фильтры' : 'Показать фильтры'}} | |
</button> | |
<div id="yandexmap" class="map__yandexmap"></div> | |
</div> | |
</template> |
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 Validator from './modules/module.validate' | |
let validator = new Validator({ | |
fields: { | |
current: { | |
empty: { | |
message: 'Поле обязательно к заполнению' | |
} | |
}, | |
checkbox: { | |
unchecked: { |
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
const tree = { | |
name: '/', | |
children: | |
[ | |
{ | |
name: 'eTc', children: [ | |
{ | |
name: 'config.json', | |
meta: {}, |
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
const tree = { | |
name: '/', | |
children: | |
[ | |
{ | |
name: 'eTc', children: [ | |
{ | |
name: 'config.json', | |
meta: {}, | |
type: 'file' |
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 objA = { | |
prop1: 'value1', | |
prop2: 'value2', | |
prop3: 'value3', | |
// prop7: ['value3', 'sd'], | |
prop4: { | |
subProp1: 'sub value1', | |
subProp2: { | |
subSubProp1: 'sub sub value1', | |
subSubProp2: [1, 2, {prop2: 1, prop: 2}, 4, 5] |
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
a { | |
color: blue; | |
text-decoration: none; | |
background-image: linear-gradient(currentColor, currentColor); | |
background-position: 0% 100%; | |
background-repeat: no-repeat; | |
background-size: 0% 2px; | |
transition: background-size .3s; | |
} |
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
const re1 = new RegExp('hey'); // объекта RegExp | |
const re2 = /hey/; //литерал регулярных выражений | |
/*RegExp.test(String) -> boolean*/ | |
/^hey/.test('hey'); // ^ - найти строки которые начинаются с hey | |
/hey$/.test('hey'); // $ - найти строки которые заканчиваются с hey | |
/^hey$/.test('hey'); // ^ что то тут $ - строка которая полностью совпадает |
NewerOlder