matchu / Strict-Workflow

A Chrome extension that helps you stay focused by blocking sites during work timers and letting you browse during break timers
https://chrome.google.com/webstore/detail/cgmnfnmlficgeijcalkgnnkigkefkbhd
Other
193 stars 97 forks source link

Minimal blur effect added to the blocked page overlay #20

Closed dmfrancisco closed 9 years ago

dmfrancisco commented 11 years ago

This is just an idea. It blurs the blocked webpage content using a -webkit-filter. Screenshot:

Blurred blocked page

Feel free to reject this pull-request :)

matchu commented 11 years ago

I like the effect, though it needs a bug fix before it's ready:

  1. Open a tab with a blacklisted site.
  2. Start a work timer. (The overlay and blur are applied as expected.)
  3. When the work timer ends, start a break timer. (The overlay disappears, but the blur stays — uh oh.)

I'm not sure if you noticed this hidden feature yet, but it's helpful for debugging: the work/break timer durations can be set in seconds with the syntax "0:05" representing 5 seconds. Just for reference.

Thanks, bro!

dmfrancisco commented 11 years ago

Oh I didn't noticed that :P Ok but it should be easy to fix. I will add a commit to this pull-request :)

matchu commented 11 years ago

Also, I don't think we need the try-catch: webkitFilter has been present since Chrome 18, and this extension uses manifest version 2 which was added in Chrome 18, so it won't install in versions without webkitFilter support, anyway.

dmfrancisco commented 11 years ago

Okay thanks, I didn't knew that. I added a new commit but undoing the filters and the overflow style this way may not be safe. Maybe the feature is not worth it.

matchu commented 11 years ago

Hmm. It'd be easier and safer to add/remove if it were a simple CSS class, though I'm not sure how one goes about dynamically creating a new class inside a document…

dmfrancisco commented 11 years ago

That makes sense. It would also be nice to be able to add the blur filter only to the body element, and undoing it only in the overlay, but as far as I know that is not possible. That's the reason why I'm applying the filter to all direct children of the body.