question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

new background animation behaves unexpectedly

See original GitHub issue

Checklist

  • I updated the card to the latest version available
  • I cleared the cache of my browser

Describe the bug A clear and concise description of what the bug is.

the new animation (for which a big thanks is in order: thanks!) doesnt work 100% just yet After a few cache clearances, it seems to start off well, but after a little while blacks out, and stops all together so it seems.

Version of the card Version: 3.2.0

To Reproduce This is the configuration I used:

extra_styles: |
  @keyframes bgswap1 {
    0% {
      background-image: url("/local/mijnafvalwijzer/kliko_geen.png");
    }
    25% {
      background-image: url("/local/mijnafvalwijzer/kliko_geen.png");
    }
    50% {
      background-image: url("/local/mijnafvalwijzer/plastic.png");
    }
    75% {
      background-image: url("/local/mijnafvalwijzer/plastic.png");
    }
    100% {
      background-image: url("/local/mijnafvalwijzer/kliko_geen.png");
    }
  }

styles:
  label:
    - text-transform: capitalize
    - font-size: 13px
    - font-weight: bold
    - color: var(--paper-card-background-color) #var(--primary-background-color)
#    - background-color: >
#       [[[ return states['sensor.trash_color'].state ]]]
#    - align-self: end
    - position: absolute
    - bottom: 1%
    - right: 50%
    - transform: translateX(+50%)
  card:
#    - background-image: >
#        [[[ return `url("${entity.attributes.entity_picture}")`; ]]]
#        [[[ return `url("/local/mijnafvalwijzer/kliko_geen.png,/local/mijnafvalwijzer/plastic.png")`; ]]]
#        [[[ return `url("${entity.attributes.entity_picture}")`; ]]]
#        [[[ return `url("${states['sensor.saver_trash_today'].attributes.entity_picture}",url("${states['sensor.saver_trash_tomorrow'].attributes.entity_picture}")`; ]]]
#    - animation: >
#        [[[ if (states['persistent_notification.trash_notification']) return 'blink 2s ease infinite';
#            return 'none';
#        ]]]
#    - background-repeat: no-repeat
    - animation: bgswap1 10s linear infinite
    - background-size: cover

Screenshots If applicable, add screenshots to help explain your problem.

Mar-15-2020 22-56-25

Expected behavior A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

  • Browser [e.g. chrome, safari] Safari Mac 13.05, Chrome seems better at it
  • Version [e.g. 22] 3.05

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

additional questions:

1- can I still add the (now commented animation) for the blink on persistent_notification added to this new background animation?

2- I need to template these pictures to be the picture for today (entity) and tomorrow, (sensor.saver_trash_tomorrow). How can I add templates to these picture in the new extra_styles keyframe section, which for now is hard coded?

Ive tried to use the working code now commented in the card: background-image template, like this:

extra_styles: |
  @keyframes bgswap1 {
    0% {
      background-image: `url("${entity.attributes.entity_picture}")`;
    }
    25% {
      background-image: `url("${entity.attributes.entity_picture}")`;
    }
    50% {
      background-image: `url("${entity['sensor.saver_trash_tomorrow'].attributes.entity_picture}")`;
    }
    75% {
      background-image: `url("${entity['sensor.saver_trash_tomorrow'].attributes.entity_picture}")`;
    }
    100% {
      background-image: `url("${entity.attributes.entity_picture}")`;
    }
  }

but that doesnt work thanks for having a look

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
RomRidercommented, Mar 16, 2020

To apply multiple animation you have to do like this: animation: blink 2s ease infinite, bgswap1 10s linear infinite

Regarding the other problem, I can’t reproduce chrome, FF, safari, ipad and android work as expected with this CSS.

For the templating:

extra_styles: |
  [[[
  return `@keyframes bgswap1 {
    0% {
      background-image: url("${entity.attributes.entity_picture}");
    }
    25% {
      background-image: url("${entity.attributes.entity_picture}");
    }
    50% {
      background-image: url("${entity['sensor.saver_trash_tomorrow'].attributes.entity_picture}");
    }
    75% {
      background-image: url("${entity['sensor.saver_trash_tomorrow'].attributes.entity_picture}");
    }
    100% {
      background-image: url("${entity.attributes.entity_picture}");
    }
  }`
  ]]]
0reactions
Mariusthvdbcommented, Mar 18, 2020

Yes, sorry, much obliged! Closed. Yet again successfully thanks to your magic card and support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS Animation Behaving Differently on Safari / All iPhone ...
Changing my svg images to png's, as I read that sometimes svg's behave unexpectedly; Added all of the proper -webkit- prefixes; Condensing the...
Read more >
iOS 16 unexpected rotation behaviour - Apple Developer
It seems to introduce some unexpected behaviour. ... the app again unexpectedly rotates from Portrait to Landscape with no animations.
Read more >
Animation Techniques for Adding and Removing Items From a ...
Applying CSS-only animations to a dynamic DOM event (adding brand new elements and fully removing elements) is extremely tricky work.
Read more >
Identical CSS (keyframe) animation for twin navigation items ...
I wonder if someone can assist me with a CSS animation issue (bug?) ... (keyframe) animation for twin navigation items behaving unexpectedly.
Read more >
Create advanced animations with smart animate
If you introduce a new layer in the destination frame, smart animate will dissolve ... We've outlined a few ways to troubleshoot unexpected...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found