• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 4 Documentation Website Mango 5 Documentation Website Radix IoT LinkedIn

    Rotating Fan

    Scheduled Pinned Locked Moved Dashboard Designer & Custom AngularJS Pages
    4 Posts 3 Posters 2.1k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G Offline
      georgestefan
      last edited by

      Hello, I am using the following code to rotate a image with a fan:

      <img id="fan" style="position: absolute; left: 216.578px; top: 440px; height: 100px;" src="/rest/v2/file-stores/default/Exhaust_fan.png" ng-class="{'ma-spin-counterclockwise': !page.spin, 'ma-spin-clockwise': page.spin}">
      

      I want to know if it's possible to link the rotation to a variable and change the rotation according to the data from that point, the point will be from 0 to 100% representing the real fan rotating speed.

      1 Reply Last reply Reply Quote 0
      • Jared WiltshireJ Offline
        Jared Wiltshire
        last edited by Jared Wiltshire

        Yes its possible, here's an example.

        Add this style to your page (we need the default duration to be 0s so we have to add our own class).

        <style>
        .my-spin-clockwise {
          transform-origin: 50% 50%;
          animation: spin-clockwise 0s linear infinite;
        }
        </style>
        

        You can then change the duration of the animation like this.

        <img src="/fan.svg" class="my-spin-clockwise" ng-style="{'animation-duration': 50 / point.value + 's'}">
        

        However the animation restarts whenever the duration changes so you may want to round the point value like so

        <img src="/fan.svg" class="my-spin-clockwise" ng-style="{'animation-duration': 50 / (point.value - point.value % 10) + 's'}">
        

        Developer at Radix IoT

        1 Reply Last reply Reply Quote 1
        • G Offline
          georgestefan
          last edited by

          @jared-wiltshire said in Rotating Fan:

          ng-style="{'animation-duration': 50 / (point.value - point.value % 10) + 's'}"

          Thanks, works well!

          1 Reply Last reply Reply Quote 0
          • J Offline
            James
            last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post