GithubHelp home page GithubHelp logo

joshbuddy / spoiler-alert Goto Github PK

View Code? Open in Web Editor NEW
473.0 473.0 51.0 483 KB

SPOILER ALERT! A happy little bit of javascript to hide spoilers on your site.

License: Other

JavaScript 97.15% Makefile 2.85%

spoiler-alert's People

Contributors

joshbuddy avatar pborreli avatar plainspace avatar robey avatar rolyatmax avatar roryokane avatar varemenos avatar vheissu avatar zogstrip avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spoiler-alert's Issues

change mouse pointer on hover to suggest clicking

When I first hovered over the sample spoilered image and saw it get less blurry, I wondered “why is the unspoilered image blurry?” Then I tried clicked on the image, and that got me the actual image. It didn’t occur to me to click on the image at first, because the mouse pointer was a normal arrow. A pointing hand cursor would have fixed that. Text also has this problem – it currently has an I-beam, leading one to expect that you can select the text, but that clicking won’t do anything special.

This CSS changes the cursor appropriately on hover, given the call $('spoiler, .spoiler').spoilerAlert():

spoiler, .spoiler {
    cursor: pointer;
}

Apply that CSS property to the selected elements is probably the easiest way to implement this. That would mean calling jQuery’s css function like $element.css('cursor', 'pointer').

I’m not quite sure where in your JavaScript code it would go. My best guess is right after this line – you would write $spoiler.css('cursor', 'pointer').

Re-enabling spoiler alert initializes on the wrong blur.

When hovering over a Spoiler Alert, the max blur changes to the partial blur. When clicking the blur is removed. When clicking again, the blur is restored. It is then set to the max blur, which is a bit unlogical, because when I clicked, I was hovering over the blurred item, so I would expect it to be set to the partial blur.

remove blur completely

a blur of 0px still looks a little odd in chrome -- slightly boldface and blurry. if i remove the "filter" style from the element, it looks normal again.

a guess: chrome is rendering pixels when it does the blur, even at 0px, only without a filter, does it render in normal retina text.

fix would be to remove the "filter" css-es when the transition is complete.

Add time option to hide the voucher after some time

Add time option that when you click on the text/image, the text/image will be only visible for a provided time in seconds and it will be blurred after the time expires. Its good for sensitive information. The time should be in seconds or miliseconds

Possible to remove hover and click events?

After seeing the browser support, I thought maybe I could use this to get blur effects on images, which this plugin does quite well. I'm just wondering if its possible to remove hover and click events altogether for some initialization?

Should support for users with JS disabled be considered?

In the Hacker News discussion someone mentions support for browsers with Javascript disabled seeing the teaser text and I think it's a legitimate concern. I posted a proof of concept in the thread, and will post it here for discussion. This is a purely CSS only solution for users with Javascript disabled.

What do you think of this proof of concept?

this is teaser text
.teasertext { background: #000; color: #000; }
.teasertext:focus { background: inherit; color: inherit; outline: none; }

I think perhaps it could reveal the text a little bit when you hover over it by perhaps bumping up the color of the text to 444 and background to 333 or something. Or RGBa values could be used instead or perhaps for text the text-shadow (although not widely supported) could also be considered.

Blur effect on text is too heavy

I just checked the demo and it seems to me like the blur in the text is so heavy, the text is barely visible. It requires quite a bit of focus to tell if there is supposed to be a blurred text in there, or not. Imho, I think the "un-hovered" blur value should be at about 6px and go down to 2-3px when in hover state.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.