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 curry(callback, ...oldParameters) { | |
| return function(...parameters) { | |
| const nextParameters = [...oldParameters, ...parameters] | |
| if (nextParameters.length >= callback.length) { | |
| return callback(...nextParameters) | |
| } | |
| return curry(callback, ...nextParameters) | |
| } |
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 initAdaptiveOwlCarousel(block, options, breakPoint, modClass) { | |
| windowWidth = window.innerWidth; | |
| modClass = typeof modClass !== 'undefined' ? modClass += " owl-carousel" : "owl-carousel"; | |
| if ( windowWidth < breakPoint ) { | |
| block.each(function(el) { | |
| $(this).addClass(modClass).owlCarousel(options); | |
| }) | |
| } else { | |
| block.each(function(el) { |
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
| if ($("#js-map-loader").length) { | |
| map = $("#js-map-loader") // айдишник блока в котором будет карта | |
| $(window).scroll(function () { | |
| if ($(window).scrollTop() > (map.offset().top - $(window).height())) { | |
| if ($("#js-map-loader iframe").length === 0) { | |
| // аппендим код карты | |
| $("#js-map-loader").append("<iframe frameborder='0' height='1080' src='https://yandex.ru/map-widget/v1/?um=constructor%3A12e7ecd65e53d92c0026ea8421b362b4a4ba635f1cbdf5899bc3273afb1bc21b&source=constructor' width='100%'></iframe>") | |
| } | |
| } else { | |
| return 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
| .youtube { | |
| background-position: center; | |
| background-repeat: no-repeat; | |
| position: relative; | |
| display: block; | |
| overflow: hidden; | |
| transition: all 200ms ease-out; | |
| cursor: pointer; | |
| } |
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
| .constant-width-to-height-ratio { | |
| background: #333; | |
| width: 50%; | |
| } | |
| .constant-width-to-height-ratio::before { | |
| content: ''; | |
| padding-top: 100%; | |
| float: left; | |
| } | |
| .constant-width-to-height-ratio::after { |
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
| .pretty-text-underline { | |
| display: inline; | |
| text-shadow: 1px 1px #f5f6f9, -1px 1px #f5f6f9, -1px -1px #f5f6f9, 1px -1px #f5f6f9; | |
| background-image: linear-gradient(90deg, currentColor 100%, transparent 100%); | |
| background-position: bottom; | |
| background-repeat: no-repeat; | |
| background-size: 100% 1px; | |
| } | |
| .pretty-text-underline::-moz-selection { | |
| background-color: rgba(0, 150, 255, 0.3); |
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
| ReactDOM.render( | |
| <AutoLink text='foo bar baz http://example.org bar' />, | |
| document.getElementById('root') | |
| ); |
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
| { | |
| // ЗДЕСЬ КАКИЕ ЛИБО ВАШИ НАСТРОЙКИ | |
| //postcss sorting | |
| "postcssSorting.config": { | |
| "order": [ | |
| "custom-properties", | |
| "dollar-variables", | |
| "declarations", | |
| "at-rules", | |
| "rules" |
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
| const getResource = async (url) => { | |
| // await мы будем ждать пока результат не будет доступен. | |
| const res = await fetch(url); | |
| // если произошла ошибка сервера и один из статусов реально не доступен. | |
| if (!res.ok) { | |
| throw new Error(`Could not fetch ${url}` + | |
| `, received ${res.status}`); | |
| } | |
| const body = await res.json(); | |
| return body; |
NewerOlder