mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 07:57:02 +03:00
Add login background animation
This commit is contained in:
parent
6f6ded7352
commit
52018b40e8
3 changed files with 38 additions and 4 deletions
|
|
@ -1,4 +1,9 @@
|
||||||
|
|
||||||
|
import $ from '$';
|
||||||
|
import _ from '_';
|
||||||
|
|
||||||
|
import {$win} from 'Common/Globals';
|
||||||
|
|
||||||
import {AbstractScreen} from 'Knoin/AbstractScreen';
|
import {AbstractScreen} from 'Knoin/AbstractScreen';
|
||||||
|
|
||||||
import {LoginUserView} from 'View/User/Login';
|
import {LoginUserView} from 'View/User/Login';
|
||||||
|
|
@ -13,6 +18,35 @@ class LoginUserScreen extends AbstractScreen
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
getApp().setWindowTitle('');
|
getApp().setWindowTitle('');
|
||||||
|
this.initFunBackgroud();
|
||||||
|
}
|
||||||
|
|
||||||
|
getHeightAndWidth() {
|
||||||
|
const
|
||||||
|
height = $win.height(),
|
||||||
|
width = $win.width();
|
||||||
|
|
||||||
|
return {height, width};
|
||||||
|
}
|
||||||
|
|
||||||
|
initFunBackgroud() {
|
||||||
|
|
||||||
|
const
|
||||||
|
$bg = $('#rl-bg'),
|
||||||
|
movementStrength = 25,
|
||||||
|
winHeight = $win.height(),
|
||||||
|
winWidth = $win.width(),
|
||||||
|
height = movementStrength / winHeight,
|
||||||
|
width = movementStrength / winWidth,
|
||||||
|
winHeightHalf = winHeight / 2,
|
||||||
|
winWidthHalf = winWidth / 2;
|
||||||
|
|
||||||
|
$('#rl-app').on('mousemove', _.throttle((e) => {
|
||||||
|
$bg.css({
|
||||||
|
top: height * (e.pageY - winHeightHalf) * -1 - movementStrength,
|
||||||
|
left: width * (e.pageX - winWidthHalf) * -1 - movementStrength
|
||||||
|
});
|
||||||
|
}, 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
#rl-bg {
|
#rl-bg {
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: -0;
|
||||||
right: 0;
|
right: -25px;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: -25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#rl-content {
|
#rl-content {
|
||||||
|
|
|
||||||
|
|
@ -310,7 +310,7 @@ html.glass {
|
||||||
text-shadow: none !important;
|
text-shadow: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus {
|
&:focus, &:hover {
|
||||||
border-color: @glass-color;
|
border-color: @glass-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue