Coder Social home page Coder Social logo

tiaanduplessis / dont-go Goto Github PK

View Code? Open in Web Editor NEW
328.0 8.0 12.0 1.01 MB

A small client-side library with zero dependencies to change the title and/or favicon of the page when it is inactive. :relieved:

Home Page: https://tiaanduplessis.github.io/dont-go/

HTML 76.44% JavaScript 23.56%
favicon dont-go

dont-go's Introduction

Dont go


Do the old favicon switcheroo in under 500 bytes

Table of Contents

About

leo

Dont-go is a small client-side library with zero dependencies to change the title and/or favicon of the page when it is inactive. Minified version weighs in at a whopping 476 Bytes when minified. Note that You must include a default favicon in your webpage.

As Seen In

Install

Install with cdn

<script src="https://unpkg.com/dont-go/lib/dont-go.js"></script>

Install with npm

$ npm install dont-go

Install with yarn

$ yarn add dont-go

Usage

example

To use, simply call the function with options.

dontGo({
	title: 'Alternative title text right here!',
	faviconSrc: 'path/to/Alternative/favicon.ico',
	timeout: 5000 //5 seconds
});

The faviconSrc property is optional and will keep the same icon if not set.

The timeout property is optional, it takes an interval in milliseconds to before title & favicon change.

It is also possible to set the title property to an array of values and set an interval to switch between them as seen in the example below;

dontGo({
	title: ['Alternative title text', 'Another alternative title'],
	faviconSrc: 'path/to/Alternative/favicon.ico',
	interval: 1000 //1 second
});

Demo

Check out the demo here.

Examples

Please see the example directory for more usage examples.

Contributing

All Contributions are welcome! Please open up an issue if you would like to help out. ๐Ÿ˜„

License

Licensed under the MIT License.

Icons made by Madebyoliver from www.flaticon.com is licensed by CC 3.0 BY.

dont-go's People

Contributors

greenkeeper[bot] avatar greenkeeperio-bot avatar imgbotapp avatar jalvarado91 avatar renovate-bot avatar tiaanduplessis 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

dont-go's Issues

RawGit is shutting down

Hey,

I see you recommend users fetching the code hosted using RawGit, but since they'll shut down soon, you should at some point remove that link. One side note: They say they'll stop serving the content in October 2019, but I already have seen cases where I can't fetch content from them.

Add feature to set multiple faviconSrc's

dontGo({
	title: ['Alternative title text', 'Another alternative title'],
	faviconSrc: ['path/to/Alternative/favicon.ico', 'path/to/Alternative/favicon2.ico'],
	interval: 1000 //1 second
});

Create a message loop

Hello everyone, first of all congratulations for the work. Really enjoyed.
Actually, it's not an issue, it's a question, I'm trying to create a messaging loop but without success so far. Can you help me ?

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.