Button that increase margin with React - css

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.

Related

How can I create a hop up image effect with Swiper?

Currently, I'm browsing some pages and I found that there's a page where the design is very pleasing to me. So I'm trying to replicate it, but unfortunately that I can't figure it out due to my lack of CSS skills.
So here's how that page work:
Whenever the class is active, it'll hop up a bit (the page I'm looking at is using Swiper, too!)
But however, the Hop-up image will go out of the box of Swiper
And what I'm doing right now, there's a box just like that page, but the image or anything else if it's larger than the current box, it'll be cut. I can't make it go outside of the Swiper's box.
Here's how I'm currently doing it, I made a quick dataSample and then mapped it, get the current slide to have the active class, and then CSS it. Any help is appreciated, many thanks.
I've left comment on what I'm doing in the CSS at CodeSandbox.
Code: CodeSandbox - Trying to create Hop-up image using Swiper

create simple carousel slidler with slider revolution

I'm trying to create a simple carousel slider like the one on the page below which shows rooms in a hostel. Three rooms are displayed at a time in the slider. It's a very common slider setup especially for products etc.
enter link description here
I cannot achieve this in revolution slider, each slide takes up all of the slider viewport as it were, I cannot seem to make a slide only take up one -third of the view port so that 3 slides are visible simultaneously. Does anyone know how this is done?
I saw the setting in carousel settings: Max visible items but this makes no difference.
Any help would save my remaining hair!! Thanks!
I realize this may be late, but I figured this out. Under Slider Settings for option 4 (slide layout) you have to set the initial "Layer Grid Size" to something smaller than your screen width. For example, I set mine to 350x200 with 3 max items selected and it is working well. I also have Auto set for the sizing of the slider and all subsequent layers.
See Screenshot Here

Text appears while over on an icon in Webflow

I made some research before writing here, but I couldn't find nothing that satisfied my answer to this specific case.
I have an icon, and when user hover onto it I want the icon become smaller and text (caption for the icon) should appear -at icons bottom.
As now, I have an interaction for the icon, that makes it become smaller.
It's first time for me working with WebFlow, and I see that using overlapping blocks they work as layers in the sense that the one on top is the only one who react to hovering.
I found in other questions that there was the need of setting correctly absolute/relative for blocks, but is not working for me since I have also the icon, inside the same block.
If I move the icon out of the block, I have the problem I shared before about overlapping "layers".
I need that icon decrease in size and text appear at the same time.
Is this achievable?
Thank you for your help!

should I use Navigator or View State?

Hi I want to create an application has this sort of function:
http://looklet.com/create
In this application when you click the button (or some tilelist) on the right the model on the left update accordingly. I wonder how they achieve this. Originally i think it's some sort of image-only pop-up window but then pop-up window seems to update the entire view.
Then I think it might be only change view state, but then I still confused how it can be done using view state.
Flex expert please give me some hint !
Looks like transparent images drawn on Canvas. Each piece must have predefined offset and draw order.
Probably just images placed on one or more Canvas, with the z-order controlled for depth.
The body stays the same, so shirts probably have their own placement properties, as do skirts, underwear, hosiery, etc. as well as backgrounds, faces, etc.

To build a flex volume control component similar to that of Youtube

Hey, I've been assigned to design a flex 3 volume control component similar to the one Youtube players have. I mean, you move the mouse over the volume icon and a vertical slider appears.
My only doubt is about how making this vertical slider to appear and to hide properly.
Should I extend a PopUpButton somehow? Maybe another kind of PopUp component? Or do I really need to program the whole thing in actionscript(that would be just sad and sounds like reinventing the wheel)?
Is anyone able to simply point me in the right direction?
OBS: No need to teach me about skinning, designing.. or any of the rest. :)
No! Don't use a popup. Put a canvas somewhere hidden behind your bar of controls and just set it's visible to true when you mouse over the control.
I don't remember if the youtube slider covers the volume button or appears above it, but either way you can put it in there with a canvas.
If you want it to be one single component, the problem you run in to is that the size will be wrong if you hide the slider in the button component (It will be measured to be the size of the slider, instead of the button). But don't worry! Just override measure() and measure the button instead of both. Then if you set clipContent to false, it can display the slider outside of its bounds
What I suggest is to create a flex control that contains a graphic for displaying the volume meter and a hidden slider.
When you roll over the graphic volume meter you show the slider.
When you roll out the slider or the volume meter then you hide the slider.
I believe that's all

Resources