From 84865fbfd21441399c000b88562ad88123284c68 Mon Sep 17 00:00:00 2001 From: Ethan Selzer Date: Sun, 1 Apr 2018 22:02:38 -0700 Subject: [PATCH] Example: Add Hint and Responsive Images + Updates --- example/src/components/ReactSlick.js | 16 +++--- example/src/pages/Basic.js | 53 +++++++++++++++++ .../pages/EnlargedImageContainerDimensions.js | 18 +++--- example/src/pages/ExternalEnlargedImage.js | 9 +-- example/src/pages/FixedWidthSmallImage.js | 11 ++-- example/src/pages/Hint.js | 57 +++++++++++++++++++ example/src/pages/ReactSlick.js | 2 +- .../{SideBySide.js => ResponsiveImages.js} | 37 ++++++------ example/src/router.js | 8 ++- 9 files changed, 159 insertions(+), 52 deletions(-) create mode 100644 example/src/pages/Basic.js create mode 100644 example/src/pages/Hint.js rename example/src/pages/{SideBySide.js => ResponsiveImages.js} (81%) diff --git a/example/src/components/ReactSlick.js b/example/src/components/ReactSlick.js index 97300f57..68682f7c 100644 --- a/example/src/components/ReactSlick.js +++ b/example/src/components/ReactSlick.js @@ -69,19 +69,19 @@ export default class ReactSlickExample extends Component {
diff --git a/example/src/pages/Basic.js b/example/src/pages/Basic.js new file mode 100644 index 00000000..eb191241 --- /dev/null +++ b/example/src/pages/Basic.js @@ -0,0 +1,53 @@ +import React, { Component } from 'react'; +import ReactImageMagnify from '../pkg-lnk/ReactImageMagnify'; +import SpacedSpan from '../components/SpacedSpan'; + +import './app.css'; + +import watchImg687 from '../images/wristwatch_687.jpg'; +import watchImg1200 from '../images/wristwatch_1200.jpg'; + +export default class BasicExample extends Component { + render() { + return ( +
+
+ +
+
+

Basic Example

+

+ Side by Side enlargement for mouse input. +

+

+ In place enlargement for touch input. +

+

+ Fluid between breakpoints. +

+

+ Please see + + + source code + + + for details. +

+
+
+
+ ); + } +} diff --git a/example/src/pages/EnlargedImageContainerDimensions.js b/example/src/pages/EnlargedImageContainerDimensions.js index b974f188..20e3c0e4 100644 --- a/example/src/pages/EnlargedImageContainerDimensions.js +++ b/example/src/pages/EnlargedImageContainerDimensions.js @@ -38,20 +38,18 @@ export default class EnlargedImageContainerDimensions extends Component {

- Exmample specifies width of + This example specifies width of 200% and height of 100%. diff --git a/example/src/pages/ExternalEnlargedImage.js b/example/src/pages/ExternalEnlargedImage.js index 690fe950..7b052a06 100644 --- a/example/src/pages/ExternalEnlargedImage.js +++ b/example/src/pages/ExternalEnlargedImage.js @@ -12,14 +12,7 @@ export default class ReactSlickExample extends Component {

diff --git a/example/src/pages/FixedWidthSmallImage.js b/example/src/pages/FixedWidthSmallImage.js index 18fc4239..b1eda3e0 100644 --- a/example/src/pages/FixedWidthSmallImage.js +++ b/example/src/pages/FixedWidthSmallImage.js @@ -11,18 +11,17 @@ export default class extends Component {
diff --git a/example/src/pages/Hint.js b/example/src/pages/Hint.js new file mode 100644 index 00000000..7e4dace5 --- /dev/null +++ b/example/src/pages/Hint.js @@ -0,0 +1,57 @@ +import React, { Component } from 'react'; +import ReactImageMagnify from '../pkg-lnk/ReactImageMagnify'; +import SpacedSpan from '../components/SpacedSpan'; + +import './app.css'; + +import watchImg687 from '../images/wristwatch_687.jpg'; +import watchImg1200 from '../images/wristwatch_1200.jpg'; + +export default class BasicExample extends Component { + render() { + return ( +
+
+ +
+
+

Hint Example

+

+ Helps inform users of zoom feature. +

+

+ Configurable text for mouse and touch inputs. English defaults provided. +

+

+ Custom component option. +

+

+ Hidden after first interaction by default. +

+

+ Please see + + + source code + + + for details. +

+
+
+
+ ); + } +} diff --git a/example/src/pages/ReactSlick.js b/example/src/pages/ReactSlick.js index 86f2dfb0..4826efd8 100644 --- a/example/src/pages/ReactSlick.js +++ b/example/src/pages/ReactSlick.js @@ -45,7 +45,7 @@ export default class ReactSlickExample extends Component {

Initial file size optimized via - srcSet + srcset and diff --git a/example/src/pages/SideBySide.js b/example/src/pages/ResponsiveImages.js similarity index 81% rename from example/src/pages/SideBySide.js rename to example/src/pages/ResponsiveImages.js index c6204502..526f3f1a 100644 --- a/example/src/pages/SideBySide.js +++ b/example/src/pages/ResponsiveImages.js @@ -38,37 +38,29 @@ export default class BasicExample extends Component {

-

Basic Example

-

- Side by Side enlargement for mouse input. -

-

- In place enlargement for touch input. -

+

Responsive Images Example

Fluid between breakpoints.

Initial file size optimized via - srcSet + srcset and @@ -76,10 +68,21 @@ export default class BasicExample extends Component { attributes.

+

+ For more information on responsive images, please try these resources: +
+ + Responsive Images 101 + +
+ + Responsive Images - The srcset and sizes Attributes + +

Please see - + source code diff --git a/example/src/router.js b/example/src/router.js index c23c7b4b..4045f899 100644 --- a/example/src/router.js +++ b/example/src/router.js @@ -1,7 +1,9 @@ import React from 'react'; import { Router, Route } from 'react-router'; -import SideBySide from './pages/SideBySide'; +import Basic from './pages/Basic'; +import ResponsiveImages from './pages/ResponsiveImages'; +import Hint from './pages/Hint'; import ReactSlick from './pages/ReactSlick'; import EnlargedImageContainerDimensions from './pages/EnlargedImageContainerDimensions'; import FixedWidthSmallImage from './pages/FixedWidthSmallImage'; @@ -9,7 +11,9 @@ import ExternalEnlargedImage from './pages/ExternalEnlargedImage'; const Routes = (props) => ( - + + +