2.1.6 • Published 1 year ago

js-dynamic-island v2.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

js-dynamic-island

U59dIv.png

Description

A message prompt interaction effect, inspired by the excellent IOS dynamic island animation interaction

Live Demo

Install

$ npm i js-dynamic-island

Quick Start

import { BubbleMessage, FoldMessage, MessageBox, ProgressBox, Rate, Spinner, AddToCart } from 'js-dynamic-island'
import "../node_modules/js-dynamic-island/style.css";

// BubbleMessage
BubbleMessage({
  user: 'zack',
  message: 'ot take to heart every thing you hear. do not take to heart every thing you hear. do not spend all; Whenever you find your wrongdoing',
  avatar: 'https://joeschmoe.io/api/v1/random',
  type: 'success'
})

// FoldMessage
FoldMessage({
  message: 'ot take to heart every thing you hear. do not take to heart every thing you hear. do not spend all; Whenever you find your wrongdoing',
  type: 'success'
})

// MessageBox
MessageBox({
  title: 'This is a title',
  content: 'ot take to heart every thing you hear. do not take to heart every thing you hear. do not spend all; Whenever you find your wrongdoing'
}).then(() => {
  // confirm
  console.log('confirm')
}).catch(() => {
  // cancel
  console.log('cancel')
})

// ProgressBox
ProgressBox({
  loadingTime: 3000
}).then(() => {
  // done
  console.log('done')
})

// Rate
Rate({
  title: 'like me~'
})

// Spinner loading
Spinner.show('loading...')
// ...javascript code
// loading finish
Spinner.done()

// add to cart
AddToCart({
  beforeTitle: 'adding...',
  afterTitle: 'finish'
})

API Docs

BubbleMessage

AttributeDescriptiontypeAccepted Valuesdefault
userusernameString--
messagemessage contentString-success
avataruser avatarString-https://joeschmoe.io/api/v1/random
typemessage typeStringsuccess/error-

FoldMessage

AttributeDescriptiontypeAccepted Valuesdefault
messagemessage contentString--
typemessage typeStringsuccess/error-

MessageBox

promise callback is supported
AttributeDescriptiontypeAccepted Valuesdefault
titletitleString--
contentmessage contentString--

ProgressBox

 promise callback is supported
AttributeDescriptiontypeAccepted Valuesdefault
loadingTimeloading timeNumber-5500(ms)

Rate

AttributeDescriptiontypeAccepted Valuesdefault
titletitleString--

Spinner

AttributeDescriptiontypeAccepted Valuesdefault
titleloading textString--
Spinner methods
AttributeDescription
showshow spinner loading
doneclose spinner loading

AddToCart

AttributeDescriptiontypeAccepted Valuesdefault
beforeTitletitleString--
afterTitlecomplete titleString--

License

js-dynamic-island is open source software licensed as MIT.

2.1.2

2 years ago

2.1.1

2 years ago

2.1.4

2 years ago

2.1.3

2 years ago

2.1.6

1 year ago

2.1.5

2 years ago

2.1.0

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago