File size: 6,865 Bytes
bc8bf33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
{{ "<!-- a11y.html -->" | safeHTML -}}
<details id="has-a11y" class="presentation js-details" name="on-deck" aria-haspopup="true" aria-labelledby="has-a11y-summary">
    <summary id="has-a11y-summary" accesskey="a" aria-keyshortcuts="a">
        <span>&nbsp;{{ i18n "accessibility" }}</span>
        <kbd class="key">a</kbd>
    </summary>
    {{ "<!-- a11y console -->" | safeHTML }}
    <fieldset id="a11y" role="region" disabled>
        {{ "<!-- brightness & contrast -->" | safeHTML }}
        <div id="setColorScheme" role="group" aria-label="{{ i18n "colorSettings" }}">
            {{ partialCached "a11y/darkMode.html" . }}
            {{ partialCached "a11y/contrast.html" . }}
        </div>
        {{ partialCached "a11y/colorPalette.html" . }}
        {{ partialCached "a11y/fontsize.html" . }}
        {{ partialCached "a11y/baselineStretch.html" . }}
        {{ partialCached "a11y/OpenDyslexic.html" . }}
        {{ partialCached "a11y/menu.html" . }}
        <noscript>
            <center id="noScript" role="alert">{{ i18n "noScript" }}</center>
        </noscript>
        <center id="noLocalStorage" class="hide" role="alert">{{ i18n "noLocalStorage" }}</center>
    </fieldset>
    <div class="screening js-cpn" role="presentation" aria-hidden="true"></div>
</details>

{{/*----------------------- end of a11y.html ------------------------*/}}

{{- define "partials/a11y/darkMode.html" -}}
    {{ "<!-- darkMode.html -->" | safeHTML }}
    <input
        id="lightSwitch"
        type="checkbox"
        onclick="setColor()"
        aria-label="{{ i18n "darkMode" }}"
        >
        <label for="lightSwitch">
            <div class="has-aria-label off" role="status" aria-label="{{ i18n "light" }}"></div>
            <div class="has-aria-label on" role="status" aria-label="{{ i18n "dark" }}"></div>
            <div id="lightSwitchIndicator" aria-hidden="true"></div>
        </label>
{{- end }}

{{- define "partials/a11y/contrast.html" -}}
    {{ "<!-- contrast.html -->" | safeHTML }}
    <fieldset id="setContrast">
        <legend>{{ i18n "contrast" }}</legend>
        <input
            id="lessContrast"
            type="radio" name="setContrast" value="less"
            onclick="setColor()"
            >
            <label for="lessContrast">
                <span>{{ i18n "lessContrast" }}</span>
            </label>
        <input
            id="defaultContrast"
            type="radio" name="setContrast" value="default"
            onclick="setColor()"
            >
            <label for="defaultContrast">
                <span>{{ i18n "defaultContrast" }}</span>
            </label>
        <input
            id="moreContrast"
            type="radio" name="setContrast" value="more"
            onclick="setColor()"
            >
            <label for="moreContrast">
                <span>{{ i18n "moreContrast" }}</span>
            </label>
    </fieldset>
{{- end }}

{{- define "partials/a11y/colorPalette.html" -}}
    {{ "<!-- colorPalette.html -->" | safeHTML }}
    <div id="setColorPalette" style="display:none;">
        <label for="colorPalette">{{ i18n "colorPalette" }}</label>
        <select id="colorPalette" name="colorPalette" oninput="setColorPalette()">
            <option value="defaultColor">{{ i18n "defaultColor" }}</option>
            <option value="deuteranopia">{{ i18n "deuteranopia" }}</option>
            <option value="protanopia">{{ i18n "protanopia" }}</option>
            <option value="tritanopia">{{ i18n "tritanopia" }}</option>
            <option value="monochrome">{{ i18n "monochrome" }}</option>
        </select>
    </div>
{{- end }}

{{- define "partials/a11y/fontsize.html" -}}
    {{ "<!-- fontsize.html -->" | safeHTML }}
    <div class="has-aria-label-top" aria-label="{{ i18n "fontSize" }}">
        <label class="range" for="fontSize" aria-label="{{ i18n "fontSize" }}">
            <input
                id="fontSize"
                type="range" min="8" max="12" step="0.5"
                oninput="setFontSize()">
            <output
                id="fontSizeState"
                onclick="resetFontSize()"
                aria-live="polite"
                >10</output>
        </label>
    </div>
{{- end }}

{{- define "partials/a11y/baselineStretch.html" -}}
    {{ "<!-- baselineStretch.html -->" | safeHTML }}
    <div id="setBaselineStretch" class="has-aria-label-top" aria-label="{{ i18n "baselineStretch" }}">
        <label class="range" for="baselineStretch">
            <input
                id="baselineStretch"
                type="range" min="0.8" max="1.2" step="0.05"
                oninput="setStretch()"
                >
            <output
                id="baselineStretchState"
                onclick="resetStretch()"
                aria-live="polite"
                >1</output>
        </label>
    </div>
{{- end }}

{{- define "partials/a11y/OpenDyslexic.html" -}}
    {{ "<!-- OpenDyslexic.html -->" | safeHTML }}
    <div id="setOpenDyslexic">
        <input
            id="OpenDyslexic"
            type="checkbox"
            onclick="useOpenDyslexic()"
            aria-label="{{ i18n "OpenDyslexic" }}"
            >
            <label
                class="has-aria-label-top"
                for="OpenDyslexic"
                aria-label="{{ i18n "OpenDyslexic" }}"
                >
                <span id="OpenDyslexicState" aria-hidden="true">
                    <span id="OpenDyslexicIndicator"></span>
                </span>
            </label>
    </div>
{{- end }}

{{- define "partials/a11y/menu.html" -}}
    {{ "<!-- menu.html -->" | safeHTML }}
    <menu
        id="a11y-menu"
        class="hide"
        role="toolbar"
        aria-label="{{ i18n "menuControls" }}"
        >
        <button
            id="saveButton" class="reverse"
            onclick="saveA11y()"
            disabled>
            {{- i18n "save" }}
        </button>
        <button
            id="resetButton" class="has-aria-label"
            onclick="resetA11y()"
            aria-label="{{ i18n "reset" }}"
            disabled>
        </button>
        <button
            id="closeButton" class="has-aria-label"
            onclick="closeA11yConsole()"
            aria-label="{{ i18n "close" }}"
            >
        </button>
    </menu>
{{- end }}

{{- define "partials/a11y/bionread.html" -}}
    {{ "<!-- bionread.html -->" | safeHTML }}
    <div id="useBionRead" class="hide">
        <input
            id="bionReadSwitch"
            accesskey="b" type="checkbox"
            onclick="bionRead()"
            aria-keyshortcuts="b"
            aria-label="{{ i18n "bionRead" }}"
            >
            <label id="bionReadButton" for="bionReadSwitch">
                <span><strong>Bion</strong>Read</span>
                <kbd class="key">b</kbd>
            </label>
    </div>
{{- end }}