-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.html
174 lines (174 loc) · 6.02 KB
/
index.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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Ticker Board</title>
<script src="./ticker-board/dist/ticker-board.js"></script>
<link rel="stylesheet" href="https://rjkerrison.co.uk/styles/header.css" />
<link rel="stylesheet" href="./styles/main.css" />
</head>
<body>
<script src="https://rjkerrison.co.uk/script/shared.js"></script>
<header>
<h1>Ticker Board</h1>
<p>This is the landing page for the ticker board plugin.</p>
<p class="create-ticker">
<span>A JS plugin</span>
<span>for ticker boards</span>
</p>
<p>
See the project on
<a href="https://github.com/rjkerrison/ticker-board">GitHub</a>. Find
the package on
<a href="https://www.npmjs.com/package/ticker-board">npmjs.com</a>.
</p>
<nav>
<ul>
<li>
<a href="#features">Features</a>
</li>
<li>
<a href="#importing">Importing</a>
</li>
<li>
<a href="#using">Using</a>
</li>
<li>
<a href="#other-examples">Other Examples</a>
</li>
<li>
<a href="#react-ticker-board">React</a>
</li>
</ul>
</nav>
</header>
<main>
<section id="features">
<h2><a href="#features">Included features</a></h2>
<p>The features include:</p>
<ul class="create-ticker">
<li>Vanilla JS</li>
<li>Styling included</li>
<li>Auto rotating board</li>
<li>Manual update methods</li>
<li>Node package</li>
</ul>
<p>
It's accessible for screen-readers, using a left-of-view element to
mimic the text in each row. The rows themselves are
<code>aria-hidden="true"</code>. User selecting of the rows is
disabled, however the screen-reader only text can be selected.
</p>
</section>
<section id="importing">
<h2><a href="#importing">Importing the Ticker Board plugin</a></h2>
<p>You can use this by either of the following methods</p>
<ul>
<li>
<h3>node package manager</h3>
<p>
If you're using node package manager for your project, you can use
the node module <code>ticker-board</code>
</p>
<pre><code lang="sh"
>npm install --save ticker-board</code
></pre>
</li>
<li>
<h3>minified package</h3>
<p>
using the
<a href="./ticker-board/dist/ticker-board.min.js"
>minified version</a
>, either downloading it locally or using it directly
</p>
<pre><code lang="javascript"
><script src="{{baseUrl}}/ticker-board/dist/ticker-board.js"></script></code
></pre>
</li>
<li>
<h3>Git repo</h3>
<p>
Clone this repository, take a look at the module files, or use the
ready-made distribution files.
</p>
<pre><code lang="en"
>git clone https://github.com/rjkerrison/ticker-board.git
cd ticker-board</code></pre>
</li>
</ul>
</section>
<section id="using">
<h2><a href="#using">Using the Ticker Board plugin</a></h2>
<p>After importing the JS, the simplest way to get set up is with…</p>
<pre><code lang="javascript">new TickerBoard('.my-ticker-board')</code></pre>
<p>
This would replace each of the children of any
<code>.my-ticker-board</code> matching element with a board which
automatically rotates through the inner text of that board. This is
exactly how the <a href="#features">board showing features</a> works!
</p>
<p>
You can override settings like size and colour scheme by providing
options.
</p>
<pre><code lang="javascript">new TickerBoard('.my-ticker-board',
{
theme: 'dark',
size: 24,
})</code
></pre>
</section>
<section id="other-examples">
<h2><a href="#other-examples">Other Examples</a></h2>
<p>
For more complicated examples, the generic <code>Board</code> class
allows you to manually updateMessages with the
<code>updateMessages</code> method.
</p>
<pre><code lang="javascript">document.getElementById('my-board')
const board = new Board(element)
board.updateMessages(['Apple', 'Banana', 'Cherry'])</code></pre>
<p>
This would just update the board with some fruit names, and then not
update again.
</p>
<p>
Another example usage of <code>updateMessages</code> uses
<a href="./demo/sncf.html">SNCF Live Data</a> to update the board with
train times.
</p>
<p>
You can also seee how it's possible to create a
<a href="./demo/rotation.html">simple rotating board</a>
that moves through multiple messages in one or two rows.
</p>
</section>
<section id="react-ticker-board">
<h2><a href="#react-ticker-board">React Ticker Board</a></h2>
<p>
Using react? There's an
<a href="https://www.npmjs.com/package/react-ticker-board"
>react-ticker-board package</a
>. Install it with yarn,
</p>
<pre><code>yarn add react-ticker-board</code></pre>
<p>or if you're using npm,</p>
<pre><code>npm install react-ticker-board</code></pre>
<p>
Take a look at the
<a href="./demo/react/build/">react ticker board demo</a> to get
started.
</p>
</section>
</main>
<footer>
<p>© Robin James Kerrison {{currentYear}}</p>
</footer>
<script>
new TickerBoard('.create-ticker')
</script>
<script src="./replacements.js"></script>
</body>
</html>