Release
This commit is contained in:
50
client/core/spin/_skin/spin_skin_common.styl
Normal file
50
client/core/spin/_skin/spin_skin_common.styl
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
9
client/core/spin/_skin/spin_skin_size-l.styl
Normal file
9
client/core/spin/_skin/spin_skin_size-l.styl
Normal file
@@ -0,0 +1,9 @@
|
||||
spin_skin_size-l() {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
|
||||
font-size: 18px;
|
||||
line-height: 34px;
|
||||
|
||||
background-position: -2px -106px;
|
||||
}
|
||||
BIN
client/core/spin/images/spin.gif
Normal file
BIN
client/core/spin/images/spin.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
7
client/core/spin/spin.bt.js
Normal file
7
client/core/spin/spin.bt.js
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = function (bt) {
|
||||
bt.setDefaultView('spin', 'default');
|
||||
|
||||
bt.match('spin_default*', function (ctx) {
|
||||
ctx.setState('progressed');
|
||||
});
|
||||
};
|
||||
1
client/core/spin/spin.deps.yaml
Normal file
1
client/core/spin/spin.deps.yaml
Normal file
@@ -0,0 +1 @@
|
||||
- view: default
|
||||
38
client/core/spin/spin.js
Normal file
38
client/core/spin/spin.js
Normal 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);
|
||||
});
|
||||
4
client/core/spin/spin_default-large.styl
Normal file
4
client/core/spin/spin_default-large.styl
Normal file
@@ -0,0 +1,4 @@
|
||||
.spin_default-large {
|
||||
spin_skin_common();
|
||||
spin_skin_size-l();
|
||||
}
|
||||
2
client/core/spin/spin_view.deps.yaml
Normal file
2
client/core/spin/spin_view.deps.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
- skin: '*'
|
||||
required: true
|
||||
Reference in New Issue
Block a user