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 fact($number) { | |
| $value: 1; | |
| @if $number > 0 { | |
| @for $i from 1 through $number { | |
| $value: $value * $i; | |
| } | |
| } | |
| @return $value; | |
| } |
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
| @mixin loading($name, $big_radius:50,$little_radius:10,$big_stroke:10,$little_stroke:5,$speed:4s,$res:40) { | |
| &:before{ | |
| content:''; | |
| position: absolute; | |
| top: 50%; | |
| left: 50%; | |
| width: ($big_radius*2) +px; | |
| height: ($big_radius*2) +px; | |
| z-index: 999; | |
| border-radius: 50%; |
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
| @supports(prop:value) { | |
| /* more styles */ | |
| } | |
| @supports (display: flex) { | |
| div { display: flex; } | |
| } | |
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
| body:before { | |
| content: "smartphone"; | |
| display: none; /* Prevent from displaying. */ | |
| } | |
| @media (min-width: 550px) { | |
| body:before { | |
| content: "smartphone_wide"; | |
| } | |
| } | |
| @media (min-width: 650px) { |
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
| Самое простое менять класс контейнера для псевдоэлемента, с предопределенными стилями и конентом | |
| $('p').on('click', function() { | |
| $(this).toggleClass('special'); | |
| }); | |
| // Чтобы их динамично менять, | |
| // можно только получить доступ к их контейнеру с его свойством content, | |
| // которое должно быть предопределено в том же CSS. | |
| // А потом мы просто задаем соответстующий атрибут элементу |
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
| var evnt = { | |
| addEvent: function(el, type, fn) { | |
| if (typeof addEventListener !== 'undefined') { | |
| el.addEventListener(type, fn, false); | |
| } else if (typeof attachEvent !== 'undefined'){ | |
| el.attachEvent('on'+ type, fn); | |
| } else { | |
| el['on' + type] = fn; | |
| } | |
| }, |
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
| /* | |
| By Osvaldas Valutis, www.osvaldas.info | |
| Available for use under the MIT License | |
| */ | |
| ;( function ( document, window, index ) | |
| { | |
| var s = document.body || document.documentElement, s = s.style, prefixAnimation = '', prefixTransition = ''; | |
| if( s.WebkitAnimation == '' ) prefixAnimation = '-webkit-'; |
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
| var svgNs = "http://www.w3.org/2000/svg"; | |
| var svg = document.createElementNS(svgNs,"svg"); | |
| svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink"); | |
| svg.setAttribute('width', '600'); | |
| svg.setAttribute('viewBox', '0 0 600 520'); | |
| svg.setAttribute('preserveAspectRatio', 'xMidyMid'); | |
| svg.setAttribute('height', '250'); |
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
| .fave { | |
| width: 100px; | |
| height: 100px; | |
| background: url(images/sprite.png) no-repeat; | |
| background-position: 0 0; | |
| } | |
| .fave:hover { | |
| background-position: -5500px 0; | |
| transition: background 1s steps(55); |
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
| -webkit-column-break-inside: avoid; | |
| page-break-inside: avoid; /* Makes effect only in Firefox */ | |
| break-inside: avoid; /* IE10+, Opera 11.1—12.1 */ |