AviKKi / hover-preview

A vanilla js library to show preview images on hover
7 stars 17 forks source link

Add an animated gif example on readme #2

Closed AviKKi closed 3 years ago

AviKKi commented 3 years ago

Readme should have a gif/video demonstration of what this library does.

panvicka commented 3 years ago

Hello, can I work on this? Would you like just the gif of the black square with hover me text and the 1+2+3 dummy images or some nice "real-life" example?

AviKKi commented 3 years ago

Hey @panvicka I'm assigning this one to you

A real life example would be really great, remember it's more of a showoff thing, so an actual looking site like youtube or tumblr would be great.

panvicka commented 3 years ago

Hey @AviKKi I have created this demo site. and generated this gif screen_gif

Do you like? If so I will make PR with the gif inserted into your README. You can grab the repository with the demo site from my git anytime.

BTW I tried following your README but I havent got it working with the
<script type="text/javascript" src='https://raw.githubusercontent.com/AviKKi/hover-preview/main/dist/hover-preview.min.js'></script> because I was getting this error (Windows, Chrome) Cross-Origin Read Blocking (CORB) blocked cross-origin response https://raw.githubusercontent.com/AviKKi/hover-preview/main/dist/hover-preview.min.js with MIME type text/plain. See https://www.chromestatus.com/feature/5629709824032768 for more details.

I have tried a bunch of stuff from StackOverflow. Like adding type=aplication/javascript to the script tag but it did not work. I ended up copying the hover-preview.min.js into the project. Did I do anything wrong? I am fairly new to this stuff (as you can probably tell, haha).

I think that the X-Content-Type-Options: nosniff in a response header is causing the trouble.

AviKKi commented 3 years ago

Yes that looks really nice add it to readme and make a PR.

Yes I'm aware that you can't directly use raw.githubusercontent.com for hosting static JS files. I'll add this to a CDN after proper version release. Till then I should just change the readme.