I want to click on the first rectangle and click on the second rectangle, they will be connected by
anyone can help me ? pls
50 Replies
Not quite, can you please elaborate? https://discord.com/channels/436251713830125568/1022288836715356180
i want this
Suppose the first image contains the question, the second image contains the answer, and I want to click on the first image and then click on the second image, a line connecting the first image and the second image.
Look into the ::before / ::after selectors, maybe .I am off now.
tks u
Oohh so u want to like when u click on the first box , the line to show up
And when u click on the second the line to go away and show on second box
Yeah u could play with opacities of psuedo elements
For a click trigger you proly need js. Or maybe :focus pseudoclass. Not difficult.
would go for transform scale rather than opacity to get the scaling animation. But whatever suits one.
Love the way u think
:this: :thumbup:
No, I want when we click on the first image and click on the second image, we will connect together
here is something i once made
i never thought I'd be sharing this lmao
Exactly, I want to join 2 blocks together but I want the 2 blocks to have a fixed position
glad it helped
since i coded it a long ago, the code may not be in the best shape
i hope u can still understand
tks u
welcome
i can firmly say i got 0 clue wth is going on in that code
More specifically, I want to connect the left block to the right using a black seam
i would've used canvas
instead of normal html elements
let me try to make things simple for you
try to instead make a function
a function that takes two point(object). each point will have an x,y position
so u have 2 input points, the function will draw a line from point a to point b
work on making that function as a separate project
perhaps u can do it with codepen
by doing so, once u get able to make such a function, all just need to copy paste it in your current project, you'll pass the position of the left and right block to the function and it'll draw it for you
tks u so much
i will try
i thought it would be a nice project for me as well so i came up with a solution of my own.. lemme know yours so i can share mine
tks u
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="./styles.css" />
</head>
<body>
<div class="app">
<main class="project">
<div class="project-questionTest">question test dispplay here</div>
<div class="project-tasks">
<div class="project-tasks-questionsList">
</div>
<div class="project-tasks-results"></div>
<div class="project-tasks-questionTitle"></div>
<div class="project-tasks-answers">
</div>
</div>
</div>
</main>
</div>
<script src="app.js"></script>
<!-- <script type="application/javascript" src="/js/answers.js"></script> -->
</body>
</html>
I haven't drawn the seam line yet
m talking bout the line making function
this..not the whole project
I want you to check it out to understand the problem better
make a codepen
m in a trip rn.. perhaps someone else can check
tks u so much
welcome
do let me know if u manage to code a function that draws a line
I don't want u to stop trying yourself so i won't show mine here
Currently I want to connect many points together, I will save the positions of the points, then I use a loop to connect them all into 1 pair.
if u can make a function that connects two points
u can use it on multiple points
so try to make a function that works with 2 points just
make it a separate project
this will help u focus more on it
okay , i will try
leader-line is a simple js library I used in the past
https://anseki.github.io/leader-line/
LeaderLine
Draw a leader line in your web page.
Currently I have connected the two images, but I want to draw them on the right edge of the first image and the left edge of the second image, can you help me?
@glutonium
i want this
give the cards higher z index than the line
i don't understand :((((
i.e. I want the start point to be at the edge of the first shape and the end point to be the edge of the second shape
increase the z index of the cards
i don't see any z attribute :(((
Please help me with this part, I tried my best, I spent many days doing it
Maybe you misunderstood me
I mean the starting point on the first shape will default to the right edge, and the left edge of the second shape when they are joined together
Pseudo element with url to svg <path /> or <line />. could use JS to find the values of where the target ending point set as a custom property to update it? That’s my first thought anyway.
Thank you everyone for your comments, thank you very much. I have completed the assignment
Do show!
I will leave the codepen link when completed
since u have solved the issue
this is the function i had came up with previously