mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add random int utility function
This commit is contained in:
parent
ff8b7427e3
commit
4937f2d60c
4 changed files with 17 additions and 17 deletions
|
@ -1,4 +1,5 @@
|
|||
import { PluginType } from '../../types/plugin.ts';
|
||||
import { randomInt } from '../../utils/number.ts';
|
||||
|
||||
export default function () {
|
||||
const self = this;
|
||||
|
@ -25,16 +26,12 @@ export default function () {
|
|||
const elem = document.querySelector('.logoScreenSaverImage');
|
||||
|
||||
if (elem && elem.animate) {
|
||||
const random = getRandomInt(0, animations.length - 1);
|
||||
const random = randomInt(0, animations.length - 1);
|
||||
|
||||
animations[random](elem, 1);
|
||||
}
|
||||
}
|
||||
|
||||
function getRandomInt(min, max) {
|
||||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||
}
|
||||
|
||||
function bounceInLeft(elem, iterations) {
|
||||
const keyframes = [
|
||||
{ transform: 'translate3d(-3000px, 0, 0)', opacity: '0', offset: 0 },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue