Im currently designing an application in Ionic where I have a schedule for 5 days as an image. Now, I want to make a "detailed" view of each day that will fade in when one presses one out of 5 buttons, one for each day.
To do this, I use a CSS animation which pushes the image to the right a certain amount of pixels and then slides in two white images on top of the 4 days that shouldn't be visible.
My problem is that I have 5 animations, and I want to perform a different one depending on which of the 5 buttons is clicked. In angular, I can't do:
document.getElementById('image').setAttribute('animation', 'animation1 2s fade')
How would I go about passing the button information to CSS to perform these animations?
You can use Angular Web Animations API to do what ever the animation you want. But keep in mind you must get the right version since Ionic is behind the Angular.
npm install #angular/animations#4.1.3 --save --save-exact
Here is the great article about basics of it with Ionic.
Related
I'm trying to create a card slider. Where if you click the next arrow button will increase the margin left that will show next card. Is there away that i can create a function that will increase a margin of an card slider when i click on it?
Example:
https://animedia.netlify.app/
Just like this person. When I inspect on this person card slider I found that when you press the next arrow it will increase the margin which will push to the next card. I wanna know if I can accomplish the same thing with react.
Thanks.
What you are really looking for a carousel/swiper library. There are many availiable out there and you could search then on the npm.
Take a look at this one, https://www.npmjs.com/package/swiper
it is pretty well maintained, and if you go on their site they basically have a lot of various exaples, including having multiple slides/cards and being able to navigate across them.
I would like to know a way to stop the swiperjs transition at the exact spot while it's transitioning.
What I currently have is a continuous autoplay loop combined with transition-timing-function : linear; on the swiper wrapper. This makes it look like it's constantly sliding one way in a fluent motion. On the background it is however always transitioning from slide to slide (and the transition-timing property makes it look fluent). What I would like to implement is when I hover the swiper, it stops at the exact position and when I leave the mouse it starts again. I have already implemented a fix to make it stop at the exact position using this link. When hovering out though, it moves too fast to the next translate3d point. This is because when starting it again, it takes the stopped position as the starting position of the transition, which is of different length so it moves at a different speed.
I've already gone as far as implementing an interval with the same speed count as the slider property to determine the progress of the animation from point to point so to from there be able to determine the transition-duration. For example when the slide transition is half way (in my case 3.5 seconds later as the speed I set is 7 seconds), I set the transition duration to 3500 on the swiper wrapper so that it moves at the same speed to the next point when hovering out.
This however is very buggy and relies on a continuous counter that starts upon loading the page (in mounted()), which isn't correct anymore after hovering a few times.
It's maybe a bit of a complex story but I would like to know if there are other ways of implementing this functionality, or how to somehow be able to know the current progression of the transition.
I'm building this in Nuxt 3 (vue.js framework) using the vue swiperjs library.
Thanks in advance
I am using Ionic Slides in my app. I wish to gradually change the background colour as I move from the first slide to the second one from white to blue. I am able to change them abruptly, but how can I make it look like it changes smoothly?
A lot of native apps (e.g. Buffer) do that in their introductory slides.
Thanks in advance!
well there are many ways in which you can do a smooth transition one of which is
CSS3 animation
read here
https://www.w3schools.com/css/css3_animations.asp
or you can use angularjs animation
read here
https://www.w3schools.com/angular/angular_animations.asp
I'm building a project using AngularDart and bootstrap. My project includes an NgComponent that is being rendered in a shadow dom. On load there seems to be a 1 out of 5 chance the component will render visibly on the page. The other 4 out of 5 times it takes a browser resize (to where the responsive bootstrap css snaps back) in order to see the component. Is this just some funky css or what?
Usually this is when an error occurs. When you have set class="ng-cloak" Angular hides the content and when the initialization of Angular fails at some point it doesn't come to the point where it unhides the content. Check the output in DartEditor or Development console.
I'm new here and I didn't know where to ask this sort of question, so here's a go. I'm trying to build my new portfolio website, and I'm trying to make it so that in the background I have a cloud that moves from left to right on the screen in the top left hand corner and it wraps around the website when it goes off the screen. How would I go about accomplishing this?
I'm building my site on wordpress, and I'm using HTML5, JS, PHP and CSS3. I tried going about using the css3 #keyframes class to move the cloud, but it didn't work.
Here's a link to my site.
http://www.secret.irmattstenquist.com
Simila sites that do this :
http://vimeo.com/ <-- With the sun and the bottom footer.
http://jsanim.com/ might be a solution. Its a javascript library for animations and you can see on their site they like animated background clouds :)