Scripts/New-UDTextAnimate.ps1

<#
.SYNOPSIS
    Sample control for UniversalDashboard.
.DESCRIPTION
    Sample control function for UniversalDashboard. This function must have an ID and return a hash table.
.PARAMETER Id
    An id for the component default value will be generated by new-guid.
.EXAMPLE
    PS C:\> <example usage>
    Explanation of what the example does
.INPUTS
    Inputs (if any)
.OUTPUTS
    Output (if any)
.NOTES
    General notes
#>

function New-UDTextAnimate {
    param(
        [Parameter()]
        [string]$Id = (New-Guid).ToString(),
        [Parameter(Mandatory)]
        [string]$Text,
        [Parameter()]
        [int]$OffSet = 150,
        [Parameter()]
        [ValidateSet('bounce',
            'flash',
            'pulse',
            'rubberBand',
            'shake',
            'headShake',
            'swing',
            'tada',
            'wobble',
            'jello',
            'bounceIn',
            'bounceInDown',
            'bounceInLeft',
            'bounceInRight',
            'bounceInUp',
            'fadeIn',
            'fadeInDown',
            'fadeInDownBig',
            'fadeInLeft',
            'fadeInLeftBig',
            'fadeInRight',
            'fadeInRightBig',
            'fadeInUp',
            'fadeInUpBig',
            'flipInX',
            'flipInY',
            'lightSpeedIn',
            'rotateIn',
            'rotateInDownLeft',
            'rotateInDownRight',
            'rotateInUpLeft',
            'rotateInUpRight',
            'hinge',
            'jackInTheBox',
            'rollIn',
            'zoomIn',
            'zoomInDown',
            'zoomInLeft',
            'zoomInRight',
            'zoomInUp',
            'slideInDown',
            'slideInLeft',
            'slideInRight',
            'slideInUp',
            'heartBeat')]
        [String]$AnimateIn = 'slideInUp',
        [Parameter()]
        [ValidateSet('bounceOut',
            'bounceOutDown',
            'bounceOutLeft',
            'bounceOutRight',
            'bounceOutUp',
            'fadeOut',
            'fadeOutDown',
            'fadeOutDownBig',
            'fadeOutLeft',
            'fadeOutLeftBig',
            'fadeOutRight',
            'fadeOutRightBig',
            'fadeOutUp',
            'fadeOutUpBig',
            'flipOutX',
            'flipOutY',
            'lightSpeedOut',
            'rotateOut',
            'rotateOutDownLeft',
            'rotateOutDownRight',
            'rotateOutUpLeft',
            'rotateOutUpRight',
            'rollOut',
            'zoomOut',
            'zoomOutDown',
            'zoomOutLeft',
            'zoomOutRight',
            'zoomOutUp',
            'slideOutDown',
            'slideOutLeft',
            'slideOutRight',
            'slideOutUp')]
        [String]$AnimateOut = 'slideOutUp',
        [Parameter()]
        [int]$Duration = 1,
        [Parameter()]
        [int]$Delay = 0,
        [Parameter()]
        [bool]$AnimateOnce = $false,
        [Parameter()]
        [bool]$AnimatePreScroll = $true,
        [Parameter()]
        [bool]$InitiallyVisible = $false
    )

    End {

        @{
            # The AssetID of the main JS File
            assetId          = $AssetId
            # Tell UD this is a plugin
            isPlugin         = $true
            # This ID must be the same as the one used in the JavaScript to register the control with UD
            type             = "UD-TextAnimate"
            # An ID is mandatory
            id               = $Id

            # This is where you can put any other properties. They are passed to the React control's props
            # The keys are case-sensitive in JS.
            text             = $Text
            offset           = $OffSet
            animateIn        = $AnimateIn
            animateOut       = $AnimateOut
            duration         = $Duration
            initiallyVisible = $InitiallyVisible
            delay            = $Delay
            animateOnce      = $AnimateOnce
            animatePreScroll = $AnimatePreScroll
        }

    }
}