1
0
Fork 0
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:
Bill Thornton 2023-03-14 01:32:36 -04:00
parent ff8b7427e3
commit 4937f2d60c
4 changed files with 17 additions and 17 deletions

View file

@ -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 },