NativeScript / NativeScript

⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java, Dart). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Dart (Flutter) and you name it compatible.
https://nativescript.org
MIT License
24.07k stars 1.64k forks source link

Add support for CSS transitions #1894

Open tzraikov opened 8 years ago

tzraikov commented 8 years ago

Add support for CSS transitions. This includes the following CSS properties:

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/32628680-add-support-for-css-transitions?utm_campaign=plugin&utm_content=tracker%2F12908224&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F12908224&utm_medium=issues&utm_source=github).
facekapow commented 8 years ago

Any word on this? I would love to be able to transition my label opacitys.

konradkubiec commented 7 years ago

Is there any architecture overview of CSS animation logic?

I'm not happy with animations (rewinding and dynamic switching between many animations). Transitions will remove all of those problems.

Right now my hypothesis is to use almost the same logic as CSS animations do. The biggest difference is to have additional transitions manager that will:

Transition manager should watch for CSS transition properties (transition-*) and then for pointed properties changes (transition: width 2s, height 2s, background-color 2s, transform 2s; and then e.g. height: 20;).

In next attempts, I'll try to address animation conflicts (e.g. CSS animation vs transitions) and other unexpected bugs.

As a new NativeScript user and contributor, I'll appreciate all help and guidance.

tzraikov commented 7 years ago

Currently we can't offer an architecture overview. A good starting point could be the animations article in our documentation. Then you can check the source code located here.

3rror404 commented 7 years ago

+1. Using the Animation module for simple tasks like transitioning a background colour can be cumbersome.

BenLorantfy commented 6 years ago

Transitions also can do things that animations can't. e.g. animate a value from it's current state. For example, this is how I'm showing/hiding using animations.

@keyframes show {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes hide {
  from { opacity: 1; }
  to { opacity: 0; }
}

.hidden {
  animation-name: hide;
  animation-duration: 1s;
  animation-fill-mode: forwards;
}

.shown {
  animation-name: show;
  animation-duration: 1s;
  animation-fill-mode: forwards;
}

The code for a transition would be:

.myThing {
  transition: opacity 0.3s;
  opacity: 1;
}

.hidden {
  opacity: 0;
}

Transitions are smart enough to know to start the new transition at the current value of opacity. e.g. If I add the hidden class and remove it before it's done hiding, it will start the new transition from where it left off. Animations can't do that, they have to start from a value. If I start hiding and removing the hidden class before it's done hiding, it will set the opacity to 0 and then animate it to 1.

I don't want to do imperative animations, but this is making it hard to declarative ones.

tillsanders commented 5 years ago

I'm still looking forward to transitions. Is this just low priority, or are there technical difficulties?

plackowski commented 3 years ago

Any news?

SephReed commented 1 year ago

Would be really helpful

perez247 commented 8 months ago

At this point, I believe I am allowed to ask about the status of Nativescript. It has been years and things are getting much slower. Is there something we the developers ought to know?

CatchABus commented 8 months ago

At this point, I believe I am allowed to ask about the status of Nativescript. It has been years and things are getting much slower. Is there something we the developers ought to know?

This is off-topic so let's try to keep things clean here. I'm sure you'll have your questions answered and much more if you join NativeScript discord server and interact with the rest of community.

NathanWalker commented 8 months ago

Thanks @CatchABus it's true @perez247, most discussions take place in the community discord here: https://nativescript.org/discord We look forward to seeing you there.

We just wrapped up a case study on NativeScript where you can learn more: https://nstudio.io/success-stories/blackout-lighting-console