I am a newbee to react and CSS. I have a problem about styling. Here is how my webpage looks like now:
<TopMenu> is a commandBar component from Fluent ui7. <ControlPanel> is non-modal panel also from fluent ui7.
What I want to do is to let <App> component full of the rest place component, and NO scrollbar appears (I try to set height:100vh and something but it out of range of screen. I think it should subtract the height of topMenu but I don't want to do).
I also want to know if there any possible to auto resize the <App> when the controlPanel pop eject. How to write an option to switch two modes: 1) controlPanel on the <App> when it ejects 2) <App> resize and no overlap
I am not a front-end engineer and just want to write a visualization package facilitate my chemical research
Related
I have a grid of accordions like in the codesandbox below. The problem is when I open one of the accordions, it pushes down all the accordions in the row below, whereas the desired behaviour is to just push down the accordion right below it and the other accordions in the lower row staying in the same place. What needs to be changed in the following code to get this effect?
https://codesandbox.io/s/basicaccordion-demo-material-ui-forked-sw4juk?file=/demo.tsx
You can utilize the power of the Grid component to get your desired behavior. Nesting grids within grids is the magic sauce:
To do this with the material Grid component, the layout will need to be as such:
EXAMPLE (I forked your sandbox)
I wanted to create a layout where when the divs reach the bottom they will continue from the top. See my (super fancy) image I drew:
I got it working by using column-fill: auto. And now I'd like to add a dimmer on each item when being clicked. I'm using React and Semantic UI React for my app so I'm trying to achieve this with their Dimmer component.
My problem is that when I active the dimmer, it's not "dimmering" the whole item. I made a small CodeSandbox for my problem so we can debug this more easily. When you press the third item you can see that the part who is coming from the top is not dimmed. I assume it because the position of the dimmer is relative.
LINK: https://codesandbox.io/s/semantic-ui-react-yl0dj
I hope I described my issue well enough and that we can solve this together.
Cheers!
I am currently building a small web page using react-redux. In my page I am rendering two containers. One container has a button that on clicking causes a change in the state and as a result the content in the other container also changes e.g initially there is a div container with text hello my name is rishi bhatia. As soon as I click on the button the a separate div container with 4 links replaces the previously displayed div container. What are the possible ways in which I can add animations when the content in the container changes. All I am doing is displaying different div containers on state change.
You can implement componentWillReceiveProps(nextProps). Here you can define your animation when component receive props playing with state.
Even if your component is just presentational id doesn't mean it cannot use state for graphical purposes.
The calendar (so far) doesn't seem to account for collision detection when deciding the position of the calendar. For example :
In the screen shot you can see that the calendar goes off screen. Even if I disable horizontal scroll (overflow-x: hidden;), it still renders off screen.
Is there a solution to this without hacking away at the styles?
react-day-picker's DayPickerInput API now has classNames which allows you to change the name of the classes for the overlay and the overlay wrapper. You are basically renaming them so that in your own CSS/LESS file, you can use that name to style the overlay and have it use that instead of the classes in the react-day-picker-style.css (which you should not try to change as a best practice).
If you want to change the default props for the overlay (calendar popup), then you would do something like this wherever you are creating the component:
createElement(DayPicker.Input,
{ //all other props
classNames: {
overlay: "TheNewNameForTheClass",
overlayWrapper: "TheOtherNewNameForTheClass"
}
}
})
And then in your styling file, you would use TheNewNameForTheClass and TheOtherNewNameForTheClass to style the overlay.
First of all, I am sorry that this is not a 'question that can be answered' like it is written in 'How to ask' section, but I think that stackoverflow is the place where I will get the best 'answers' so please help me with this one;
I have in mind to make some Flex application which will be used as some kind of (powerpoint) presentation.
My idea is to make some kind of template which will hold basic stuff like header, footer, and mainContent...
Header will be probably 'static' which means that it will hold some constant values (strings). Footer will have few static strings and an option to display current slide / total slides. Main content would be just some Canvas and I imagine that easiest way to make all my slides is to make a component (which will extend Canvas) for each slide so I will be able to 'design' each slide however I want...
The most important thing is that I should be able to define a transition between slides (some of Flex effects - Move, Fade, etc). And maybe even extend that option to some other Flex libraries (maybe like Distortion Effects or similar).
And finally I should be able to define how much 'steps' each slide has... For example, when you click next, slide can switch to next slide or it can stay on same slide and change some values inside of it (like changing graph values or something).
I started to make my application and for now I made an XML file which holds a title and effect definition for each slide. I made 3 AS classes which are header, footer and mainContent. I was playing around with effects and counting pages and such basic stuff and for now things seems fine... But I am stuck with 'implementing' my canvases (slide content) to each slide...
Nevertheless, I don't ask you to make some code for me... I just want to know if I get the idea correctly... I would need just few guidelines how to 'set-up' my application so it could have all those features I need =)
Thank you very much for any help really!
Cheers!
You seem to be going well with it. Have you considered using a view stack as slide holder?
<vbox>
<header/>
<viewstack>
<Slide/>
<Slide/>
</viewstack>
<footer/>
<hbox-with-navigation-buttons/>
</vbox>
The base class Slide extends Canvas
The Slide class describes (abstract) methods to go to next/prev step.
Viewstack listens for navigation button clicks and passes it to current slide and changes slides only if current slide has no more steps.
Bind the header property of viewstack.selectedItem to the header
Bind viewstack.selectedIndex to the page number in footer.
I'd use a viewstack as Amarghosh suggested, but then also create a base class or interface for each of your slides that has a 'stepForward()' and perhaps a 'stepBackward()' function. That way you'll know each of your items in your viewstack has those functions available for you to call, but each viewstack item can implement these functions differently.
You can use the hideEffect and showEffect properties of the viewstack's children to define cool transistion between slides. Something like this:
<!-- wipe transistion effects -->
<mx:WipeUp id="myWU" duration="300"/>
<mx:WipeDown id="myWD" duration="300"/>
<viewstack>
<Slide id="slide_1" showEffect="{myWU"}" hideEffect="{myWD}"/>
<Slide id="slide_2" showEffect="{myWU"}" hideEffect="{myWD}"/>
</viewstack>
Will cause the wipe effects to be played when you switch from slide 1 to slide 2.