r/webdev • • Nov 22 '21

X-ray with clip-path

3.2k Upvotes

72 comments sorted by

261

u/superluminary Nov 22 '21

That's really clever. So you've got two absolutely positioned SVGs, with the skeleton on top, then you're using some JavaScript to move a clippath over the skeleton, so you only see the bit inside the frame.

I really like it, and the heart is an excellent touch.

-30

u/Crazy_Scientist369 Nov 23 '21

Can one include this project in his/her CV?

38

u/panzerex Nov 23 '21

Yes, if they’ve created it.

21

u/Tintin_Quarentino Nov 23 '21

Yes. If anyone causes any fuss just take my name.

150

u/prudentj Nov 22 '21

Not going to lie I got really nervous when it went into the underwear region...

47

u/SnipeyMcSnipe Nov 22 '21

do you have weenaphobia?

18

u/prudentj Nov 22 '21

I'm not sure fear is the right word... anticipation more like

1

u/augburto full-stack Nov 23 '21

weenacravings?

0

u/SlashdotDiggReddit full-stack ... aren't we all? Nov 23 '21

More than likely they thought it might be NSFW.

15

u/dailydrudge Nov 22 '21

Also lingered there a bit longer than expected

1

u/MsWeather Nov 23 '21

Everyone is curious. I love his little heart the best.

15

u/kumonmehtitis Nov 23 '21

Someone needs to go back to anatomy class… there’s no bones there, pal.

13

u/prudentj Nov 23 '21

But artistic license is a thing...

7

u/atw527 Nov 23 '21

Yup, for example the heart.

1

u/Kody_Wiremane Nov 23 '21

Maybe an implant…

-3

u/PowerfulProfessor305 front-end Nov 23 '21

LOL 😂
This Sub-Reddit is not for that kinda stuff so chill 🤙

65

u/PhoenixDBlack full-stack Nov 22 '21

It looks amazing, but for some reason I really expected a bulging cock in the nether-area

22

u/dailydrudge Nov 22 '21

Reddit will do that to you

6

u/pelijr Nov 23 '21

What is "Something I hear too often after dates" for $500 Alex.

0

u/Agile_Persimmon2196 Nov 22 '21

looks amazing, but for some reason I really expected a bulging cock in the nether-area

lol

20

u/timmense Nov 22 '21

Why did you choose to do Number(position.replace('px', '').trim())) over parseFloat(position))?

11

u/[deleted] Nov 23 '21

I did not realize parseFloat ignored characters like that. I'll have to keep it in mind.

5

u/timmense Nov 23 '21

Maybe it was to make the intent clearer. Still I think parseFloat requires less cognitive overhead.

1

u/Affectionate_Ad_5358 Nov 23 '21

I think simply coalsecing with + works too Check the output of +"123.45px"

2

u/timmense Nov 23 '21

I get NaN for +"123.45px". Or did you mean +position.replace('px', '')

10

u/StaticCharacter Nov 23 '21

It should actually be [...position].filter(function someRandomUselessName(eachElementInTheSpreadStringISuppose) { return [..."0123456789"].includes(eachElementInTheSpreadStringISuppose) && eachElementInTheSpreadStringISuppose.test(/^\d+$/) }).join(String(""))

|| I wrote this mobile and halfway no longer thought my /s joke was funny but I spent so much time fat thumbing it out that I am committed to making 5he comment ily glhf ||

1

u/Humpfinger Nov 23 '21

Thank you now my eyes hurt

76

u/bkdotcom Nov 22 '21

I spotted a bug.
When you hover over his chest, his heart shows up.
No other muscle tissue is visible elsewhere.

/s

6

u/e0b1ff Nov 22 '21

Surly that's a valentine's egg, not a bug

2

u/bkdotcom Nov 23 '21

Shirley you can't be serious.

0

u/HighOnBonerPills Nov 23 '21 edited Nov 23 '21

Don't call me serious.

32

u/hutilicious Nov 22 '21

Cool i really need to pack this into my next project no matter what the project is about

16

u/[deleted] Nov 23 '21

ok we gonna make a landing page for customer's business but what do you guys think of a man with just white underwear and x-ray feature?

12

u/DonnaxNL Nov 22 '21

He even blinks :o

4

u/Lake-ctrl Nov 22 '21

He’s smiling at me with such confidence

4

u/datax_ Nov 23 '21

Imagine the radiation

2

u/Guilty_Serve Nov 22 '21

I had to do a similar concept that I’m guessing you used, but during an interview. The difference was I had to magnify an image. Hardest interview of my life. I figured it out eventually, but it almost made my full-stack self with strengths in backend, buckle under pressure.

4

u/_Invictuz Nov 22 '21

Please share, I wouldn't even know where to begin!

1

u/Guilty_Serve Nov 23 '21

2

u/_Invictuz Nov 23 '21

Wow, it actually doesn't look too complicated from the amount of code. Thanks for sharing!

2

u/Squagem Nov 22 '21

Really clean man

2

u/locadelosgatos Nov 23 '21

I made something like this for work but on real images and using caman js. I work at a dental imaging software company. The glass could also magnify the image at the spot.

2

u/feral_y33t Nov 23 '21

Very very nice work! Always love seeing awesome shit like this 🙌

2

u/djibyt Nov 22 '21

those things are the reason why i love web developement😍

2

u/ComplaintInfamous Nov 23 '21

Where is the weewee?

1

u/knucklecuts Nov 22 '21

This is awesome! Great work

1

u/corinne0124 Nov 22 '21

Omg the beating heart 😍

1

u/Giobee Nov 22 '21

Awesome

1

u/Brumbleby Nov 22 '21

Love it! Great design

1

u/[deleted] Nov 22 '21

That is fricken cool.

1

u/dailydrudge Nov 22 '21

Very nice! Would also be a cool nighttime effect; i.e. mostly dark, and the cursor is a spotlight / flashlight to illuminate the darkness.

1

u/[deleted] Nov 23 '21

❤️❤️❤️Love this use of clippath + nice touch with blinking eyes too!

1

u/misterpobbsey Nov 23 '21

There’s a flash game on newgrounds that’s kinda like this…

1

u/[deleted] Nov 23 '21

That's so impressive!

1

u/bubbaholy Nov 23 '21

You could probably do the same thing with fixed background attachment

1

u/haris_hash Nov 23 '21

Beautiful

1

u/MrSpoopyBeard Nov 23 '21

Carefully checks twice for penis bone

1

u/JB-the-czech-guy Nov 23 '21

what a wasted opportunity for a surprize dick joke (like a bone in the pelvis zone)

1

u/kinduff Nov 23 '21

you missed a bone

1

u/summonthejson Apr 09 '22

It was an exciting video :)

0

u/[deleted] Nov 23 '21

[deleted]

1

u/Dontwant2leave Nov 29 '21

There are tutorials in the comments. The magnifying glass one from w3schools goes over html css and JavaScript required for something like this