Get Canvas to stick next to other canvas vue.js - css

I have a project that use multiple canvas elements. I have one canvas called gutter and then multiple groups of canvas that render as many times as needed. Each group contains three canvas layered over each other. I am using vue js and vuetify to work with all this. What I want is to place the canvas called gutter next to the first group of canvas. I have tried floating both elements to the left and that has not worked and variety of different div configurations and also display properties such as flex block and flex inline with no luck. I attached a picture to try and illustrate what I am doing, on the far left is the gutter that I want to move next to the other canvas. The blue boxes illustrate the groups.Each group has a name that renders on top of it.
rendered layout in inspector

Related

Accordions in a Grid pushing content down

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)

Show image in Square grid (React + Material UI Grid)

I use React + [Material UI Grid][1] to show my images, the images are in different sizes, and I want to:
Keep image ratio
Make image fit the parent container square(in other words, all images in a row with the same height)
The problem is that, The number of columns in Grid is variant, sometimes 3 columns(on mobile) and sometime 6 columns(on PC), React calcuate the width of image Dynamically. I don't know the run-time image width, so i can not set the image height in my css style excatly. any idea? thanks.
You can see the following effect currently, a very tall image makes the grid streched vertically, very ugly.
Use this code. It centres the image inside the Grid and doesn't let it overflow while also not giving the dim in pixels. Although the dimension is fixed to square(a x a) but can be changed.
I had the same issue in the past so I am sharing my own code.
Hope this will be useful as I have used CardMedia with component type img. You can select the relevant CSS if not complete from inspecting.

Container and sidebar at right side

I am trying to achieve something, I want a main container and a sidebar at the rightside. which should deal with mobile layout as well, I was unable to find such thing or make it. The blue print is given in the image below. Thanks
BluePtint of what im trying to make
You can create this layout using div's with different ids or classes- your main body(red) could go in a div with class "#mainbody" and your sidebar(blue) would go in another div with class "#sidebar", then you can specify the dimensions in CSS.
Have you checked out a CSS framework like Bootstrap? Bootstrap makes it super easy to specify column widths with their grid system, so instead of having to state px or % width in CSS, you can add the class "col-md-3" to a column for a width of "3". Their system is based on units of 12, where 12 would be a full bar, 6 would be half etc: https://getbootstrap.com/docs/4.0/layout/grid/

Add fixed sized items to grid layout in correct row

I am trying to create a grid layout of images kind of like how google images does it.
I want to add fixed sized images left to right, top to bottom but I am having trouble is figuring out when adding another image to a row would make it not fit and then decide that that images should be placed in a new row.
Also when the window resizes it should move images into/from rows based on how many it can fit in.
Ive got a scroll area with a grid layout in it which is fine if I know what can fit, but I can't figure out how to make it move items if say the window width is shrunk, and say an item needs to be moved down 1 row which moves other etc.
Assuming you are using QWidgets I'd suggest you to use QListView which does the layouting for free, if you want more control on how items are displayed use a QItemDelegate. For QListView the view mode should be set to QListView::IconMode so that you have a grid of items and not a list.
But if you are using QtQuick things are much easier, a GridView with Image delegates would do what you want really quickly and using GPU power to build you UI.

Place grid over map using CSS?

I have a world map image. I would like to place a SQUARE GRID over the entire map. I would like each square (cell grid) to change via mouseover with a border color change and background color change.
The grid needs to be layered over the map, transparent except the borders (which is the grid).
Can I achieve this using CSS or there a better way to do this?
Many thanks.
Erik
I'd suggest using a CSS grid framework as an easy way to produce the grid layout. I'd go for this one as you can easily use create a grid with 0px gutters.
You will need to modify the CSS to make the grid absolute positioned so it sits over the top of your map.
Each element in the grid is a DIV so you can easily attach Javascript events to each one to allow users to control the map. If it's a simple colour change on hover then just use css.
You can make the grid transparent using css too: http://css-tricks.com/css-transparency-settings-for-all-broswers/

Resources