]> _ Git - fluidbook-html5.git/commitdiff
wip #7779 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 11 Dec 2025 17:57:08 +0000 (18:57 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 11 Dec 2025 17:57:08 +0000 (18:57 +0100)
js/libs/fluidbook/fluidbook.accessibility.js
js/libs/fluidbook/fluidbook.audiodescription.js
js/libs/fluidbook/fluidbook.l10n.js
js/libs/fluidbook/fluidbook.menu.js
style/accessibility.less

index 134e4edee24cbb1aaa675f4536fd7208bc9b0a59..78f0c3a49aaf1ecd10296d22372e8ce5a3641dbe 100644 (file)
@@ -47,7 +47,51 @@ FluidbookAccessibility.prototype = {
     },
 
     openMenu: function (callback) {
-        var t = '<div class="content"></div>';
+        var t = '<div class="content">';
+        t += '<header>';
+        t += '<h1>' + this.fluidbook.l10n.__('A user experience optimized for accessibility') + '</h1>';
+        t += '<p>' + this.fluidbook.l10n.__('This interactive Fluidbook has been thoughtfully designed to support accessibility and inclusivity. We are actively working towards compliance with the WCAG 2.2 accessibility standards, aiming to meet both Level A and AA criteria.') + '</p>';
+        t += '<p>' + this.fluidbook.l10n.__('The Fluidbook is compatible with assistive technologies such as screen readers (e.g., JAWS, NVDA), and can be navigated using either a mouse or keyboard. Users can easily adjust text and content size by clicking directly on the page or using shortcuts like :zoominshortcut and :zoomoutshortcut. Wherever possible, content is provided in multiple formats - text, video, image, transcript, and audio - to suit different needs.', false, {
+            'zoominshortcut': '<strong>[Ctrl][+]</strong>',
+            'zoomoutshortcut': '[Ctrl][-]'
+        }) + '</p>';
+        t += '</header>';
+        t += '<section>'
+
+
+        let sections = [
+            {
+                icon: 'keyboard',
+                title: this.fluidbook.l10n.__('Optimized navigation using both mouse and keyboard'),
+                text: this.fluidbook.l10n.__('Functionalities within the Fluidbook can be accessed using both the mouse and standard keyboard shortcuts. All interactive elements (buttons, links, etc.) are accessible using the <strong>Tab key</strong> to jump from one element to the next (use <strong>Shift+Tab</strong> to jump backward). Press <strong>Enter</strong> to activate the selected element.'),
+            },
+            {
+                icon: 'audiodescription',
+                title: this.fluidbook.l10n.__('Listen to the page'),
+                text: this.fluidbook.l10n.__('Click the <strong>audio icon</strong> to hear an audio version of your Fluidbook. Where an audio version isn’t yet available, you can download a transcript of the content. Alternatively, you can use the Text-to-Speech feature from your screen reader software.'),
+                if: this.fluidbook.settings.audiodescription,
+            },
+            {
+                icon: 'resources',
+                title: this.fluidbook.l10n.__('Downloadable resources'),
+                text: this.fluidbook.l10n.__('When infographic resources are downloaded, they have been optimized for screen reader compatibility to support accessible offline use.'),
+            }, {
+                icon: 'help',
+                title: this.fluidbook.l10n.__('We’re here to help'),
+                text: this.fluidbook.l10n.__('If this Fluidbook doesn’t meet your accessibility requirements, please let us know. We’re committed to working with you to ensure you can access the content in a way that works for you.'),
+            },
+        ];
+        $.each(sections, function (k, section) {
+            t += '<article>';
+            t += '<img src="images/accessibility/' + section.icon + '.svg">';
+            t += '<h2>' + section.title + '</h2>';
+            t += '<p>' + section.text + '<p/>';
+            t += '</article>';
+        });
+
+        t += '</article>';
+        t += '</section>';
+        t += '</div>';
         this.fluidbook.menu.viewWrap(t, 'accessibility');
         if (callback != undefined) {
             callback();
index 8f5d77403c9adc50318e535b64438dbf02530110..6e27c0d89bed0c9987276665e1620ac4bd75869f 100644 (file)
@@ -135,7 +135,6 @@ FluidbookAudioDescription.prototype = {
         if (!this.audioSupport) {
             return false;
         }
-        console.log(this.fluidbook.settings.audiodescriptionAudio, page);
         if (this.fluidbook.settings.audiodescriptionAudio === undefined) {
             return false;
         }
index 4b4c434684951f75143738ae01ae916d9ce236e1..87f89ea91ebcfa7fbc5d7ab727dc8d6ff6e35780 100644 (file)
@@ -205,7 +205,8 @@ FluidbookL10N.prototype = {
     translate: function (str, markupIfNonAvailable) {
         return this.__(str, markupIfNonAvailable);
     },
-    __: function (str, markupIfNonAvailable) {
+
+    __: function (str, markupIfNonAvailable, replace) {
         if (str === undefined) {
             return;
         }
@@ -216,13 +217,21 @@ FluidbookL10N.prototype = {
             str = str.substring(1);
         }
 
+        let res;
         if (this.translations[str] == undefined || this.translations[str] == null || this.translations[str] == '') {
             if (markupIfNonAvailable == undefined || !markupIfNonAvailable) {
-                return str;
+                res = str;
             } else {
-                return '~ ' + str + ' ~';
+                res = '~ ' + str + ' ~';
             }
+        } else {
+            res = this.translations[str];
         }
-        return this.translations[str];
+        if (replace) {
+            $.each(replace, function (k, v) {
+                res = res.replaceAll(':' + k, v);
+            });
+        }
+        return res;
     }
 };
index ab34ad2373b963a983411b4a5c03ab565d38e4c3..1a6d78c0e3dabddfaa12af58a0bed85e903e6338 100644 (file)
@@ -880,6 +880,10 @@ FluidbookMenu.prototype = {
             case 'notes':
                 fullscreen = true;
                 break;
+            case 'accessibility':
+                w=900;
+                h = hh * 0.9;
+                break;
             case 'share':
                 w = 200;
                 break;
index 7eb96a72d3a5ed9079cc6b94ef7e5353893a4161..9e6ba2320763f6cc6d3450347eeffac6ecd29389 100644 (file)
   .using-keyboard & {
     border-color: #c00;
   }
+}
+
+
+.mview[data-menu="accessibility"] {
+  .content {
+    background-color: #fff;
+    color: #000;
+    text-align: left;
+    padding: 65px;
+
+    header {
+      height: auto !important;
+      h1 {
+        font-size: 80px;
+        font-weight: 600;
+        letter-spacing: -4px;
+        line-height: 1;
+        margin-bottom: 64px;
+      }
+    }
+
+    p{
+      font-size: 20px;
+      line-height: 30px;
+      letter-spacing: -0.5px;
+      margin: 32px 0;
+    }
+
+    h2{
+      font-size: 32px;
+      font-weight: 700;
+      line-height: 38px;
+    }
+  }
 }
\ No newline at end of file