survey.js - скрипт создания интерактивных опросников
http://surveyjs.org/
import { notti } from 'notti';
notti('Hello User!');
notti({
// HTML Element
message: 'Hello! User',
isHTML: true,
style : {
backgroundColor: '#333',
color:'#fff',
bottom: '10px',
right: '10px'
},
onHide: () => {
console.log('Awesome notti.js!')
}
});
import gotem from 'gotem'
// a trigger and target node are required
const nodes = {
trigger: document.getElementById('trigger'),
target: document.getElementById('target')
}
// when the trigger is clicked,
// the text of the target will be copied to the clipboard
gotem(nodes.trigger, nodes.target)
// if an object with callback functions (success, error) is passed,
// the appropriate function, based on the result of executing the copy command, will be fired if it exists
gotem(nodes.trigger, nodes.target, {
success: () => console.log('Copy command succeeded'),
error: () => console.log('Copy command failed, BUT the text to copy has still been selected.')
})
numberformat.format(1e10) // or {format: 'standard'}
// => "10.000 billion"
numberformat.format(1e10, {format: 'scientific'})
// => "1.0000e10"
numberformat.format(1e10, {format: 'engineering'})
// => "10.000E9"
numberformat.format(1e10, {format: 'longScale'})
// => "10.000 milliard"
import { frames, ease } from 'animationframes';
const translate = (x, y) => `translate(${x}%, ${y}%)`;
const el = document.createElement('h1');
const animation = frames(0, 1000)
.start(() => {
el.style.transform = translate(-100, 0);
})
.progress((t) => {
const e = ease.quartInOut(t);
const x = -100 * (1 - e);
el.style.transform = translate(x, 0);
})
.end(() => {
el.style.transform = '';
});
el.textContent = 'Hello world!';
document.body.appendChild(el);