How to step through a GIF animation based on the browser's scroll position? - reactjs

I have a GIF that I will use in a React web app I am building. I want to be able to step through the animation based on the scroll position of the site.
I.e. when I have scrolled through 50% of the page, then I want the gif to display the image at its 50% position.
The gif will be in a div, position:fixed. So it will always live in the top corner of the browser.
The web app is a react app so if it's possible that there's a react library that implements this then that would be great.
Thanks!

There appears to be at least one ready made React implementation for dealing with the interaction with/playing of the GIF that may be able to assist you in your project.
React Gif Player is a React component which creates a GIF player similar to Facebook's implementation. It also comes with a pause function (and an example), which you may be able to use to programatically pause the GIF at corresponding points based on your scroll position.
Gif Frames is a pure JavaScript tool for extracting GIF frames and saving to file. You may be able to create individual frames and correspond frames with certain points of the scroll.
I'm not aware of a gif player that implements exactly what you were hoping for, although others may be able to assist in this regard. If not, you may have to use a combination of, or do a full implementation yourself.
Hopefully this helps.

Related

Possible to support StickyHeaders for CN1?

I really like the idea of StickyHeaders (https://www.codenameone.com/blog/sticky-headers.html), they're great for usability, but the CN1 implementation was never fully developed or included in CN1. Solutions exist for iOS and Android (https://github.com/emilsjolander/StickyListHeaders and http://applidium.github.io/HeaderListView/).
The two main features I'm missing in the old implementation are: that each header visually 'pushes' the previous out of the top of the screen (and vice-versa when scrolling down), and that the stickyheader which is 'stuck' at the top of the screen is the actual stickyheader itself, so that eg. buttons inside it will work.
Are there any plans to add this to CN1 sometime soon? Or anyone who has implemented a similar solution (I tried Chibuike Mba's alternative implementation mentioned on the original blog post but it doesn't cover the features I'd like)?
Alternatively, any pointers to how I might implement this myself?
I've already tried a couple of times, but given up since I don't master the details of CN1 graphics etc well enough. The approach mentioned here How to make sticky section headers (like iOS) in Android? sounds like a good approach (add a container on top for the stickyheader, scroll that container when the next stickyheader arrives), but then how to force the size and scrolling of such a container?)
This should be much simpler to implement today as we have two helpful features:
Scroll listener
Layered pane
You can use the scroll listener to detect the location of a header and appropriately place another component in the NORTH of a Container within the layered pane. Then as scrolling happens and you detect a new header is coming in you can just place it in an X/Y position below the existing component and use animateLayout to push it out.

What's the Facebook/AirBnb app design effect called?

I want to read about that effect you see on pages like Facebook or Airbnb when you open the page and the browser shows you the low fidelity design of page while the actual data loads - so you'll see grey box instead in the place where pictures of the users will be, grey rectangles instead of the text content etc. I've been searching for hours but cannot find anything useful, anyone knows the name of this UX practice?
I believe this is referred to as loading dummy content. There wasn't much info when I searched for it, but I do know that the basic principle is first load a gray background for images and dummy block font then wait for your content to render.

Silverlight Deep Zoom: Generate images as requested

I am trying to build an application which serves images to a Deep Zoom MultiScaleImage dynamically. For example, when an image for a particular corner of the large image is requested, that image should be rendered automatically.
Rendering is what I will implement. But my code needs to be called when the MultiScaleImage requests that corner of the image. How do I implement this?
When I search on StackOverflow for this, I get results that explain dynamic generation of deep zoom images using DeepZoomTools. I am not entirely sure, but this is not I want. I want to generate images only when requested individually and not generate all of them on the fly.
EDIT: Let me give you an example that will explain one of the possible solutions to this, which I don't know how to implement.
If the MultiScaleImage requests the image 5/1_0.png, which if you know Deep Zoom will be the first image in the second column of the large image at 5th zoom level (not related to the real zoom value in deep zoom). When the DeepZoom requests this file, I want to generate it looking at the parameters I have, which are "5", "1", and "0".
#Salil: will do.
You could use routing (e.g. https://web.archive.org/web/20211020111718/https://www.4guysfromrolla.com/articles/012710-1.aspx) to direct the request to a Web Generic handler. Note that a generic handler is a bit more suitable than an aspx page as it doesn't have to do so much work with a page lifecycle.

Wpf flowdocumentReader page turn effect

I am working in a very crucial wpf project.This project is almost finished apart from some points.
I am showing flowdocumentreader which is loaded with dynamic images around 100.
I have one requirement to show page turn effect whenever user navigates to pages in flowdocumentreader.
I have used google and seen lots of example but no body has used flowdocumentreader.
I have also seen wpfBookControl which is not dynamic and it uses xps document.
Please help me to achieve that.
Take a look here or here.
In the WPF Shader Effects Library you have a 'negative' effect which inverts ('turns') the image.

Render Silverlight Animation to video file

I need to be able to render a silverlight storyboard animation to video. The animated content itself could be simple UIElements, Images or even two or more videos playing at the same time.
Several ideas came to mind like RenderTargetBitmap on a single frame basis, but:
1) I've never tested this against video embedded content
2) Don't know how to actually compose the video from the generated images.
Expression Encoder was also on my mind, but I don't know if it's possible to integrate it in a Silverlight/XBAP app to fulfill what's expected from it.
What's your opinion on this?
Your best bet if you just need to capture this sort of thing would be to use the Expression Encoder 4's screen recording feature, or a tool like TechSmith Camtasia.

Resources