How can I make a blur background that appears onPress of a button and when clicking back on the background it un-blurs it? - reactjs

I also want to when I click on the background and there are other pressable things/buttons on this background, they are not being pressed unless the state is back to when it is un-blurred (basically: only the blurred background can be pressed when the screen is blurred). If you need an example look at twitter mobile: when you click on the post (+) button, it blurs the background but when clicked back it un-blurs it. (Must work for IOS and Android).

I think you need this..
In CSS create 2 classes - First one with the blur and second one without.
In React create 2 functions - 1 onclick for the blur-button and 1 onclick for the close button. These functions should change the class of body.
$('.button').click(function(){
$('body').addClass('blur'); });

Related

Overlay button on button in Material UI

Currently I'm trying to overlay a button on another button in Material UI:
https://codesandbox.io/s/responsivedrawer-demo-material-ui-forked-inc7xz?file=/demo.js
I'd like if pressing the X would only print B, rather than printing A and B. I know nesting buttons is not the correct way to do it, but I'd like to overlay the button with the exact look and ripple behavior I'm currently seeing with the nesting. I like how it looks so well aligned on the right, clicking the X doesn't ripple the effect to the entire ListButton the ListButtons takes up the entire drawer width without any extra work, and clicking the ListButton ripples under the X.
I'd really appreciate it if someone has the time to help. Thanks so much!
The solution would be to stopPropagation inside the onClick function since this is where the click event happens.
onClick={(e) => {
e.stopPropagation();
console.log("B");
}}

MUI button transition on focus

I have a basic create-react-app with Material/MUI text field and button. When I tab from the textfield to the button, it creates an animation on the button where the middle part slightly grows and shrinks. I'm trying to figure out how to get rid of that animation and just show a simple button that has focus. Toggling the options in Chrome debugger hasn't helped me track down where this animation is being created (focus, hover, etc.). In fact, anytime I change any property in the CSS panel it turns the animation off and makes it harder to track down what is causing this.
Thanks.

Light box image automatically change to the next image

Is there a way to get lightbox to automatically move on to the next image without the need for pressing the arrow buttons to move on?
The view I'm asking about is when one has already clicked on the already moving carousel to get the lightbox(Image attached below).
View of lightbox I want to automatically move to the next image.
Thanks
The Lightbox API doesn't expose this feature but you can programmatically click on the 'next' navigation button with Javascript. This could be done on a timer with setInterval.
// Simplified code
setInterval(() => {
$('.lb-next').trigger('click');
}, 2000)

Having an issue with navigation buttons while using Lightbox 2

I have a slideshow of 12 images in place. When I click on the first image, the right arrow pops up which allows me to scroll to the next image. When I do so, the second image has no next button. The same is true for every picture except the first. The really odd thing is that when I hit the X button to close out, it scrolls to the next image. The previous button works correctly on all of the pictures, but there's something wrong with both the next button and the close(X) button
"Next" button is overlapping with "X" button.
If you hover a little lower from "X" button the "Next" button will appear.
I solved this by adding a position:absolute to .lb-prev, .lb-next to lightbox.css

How to adding navigation bar button having ionic-on/ ionic-off functionality

I want to add star button on navigation bar and when user press on this, the button show selected icon and next time is press it show unselected.
I tried it by using ionic-on and ionic-off but I can't make it.
The icon-on and icon-off attributes only apply to tabs I think. You can use ng-class like you see here. Based on the value of your $scope.starred property, it will show a star or the outline of a star.
<span class="icon" ng-class="{'ion-ios-star': starred, 'ion-ios-star-outline': !starred}"></span>

Resources