This commit is contained in:
Oleg Mokhov
2015-06-20 12:26:08 +03:00
committed by mokhov
parent a716969f4e
commit f3546ef3a5
85 changed files with 16682 additions and 1 deletions

View File

@@ -0,0 +1,50 @@
spin_skin_common() {
& {
display: inline-block;
box-sizing: border-box;
border: 2px solid transparent;
border-radius: 100px;
/*
* Поддержка CSS анимаций и CSS градиентов у основных браузеров совпадает
* Если браузер не поддерживает градиенты, будет показана gif-анимация
*/
background-image: url(images/spin.gif);
background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0));
}
/* Для правильного позиционирования прелоадера относительно baseline */
&:after {
visibility: hidden;
content: '\00A0'; /*   */
}
&._progressed {
display: inline-block;
animation: spin 1s infinite linear;
backface-visibility: hidden; /* Для ускорения анимации */
}
@keyframes spin
{
from
{
border-top-color: #fc0;
border-left-color: #fc0;
transform: rotate(0deg);
}
to
{
border-top-color: #fc0;
border-left-color: #fc0;
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
}

View File

@@ -0,0 +1,9 @@
spin_skin_size-l() {
width: 38px;
height: 38px;
font-size: 18px;
line-height: 34px;
background-position: -2px -106px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1,7 @@
module.exports = function (bt) {
bt.setDefaultView('spin', 'default');
bt.match('spin_default*', function (ctx) {
ctx.setState('progressed');
});
};

View File

@@ -0,0 +1 @@
- view: default

38
client/core/spin/spin.js Normal file
View File

@@ -0,0 +1,38 @@
modules.define(
'spin',
[
'y-block',
'inherit'
],
function (
provide,
YBlock,
inherit
) {
var Spin = inherit(YBlock, {
__constructor: function () {
this.__base.apply(this, arguments);
},
/**
* Останаваливает анимацию спиннера
*/
stop: function () {
this._removeState('progressed');
},
/**
* Запускает анимацию спиннера
*/
start: function () {
this._setState('progressed');
}
}, {
getBlockName: function () {
return 'spin';
}
});
provide(Spin);
});

View File

@@ -0,0 +1,4 @@
.spin_default-large {
spin_skin_common();
spin_skin_size-l();
}

View File

@@ -0,0 +1,2 @@
- skin: '*'
required: true