-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.html
76 lines (58 loc) · 1.49 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>wintip</title>
<style>
.title {
font-size: 3em;
}
body {
background-color: #ffd;
}
</style>
</head>
<body>
<header>
<h1 class="title">Hello wintip!</h1>
</header>
<main>
<div id="div">By Vincent</div>
</main>
<script src="lib/wintip.js"></script>
<script>
/* global wintip */
wintip.config({
output: true,
console: true // open console.log proxy
})
// return a element
const tip = wintip('origin message')
tip.textContent = 'Hello Wintip!'
wintip('Auto stringify object:', {name: 'wintip', author: 'Vincent'})
wintip.$({color: 'yellow'})('Yellow tip')
// named tip
const namedTip = wintip.$('vincent')
namedTip('named tip')
// named tip with color options
const fishOrange = wintip.$('fish cat', {color: 'orange'})
fishOrange('hello')
fishOrange('named tip with color')
// chennge the first message
// wintip.$(1)('new message')
const foo = wintip.$('foo')
foo('foo tip')
wintip.$('baz')('baz tip')
// remove foo tip object
wintip.remove(foo)
// remove tip named 'baz'
wintip.remove('baz')
console.log('console.log', 'proxy')
wintip('balabala...')
wintip.info('info level')
wintip.warn('warn level')
wintip.error('error level')
</script>
</body>
</html>