Faster swipe transition in flutter bottom navigation bar - animation

Does anyone know how to make the swipe transition go faster? I am aware on the "on tab" transition: controller.animateToPage(index,duration: const Duration(milliseconds: 250),curve: Curves.easeInOut); but i would like to know if there is any option for the onPageChanged.
Thanks!

Related

Move a div up and down based on mouse Move

I have this aside element which is has a position:fixed; property. Inside it, i have another div.inner which will hold elements which might be many and therefore might exceed the window.height();
Now, i need to solve this problem based on mouse scroll event on the div.inner element. I need to move the inner div top or down based on mouse scroll up or down events.
Please have a look at this website which demonstrates exactly what i need on the left were they have the logo and menus. Try moving your mouse up or down on that element and see.
Here is my attempt which didn't go so well.
Im not gonna write the entire code, but the concept from the page is:
pageHeigth = 200px
menuHeight = 250px
menuOverflow = menuHeight - pageHeight (50px)
Mouse positioned at the top: Menu CSS = "top:0px"
Mouse positioned at the bottom: Menu CSS = "top:-50px" (negative menuOverflow)
And of course interpolate the postion between top/bottom depending on mouse position. And also, using the terminology "mouse scroll" in your question makes it ambigous to understand, i believe "mouse move" is a better wording. "Scroll" makes me think about mousewheel or the page scrolling

Firefox mousemove bugs out if left mouse button pressed on svg image

So in this little example I have a square (thumbnail) following the mouse around, in the final product it will be the place where the dragged item will be visible. I ran into a problem however that if I try to drag and drop a svg <image> in Firefox it bugs out and doesn't follow the mouse anymore.
http://jsfiddle.net/Lx7besrw/
Same applies if you have different mouseEvents, they all bug out and stop working until you unpress left mouse button and move again. I've tried e.preventDefault e.stopPropagation and return false to prevent weird behaviour but without luck.
Any help would be GREATLY appriciated.
This solved my problem:
$(document).on('dragstart', function(e){
e.preventDefault();
});
https://bugzilla.mozilla.org/show_bug.cgi?id=511188

Spin a FontAwesome icon along with page scrolling

I want to spin the <i class="fa fa-refresh"></i> icon as the page is scrolled down (up). I mean as long as you scroll down (up) the page the icon will be spinning right or left with the speed depending on the scroll speed. Seems like I want too much, but it would be awesome if there were some ready solutions out there.
Up vs down will take some extra code, speed is not possible using font awesome spin, so I would do that something like this to get you as close as possible:
var timer;
$(window).scroll(function(e){
clearTimeout(timer);
$('.fa-refresh').addClass('fa-spin');
timer = setTimeout(checkStop,150);
});
function checkStop(){
$('.fa-refresh').removeClass('fa-spin');
}
Heres working example in FIDDLE
just keep scrolling up and down to see it spin

How to achieve a translucent background color for the control bar of FlowPlayer?

I'm trying to style the control bar of the flowplayer and i want a semi-transparent(translucent) black control bar.
When i give an opacity value like this :
controls: {
url: "/flowplayer/flowplayer.controls-3.2.15.swf",
backgroundColor: "#000000",
opacity: 0.5
}
even the controls within the control bar (the play/pause buttons, seek bar, etc) become translucent. I don't want that to happen. I only want the "background" of the control bar to be trasnlucent.
How can i achieve this?
Got it!! All i had to do was
backgroundColor: "rgb(0,0,0,0.5)"
Silly me!!!

How to create a page-stop scroll animation

The new mini-site for iPhone 5s has a special page scroll:
http://www.apple.com/iphone-5s/
Every time you flick the page, it glides and stops at the next full page, not halfway, and not any more than required. How do they do it?
I had to do a similar site and I created a plugin for it:
http://alvarotrigo.com/blog/fullpage-jquery-plugin-for-fullscreen-scrolling-websites/
Living demo
In mine you can also:
Use it over IE 8 and old browsers with no CSS 3 support.
Slide throw the page using the keyboard arrows.
Add horizontal sliders.
Resize of texts when resizing the window.
Mobile and Tablet detection enabling the scrolling on them. (as there are usually problems to visualize big contents and texts)
It is in its first version, simple but working well :)
I will keep improving it as far as I can. Suggestions will be more than welcome.
OnePageScroll may be what you're looking for: http://www.onextrapixel.com/2013/09/18/onepagescroll-js-creating-an-apples-iphone-5s-website/
I've been fiddling with a solution to a similar problem.
All my solution does is monitor when the window scrolls.
if ($(window).scrollTop()+$(window).height()>=$("#page"+(nextpage)).offset().top+100) {
If it scrolls past the end of the "page" by more than 50px jquery animates the scroll to the next "page".
$('html, body').animate({ scrollTop: pageheight }, 500, function() { currentpage = nextpage; animatingdown = false; document.location.hash = currentpage;});
It does the same for scrolling up. This covers scrolling by mouse, keyboard or javascript.
Check out the full code at http://jsfiddle.net/dLCwC/1/
Maybe it'll be of some use to someone (let me know if it is, or isn't).

Resources