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.

[Style] Support backface-visibility style property on views.

See original GitHub issue

For 3d animations with perspective, it is important to have backface-visibility.

Reference: https://developer.mozilla.org/en-US/docs/Web/CSS/backface-visibility

cc @vjeux @sahrens

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

15reactions
vnilcommented, Nov 21, 2016

I’m using Animated.Views and I’ve been playing with the idea of animating the opacity as well. It seems to work ok for my use case, and the only thing Im doing is this:

this.backOpacity = this.animatedValue.interpolate({ inputRange: [89, 90], outputRange: [0, 1] })

and then use this for the animation

const backAnimatedStyle = { opacity: this.backOpacity,...}

The Animated.Value in my case goes from 0-180 (symbolising degrees). When I flip them back I go from 180 to 0, so thats why this solution is enough for my case.

So if your situation is similar to mine, maybe this will help for now.

9reactions
abdennourcommented, Sep 24, 2017

Thanks @vnil . I will expand your solution : You explained the backOpacity, still now frontOpacity … And it will be :

    this.frontOpacity = this.animatedValue.interpolate({
      inputRange: [89, 90],
      outputRange: [1, 0]
    });

    this.backOpacity = this.animatedValue.interpolate({
      inputRange: [89, 90],
      outputRange: [0, 1]
    });

Then: style={opacity: this.frontOpacity} goes with Card Face, and style={opacity: this.backOpacity} goes with Card Back.

Read more comments on GitHub >

github_iconTop Results From Across the Web

backface-visibility - CSS: Cascading Style Sheets | MDN
The backface-visibility CSS property sets whether the back face of an element is visible when turned towards the user.
Read more >
CSS backface-visibility property - W3Schools
This property is useful when an element is rotated. It lets you choose if the user should see the back face or not....
Read more >
CSS | backface-visibility Property - GeeksforGeeks
The backface-visibility Property decides whether the back face of an element might be visible or not to the user.
Read more >
CSS3 backface-visibility property
Browser Support. The numbers in the table specify the first browser version that fully supports the property. Numbers followed by -webkit- or -moz-...
Read more >
backface-visibility | CSS-Tricks
The backface-visibility property relates to 3D transforms. ... 2 Supported in Chrome 12-35, Safari, Safari iOS, and Opera 15-22 with prefix ...
Read more >

github_iconTop Related Medium Post

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