how to approach this complex layout ?

i have tried made the character and the button absolute and the other as a background, but the result if we resize it will stretch and look so bad....
84 Replies
ἔρως
ἔρως2w ago
which layout?
kamekameha
kamekamehaOP2w ago
No description
ἔρως
ἔρως2w ago
that's an huge emoji
kamekameha
kamekamehaOP2w ago
yes it's
ἔρως
ἔρως2w ago
i would just use grid
kamekameha
kamekamehaOP2w ago
yes can you elaborate more, i never use that kind of approach before is there any kevin video should i watch first ?
ἔρως
ἔρως2w ago
good question but i would work with grid areas
kamekameha
kamekamehaOP2w ago
so if use grid we need export all of the component
kamekameha
kamekamehaOP2w ago
No description
kamekameha
kamekamehaOP2w ago
?
ἔρως
ἔρως2w ago
you can try with svg, if you want you can shove a link inside it, using a <foreignObject> but i'm pretty sure it has native support for <a> then you can position everything as if it was an image
kamekameha
kamekamehaOP2w ago
No description
kamekameha
kamekamehaOP2w ago
i will show 3 on desktop and if resize with current approach, it's so broken ok so there is 2 approach grid and svg ?
ἔρως
ἔρως2w ago
there are more, but those are the easiest ones
kamekameha
kamekamehaOP2w ago
yes which one is the easiest first let me try that first
ἔρως
ἔρως2w ago
you can also have everything as a background image
kamekameha
kamekamehaOP2w ago
but i can't click the sign up ? isn't ?
ἔρως
ἔρως2w ago
that will have to be separated
kamekameha
kamekamehaOP2w ago
can you give an example tutorial video from grid approach and svg approach
ἔρως
ἔρως2w ago
the svg approach: right-click, copy as > copy as SVG the link will have to be added manually later on
kamekameha
kamekamehaOP2w ago
owh ok, is it will responsive and sharp and good ?
ἔρως
ἔρως2w ago
well, it depends, a lot it will scale, but not sure if that's what you want the svg approach isn't a good approach anyways
kamekameha
kamekamehaOP2w ago
ok let's do the grid one
ἔρως
ἔρως2w ago
the grid is easier draw lines around the area of each element for example, the emoji has an area around it the weird floaties are another one the button is another one
kamekameha
kamekamehaOP2w ago
wdymean the weird floaties do you have starter video of how to use grid i'm familliar with flex not grid
ἔρως
ἔρως2w ago
do you know what a grid is? like grid paper? or grid on a design program? just grid in general
kamekameha
kamekamehaOP2w ago
a grid maybe it's a matrix what i imagine never heard never heard too
ἔρως
ἔρως2w ago
so, something divided like this
No description
ἔρως
ἔρως2w ago
does the hat really have to leave the pink area?
kamekameha
kamekamehaOP2w ago
why svg approach not a good apporach, is it because we can't click the button ?
No description
kamekameha
kamekamehaOP2w ago
yes it's
ἔρως
ἔρως2w ago
and not just that the text isn't text when you copy, which means that screenreaders can't read it usually, it's converted to a path to stay close to the design also, if you need to change something, you have to change everything
kamekameha
kamekamehaOP2w ago
owh ok what do u mean by need change something, i have to change everything ?
ἔρως
ἔρως2w ago
imagine you want to move one of those floating thingies or change the emoji or just change the text you will have to change the whole svg as many times as it shows and if you changed the code manually, for any reason, you will always have to remember to change it this can be mitigated with symbols, but that has to be done manually
kamekameha
kamekamehaOP2w ago
ahh ok, i think better grid approach, i'm not familliar also with svg things....
ἔρως
ἔρως2w ago
how do you want this to be responsive?
kamekameha
kamekamehaOP2w ago
3 in desktop 1 in mobile so desktop > 1000px mobile < 1000px
kamekameha
kamekamehaOP2w ago
so when the card got resize
No description
kamekameha
kamekamehaOP2w ago
it's still stay lock
kamekameha
kamekamehaOP2w ago
No description
ἔρως
ἔρως2w ago
so, they always stay the same size?
kamekameha
kamekamehaOP2w ago
yes it's can shrink maybe if it's to tight ? or what is the best approach usually ?
ἔρως
ἔρως2w ago
honestly, it depends a lot on what you want to me, this is too much work to implement it looks pretty, but doesn't look easy
kamekameha
kamekamehaOP2w ago
so what is the step by step to solve the issue ? - export all the component - put it into the grid - and then check on resize ?
ἔρως
ἔρως2w ago
well, first you have to figure out how you want it to look like at small sizes, like 320px
kamekameha
kamekamehaOP2w ago
at mobile size it should be start from 999px and resize till 0px can be resizesable show only one card on mobile but at desktop just keep it 400px for example
ἔρως
ἔρως2w ago
so, at 999px the card will have what size?
kamekameha
kamekamehaOP2w ago
full width 100%
ἔρως
ἔρως2w ago
but the original size is about 490px of width so, it will now be stretched to about 980px? (assuming some space on the sides so it looks better)
kamekameha
kamekamehaOP2w ago
yes it's for mobile we only show one card
ἔρως
ἔρως2w ago
what will happen to the other ones?
kamekameha
kamekamehaOP2w ago
no need we only 3 on dekstop and one on mobile so i just display none
ἔρως
ἔρως2w ago
well, if it has to resize, it will be a massive pain in the ass
kamekameha
kamekamehaOP2w ago
for dekstop or mobile ?
ἔρως
ἔρως2w ago
both i mean, it will be a pain to make both but if it has to fill the width of the mobile size, then that's a massive pain
kamekameha
kamekamehaOP2w ago
owh ok i thought the grid would lock the element
ἔρως
ἔρως2w ago
it's the sizes of the other elements that make this a pain not the grid
kamekameha
kamekamehaOP2w ago
so then what is the best or efficient way to solve the issue ? i think the first step to arrange grid is make it all the element arrange to bottom and give them width
kamekameha
kamekamehaOP2w ago
No description
kamekameha
kamekamehaOP2w ago
is this will be the fundamental layout (using grid) ?
No description
kamekameha
kamekamehaOP2w ago
@ἔρως
ἔρως
ἔρως2w ago
the problem is that you want the hat to leave background that makes everything a lot harder and the floaties too
kamekameha
kamekamehaOP2w ago
ok so what if hat stay inside ? and which part do you mean floaties ? i don't get it i guess the image need relative and make it right 0 and 50%
ἔρως
ἔρως2w ago
those weird kite shapped thingies with a background i mean, inside the circles
kamekameha
kamekamehaOP2w ago
No description
kamekameha
kamekamehaOP2w ago
so if like this it will be more easier ?
kamekameha
kamekamehaOP2w ago
No description
ἔρως
ἔρως2w ago
what are these for?
No description
kamekameha
kamekamehaOP2w ago
just styling to make it more crowded
ἔρως
ἔρως2w ago
why?
kamekameha
kamekamehaOP2w ago
just for better ui
kamekameha
kamekamehaOP2w ago
ok so if like this means grid 1fr 1fr
No description
ἔρως
ἔρως2w ago
what is this for?
No description
kamekameha
kamekamehaOP2w ago
that will be a category
ἔρως
ἔρως2w ago
and if im not mistaken, the emoji takes 60% of the width?
kamekameha
kamekamehaOP2w ago
around that
No description
ἔρως
ἔρως2w ago
and each thing has a different space :/
kamekameha
kamekamehaOP2w ago
yes it's
No description
ἔρως
ἔρως2w ago
so, going for the easier option
ἔρως
ἔρως2w ago
No description
ἔρως
ἔρως2w ago
like this, with grid area names
No description
ἔρως
ἔρως2w ago
or maybe the top zone should have a different name
ἔρως
ἔρως2w ago
or something like this
No description
curiousmissfox
YouTube
CSS Grid videos
The CSS Grid is here, and it's awesome. This playlist is a collection of all the videos I do where I use the CSS Grid, whether it's a tutorial specific to us...

Did you find this page helpful?