From 91705c23b44e4cc36a1d5225c3013aa1920b2101 Mon Sep 17 00:00:00 2001 From: Jon Gunderson Date: Sat, 23 Mar 2019 19:56:35 -0500 Subject: [PATCH 01/20] added visable pause button and converted a elements to button elements --- examples/carousel/carousel-1/carousel-1.html | 93 ++++---- examples/carousel/carousel-1/css/carousel.css | 201 +++++++++++++----- examples/carousel/carousel-1/js/carousel.js | 26 +-- .../carousel/carousel-1/js/carouselButtons.js | 21 -- .../carousel/carousel-1/js/pauseButton.js | 16 +- test/tests/carousel-1.js | 10 +- 6 files changed, 213 insertions(+), 154 deletions(-) diff --git a/examples/carousel/carousel-1/carousel-1.html b/examples/carousel/carousel-1/carousel-1.html index 3c93d9c3cf..9630943a20 100644 --- a/examples/carousel/carousel-1/carousel-1.html +++ b/examples/carousel/carousel-1/carousel-1.html @@ -48,31 +48,54 @@

Example

@@ -223,7 +223,7 @@

diff --git a/examples/carousel/carousel-1/css/carousel.css b/examples/carousel/carousel-1/css/carousel.css index a6a534c880..3dbc8445cc 100644 --- a/examples/carousel/carousel-1/css/carousel.css +++ b/examples/carousel/carousel-1/css/carousel.css @@ -36,7 +36,17 @@ .carousel .carousel-inner .carousel-caption a { text-decoration: underline; - border: none; +} + +.carousel .carousel-inner .carousel-caption a, +.carousel .carousel-inner .carousel-caption span.contrast { + display: inline-block; + background-color: rgba(0, 0, 0, 0.6); + padding-left: 0.25em; + padding-right: 0.25em; + border-radius: 5px; + border: 2px solid transparent; + margin: 0; } .carousel .carousel-inner .carousel-caption h3 a { @@ -44,10 +54,16 @@ font-weight: 600; } -.carousel .carousel-inner .carousel-caption a:focus, -.carousel .carousel-inner .carousel-caption a:hover { - outline: solid 2px #fff; - outline-offset: 1px; +.carousel .carousel-inner .carousel-caption a:hover, +.carousel .carousel-inner .carousel-caption span.contrast:hover { + background-color: rgba(0, 0, 0, 1); + margin: 0; +} + +.carousel .carousel-inner .carousel-caption a:focus { + background-color: rgba(0, 0, 0, 1); + border-color: #fff; + margin: 0; } .carousel .carousel-inner .carousel-caption p { @@ -56,7 +72,7 @@ margin-bottom: 0; } -.carousel .carousel-caption { +.carousel .carousel-inner .carousel-caption { position: absolute; right: 15%; bottom: 0; @@ -65,20 +81,6 @@ padding-bottom: 20px; color: #fff; text-align: center; - text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); -} - -.carousel .carousel-inner .carousel-caption { - bottom: 0; - left: 0; - padding: 3% 3% 50px; - right: 0; - text-shadow: none; -} - -.carousel:hover .carousel-inner .carousel-caption, -.carousel .carousel-item.focus .carousel-caption { - background-color: rgba(0, 0, 0, 0.4); } .carousel .carousel-inner, @@ -92,14 +94,11 @@ .carousel .carousel-control { position: absolute; top: 0; + bottom: 0; z-index: 10; background-color: transparent; -} - -.carousel .carousel-control svg { - position: relative; - display: inline-block; - top: 45%; + width: 15%; + border: 1px solid red; } .carousel .carousel-control svg polygon { @@ -112,16 +111,10 @@ .carousel .carousel-control.previous { left: 0; - bottom: 0; - width: 15%; - border: none; } .carousel .carousel-control.next { right: 0; - bottom: 0; - width: 15%; - border: none; } .carousel .carousel-control.previous:focus, From 4cf22c63b6e679c3944126aa6695efb1cf9b6bae Mon Sep 17 00:00:00 2001 From: Jon Gunderson Date: Mon, 25 Mar 2019 16:46:07 -0500 Subject: [PATCH 04/20] fixed css issue --- examples/carousel/carousel-1/css/carousel.css | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/carousel/carousel-1/css/carousel.css b/examples/carousel/carousel-1/css/carousel.css index 3dbc8445cc..f45c2b3adc 100644 --- a/examples/carousel/carousel-1/css/carousel.css +++ b/examples/carousel/carousel-1/css/carousel.css @@ -98,7 +98,6 @@ z-index: 10; background-color: transparent; width: 15%; - border: 1px solid red; } .carousel .carousel-control svg polygon { From 36561169e3bb09ca4e69d5358c1f2dd028d7e3e0 Mon Sep 17 00:00:00 2001 From: Jon Gunderson Date: Mon, 25 Mar 2019 17:42:10 -0500 Subject: [PATCH 05/20] fixed css issue --- examples/carousel/carousel-1/css/carousel.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/carousel/carousel-1/css/carousel.css b/examples/carousel/carousel-1/css/carousel.css index f45c2b3adc..9703a109d8 100644 --- a/examples/carousel/carousel-1/css/carousel.css +++ b/examples/carousel/carousel-1/css/carousel.css @@ -41,7 +41,7 @@ .carousel .carousel-inner .carousel-caption a, .carousel .carousel-inner .carousel-caption span.contrast { display: inline-block; - background-color: rgba(0, 0, 0, 0.6); + background-color: rgba(0, 0, 0, 0.65); padding-left: 0.25em; padding-right: 0.25em; border-radius: 5px; @@ -98,6 +98,7 @@ z-index: 10; background-color: transparent; width: 15%; + border: none; } .carousel .carousel-control svg polygon { From afbd4c6f54ff7bc45a4b1d745c3c20981a446c1c Mon Sep 17 00:00:00 2001 From: Jon Gunderson Date: Wed, 27 Mar 2019 16:36:20 -0500 Subject: [PATCH 06/20] updated color contrast of text and positining of controls --- examples/carousel/carousel-1/carousel-1.html | 9 ++- examples/carousel/carousel-1/css/carousel.css | 3 +- examples/carousel/carousel-1/js/carousel.js | 57 +++++++++++-------- .../carousel/carousel-1/js/carouselButtons.js | 4 +- .../carousel/carousel-1/js/carouselItem.js | 4 +- 5 files changed, 43 insertions(+), 34 deletions(-) diff --git a/examples/carousel/carousel-1/carousel-1.html b/examples/carousel/carousel-1/carousel-1.html index 2d468920ae..42a47fdfa6 100644 --- a/examples/carousel/carousel-1/carousel-1.html +++ b/examples/carousel/carousel-1/carousel-1.html @@ -67,8 +67,11 @@

Example

- + + + @@ -155,7 +158,7 @@

- Survey confirms that TV is America’s most trusted institution + Great Children's Programming on Public TV

diff --git a/examples/carousel/carousel-1/css/carousel.css b/examples/carousel/carousel-1/css/carousel.css index 9703a109d8..fb13731c8f 100644 --- a/examples/carousel/carousel-1/css/carousel.css +++ b/examples/carousel/carousel-1/css/carousel.css @@ -174,8 +174,7 @@ .carousel .carousel-pause[aria-disabled=true] svg polygon.pause, .carousel .carousel-pause[aria-disabled=true] svg polygon.play { - stroke: transparent; - fill: transparent; + opacity: 0.7; } .carousel .carousel-pause[aria-disabled=true] svg polygon.disabled { diff --git a/examples/carousel/carousel-1/js/carousel.js b/examples/carousel/carousel-1/js/carousel.js index f94dcb8e4c..757b737745 100644 --- a/examples/carousel/carousel-1/js/carousel.js +++ b/examples/carousel/carousel-1/js/carousel.js @@ -149,45 +149,50 @@ Carousel.prototype.rotateSlides = function () { setTimeout(this.rotateSlides.bind(this), this.timeInterval); }; -Carousel.prototype.startRotation = function () { +Carousel.prototype.updatePauseButtonDisabledState = function () { + if (this.hasHover || this.hasFocus) { + this.pauseButton.setAttribute('aria-disabled', 'true'); + } + else { + this.pauseButton.removeAttribute('aria-disabled'); + } +}; + +Carousel.prototype.updateRotation = function () { + if (!this.hasHover && !this.hasFocus && !this.isStopped) { this.rotate = true; + } + else { + this.rotate = false; + } + + if (this.isStopped) { this.liveRegionNode.setAttribute('aria-live', 'off'); + this.pauseButton.setAttribute('aria-label', this.playLabel); + this.pauseButton.classList.remove('pause'); + this.pauseButton.classList.add('play'); + } + else { + this.liveRegionNode.setAttribute('aria-live', 'polite'); this.pauseButton.setAttribute('aria-label', this.pauseLabel); this.pauseButton.classList.remove('play'); this.pauseButton.classList.add('pause'); } - this.disablePauseButton(); -}; -Carousel.prototype.stopRotation = function () { - this.rotate = false; - this.liveRegionNode.setAttribute('aria-live', 'polite'); - this.pauseButton.setAttribute('aria-label', this.playLabel); - this.pauseButton.classList.remove('pause'); - this.pauseButton.classList.add('play'); - this.disablePauseButton(); -}; - -Carousel.prototype.disablePauseButton = function () { - if (this.hasHover || this.hasFocus) { - this.pauseButton.setAttribute('aria-disabled', 'true'); - } - else { - this.pauseButton.removeAttribute('aria-disabled'); - } + this.updatePauseButtonDisabledState(); }; Carousel.prototype.toggleRotation = function () { if (this.isStopped) { if (this.pauseButton.getAttribute('aria-disabled') !== 'true') { this.isStopped = false; - this.startRotation(); + this.updateRotation(); } } else { this.isStopped = true; - this.stopRotation(); + this.updateRotation(); } }; @@ -199,14 +204,16 @@ Carousel.prototype.handleImageLinkBlur = function () { this.liveRegionNode.classList.remove('focus'); }; -Carousel.prototype.handleMouseOver = function () { - this.hasHover = true; - this.stopRotation(); +Carousel.prototype.handleMouseOver = function (event) { + if (!this.pauseButton.contains(event.target)) { + this.hasHover = true; + } + this.updateRotation(); }; Carousel.prototype.handleMouseOut = function () { this.hasHover = false; - this.startRotation(); + this.updateRotation(); }; /* Initialize Carousel Tablists */ diff --git a/examples/carousel/carousel-1/js/carouselButtons.js b/examples/carousel/carousel-1/js/carouselButtons.js index d2acf78cc4..82c6396775 100644 --- a/examples/carousel/carousel-1/js/carouselButtons.js +++ b/examples/carousel/carousel-1/js/carouselButtons.js @@ -58,11 +58,11 @@ CarouselButton.prototype.handleClick = function (event) { CarouselButton.prototype.handleFocus = function (event) { this.carousel.hasFocus = true; this.domNode.classList.add('focus'); - this.carousel.stopRotation(); + this.carousel.updateRotation(); }; CarouselButton.prototype.handleBlur = function (event) { this.carousel.hasFocus = false; this.domNode.classList.remove('focus'); - this.carousel.startRotation(); + this.carousel.updateRotation(); }; diff --git a/examples/carousel/carousel-1/js/carouselItem.js b/examples/carousel/carousel-1/js/carouselItem.js index 7ed5417f63..dc1f1d1513 100644 --- a/examples/carousel/carousel-1/js/carouselItem.js +++ b/examples/carousel/carousel-1/js/carouselItem.js @@ -32,11 +32,11 @@ CarouselItem.prototype.show = function () { CarouselItem.prototype.handleFocusIn = function (event) { this.domNode.classList.add('focus'); this.carousel.hasFocus = true; - this.carousel.stopRotation(); + this.carousel.updateRotation(); }; CarouselItem.prototype.handleFocusOut = function (event) { this.domNode.classList.remove('focus'); this.carousel.hasFocus = false; - this.carousel.startRotation(); + this.carousel.updateRotation(); }; From 753f8ba72fb8e50c5dad0514b4b1a04e9880ed64 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 13 May 2019 20:01:31 -0500 Subject: [PATCH 07/20] updated carousel example --- .../carousel/{carousel-1 => }/carousel-1.html | 83 +++--- examples/carousel/carousel-1/css/carousel.css | 251 ------------------ examples/carousel/css/carousel-1.css | 186 +++++++++++++ .../images/amsterdamslide__800x600.jpg | Bin .../images/britcomdavidslide__800x600.jpg | Bin .../images/foyleswarslide__800x600.jpg | Bin .../images/lands-endslide__800x600.jpg | Bin .../images/mag800-2__800x600.jpg | Bin .../images/trustslide-2__800x600.jpg | Bin .../carousel/{carousel-1 => }/js/carousel.js | 37 +-- .../{carousel-1 => }/js/carouselButtons.js | 0 .../{carousel-1 => }/js/carouselItem.js | 0 .../{carousel-1 => }/js/pauseButton.js | 0 13 files changed, 244 insertions(+), 313 deletions(-) rename examples/carousel/{carousel-1 => }/carousel-1.html (87%) delete mode 100644 examples/carousel/carousel-1/css/carousel.css create mode 100644 examples/carousel/css/carousel-1.css rename examples/carousel/{carousel-1 => }/images/amsterdamslide__800x600.jpg (100%) rename examples/carousel/{carousel-1 => }/images/britcomdavidslide__800x600.jpg (100%) rename examples/carousel/{carousel-1 => }/images/foyleswarslide__800x600.jpg (100%) rename examples/carousel/{carousel-1 => }/images/lands-endslide__800x600.jpg (100%) rename examples/carousel/{carousel-1 => }/images/mag800-2__800x600.jpg (100%) rename examples/carousel/{carousel-1 => }/images/trustslide-2__800x600.jpg (100%) rename examples/carousel/{carousel-1 => }/js/carousel.js (86%) rename examples/carousel/{carousel-1 => }/js/carouselButtons.js (100%) rename examples/carousel/{carousel-1 => }/js/carouselItem.js (100%) rename examples/carousel/{carousel-1 => }/js/pauseButton.js (100%) diff --git a/examples/carousel/carousel-1/carousel-1.html b/examples/carousel/carousel-1.html similarity index 87% rename from examples/carousel/carousel-1/carousel-1.html rename to examples/carousel/carousel-1.html index 42a47fdfa6..9369dbffa9 100644 --- a/examples/carousel/carousel-1/carousel-1.html +++ b/examples/carousel/carousel-1.html @@ -6,13 +6,13 @@ - - - - + + + + - + @@ -22,10 +22,10 @@
@@ -51,54 +51,45 @@

Example

- - -