How to display images as the same size in a V-Card - vue.js

This should be a simple fix but I can’t figure it out. Please excuse my lack of posting my whole code.
Here is the issue. I am using the following
`
<v-card>
<v-img :src=“{{person.png}}”</v-img>
<v-card>
`
I have an array of users with profile images. Some of these images are different sizes ( some may be 400w other maybe 250w ). My issue is that because these images are different sizes, that they actually end up making my cards ( which are uniform in size ), different widths and height. This makes the cards ugly of course, and I need help on how to fix this.
Now, I had a friend build a react project, and I providing him with pictures, but the sizes were off. I fixed this by importing all images into Figma and making them all the same height and width, which, worked. However, for this project, this method isn’t working for me and I need a way to auto size these images so that my cards stay uniform.
I do not want to use the v-avatar feature, so please refrain from asking me, because these aren’t really “avatars”.
One “solution” I found was to use “contain” but I can’t find any information on contain in the documentation and I’m not sure if that would even work.

Unfortunately in some edge cases you cannot depend only on the components provided by a framework and you need to improvise. This issue sounds purely like a CSS one. Instead of using vuetify component you could try to create own component and just apply the avatar image as element's background-image inline property. Then you could use background-size: cover in order to preserve correct ratio of uploaded images.

I never found a 1 size fits all fix for this, but this is what I did to make it work out.
1. I imported all images to figma
2. I edited the images to all be the same size, then used the crop tool to "fit" them to the new "canvas" size
3. Within my v-img , I added "contain", which insured that the picture didn't get cut off or cropped when placing inside of a card.
Thanks for the help all.

Related

Bootstrap Photo gallery: responsiveness on desktop has bug

Every time the window is sized from big:
http://res.cloudinary.com/liberationfront/image/upload/v1497626018/vb1_t29xlz.png
To small:
https://res.cloudinary.com/liberationfront/image/upload/v1497625905/vb2_gtmjrl.png
There is all of a sudden a gap.
The problem is likely that your images don't all have the exact same aspect ratio, so some of them end up a pixel taller than others in some cases. Then the floated columns don't clear properly.
You can either re-crop your images, which is a fragile solution since you then rely on all future images being perfectly cropped, or you can set your cards' height through CSS and let the images flow to fit. Often using background images gives much more flexibility.
I suggest looking into Bootstrap's responsive embed and setting your images as backgrounds on a child element. Create your own 1:1 class if needed.

Positioning items dynamically for different screensizes

Good morning!
I'm currently trying to create a view similar to this mockup.
I have put down 3 different screen sizes so you can see the issue.
I have a header background image (grey box) with an angled bottom. On the right I want to display an image, which obviously needs to be positioned.
Positioning it horizontally is no issue but how can I position the image vertically? I have it positioned fixed for one screen size but obviously need to make it flexible.
Any ideas? Help would be much appreciated!
David
You can definitely use measure as #rajesh pointed out, or you can use Dimensions. As far as getting the layout consistent across devices, using position absolute and measuring the device height should allow you to get consistency across these devices.
Check out this example I set up, it should be a good starting point at least.
https://rnplay.org/apps/pSzCKg

Bootstrap addons not working properly on different resolutions

It looks like there is a bug in Bootstrap. If you change resolution, for example with ctrl + (+/-) in your browser the addons are not properly adjusted. It looks like this:
Notice the wrong sizes of addons.
Is there a simple way to fix this?
No, there is no simple way (and quite possibly no way period) to fix problems related to the type of zooming that you're referring to (as opposed to the viewport-width-based zooming that you get when using the pinch gesture on touch-based devices).
Per Bootstrap's documentation:
Page zooming inevitably presents rendering artifacts in some components, both in Bootstrap and the rest of the web. [... these issues] often have no direct solution other than hacky workarounds.
Zooming in and out is not changing the resolution at all its zooming and is completely different from changing the view port's aspect ratio and dimensions.
Give the input area a fixed width like input {width:100px}

How does image sizing work?

I'm not the best at using bootstrap but trying to learn. I have a row and 3 col-md-4's I put a image in each column and they look and fit great with the thumbnail class. But without that class the images are their full size and overlap and when I scale the browser down they stay big and you have to use the scroll arrow. I thought the col-md-4 would determine the display of the image but it seems not. When not using the thumbnail class do I have to just resize my photos to the size I want them to display? Please help me understand. Thank you
Try using max-width="100%" (or the class img-responsive). See the bootstrap docs for more info.

Bootstrap 3.0.0: How to use data-slide-to outside of indicators?

I am attempting to make a small gallery like the one shown below -
I'm sure you've all seen them considering they are fairly common. When trying to make one using bootstrap I ran into a major problem. I can't seem to link the smaller bottom images to the larger top one that was when one of the smaller ones is clicked it changes to the selected image. I am attempting to use data-slide-to however it does not seem to work outside of the "carousel-indicators". I can't put it into the carousel indicators list because that moves the images up into the gallery (It may be possible to fix this with CSS but my attempts have been worthless). Does anyone know the problem? I've tried tags around each image that didn't seem to work then I tried divs. Still nothing.
Things I've tried:
encasing images in .
Moving the smaller images in and out of carousel inner.
Making a custom class for the smaller images.
Things to note:
I am using 3.0.0
All images are generated (if you haven't guessed already)
Smaller images are separate from larger one (not auto scaled down)
Things I plan on trying:
data-target
changing id
Changing class of div tag that encapsulates everything.
As it turns out bootstrap requires you to id the carousel as "myCarousel" and then use data-targets for each image. After changing the ID and setting the data target the gallery now works.