Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

Component/vetting tiny slider #219

Open
wants to merge 2 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 78 additions & 76 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.11.1)
i18n (~> 0.7)
activesupport (6.0.2.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
zeitwerk (~> 2.2)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
coffee-script (2.4.1)
Expand All @@ -24,34 +25,35 @@ GEM
ethon (0.12.0)
ffi (>= 1.3.0)
eventmachine (1.2.7)
eventmachine (1.2.7-x64-mingw32)
execjs (2.7.0)
faraday (0.17.0)
faraday (1.0.0)
multipart-post (>= 1.2, < 3)
ffi (1.11.1)
ffi (1.12.1)
ffi (1.12.1-x64-mingw32)
forwardable-extended (2.6.0)
gemoji (3.0.1)
github-pages (202)
activesupport (= 4.2.11.1)
github-pages (204)
github-pages-health-check (= 1.16.1)
jekyll (= 3.8.5)
jekyll-avatar (= 0.6.0)
jekyll-avatar (= 0.7.0)
jekyll-coffeescript (= 1.1.1)
jekyll-commonmark-ghpages (= 0.1.6)
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.11.0)
jekyll-feed (= 0.13.0)
jekyll-gist (= 1.5.0)
jekyll-github-metadata (= 2.12.1)
jekyll-mentions (= 1.4.1)
jekyll-optional-front-matter (= 0.3.0)
jekyll-github-metadata (= 2.13.0)
jekyll-mentions (= 1.5.1)
jekyll-optional-front-matter (= 0.3.2)
jekyll-paginate (= 1.1.0)
jekyll-readme-index (= 0.2.0)
jekyll-redirect-from (= 0.14.0)
jekyll-relative-links (= 0.6.0)
jekyll-remote-theme (= 0.4.0)
jekyll-readme-index (= 0.3.0)
jekyll-redirect-from (= 0.15.0)
jekyll-relative-links (= 0.6.1)
jekyll-remote-theme (= 0.4.1)
jekyll-sass-converter (= 1.5.2)
jekyll-seo-tag (= 2.5.0)
jekyll-sitemap (= 1.2.0)
jekyll-swiss (= 0.4.0)
jekyll-seo-tag (= 2.6.1)
jekyll-sitemap (= 1.4.0)
jekyll-swiss (= 1.0.0)
jekyll-theme-architect (= 0.1.1)
jekyll-theme-cayman (= 0.1.1)
jekyll-theme-dinky (= 0.1.1)
Expand All @@ -61,27 +63,26 @@ GEM
jekyll-theme-midnight (= 0.1.1)
jekyll-theme-minimal (= 0.1.1)
jekyll-theme-modernist (= 0.1.1)
jekyll-theme-primer (= 0.5.3)
jekyll-theme-primer (= 0.5.4)
jekyll-theme-slate (= 0.1.1)
jekyll-theme-tactile (= 0.1.1)
jekyll-theme-time-machine (= 0.1.1)
jekyll-titles-from-headings (= 0.5.1)
jemoji (= 0.10.2)
jekyll-titles-from-headings (= 0.5.3)
jemoji (= 0.11.1)
kramdown (= 1.17.0)
liquid (= 4.0.0)
listen (= 3.1.5)
liquid (= 4.0.3)
mercenary (~> 0.3)
minima (= 2.5.0)
minima (= 2.5.1)
nokogiri (>= 1.10.4, < 2.0)
rouge (= 3.11.0)
rouge (= 3.13.0)
terminal-table (~> 1.4)
github-pages-health-check (1.16.1)
addressable (~> 2.3)
dnsruby (~> 1.60)
octokit (~> 4.0)
public_suffix (~> 3.0)
typhoeus (~> 1.3)
html-pipeline (2.12.0)
html-pipeline (2.12.3)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.6.0)
Expand All @@ -100,8 +101,8 @@ GEM
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
jekyll-avatar (0.6.0)
jekyll (~> 3.0)
jekyll-avatar (0.7.0)
jekyll (>= 3.0, < 5.0)
jekyll-coffeescript (1.1.1)
coffee-script (~> 2.2)
coffee-script-source (~> 1.11.1)
Expand All @@ -114,36 +115,36 @@ GEM
rouge (>= 2.0, < 4.0)
jekyll-default-layout (0.1.4)
jekyll (~> 3.0)
jekyll-feed (0.11.0)
jekyll (~> 3.3)
jekyll-feed (0.13.0)
jekyll (>= 3.7, < 5.0)
jekyll-gist (1.5.0)
octokit (~> 4.2)
jekyll-github-metadata (2.12.1)
jekyll (~> 3.4)
jekyll-github-metadata (2.13.0)
jekyll (>= 3.4, < 5.0)
octokit (~> 4.0, != 4.4.0)
jekyll-mentions (1.4.1)
jekyll-mentions (1.5.1)
html-pipeline (~> 2.3)
jekyll (~> 3.0)
jekyll-optional-front-matter (0.3.0)
jekyll (~> 3.0)
jekyll (>= 3.7, < 5.0)
jekyll-optional-front-matter (0.3.2)
jekyll (>= 3.0, < 5.0)
jekyll-paginate (1.1.0)
jekyll-readme-index (0.2.0)
jekyll (~> 3.0)
jekyll-redirect-from (0.14.0)
jekyll (~> 3.3)
jekyll-relative-links (0.6.0)
jekyll (~> 3.3)
jekyll-remote-theme (0.4.0)
jekyll-readme-index (0.3.0)
jekyll (>= 3.0, < 5.0)
jekyll-redirect-from (0.15.0)
jekyll (>= 3.3, < 5.0)
jekyll-relative-links (0.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-remote-theme (0.4.1)
addressable (~> 2.0)
jekyll (~> 3.5)
rubyzip (>= 1.2.1, < 3.0)
jekyll (>= 3.5, < 5.0)
rubyzip (>= 1.3.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-seo-tag (2.5.0)
jekyll (~> 3.3)
jekyll-sitemap (1.2.0)
jekyll (~> 3.3)
jekyll-swiss (0.4.0)
jekyll-seo-tag (2.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-swiss (1.0.0)
jekyll-theme-architect (0.1.1)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
Expand Down Expand Up @@ -171,8 +172,8 @@ GEM
jekyll-theme-modernist (0.1.1)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-primer (0.5.3)
jekyll (~> 3.5)
jekyll-theme-primer (0.5.4)
jekyll (> 3.5, < 5.0)
jekyll-github-metadata (~> 2.9)
jekyll-seo-tag (~> 2.0)
jekyll-theme-slate (0.1.1)
Expand All @@ -184,44 +185,44 @@ GEM
jekyll-theme-time-machine (0.1.1)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-titles-from-headings (0.5.1)
jekyll (~> 3.3)
jekyll-titles-from-headings (0.5.3)
jekyll (>= 3.3, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
jemoji (0.10.2)
jemoji (0.11.1)
gemoji (~> 3.0)
html-pipeline (~> 2.2)
jekyll (~> 3.0)
json (2.2.0)
jekyll (>= 3.0, < 5.0)
kramdown (1.17.0)
liquid (4.0.0)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
liquid (4.0.3)
listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
mini_portile2 (2.4.0)
minima (2.5.0)
jekyll (~> 3.5)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.12.2)
minitest (5.14.0)
multipart-post (2.1.1)
nokogiri (1.10.4)
nokogiri (1.10.7)
mini_portile2 (~> 2.4.0)
nokogiri (1.10.7-x64-mingw32)
mini_portile2 (~> 2.4.0)
octokit (4.14.0)
octokit (4.15.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (3.1.1)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
rouge (3.11.0)
rouge (3.13.0)
ruby-enum (0.7.2)
i18n
ruby_dep (1.5.0)
rubyzip (1.3.0)
rubyzip (2.1.0)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
Expand All @@ -236,16 +237,17 @@ GEM
thread_safe (0.3.6)
typhoeus (1.3.1)
ethon (>= 0.9.0)
tzinfo (1.2.5)
tzinfo (1.2.6)
thread_safe (~> 0.1)
unicode-display_width (1.6.0)
unicode-display_width (1.6.1)
zeitwerk (2.2.2)

PLATFORMS
ruby
x64-mingw32

DEPENDENCIES
github-pages (= 202)
json
github-pages (= 204)

BUNDLED WITH
2.0.2
8 changes: 8 additions & 0 deletions _component/tiny-slider/component-usage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { tns } from "./node_modules/tiny-slider/src/tiny-slider";

var slider = tns({
container: ".my-slider",
items: 1,
slideBy: "page",
autoplay: false
});
1 change: 1 addition & 0 deletions _component/tiny-slider/component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "./node_modules/tiny-slider/dist/tiny-slider.css";
20 changes: 20 additions & 0 deletions _component/tiny-slider/component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div class="my-slider">
<div>
<img
src="https://via.placeholder.com/150/ffff00/000000?Text=3"
alt="C/O https://placeholder.com/"
/>
</div>
<div>
<img
src="https://via.placeholder.com/150/ffff00/000000?Text=3"
alt="C/O https://placeholder.com/"
/>
</div>
<div>
<img
src="https://via.placeholder.com/150/ffff00/000000?Text=3"
alt="C/O https://placeholder.com/"
/>
</div>
</div>
64 changes: 64 additions & 0 deletions _component/tiny-slider/content/_code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<div class="tabs">
<div class="code-tab-control tab-control">
<ul class="code-tab-list tab-list" role="tablist">
<li class="code-tab-item tab-item">
<a href="#text" id="js-text-link" role="tab" aria-controls="text">HTML</a>
</li>
<li class="code-tab-item tab-item">
<a href="#css" id="js-css-link" role="tab" aria-controls="css">CSS</a>
</li>
<li class="code-tab-item tab-item">
<a href="#js" id="js-js-link" role="tab" aria-controls="js">JavaScript</a>
</li>
</ul>
</div><!-- //.tab-control -->

<div class="tab-group">

<div id="text" class="code-tab tab-content" role="tabpanel">

<div class="tab__body">
<div class="copy-html">
{% highlight html %}
{% include_relative component.html %}
{% endhighlight %}
</div>
</div>

<ul class="button-group">
<li><button data-clipboard-action="copy" data-clipboard-target=".copy-html" class="copy-clipboard button button--tertiary">Copy HTML to clipboard</button></li>
</ul>
</div>

<div id="css" class="code-tab tab-content" role="tabpanel">
<div class="tab__body">
<div class="code-block">
<div class="copy-css-snippet">
{% highlight css %}
{% include_relative component.css %}
{% endhighlight %}
</div>
</div><!--/.code-block-->
</div><!--/.tab__body-->
<ul class="button-group">
<li><button data-clipboard-action="copy" data-clipboard-target=".copy-css-snippet" class="copy-clipboard button button--tertiary">Copy CSS to clipboard</button></li>
</ul>
</div><!--/.code-tab-->

<div id="js" class="code-tab tab-content" role="tabpanel">
<div class="tab__body">
<div class="code-block">
<div class="copy-js-snippet">
{% highlight javascript %}
{% include_relative component-usage.js %}
{% endhighlight %}
</div><!--/.copy-js-snippet-->
</div><!--/.code-block-->
</div><!--/.tab__body-->
<ul class="button-group">
<li><button data-clipboard-action="copy" data-clipboard-target=".copy-js-snippet" class="copy-clipboard button button--tertiary">Copy JavaScript to clipboard</button></li>
</ul>

</div>
</div>
</div>
7 changes: 7 additions & 0 deletions _component/tiny-slider/content/_documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<h3>Installation</h3>

<p>You can view full documentation for this component in the <a href="https://github.com/ganlanyuan/tiny-slider">Tiny Slider repository</a>. This documentation should be enough to get you going.</p>

<div class="u-spacing__bottom--medium">
<code>npm install tiny-slider --save</code>
</div>
7 changes: 7 additions & 0 deletions _component/tiny-slider/content/_notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The Tiny Slider component is based off the popular library [Tiny Slider 2](https://github.com/ganlanyuan/tiny-slider#fallback), it was chosen because it passed accessibility, performance, and quality tests. Therefore the [tiny-slider.js](https://github.com/ganlanyuan/tiny-slider/blob/master/dist/min/tiny-slider.js) file and [tiny-slider.css](https://github.com/ganlanyuan/tiny-slider/blob/master/dist/tiny-slider.css) file is necessary to use this component out of the box before customizing for your own use. Pikaday is also generally flexible enough with a strong API to accomplish most goals of any carousel you might encounter.

## Accessibility Notes

- Autoplaying will lead to less than desirable screen reader behavior
- Looping slides will make the "count" listed by screen readers behave abnormally
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@treighton can you elaborate on "abnormally"?

- Even though the slider out of the box passes WCAG 2.1AA you should still make sure to check your build to ensure that things like color contrast, and navigability still pass WCAG 2.1AA
4 changes: 4 additions & 0 deletions _component/tiny-slider/content/_resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<ul>
<li><a href="https://github.com/ganlanyuan/tiny-slider">Tiny Slider Github</a></li>
<li><a href="http://ganlanyuan.github.io/tiny-slider/demo/">Tiny Slider Demos</a></li>
</ul>
Loading