-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlexicon.html
616 lines (615 loc) · 19.2 KB
/
lexicon.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
<!doctype html><!--*- ispell-dictionary:"sv"; js-indent-level:2; css-indent-offset:2 -*-->
<html lang=sv>
<head>
<!-- Copyright 2017-2023 by zrajm. Released under GPLv3 license. -->
<meta charset="UTF-8">
<link rel="preload" href="freesans-swl.woff2" as="font" type="font/woff2" crossorigin>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="theme-color" content="#a5e7ef">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<title>TSP-Lex!</title>
<link rel=stylesheet href="lexicon.css">
<link rel=license href="LICENSE.txt">
<link rel=search type="application/opensearchdescription+xml" title="TSP-Lex!" href="/teckentranskription/lexicon-opensearch.xml">
<meta name="description" content="TSP-Lex är ett experimentellt (snabbt!) teckenspråkslexikon. Data importeras ifrån Svenskt Teckenspråkslexikon varje måndag.">
<style>
/* styles for first screenful of content */
@-ms-viewport{ width: device-width; }
@font-face {
font-family: "FreeSans-SWL";
src: url("freesans-swl.woff2");
font-display: swap;
}
html {
font-family: "FreeSans-SWL", "FreeSans", sans-serif;
font-size: 22px;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:focus {
box-shadow: 0 0 0 3px #abd; /* dark focus outline */
outline: 0;
}
/* Make <body> fill first screen. http://stackoverflow.com/q/17555682/ */
html { height: 100%; overflow-y: scroll; }
body { min-height: 100%; }
/* line-height must be >1.25 for FreeSans-SWL relation diacritics
* not to leave remains on previous line when column breaking
*/
body { line-height: 1.25; }
body {
display: flex;
flex-direction: column;
}
header {
display: flex;
background: #a5e7ef; /* theme color */
padding: .25em .5em .35em .5em;
color: #444; /* text color */
padding-left: 48px; /* room for menu button */
}
#keyboard { display: none; }
#search {
display: flex;
border-radius: 24px;
border: 1px solid #aaa;
padding: 0 10px;
background: #fff;
position: relative; /* on top of menu */
height: 48px;
line-height: 46px; /* height - (top + bottom border) */
width: 100%;
}
#search > * {
border: 0;
padding: 0 6px;
}
#search > .icon + .icon { padding-left: 2px; }
/* focus & hover */
#q:focus, #q:hover, #search .icon:focus, #search .icon:hover {
box-shadow: none;
}
button.icon > svg {
color: #888; /* placeholder text color + #111 */
}
button.icon:focus > svg, #search.focus {
box-shadow: 0 0 0 3px #99f6; /* focus outline */
}
button.icon:focus > svg {
border-radius: 1px;
background: #99f6; /* focus outline color */
color: #569;
}
#search.focus:hover {
box-shadow:
0 3px 6px 2px #0003, /* hover shadow */
0 0 0 3px #99f6; /* focus outline */
}
#search:hover {
box-shadow: 0 3px 6px 2px #0003; /* hover shadow */
}
/* On touchscreen devices (where no input type has hover). */
@media not all and (any-hover:hover) {
#search.focus:hover {
box-shadow: 0 0 0 3px #99f6; /* focus outline */
}
}
.menu .menu-open {
opacity: .5;
}
button.icon:hover > svg {
color: #444; /* text color */
}
#q {
flex-grow: 1;
line-height: inherit;
/* Force <textarea> to be like <input> ('wrap=off' required by MSIE11.) */
/* (<textarea> shows diacritics in front of 1st char, <input> does not) */
overflow: hidden;
resize: none;
white-space: pre;
}
#q::placeholder {
color: #777; /* placeholder text color */
}
/*
* Firefox: 'overflow:hidden' stops scroll-to-caret from working
* on focusing element, but we need this when user paste text.
*/
@-moz-document url-prefix() {
#q {
overflow: auto;
scrollbar-width: none;
}
}
#search:invalid [type="reset"] { /* not on IE9 */
display: none;
}
#search-wrapper {
margin: 0 0 .5em;
}
#search-result {
margin: 0 auto;
}
#nomatch, #noquery {
min-width: 12em;
max-width: 22em;
width: 75%;
margin: auto;
padding-bottom: 1em;
display: none;
}
body.nomatch #nomatch, body.noquery #noquery {
display: block;
}
#nomatch li {
margin-top: .5em;
}
body > footer {
margin: auto 0 .5em;
text-align: center;
}
.info, body > footer, #search-brief {
font-size: smaller;
color: #666;
}
#search-brief {
margin: .5em;
display: flex;
justify-content: space-between;
}
#more {
display: none;
padding: .25em .5em;
background: #a5e7ef; /* theme color */
margin: 0 auto 1.5em;
}
/* Full screen search form */
/* normally hide 'noquery-content' */
.noquery-content {
display: none;
}
/* in 'noquery' mode: show noquery-content + hide normal search result */
body.noquery .noquery-content { display: block; }
body.noquery #search-wrapper { display: none; }
.logo { margin-top: -3em; }
.logo svg {
height: 5em;
margin: .5em auto;
}
@media only screen and (max-width: 450px) { .info .size { display: none; } }
@media only screen and (max-width: 330px) { .info .beg { display: none; } }
@media only screen and (max-width: 220px) { .info .date { display: none; } }
/* form fields changed in 'noquery' mode */
body.noquery header {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
display: block;
text-align: center;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
body.noquery #search {
width: calc(100% - 6px);
max-width: 610px;
margin: 1.5rem 1em 1.1rem;
}
/* Result mode selector switch (video/text) */
.selector {
cursor: pointer;
border-radius: 4px; /* form border radius */
}
.selector > .switch {
vertical-align: top;
display: inline-block;
width: 1.6em;
height: .9em;
box-sizing: content-box;
background: #eee;
border: 1px solid #888;
border-radius: 1em;
box-shadow: inset 0 2px 5px 3px #ccc;
position: relative;
top: .1em;
}
.selector > .switch:before {
transition: all .05s ease-in;
content: '';
width: .9em;
height: 100%;
background: white;
position: absolute;
border: inherit;
border-radius: inherit;
margin: -1px;
}
.text-view .selector > .switch:before { right: 0; }
.video-view .selector > .switch:before { left: 0; }
.video-view .selector > .video { font-weight: bold; }
.text-view .selector > .text { font-weight: bold; }
/* Stuff common to both result views (video/text) */
#search-result > .match {
column-break-inside: avoid;
-moz-column-break-inside: avoid;
-webkit-column-break-inside: avoid;
}
/* Align these icons with baseline */
img[src="pic/warn-marked.svg"],
img[src="pic/warn.svg"] { position: relative; top: 2px; }
img[src="pic/tag-marked.svg"],
img[src="pic/tag.svg"] { position: relative; top: 3px; }
img[src$="-marked.svg"] { background: #fb05; }
/* Stuff for text result view (text/video) */
.text-view #search-result {
padding: 0 .5em;
width: 100% !important;
column-gap: 1em;
columns: 14em;
}
.text-view #search-result > .match {
margin: 0 0 .125em;
text-indent: -1em;
padding-left: 1em;
}
.text-view .video-container {
display: inline;
}
.text-view .video-container, .text-view .video-container > * {
display: inline;
}
.text-view .video-container,
.text-view .video-container .video-id { margin-left: 0; }
.text-view .video-container .video-id { font-size: 95%; }
.text-view .video-container > img,
.text-view .video-container > video,
.text-view .video-feedback {
display: none;
}
.text-view .video-id:hover { opacity: 1; }
.text-view .video-subs a {
font-size: 95%;
color: #595959;
}
.text-view .match > a {
color: inherit;
}
/* Stuff for video result view (text/video). */
.video-view #search-result {
word-spacing: 16px; /* Used by JS, MUST be in px! */
font-size: 0;
line-height: 12px;
}
.video-view #search-result > * {
word-spacing: normal;
font-size: 1rem;
line-height: normal;
}
.video-view #search-result > .match {
display: inline-block;
width: 270px; /* same as .video-container */
margin: 0;
text-align: center;
/* text: center or truncate if too long */
white-space: nowrap;
text-align: center;
text-overflow: ellipsis;
overflow: hidden;
}
.video-view .match > a:hover, .video-view .match > a:focus {
text-decoration: underline;
}
.video-view .video-container.is-loading {
background-image: url(pic/gui/image-loading.jpg);
}
.video-view .video-container.is-broken:before,
.video-view .video-container.is-loading-video:before {
content: '';
position: absolute;
width: 100%; height: 100%;
}
.video-view .video-container.is-broken:before {
background: no-repeat center url(pic/gui/image-broken.svg);
}
.video-view .video-container.is-loading-video:before {
background: no-repeat center url(pic/gui/video-loading.svg);
}
.video-view .video-container.is-loading > img,
.video-view .video-container.is-broken > img {
opacity: 0; /* hide but allow clicks etc. */
}
.video-view .video-container {
background: no-repeat center url(pic/gui/image-loading.jpg) #a5e7ef; /* theme color */
position: relative; /* for subtitle+id positioning */
border-radius: 4px;
/* center video + truncate sides for 16:19 videos */
overflow: hidden;
display: flex;
justify-content: center;
width: 270px; /* same as #search-result > .match */
height: 202px;
/* text color + outline */
color: #fff;
text-shadow:
1px 1px 1px #000,
1px -1px 1px #000,
-1px 1px 1px #000,
-1px -1px 1px #000,
0 1px 1px #000,
0 -1px 1px #000,
1px 0 1px #000,
-1px 0 1px #000;
}
.video-view .video-container a { color: inherit; }
.video-view .video-container > video, .video-view .video-container > img {
/* z-index fixes Firefox where subs disappear when clicking video content a
second time (to stop video playback) */
z-index: auto;
max-height: none;
flex: none;
margin: auto;
height: 100%;
min-width: 100%;
transition: opacity 0.2s ease-in-out;
}
.video-view .video-container wbr { display: none; }
.video-view .top-right {
/* top-right corner */
position: absolute; right: 8px; top: 4px;
font-size: smaller;
}
.video-view .top-right > * { opacity: .75; }
.video-view .top-right > *:hover { opacity: 1; }
.video-view .top-right img {
display: block;
}
.video-view .top-right .tags {
display: table;
margin-left: auto;
}
.video-view .video-id:hover { opacity: 1; }
.video-view .video-subs {
position: absolute; bottom: 4px; /* subtitle placement */
left: 0; right: 0;
padding: 3px 2px 1px 2px; /* don't truncate shadow */
/* text: center or truncate if too long */
white-space: nowrap;
text-align: center;
text-overflow: ellipsis;
overflow: hidden;
max-width: 100%;
}
.video-view .video-container a mark {
background: #fb05;
color: #fb3;
}
.video-view .video-container a:focus mark,
.video-view .video-container a:hover mark {
text-decoration: underline #fb3;
}
.video-view .video-feedback {
width: 100%;
height: 100%;
position: absolute;
background: no-repeat center/45px;
}
.video-view .video-feedback.anim {
transition: all .5s ease-out;
background-size: 90px;
opacity: 0;
}
.video-view .video-feedback.play { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="45" height="45"><circle r="22.5" cy="22.5" cx="22.5" style="isolation:auto;mix-blend-mode:normal" color="%23000" overflow="visible" opacity=".75" fill-rule="evenodd"/><path color="%23000" fill="%23fff" style="isolation:auto;mix-blend-mode:normal" overflow="visible" d="M33.25 22.5l-16.5 9.53V12.97z"/></svg>'); }
.video-view .video-feedback.pause { background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="45" height="45"><circle r="22.5" cy="22.5" cx="22.5" style="isolation:auto;mix-blend-mode:normal" color="%23000" overflow="visible" opacity=".75" fill-rule="evenodd"/><path color="%23000" fill="%23fff" style="isolation:auto;mix-blend-mode:normal" overflow="visible" d="M15 15h5v15h-5zM25 15h5v15h-5z" fill-rule="evenodd"/></svg>'); }
/* Text content */
svg { display: block; }
img { max-height: 175px; }
mark {
background: #fb09;
color: inherit;
}
/* Side menu (with content) */
.menu.shown {
visibility: visible;
color: #000b;
}
.menu {
width: 100%;
z-index: 1;
visibility: hidden;
font-size: smaller;
overflow: hidden;
position: fixed;
left: 0;
top: 0;
height: 100%;
transition: all .2s ease-in-out;
}
.menu aside {
z-index: 1;
visibility: visible;
width: 16em;
padding: 1.5em;
transition: all .2s ease-in-out;
position: relative;
background: white;
height: 100%;
right: 100%;
}
.menu button {
z-index: 1;
visibility: visible;
border-radius: 2px;
box-sizing: content-box;
position: absolute;
width: .85rem;
top: 13px;
left: 6px;
padding: 9px;
color: #000;
margin: 0;
box-shadow: unset;
}
/* Text content */
a {
border-radius: 1px;
text-decoration: none;
color: #00a;
}
a:focus, a:hover {
text-decoration: underline;
}
/* Buttons */
button, textarea {
color: inherit;
background: #fff0;
font-family: inherit;
font-size: inherit;
}
button {
cursor: pointer;
border: 0;
}
a {
cursor: pointer;
}
</style>
</head>
<body>
<script>if(/^#?#?\s*$/.test(decodeURIComponent(location.hash)))document.body.classList.add('noquery')</script>
<center id=noscript style="position:fixed;height:100%;width:100%;z-index:1;display:flex;justify-content:center;flex-direction:column;color:#ed2;background:#000;">
<h1>Vänligen aktivera Javascript.</h1>
<p><p>Lexikonet fungerar dessvärre inte utan det. :'(
<script>document.querySelector('#noscript').remove()</script>
</center>
<aside class=menu>
<button class="toggle menu-open" aria-label="Meny"><svg height="17" width="19"><path d="M0 0h19v3H0zm0 14h19v3H0zm0-7h19v3H0z" fill="currentColor"/></svg></button>
<aside>
<button class="icon toggle menu-close" tabindex=-1 aria-label="Stäng meny"><svg width="18" height="20"><path d="M3 2 1 4l14 14 2-2ZM1 16l2 2L17 4l-2-2Z" fill="currentColor"/></svg></button>
<ul style="margin-top:.75em">
<li><a href="lexicon-help.html" target=_blank>Sökhjälp</a>
<!--li><a href="#">Om lexikonet</a-->
</ul>
<p class=hr>Relaterade sidor
<ul>
<li><a href="intro.html" target=_blank>Hur transkriptionen fungerar</a>
<li><a href="freesans-swl.html" target=_blank>Transkriptionstypsnitt</a>
</ul>
<p class=hr>Sidor på GitHub
<ul>
<li><a href="https://github.com/zrajm/teckentranskription" target=_blank rel=noopener>Lexikonets källkod</a>
<li><a href="https://github.com/zrajm/teckentranskription/issues" target=_blank rel=noopener>Rapportera fel</a>
</ul>
<footer>
Data från <a href="https://teckensprakslexikon.su.se/" target=_blank rel=noopener>Svenskt teckenspråkslexikon</a>.
</footer>
</aside>
</aside>
<header>
<div class="noquery-content logo">
<svg viewBox="0 0 648 729"><defs><filter id="a" color-interpolation-filters="sRGB"><feFlood/><feComposite in2="SourceGraphic" operator="out"/><feGaussianBlur stdDeviation="15"/><feOffset dx="5" dy="10"/><feComposite in2="SourceGraphic" operator="atop"/></filter></defs><path fill="#134141" d="M0 0H115L329 355L537 0H648L381 432H601v78H374V729H281V510H47V432H274z" filter="url(#a)"/></svg>
<big>Svenskt teckenspråkslexikon</big>
</div>
<form id=search novalidate>
<button class="icon submit" type=submit aria-label="Sök"><svg width="24" height="24"><path d="m22 24-8-8 2-2 8 8zM16.1 9.4a6.7 6.7 0 1 0-13.4 0 6.7 6.7 0 0 0 13.4 0zm2.7 0A9.4 9.4 0 1 1 0 9.4a9.4 9.4 0 0 1 18.8 0z" fill="currentColor"/></svg></button>
<textarea id=q rows=1 autofocus required placeholder="Sök ord eller …" wrap=off></textarea>
<button class=icon type=reset aria-label="Rensa sökning"><svg width="18" height="20"><path d="M3 2 1 4l14 14 2-2ZM1 16l2 2L17 4l-2-2Z" fill="currentColor"/></svg></button>
<button class="icon kb" title="Transkriptionssymboler (Esc)"><svg width="38" height="20"><path d="M2,0C.892,0,0,.892,0,2v16c0,1.108.892,2,2,2h34c1.108,0,2-.892,2-2V2c0-1.108-.892-2-2-2zm0,2h4v4H2zm6,0h4v4H8zm6,0h4v4h-4zm6,0h4v4h-4zm6,0h4v4h-4zm6,0h4v4h-4zM2,8h4v4H2zm6,0h4v4H8zm6,0h4v4h-4zm6,0h4v4h-4zm6,0h4v4h-4zm6,0h4v4h-4zM2,14h4v4H2zm6,0h22v4H8zm24,0h4v4h-4z" fill="currentColor"/></svg></button>
</form>
<div class="noquery-content info">
<span class=size><span id=lexicon-size>## ###</span> tecken.</span>
<span class=date><span class=beg>Uppdaterad</span> <span id=lexicon-date>## månad ####</span>.</span>
<a href="lexicon-help.html" target=_blank>Sökhjälp</a>.
</div>
</header>
<main id=search-wrapper class=video-view>
<div id=search-brief>
<span id=search-count></span>
<span class=selector tabindex=0>
<span class=video>video</span>
<span class=switch></span>
<span class=text>text</span>
</span>
</div>
<div id=search-result></div>
<button id=more>Visa fler träffar…</button>
</main>
<aside id=nomatch>
Din sökning matchade ingenting i lexikonet.
<p><p>Tips:
<ul>
<li>Kontrollera att du stavade rätt.
<li>Försök söka efter en synonym.
<li>Använd ’*’ för att söka på del av ord (tex <a class=tt
href="#katt*">katt*</a> eller <a class=tt href="#*katt">*katt</a>).
<li>Sök upp ett annat ord som tecknas på liknande sätt, klicka på det
tecknets transkription och prova sedan att i sökfältet byta ut
delar av transkriptionen mot <a class=tt>*</a>.
<li>Om du är nyfiken på mer avancerade sökningar, ta en titt
på <a href="lexicon-help.html" target=_blank>sökhjälpen</a>.
</ul>
</aside>
<footer>© 2017–2023 <a href="mailto:[email protected]">zrajm</a>,
Uppsala. <a href="lexicon-help.html" target=_blank>Sökhjälp.</a>
</footer>
<script src="jquery-3.6.0.slim.min.js"></script>
<script src="imagesloaded.pkgd.min.js"></script>
<script src="lexicon.js"></script>
<script src="lexicon-data.js"></script>
<script src="keyboard.js"></script>
<script>
$(() => {
'use strict'
/* global transcriptKeyboard:readonly */
transcriptKeyboard($('#search'), $('#q'), $('#search .kb'))
/* global $:readonly */
;((i, $menu) => {
let $open = $menu.find('.menu-open')
let $tabbable = $menu.find('* a, * button')
function modulo(n, m) { return ((n % m) + m) % m }
function tabTo(j) {
i = modulo(j, $tabbable.length)
$tabbable[i].focus()
}
function key(e) {
if ($menu.hasClass('shown')) {
let key = e.which
switch (key) {
case 27: // Escape
$menu.removeClass('shown')
$open.focus()
break
case 9: // Tab
case 38: // Up
case 40: // Down
tabTo(i + (key === 38 || (key === 9 && e.shiftKey) ? -1 : 1), e)
e.preventDefault()
}
}
}
function toggle() {
$menu.toggleClass('shown')
if ($menu.hasClass('shown')) { // open: focus 1st item
tabTo(0)
} else {
$open.focus() // close: focus menu icon
}
}
$menu
.on('keydown', key)
.on('click', 'a,button', toggle)
.on('click', e => { // background overlay
if (e.target === $menu[0]) { toggle() }
})
})(0, $('.menu'))
})
</script>
</body>
</html>