:flashlight: Set a spotlight focus on DOM element adding a overlay layer to the rest of the page

Overview

Focusable Build Status Awesome

Gitter An awesome and lightweight library for performing spotlight in your DOM elements, setting an animated overlay to the rest of the page. You can find a live demo here.

Showcase

Installation

$ npm i focusable-element --save

$ bower i focusable-element

API

Set spotlight (jQuery style)
$('#my-element').setFocus(options);
Set spotlight (through library)
Focusable.setFocus($('#my-element'), options);
Refresh current focused element
Focusable.refresh();
Hide spotlight
Focusable.hide();
Get focused element
Focusable.getActiveElement();
Get options
Focusable.getOptions();
Options
Property Value Default Description
fadeDuration Number 700 Duration of the overlay transition (milliseconds).
hideOnClick Boolean false Hides the overlay when the user click into it.
hideOnESC Boolean false Hides the overlay when the user press Esc.
findOnResize Boolean false Refind the element in the DOM in case that the element don't still exists.
circle Boolean false Have the spotlight in a circle shape
Runing tests
Dependencies
  • jQuery
Contributing
  1. Check open issues
  2. Fork it
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request
Author

You can follow me on Twitter - https://twitter.com/zzarcon

Comments
  • Minified File Is incorrect

    Minified File Is incorrect

    The minified file in app/focus-element-overlay.min.js is 281.586 kb in size. The non-minified source is 4.579 kb in size.

    It seems like there is a compilation error here.

    opened by shidel-dev 2
  • Version 0.1.0

    Version 0.1.0

    Note that this PR is still a work in progress, since there's a lot of improvements, features and API changes that requires a deep test coverage. This PR is oriented to a next library version release (0.1.0)

    I made several major improvements/refactors, follow better conventions and adding support for some nice-to-have features, detailed below:

    • Simplified and normalized project files and folders structure (convention focused)
    • Simplified dev workflow. Removes Grunt and uses a simple Makefile
    • #19 Add support for Bower/Component web package managers (but it's still required package publishing)
    • #4 - Removes jQuery dependency (but also supports it a DOM nodes wrapper). Based on #11
    • #5 Support multiple elements focus (still experimental, it's a bit rudimentary implementation. There's also missing the spotlight animation)
    • Uses semver versioning convention
    • New and clean test suite: uses mocha instead of qunit. Removes git code and dependencies.
    • Better documentation

    IMPORTANT: note that there's still required some refactors and better code design and clean API, but the existent code and features are an initial good point to start with

    opened by h2non 1
  • Fixes build for minified file

    Fixes build for minified file

    This will close issue #13

    The issue was in the way that the js task was set up. It was doing unneeded concatenation, and not minifying correctly.

    I also added all of the grunt dependancies to the dev section of your package.json, and created a simple .gitignore.

    opened by shidel-dev 1
  • removes issue tracker from readme

    removes issue tracker from readme

    Using issues could be more friendly for open source community to help you. And you even can use great tools such waffle.io https://waffle.io/zzarcon/focusable (you got a kanban)!

    Instead of using todo, you could make contributing section.

    opened by leandromoreira 1
  • Scroll to element when not visible

    Scroll to element when not visible

    Adds a scrollToElement option to scroll to the focused element if it's not visible in the user's viewport. Use scrollTopPadding and scrollBottomPadding to compensate for floating navbars or other fixed elements attached to the screen.

    The .min and .map files were created automatically by Visual Studio. I'm not too familiar with JS build tools, my apologies if it messes something up.

    opened by nozzlegear 0
  • Add a Gitter chat badge to README.md

    Add a Gitter chat badge to README.md

    zzarcon/focusable now has a Chat Room on Gitter

    @zzarcon has just created a chat room. You can visit it here: https://gitter.im/zzarcon/focusable.

    This pull-request adds this badge to your README.md:

    Gitter

    Happy chatting.

    PS: Click here if you would prefer not to receive automatic pull-requests from Gitter in future.

    opened by gitter-badger 0
  • Remove pointer-events dependency

    Remove pointer-events dependency

    Remove the CSS pointer-events property dependency for improve compatibility with older browsers.

    The problem right now was that the columns are wrapped into a div positioned absolute filling the whole window, and with pointer-events: none, later the columns has pointer-events: all for disable interaction with the covered content.

    Please check the where you can use this feature http://caniuse.com/#feat=pointer-events.

    Also re-add the sample-app folder for test the lib in local

    opened by zzarcon 0
  • Add context for the focused area.

    Add context for the focused area.

    Hi, I need to set the context of the opaque overlay in a project I'm working on, so I think it was useful to have an option that can be passed to specify the context of this area. In real life I had to show a tutorial in a sidebar and guide the user through the app by highlighting the element in the app container leaving sidebar fully visible. I hope my effort is appreciated. Thanks.

    opened by ascariandrea 2
  • Overlay does not work as expected

    Overlay does not work as expected

    Hi Hector, I attempted to use Focusable on http://www.coupons.com. When I focus on an element while at the top of the page, focusable works fine. However, if I scroll down and then attempt to focus on an element on that section of the page, the overlay does not cover that part of page. I am suspecting it has something to do with the heights of of the columns? If you can take a look, that would be great!

    Thank you. Nick

    opened by nalexiou 7
  • Artifacts when spotlighting images

    Artifacts when spotlighting images

    On the demo website there are vertical white artifacts when spotlighting the black and white image.

    Chrome for Android version 39.0.21.71.93. Samsung Galaxy S5. Android version 4.4.2

    screenshot

    opened by zdwolfe 2
