|
1 | 1 | import React from 'react'; |
2 | 2 | import ReactDOM from 'react-dom'; |
3 | 3 | import Lightbox from '../../react-image-lightbox'; |
4 | | -import './stylesheets/app.scss'; |
| 4 | +import styles from './stylesheets/app.scss'; |
5 | 5 |
|
6 | | -const images = [ |
7 | | - 'images/1.jpg', |
8 | | - 'images/2.jpg', |
9 | | - 'images/3.jpg', |
10 | | - 'images/4.jpg', |
11 | | -]; |
| 6 | +import image1 from './images/1.jpg'; |
| 7 | +import image2 from './images/2.jpg'; |
| 8 | +import image3 from './images/3.jpg'; |
| 9 | +import image4 from './images/4.jpg'; |
| 10 | +import image1Thumb from './images/1_thumb.jpg'; |
| 11 | +import image2Thumb from './images/2_thumb.jpg'; |
| 12 | +import image3Thumb from './images/3_thumb.jpg'; |
| 13 | +import image4Thumb from './images/4_thumb.jpg'; |
12 | 14 |
|
13 | | -const thumbs = [ |
14 | | - 'images/1_thumb.jpg', |
15 | | - 'images/2_thumb.jpg', |
16 | | - 'images/3_thumb.jpg', |
17 | | - 'images/4_thumb.jpg', |
18 | | -]; |
| 15 | +const images = [ image1, image2, image3, image4 ]; |
| 16 | +const thumbs = [ image1Thumb, image2Thumb, image3Thumb, image4Thumb ]; |
19 | 17 |
|
20 | 18 | const titles = [ |
21 | 19 | '', |
@@ -89,15 +87,89 @@ const App = React.createClass({ |
89 | 87 |
|
90 | 88 | return ( |
91 | 89 | <div> |
92 | | - <button |
93 | | - type="button" |
94 | | - id="open-lightbox" |
95 | | - className="demo-button" |
96 | | - onClick={this.openLightbox} |
97 | | - > |
98 | | - Open Lightbox |
99 | | - </button> |
100 | | - {lightbox} |
| 90 | + <section className={styles['page-header']}> |
| 91 | + <h1 className={styles['project-name']}> |
| 92 | + React Image Lightbox |
| 93 | + </h1> |
| 94 | + |
| 95 | + <h2 className={styles['project-tagline']}> |
| 96 | + Lightbox component for React.js |
| 97 | + </h2> |
| 98 | + |
| 99 | + <a |
| 100 | + href="https://github.com/fritz-c/react-image-lightbox" |
| 101 | + className={styles.btn} |
| 102 | + > |
| 103 | + View on GitHub |
| 104 | + </a> |
| 105 | + |
| 106 | + <a |
| 107 | + href="https://github.com/fritz-c/react-image-lightbox/zipball/master" |
| 108 | + className={styles.btn} |
| 109 | + > |
| 110 | + Download .zip |
| 111 | + </a> |
| 112 | + |
| 113 | + <a |
| 114 | + href="https://github.com/fritz-c/react-image-lightbox/tarball/master" |
| 115 | + className={styles.btn} |
| 116 | + > |
| 117 | + Download .tar.gz |
| 118 | + </a> |
| 119 | + </section> |
| 120 | + |
| 121 | + <section className={styles['main-content']}> |
| 122 | + <h1> |
| 123 | + <a |
| 124 | + id="react-image-lightbox" |
| 125 | + className={styles.anchor} |
| 126 | + href="#react-image-lightbox" |
| 127 | + aria-hidden="true" |
| 128 | + > |
| 129 | + <span aria-hidden="true" className={`${styles.octicon} ${styles['octicon-link']}`}></span> |
| 130 | + </a> |
| 131 | + |
| 132 | + React Image Lightbox |
| 133 | + </h1> |
| 134 | + |
| 135 | + <p>A flexible lightbox component for displaying images in a React project.</p> |
| 136 | + |
| 137 | + <h3>Demo</h3> |
| 138 | + |
| 139 | + <div> |
| 140 | + <button |
| 141 | + type="button" |
| 142 | + id="open-lightbox" |
| 143 | + className={styles.demoButton} |
| 144 | + onClick={this.openLightbox} |
| 145 | + > |
| 146 | + Open Lightbox |
| 147 | + </button> |
| 148 | + {lightbox} |
| 149 | + </div> |
| 150 | + |
| 151 | + <p>Features</p> |
| 152 | + <ul> |
| 153 | + <li>Keyboard shortcuts (with rate limiting)</li> |
| 154 | + <li>Image Zoom</li> |
| 155 | + <li>Flexible rendering using src values assigned on the fly</li> |
| 156 | + <li>Image preloading for smoother viewing</li> |
| 157 | + <li>Few dependencies</li> |
| 158 | + <li>No external CSS</li> |
| 159 | + </ul> |
| 160 | + |
| 161 | + <a href="https://github.com/fritz-c/react-image-lightbox">Examples and Documentation on Github</a> |
| 162 | + |
| 163 | + <footer className={styles['site-footer']}> |
| 164 | + <span className={styles['site-footer-owner']}> |
| 165 | + <a href="https://github.com/fritz-c/react-image-lightbox">React Image Lightbox</a> is maintained by <a href="https://github.com/fritz-c">fritz-c</a>. |
| 166 | + </span> |
| 167 | + |
| 168 | + <span className={styles['site-footer-credits']}> |
| 169 | + This page was generated by <a href="https://pages.github.com">GitHub Pages</a> using the <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by <a href="https://twitter.com/jasonlong">Jason Long</a>. |
| 170 | + </span> |
| 171 | + </footer> |
| 172 | + </section> |
101 | 173 | </div> |
102 | 174 | ); |
103 | 175 | } |
|
0 commit comments