A
A
Axepec2017-08-24 17:01:43
Layout
Axepec, 2017-08-24 17:01:43

Stop tap from the designer, beautiful, but you need adaptive?

I love difficult puzzles, but here I am breaking my head for the second day. I love it so that everything is clear)
You can do it with a swing and as if few people will probably notice, but this is not my approach.
There is a design:
4b86638bdc5b4a0b8f14edb00eeea9af.png
I’m interested in how to do it, so that even when the page is resized in width, the line would clearly come out of the lower right corner, then enter the lower right corner of the block, and break it through the upper left corner ... in general then.
It is clear that you can’t do without js, but I can’t even understand how to count, and what is the best way to draw it

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Ankhena, 2017-08-24
@Axepec

With the thickness of the lines, you still need to have some better fun https://jsfiddle.net/o3yuuuff/

G
GavriKos, 2017-08-24
@GavriKos

If the proportion of the central block differs from the proportion of the window, then it is impossible to do this with one line.

S
Stepanya, 2017-08-24
@Stepanya

Draw 7 parallel lines

S
sergski, 2017-08-24
@sergski

Cool problem, I tried to throw a solution, but somewhere there is a flaw.)
An attempt here

K
kmg4e, 2017-08-24
@kmg4e

For starters: the designer should draw 2-3 options for different screen sizes.
You can do without tricky JS if you calculate the location purely mathematically.
For example, if the square is centered, then the lines will always come out of the corners.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question