package ONO::Lib::UI::Animation;
################################################################################
# COPYRIGHT / LICENSE #
################################################################################
#
# This file is part of the ONO Software Project.
#
# Copyright (C) 2000-2025 Jos KIRPS [ www.kirps.com | jos_AT_kirps_DOT_com ]
# and The Joopita Project [ www.joopita.org | contact_AT_joopita_DOT_com ]
#
# This file, as well as other parts of the ONO Software Project or related
# elements, are FREE SOFTWARE available under the ARTISTIC LICENSE 2.0.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# For the full license, see /ono/osr/license/LICENSE.txt, or write to
# jos_AT_kirps_DOT_com or contact_AT_joopita_DOT_com.
#
################################################################################
# END OF COPYRIGHT / LICENSE, HERE COMES THE CODE ... #
################################################################################
use strict;
#: Animated UI elements
###############################################################################
# dots
###############################################################################
sub dots {
#: Displays an rolling number of dots, the number can be defined.
my $rand = int(rand(99999));
my $DOTS;
for (my $i = 1; $i < $_[1]+1; $i++) {
my ($d1,$d2);
for (my $d = 0; $d < $_[1]; $d++) {
if ($d < $i) {
$d1 .= ".";
} else {
$d2 .= ".";
}
}
$DOTS .= qq~<span id="ono_ui_animation_dots_${rand}_$i" class="">$d1<span class="colf">$d2</span></span>~;
}
$DOTS .= qq~<script>onojs_ui_animation_dots('$rand','1',$_[1]);</script>~;
return $DOTS;
}
###############################################################################
# end of script
###############################################################################
1;
__END__