Releases(0.7)
Owner
Hector Zarco
Sometimes I write code
Hector Zarco
Simple overlay instructions for your apps.

Chardin.js Simple overlay instructions for your apps. Check out a demo. Or demo sequential stepping. Chardin.js is a jQuery plugin that creates a simp

Pablo Fernandez 5k Jan 5, 2023
An interactive guide for web page elements using jQuery and CSS3

pageguide.js An interactive, responsive, and smart guide for web page elements using jQuery and CSS3. Works great for dynamic pages and single-page ap

Tracelytics 912 Dec 25, 2022
null 3.9k Dec 30, 2022
why make apps to increase focus -- when you can make apps to reduce focus

impossifocus ?? What is this? ImpossiFocus will measure focus by reading your brainwaves -- and if you're in the zone, it'll ensure that changes with

Aleem Rehmtulla 10 Nov 30, 2022
ZxCDDoS for education with LAYER 7, LAYER 4, AMP METHODS

?? ZxCDDoS: Release v1.0 - Free DDoS Panel ?? Terminal only accepts ANSI color. Username: admin Password: admin Language Logs Fixed L7 methods (crash,

zxcr9999 151 Jan 3, 2023
⚡️The Fullstack React Framework — built on Next.js

The Fullstack React Framework "Zero-API" Data Layer — Built on Next.js — Inspired by Ruby on Rails Read the Documentation “Zero-API” data layer lets y

⚡️Blitz 12.5k Jan 4, 2023
基于vue3.0-ts-Element集成的简洁/实用后台模板!《带预览地址》vue-admin;vue+admin;vue-element;vue+element;vue后台管理;vue3.0-admin;vue3.0-element。

一、基于vue3.0+ts+Element通用后台admin模板 二、在线预览地址:http://admin.yknba.cn/ 三、下载使用: 1、克隆代码 通过git将代码克隆到本地;或者使用下载安装包模式进行下载。 2、进入目录 进入项目的根目录:vue3.0-ts-admin 3、安装依

null 64 Dec 16, 2022
Solid.js library adding a services layer for global shared state.

Solid Services Services are "global" objects useful for features that require shared state or persistent connections. Example uses of services might i

Maciej Kwaśniak 55 Dec 30, 2022
DOM ViewModel - A thin, fast, dependency-free vdom view layer

domvm (DOM ViewModel) A thin, fast, dependency-free vdom view layer (MIT Licensed) Introduction domvm is a flexible, pure-js view layer for building h

null 604 Dec 8, 2022
Adds a flashlight to Mindustry.

mindustry-lighting Adds various types of lighting sources to the player in Mindustry. Flashlight The default light source of the mod. Instead of makin

Antumbra (or Lich) 7 Oct 27, 2022
Fast Differentiable Tensor Library in JavaScript and TypeScript with Bun + Flashlight

A fast differentiable tensor library for research in TypeScript and JavaScript. Built with bun + flashlight. ⚠️ This is experimental software! ⚠️ Usag

Meta Research 917 Jan 7, 2023
Vercel NextJS Conf Prism + P5.js flashlight tracking

This project was bootstrapped with Create React App. Below you will find some information on how to perform common tasks. You can find the most recent

Chun Rapeepat 5 Oct 27, 2022
SpotLight is a web app which uses spotify developer APIs and lists your most listened songs, albums, artists and genres.

SpotLight is a web app which uses spotify developer APIs and lists your most listened songs, albums, artists and genres.

Sahil Saha 9 Dec 31, 2022
Instant spotlight like search and actions in your browser with Sugu Search.

Sugu Search Instant spotlight like search and actions in your browser with Sugu Search. Developed by Drew Hutton Grab it today for Firefox and Chrome

Drew Hutton (Yoroshi) 9 Oct 12, 2022
Spotlight-like search bar for spotify

Spicetify power bar Spotlight-like quick search bar to navigate to tracks, albums, artists and playlists. Table of contents Installation Usage Setting

Jeroen 43 Jan 4, 2023
Easily create key board shortcuts for your JS functions. Built using JS only with no other dependency. Inspired from MacOS spotlight

floodlightjs Inspired from macOS spotlight, floodlight is simple JS library that will show a search area. How the search is handled is completely on y

Raj Nandan Sharma 6 Aug 12, 2022
Spotlight! but for Developers.

Auxilium Auxilium is an app built to look and feel like the spotlight app for mac, but is made for developers, so you can find solutions on stack over

Nav 13 Dec 15, 2022
A light-weight, no-dependency, vanilla JavaScript engine to drive the user's focus across the page

Driver.js Powerful, highly customizable vanilla JavaScript engine to drive the user's focus across the page No external dependencies, supports all maj

Kamran Ahmed 14.3k Jan 4, 2023
Lightweight analytics abstraction layer for tracking page views, custom events, & identifying visitors

A lightweight analytics abstraction library for tracking page views, custom events, & identify visitors. Designed to work with any third-party analyti

David Wells 1.9k Dec 31, 2022
Some ideas for modern multi-layer page transitions using CSS Animations.

Multi-Layer Page Reveal Effects Some ideas for modern multi-layer page transitions using CSS Animations. Article on Codrops Demo Sponsor Demo sponsore

Codrops 117 Nov 1, 2022