-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from AN0NCER/develop
May update
- Loading branch information
Showing
15 changed files
with
1,256 additions
and
547 deletions.
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
//Управление окнами визуала | ||
const WindowManagment = { | ||
authorized: false, | ||
showed: false, | ||
|
||
target: { | ||
/** | ||
* Инициализация функции окна, запускается если прошел верификацию (this.verif) | ||
*/ | ||
init: function () { }, | ||
/** | ||
* Отображение окна | ||
*/ | ||
show: function () { }, | ||
/** | ||
* Скрытие окна | ||
*/ | ||
hide: function () { }, | ||
/** | ||
* Проверка для инициализация окна. Если проверка не нужна просто верни true | ||
* @returns Возвращает boolean | ||
*/ | ||
verif: function () { return true; }, | ||
}, | ||
|
||
init: function (authorized) { | ||
this.authorized = authorized; | ||
$('.hide-window').click(() => { | ||
this.hide(); | ||
this.target.hide(); | ||
}) | ||
}, | ||
|
||
click: function (target = this.target) { | ||
if (!target.verif()) { | ||
return; | ||
} | ||
this.target = target; | ||
this.target.init(); | ||
this.show(); | ||
this.target.show(); | ||
}, | ||
|
||
hide: async function () { | ||
this.showed = false; | ||
let el = $('.windowed'); | ||
$('.hide-window').css('opacity', 0); | ||
await sleep(300); | ||
el.addClass('hide'); | ||
$('.hide-window').css('opacity', ''); | ||
}, | ||
|
||
show: async function () { | ||
this.showed = true; | ||
let el = $('.windowed.hide'); | ||
el.css('display', 'block'); | ||
await sleep(10); | ||
$('.hide-window').css('opacity', 1); | ||
el.removeClass('hide'); | ||
el.css('display', ''); | ||
await sleep(300); | ||
$('.hide-window').css('opacity', ''); | ||
} | ||
} |
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
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
Oops, something went wrong.