-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.pug
executable file
·146 lines (121 loc) · 5.1 KB
/
index.pug
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
- var link = 'js-tooltips'
- var title = '用 JavaScript 做一個 Tooltips 功能'
- var description = '用 JavaScript 做一個 Tooltips 功能'
<!DOCTYPE html>
html(lang="zh-Hant")
head
meta(charset="UTF-8")
meta(name="viewport", content="width=device-width, initial-scale=1.0")
meta(http-equiv="X-UA-Compatible", content="ie=edge")
title #{title} - August - Let's Write
link(rel="canonical", href=`https://www.letswrite.tw/${link}/`)
meta(property="og:url", content=`https://letswritetw.github.io/letswrite-${link}/`)
meta(property="fb:app_id", content="911000986339138")
meta(property="og:type", content="website")
meta(property="og:site_name", content="Let's Write")
meta(property="og:title", content=`${title} - Augustus - Let's Write`)
meta(itemprop="name", content=`${title} - Augustus - Let's Write`)
meta(name="description", content=description)
meta(property="og:description", content=description)
meta(itemprop="description", content=description)
meta(itemprop="image", content=`https://letswritetw.github.io/letswrite-${link}/fb.jpg`)
meta(property="og:image", content=`https://letswritetw.github.io/letswrite-${link}/fb.jpg`)
meta(property="og:image:width", content="1200")
meta(property="og:image:height", content="630")
meta(property="og:image:alt", content=title)
link(rel="shortcut icon", href="https://letswritetw.github.io/letswritetw/dist/img/logo_512.png")
//- css
link(rel="stylesheet", href="https://cdn.jsdelivr.net/npm/water.css@2/out/dark.min.css", media="screen")
link(rel="stylesheet", href="https://highlightjs.org/static/demo/styles/atom-one-dark.css")
link(rel="stylesheet", href="dist/style.min.css", media="screen")
// Google Tag Manager
script.
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-PGQ9WQT');
body
// Google Tag Manager (noscript)
noscript
iframe(src="https://www.googletagmanager.com/ns.html?id=GTM-PGQ9WQT", height="0", width="0", style="display:none;visibility:hidden")
#app.container
.text-center
h1=title
p 筆記文:
a(href="https://www.letswrite.tw/js-tooltip/") Let's Write
hr
// install
h2 引用
p 下載 JavaScript 的檔案:
a(href="https://github.com/letswritetw/letswrite-js-tooltips/blob/main/src/letswrite-tooltip.mjs.js", target="_blank") Let's Write Tooltips JS
p 引用方式:
pre
code.language-javascript.
import { letswriteTooltips } from 'path/letswrite-tooltip.mjs';
hr
// demo 1
h2 Demo 1:基本使用,都吃預設值
pre
code.language-html.
<button type="button"
class="letswrite-tooltips"
data-content="Tooltips 內容"></button>
<br/>
<script>
const demo1 = new letswriteTooltips();
</script>
button(type="button", class="letswrite-tooltips", data-content="Demo1:預設樣式") hover 可看到
hr
// demo 2
h2 Demo 2:加入客製 class name
style.
.letswrite-tooltips-custom {
padding: .25rem;
background-color: white;
border: 1px solid #a1a1a1;
border-radius: .25rem;
color: #a1a1a1;
}
pre
code.language-html.
<button type="button"
class="letswrite-tooltips-demo2"
data-content="Tooltips 內容"></button>
<style>
.letswrite-tooltips-custom {
padding: .25rem;
background-color: white;
border: 1px solid #a1a1a1;
border-radius: .25rem;
color: #a1a1a1;
}
</style>
<script>
const demo2 = new letswriteTooltips({
el: '.letswrite-tooltips-demo2',
customClass: 'letswrite-tooltips-custom'
});
</script>
button(type="button", class="letswrite-tooltips-demo2", data-content="Demo2:樣式不一樣") hover 可看到
hr
// demo 3
h2 Demo 3:點擊後執行 function
pre
code.language-html.
<button type="button"
class="letswrite-tooltips-demo3"
data-content="Tooltips 內容"></button>
<script>
const demo3 = new letswriteTooltips({
el: '.letswrite-tooltips-demo3',
callback: (e) => {
e.preventDefault();
alert('callback')
}
});
</script>
button(type="button", class="letswrite-tooltips-demo3", data-content="Demo 3:點擊跳 alert") hover 可看到
hr
script(src="dist/main.min.js")
script(src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.6.0/highlight.min.js")