Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
A simple guideline tool based on which you can quickly implement new features guidelines for website users.
This is a simple guideline tool based on which you can quickly implement new features guidelines for website users.
There are two ways to play a guideline, a simple way and an advanced way. The simple way is an encapsulation of the advanced way which can do more setting and control the playing of guideline.
Guideline also supports using keyboard shortcuts to control playback. See the relevant part of API for details
const guideline = require('guideline');
const visitTimes = parseInt(localStorage.getItem('visitTimes')) || 0;
if (visitTimes === 0) {
const guideOptions = [{
content: 'Welcome, the new features guidelines come online !'
}, {
element: document.getElementById('notificationwrapper'),
content: 'all system messages and notification is here',
style: 'font-size: 20px; color: red;',
position: 'top'
}, {
element: document.querySelector('.datepicker-hint'),
content: 'datepicker hint will tell you the datepicker\'s date range restriction',
position: 'bottom'
}];
guideline(guideOptions, function () {
console.log('guideline is over');
});
}
const guideline = require('guideline');
// something else ...
const guideOptions = [{
content: 'Welcome, the new features guidelines come online !'
}, {
element: document.getElementById('notificationwrapper'),
content: 'all system messages and notification is here',
style: 'font-size: 20px; color: red;',
position: 'top'
}, {
element: document.querySelector('.datepicker-hint'),
content: 'datepicker hint will tell you the datepicker\'s date range restriction',
position: 'bottom'
}];
const gl = new guideline.Guideline(guideOptions, function (total, played) {
console.log('guideline is over, total valid ', total, 'played ', played);
});
// set hint text maximum width
gl.hintTextMaxWidth = 800
// set hint text font size
gl.hintFontSize = 20
// start the guideline
gl.play();
// autoplay the next hint every 3 seconds
const timer = setInterval(function () {
if (gl.hasNext()) {
gl.next();
} else {
clearInterval(timer);
gl.stop();
}
}, 3000);
This is the simple way to play a guideline which accepts two parameters whose description are listed in the relevant sections as follows.
This is the advanced way to play a guideline which parameters are the same as guideline(configuration, callback)
. It will return a Guideline instance based on whose prototype's method you can do more control during the playing.
The configuration item should be an array, each of which is an object.
Properties:
element
is null, the guideline text is centered relative to the browser window.'top'
or 'bottom'
.callback
is a function, which will be invoked when the guideline stops. callback
takes two parameters total
and playedAmount
, representing the total amount of valid hints and the actual playback amount of hints.
Guideline supports some keyboard shortcuts to play the next or previous hint as follows.
keyboard | action |
---|---|
arrow right | play next |
enter | play next |
space | play next |
arrow left | play previous |
backspace | play previous |
esc | stop playing |
MIT
FAQs
A simple guideline tool based on which you can quickly implement new features guidelines for website users.
We found that guideline demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.