Git Product home page Git Product logo

fokus's Introduction

Fokus

Fokus uses JavaScript to emphasize anything you select by covering the rest of the page with semi-transparent black.

The library has no dependencies and weighs in at around 3kb. A <canvas> element is used to paint the cut-out cover. Works in most modern browsers except IE and touch devices.

If you want to use this on your site simply include the fokus.min.js script.

Check out the demo page.

Get the Fokus Chrome extension.
Get the Fokus Firefox extension by @aaronraimist.

History

0.5

  • Faster selection animation
  • Handle offset document element (<html>)
  • Update selection immediately on scroll

0.4

  • Don't start selection on rightclick

0.3

  • Don't select elements of zero width and height
  • Don't select br nodes

0.2

  • Animate change in cleared area
  • Handle selection via keyboard

0.1

  • Initial release

License

MIT licensed

Copyright (C) 2012-2013 Hakim El Hattab, http://hakim.se

fokus's People

Contributors

alireza-ahmadi avatar hakimel 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fokus's Issues

CSS Transform Support

I'm using isotope so the actual position of the element before the transform is in the upper left corner. When I select the text on the element after the transform the highlight appears in the upper left corner even though on-screen the element is somewhere else.

Highlight Placement

If there is padding added to the HTML of the page, the placement of the highlight is slightly skewed.

For example, when using the WordPress admin toolbar, WordPress adds padding to the HTML element of the page. This additional padding on the HTML element causes the highlight placement to be higher than the selected element.

Enhancement Request: Chrome Extension URL Filter

I use the Chrome extension and have enjoyed it. There's one feature I'd like to request though. There are certain sites I would like to disable the extension for. I find that in gmail the plugin can get in the way when I am writing an email. Thoughts?

Bower package

Can you create a bower package for this project?

I searched on bower website and can't find him there :(

save cookie option

Is it possible to save the highlighted portion os text in a cookie or local storage so when i came back later to the page it scrolls to the still highlighted text ?

That way, if you a heve a really long text, it could be used as a marker on where you left reading,

High cpu usage

When selecting a piece of text on any webpage while using Chromium (Version 45.0.2454.101 Ubuntu 14.04 (64-bit)) and the Fokus extension I get very high cpu usage, with all 8 cores staying at around 50% for as long as the text is selected. Is that the intended behaviour? Even with my relatively powerful machine this causes some perceptible lagginess.

System:
Ubuntu 14.04 LTS 64bit
3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64
i7 @ 3.2 Ghz
24 GB RAM
GeForce GTX 560 Ti

Console

From Google Chrome:
Uncaught TypeError: Cannot read property 'style' of null fokus.js:78
capable fokus.js:78
initialize fokus.js:41
(anonymous function) fokus.js:374
(anonymous function)

Scroll

When you scroll, the box stays where the selected element was. The box should stay over the original element, or unfokus.

Cool idea, just want to make it better.

Not compatible with Reveal.js

I am trying to use your code with Reveal.js and the position coming wierdly.

I know that this is just a first release but just to inform in-case if you get time to look into this, this can be a bingo. Because this is where Fokus would require - to highlight the content most ๐Ÿ‘

Thanks.

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.