diff --git a/README.md b/README.md index bbeb03c..4e29802 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,22 @@ started this project [here](blue.verto.health/advancing-accessibility-with-astra - Text Size - Text Spacing - Screen Mask +- Line Height - More to come! +| Key | Capability | +|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Screen Reader | Screen reader is a tool where it would reads out texts on screen where user clicks on. For any html elements, if an aria label is available, the content from aria label would be read out loud, otherwise, it reads the text content of the element. There are 3 different speeds, normal, fast and slow. | +| Contrast | Contrast is a tool that removes background and replaces it with black or white to increase the difference in colours between text and the background to increase legibility. There are 3 modes, the invert colours, high contrast, and dark high contrast. | +| Saturation | Saturation is a tool that adjusts how colourful the colours are on screen, it has 3 different modes to lower saturation, increase saturation, or remove all the colours on screen (black and white). | +| Bigger Text | Bigger Text is a tool that increases the size of the texts on screen. | +| Text Spacing | Text Spacing is a tool that increases the spacing between each character on the screen to increase legibility and readibility. | +| Screen Mask | Screen Mask is a tool which dims the background and has a smaller focused area which follows the cursor sliding up and down the page. | +| Line Spacing | Line Spacing is a tool which increases the space between lines for greater readability. | + + + + ## Usage Astral is built with Angular Elements. You can use it in your website in under 30 seconds. To add it, simply include the Javascript and initialize it: @@ -40,7 +54,7 @@ Optionally we can choose which widgets should appear by passing an object inside ```html ``` diff --git a/projects/astral-accessibility/src/lib/astral-accessibility.component.html b/projects/astral-accessibility/src/lib/astral-accessibility.component.html index 761ebd3..c6fde5b 100644 --- a/projects/astral-accessibility/src/lib/astral-accessibility.component.html +++ b/projects/astral-accessibility/src/lib/astral-accessibility.component.html @@ -40,22 +40,22 @@ -
+
-
+
-
+
-
+
-
+
-
+
diff --git a/projects/astral-accessibility/src/lib/astral-accessibility.component.ts b/projects/astral-accessibility/src/lib/astral-accessibility.component.ts index 13e751a..f27aab2 100644 --- a/projects/astral-accessibility/src/lib/astral-accessibility.component.ts +++ b/projects/astral-accessibility/src/lib/astral-accessibility.component.ts @@ -33,15 +33,15 @@ export class AstralAccessibilityComponent { astralAccessibilityPanel = "astral-modal"; astralAccessibilityIcon = "astral-icon"; options: Record = {}; - filterWidget: String[] = []; + enabledFeatures: String[] = []; ngOnInit() { - const astralElement = document.querySelector("astral-accessibility"); - const astralOptions = astralElement?.getAttribute("astral-options"); + const astralElement = document.querySelector('astral-accessibility'); + const astralOptions = astralElement?.getAttribute('astral-features'); if (astralOptions) { this.options = JSON.parse(astralOptions); - this.filterWidget = this.options["filterWidget"]; + this.enabledFeatures = this.options['enabledFeatures']; } const phones = diff --git a/projects/astral-accessibility/src/main.ts b/projects/astral-accessibility/src/main.ts index 297e49c..55b0b87 100644 --- a/projects/astral-accessibility/src/main.ts +++ b/projects/astral-accessibility/src/main.ts @@ -4,21 +4,12 @@ import { createApplication } from "@angular/platform-browser"; import { AstralAccessibilityComponent } from "./lib/astral-accessibility.component"; import "zone.js"; -(window as any).initializeAstral = async function initializeAstral( - options?: Record, -) { +(window as any).initializeAstral = async function initializeAstral(features?: Record) { try { //When no options are given by default all widgets are allowed - if (!options) { - options = { - filterWidget: [ - "Screen Reader", - "Contrast", - "Saturation", - "Bigger Text", - "Text Spacing", - "Screen Mask", - ], + if (!features) { + features = { + enabledFeatures: ["Screen Reader", "Contrast", "Saturation", "Text Size", "Text Spacing", "Screen Mask", "Line Height"] }; } @@ -29,13 +20,8 @@ import "zone.js"; customElements.define("astral-accessibility", widget); const doc = app.injector.get(DOCUMENT); - const astralAccessibilityElement = doc.createElement( - "astral-accessibility", - ); - astralAccessibilityElement.setAttribute( - "astral-options", - JSON.stringify(options), - ); + const astralAccessibilityElement = doc.createElement('astral-accessibility'); + astralAccessibilityElement.setAttribute('astral-features', JSON.stringify(features)); doc.body.appendChild(astralAccessibilityElement); } catch (err) { console.error(err);