Repository: reactjs/react-page Branch: master Commit: 5f58d511c214 Files: 11 Total size: 33.7 KB Directory structure: gitextract_4tcqxmdi/ ├── .gitignore ├── LICENSE ├── README.md ├── package.json ├── server.js └── src/ ├── core/ │ └── SiteBoilerPlate.js ├── elements/ │ ├── Banner/ │ │ └── Banner.js │ └── VectorWidget/ │ └── VectorWidget.js ├── index.js ├── pages/ │ └── about.js └── style.css ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ node_modules npm-debug.log .DS_Store ================================================ FILE: LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: README.md ================================================ - - - **_This project is not actively maintained. Proceed at your own risk!_** - - - -

Render [React](http://www.github.com/facebook/react/) pages on the server or client - _effortlessly_.

-

Use CommonJS to build and share UI components.

-

Develop rapidly - instant reloading.


##Install (Mac/Linux - requires a recent version of node/npm) > Clone this project git clone https://github.com/facebook/react-page cd react-page npm install # install dependencies. > Try out the server rendering node server.js # open http://localhost:8080/index.html # Make changes to src/index.js, and refresh instantly! ##Philosophy ##### Why Server Rendering? - Faster Pages: Markup displayed before downloading JS (with SEO benefits) - Page generation on a fast server vs. low power client devices. - Instantly refresh while developing. - Static content sites: As easy as a single `wget` command. ##### Why React? - React is a client/server rendering framework from the ground up. - When performance constraints change, simply change _where_ you render it - don't change your app. - React is functional. Explore the documentation on the [React Github Page](http://www.github.com/facebook/react/). - Server rendering optional - you can always just use React as a declarative client side framework. ##Developing #### Default Project Structure The included directory structure suggests a way to organize a single _or_ multi-page app. `npm install` other components/libraries and they automatically work. It's the same commonJS that you know and love. react-page/ ├── package.json # Add npm dependencies here. ├── server.js # Start web server with `node server.js` ├── ... # Create more pages/directories here └── src # All your application JS. ├── elements/ # Shared React components. │ ├── SiteBoilerPlate.js # Reusable html/body component │ └── Banner.js # An example component for displaying text │ ├── index.js # localhost:8080/index.html routed here └── pages # Make your site structure └── about.js # localhost:8080/pages/about.html #### Everything Is A Component React's philosophy is that mutation-minimal functions and composition are the best tools for building sophisticated applications with low complexity. In React, _"components"_ are the tool for composing. `react-page` embraces this simplicity, even allowing the _entire page_ to be expressed as an arbitrarily deep composition of components. `react-page/src/index.js` corresponds to `index.html`. `index.js` is a React component that renders the ``,``, and all the contents of the page. If you look at `index.js`, you'll notice that it doesn't output all the `
`s and ``s directly - it _composes_ other components that take on much of that responsibility. `index.js` composes a `` component, and inside of `Banner.js`, you'll see that the implementation of `` outputs an `

` DOM component. Even DOM representations such as `

` are components in React To build out your app, just add or install more components with `npm`. #### Simple Default Page Routing Requests to `path/file.html` are routed to your React component located at `src/path/file.js`. By default all page requests are routed to the `src` directory, but you can customize that behavior via the `pageRouteRoot` setting. Here are a couple of examples of the default configuration: http://localhost:8080/index.html => react-page/src/pages/index.js http://localhost:8080/docs/hello.html => react-page/src/pages/docs/hello.js http://localhost:8080/pages/about.html => react-page/src/pages/about/index.js http://localhost:8080/path/img.png => react-page/src/path/img.png - Currently, every `html` routing must map to a `.js` file that exports a single React component, that renders the page, including `html/body` tags. - Routing is customizable (more later). ## How Does Server Rendering Work? - `react-page` computes page markup on the server, sends it to the client so the user can see it quickly. - The corresponding JavaScript is then packaged and sent. - The browser runs that JavaScript, so that all of the event handlers, interactions and update code will run seamlessly on top of the server generated markup. - From the developer's (and the user's) perspective, it's just as if the rendering occurred on the client, only faster. ## Command Line Usage: # --useSourceMaps=true # default:true # --useBrowserBuiltins=false # Allow node modules (util) - default:false # --logTiming=true # Shows colored timing metrics - default:true # --pageRouteRoot= # page URLs root - default: react-page/src # for example: node server.js --useSourceMaps=true **Node Modules in the Browser:** You can use modules installed via `npm`, but if anything requires builtin modules (such as `util`), make sure to enable the `useBrowserBuiltins` option. ## React As A Blogging Engine: React can power dynamic, network-connected apps. But with `react-page`, React can also be used to build a static blog, Github documentation, or any other static site. Because `react-page` uses server rendering, creating a static site is as easy as a single `wget` command. node server.js wget -mpck --user-agent="" -e robots=off http://localhost:8080/index.html Get `wget` on OS X: try http://osxdaily.com/2012/05/22/install-wget-mac-os-x/ or if you have brew: `brew install wget` This prebuilds your entire interactive site, so it can be served from a file server or github etc. **Don't forget** to enable gzip on your file server! React markup is large but compresses very well. ## Motivations/Next-Steps: -`react-page` is a rapid development environment for experimenting with new ways of building production web apps powered by React. It provides a common environment that allows sharing of modules client/server architecture prototypes. In order to use this technology in a production environment, you must audit and verify that the server rendering strategy is safe and suitable for your purposes. - You must ensure that a proper server sandbox is enforced. However, `react-page` _does_ run your UI rendering code inside of contextify as a preliminary sandbox. - In production, the js packaging features of `react-page` should be performed ahead of time and stored in a CDN. However, dynamic server rendering is a compelling production feature. - Additional connect middleware should be added to prevent stack traces from showing up in browser. #### TODO: - Windows support (depends on fixing https://github.com/facebook/node-haste/pull/2) - Allow sharing of css/images through npm packages. - Experiments with optimizing page load time - incremental streaming of markup/resources. - Advanced packaging such as splitting projects into several independently cacheable sub-packages. - require('image/path/img.jpg') should resolve to image path. - A way to automatically package/bundle css, regardless of file path of depending js resource. (using require('commonJSPath/to/css.css')) ================================================ FILE: package.json ================================================ { "name": "react-page", "version": "0.2.0", "description": "Starter Application for React, CommonJS, JSX, Server Rendering.", "main": "index.js", "start": "node server.js", "dependencies": { "React": "git://github.com/facebook/react.git", "optimist": "0.6.0", "react-page-middleware": "git://github.com/reactjs/react-page-middleware.git", "connect": "2.8.3" }, "author": { "name": "Jordan Walke", "email": "jordwalke@facebook.com", "url": "http://github.com/jordwalke" }, "engines": { "node": ">=0.10.0" }, "license": "Apache-2.0" } ================================================ FILE: server.js ================================================ /** * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ "use strict"; var connect = require('connect'); var http = require('http'); var optimist = require('optimist'); var path = require('path'); var reactMiddleware = require('react-page-middleware'); var argv = optimist.argv; var PROJECT_ROOT = __dirname; var FILE_SERVE_ROOT = path.join(PROJECT_ROOT, 'src'); var port = argv.port; var isServer = !argv.computeForPath; var serverDefaults = { serverRender: true, skipES5Shim: false, useBrowserBuiltins: false, logTiming: true, useSourceMaps: true, pageRouteRoot: FILE_SERVE_ROOT, sourceMapsType: 'linked' }; var computeDefaults = { serverRender: false, skipES5Shim: false, useBrowserBuiltins: false, logTiming: false, useSourceMaps: false, pageRouteRoot: FILE_SERVE_ROOT, sourceMapsType: 'linked' }; var defaults = isServer ? serverDefaults : computeDefaults; var buildOptions = { projectRoot: PROJECT_ROOT, skipES5Shim: argv.skipES5Shim == 'true', // Skip shim if you know you have // a very modern browser. useBrowserBuiltins: // Include node util modules. 'useBrowserBuiltins' in argv ? argv.useBrowserBuiltins === 'true' : defaults.useBrowserBuiltins, logTiming: 'logTiming' in argv ? // Colored timing logs. argv.logTiming === 'true' : defaults.logTiming, sourceMapsType: 'sourceMapsType' in argv ? argv.sourceMapsType: defaults.sourceMapsType, pageRouteRoot: 'pageRouteRoot' in argv ? argv.pageRouteRoot : defaults.pageRouteRoot, // URLs based in this directory useSourceMaps: 'useSourceMaps' in argv ? argv.useSourceMaps === 'true' : defaults.useSourceMaps, // Generate client source maps. ignorePaths: function(p) { // Additional filtering return p.indexOf('__tests__') !== -1; }, blacklistRE: argv.blacklistRE && new RegExp(argv.blacklistRE), serverRender: 'serverRender' in argv ? argv.serverRender === 'true': defaults.serverRender, dev: argv.dev === 'true' }; if (!isServer) { reactMiddleware.compute(buildOptions)(argv.computeForPath, function(str) { process.stdout.write(str); }); } else { var app = connect() .use(reactMiddleware.provide(buildOptions)) .use(connect['static'](FILE_SERVE_ROOT)) .use(connect.favicon(path.join(FILE_SERVE_ROOT, 'elements', 'favicon', 'favicon.ico'))) .use(connect.logger()) .use(connect.compress()) .use(connect.errorHandler()); var portToUse = port || 8080; http.createServer(app).listen(portToUse); console.log('Open http://localhost:' + portToUse + '/index.html'); } ================================================ FILE: src/core/SiteBoilerPlate.js ================================================ /** * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @jsx React.DOM */ var React = require('React'); /** * Component for performing some redundant site wrapping. Customize to your * liking, or create a new, similar module. `react-page` automatically ensures * that all fo the JavaScript used to generate the page, will be bundled and * sent into the response so that all the event handlers will work. * * Usage: * * var React = require('React'); * var SiteBoilerPlate = require('./components/SiteBoilerPlate.jsx'); * var MyPage = React.createClass({ * render: function() { * return ( * *
Hello This Is My App!
*
* ); * } * }); */ var SiteBoilerPlate = React.createClass({ render: function() { return ( React Page | Client-Server JavaScript Rendering {this.props.children} ); } }); module.exports = SiteBoilerPlate; ================================================ FILE: src/elements/Banner/Banner.js ================================================ /** * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @jsx React.DOM */ "use strict"; var React = require('React'); /** * Look at Banner, Michael! */ var Banner = React.createClass({ getInitialState: function() { return {initialized: false}; }, componentDidMount: function() { this.setState({initialized: true}); }, render: function() { var classes = [ 'banner', this.state.initialized ? 'fadeIn' : '' ].join(' '); return (

{this.props.bannerMessage}

); } }); module.exports = Banner; ================================================ FILE: src/elements/VectorWidget/VectorWidget.js ================================================ /** * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @jsx React.DOM */ "use strict"; var React = require('React'); var path = React.DOM.path; var MOUSE_UP_DRAG = 0.978; var MOUSE_DOWN_DRAG = 0.9; var MAX_VEL = 11; var CLICK_ACCEL = 3; var BASE_VEL = 0.15; /** * An animated SVG component. */ var VectorWidget = React.createClass({ /** * Initialize state members. */ getInitialState: function() { return {degrees: 0, velocity: 0, drag: MOUSE_UP_DRAG}; }, /** * When the component is mounted into the document - this is similar to a * constructor, but invoked when the instance is actually mounted into the * document. Here's, we'll just set up an animation loop that invokes our * method. Binding of `this.onTick` is not needed because all React methods * are automatically bound before being mounted. */ componentDidMount: function() { this._interval = window.setInterval(this.onTick, 20); }, componentWillUnmount: function() { window.clearInterval(this._interval); }, onTick: function() { var nextDegrees = this.state.degrees + BASE_VEL + this.state.velocity; var nextVelocity = this.state.velocity * this.state.drag; this.setState({degrees: nextDegrees, velocity: nextVelocity}); }, /** * When mousing down, we increase the friction down the velocity. */ handleMouseDown: function() { this.setState({drag: MOUSE_DOWN_DRAG}); }, /** * Cause the rotation to "spring". */ handleMouseUp: function() { var nextVelocity = Math.min(this.state.velocity + CLICK_ACCEL, MAX_VEL); this.setState({velocity: nextVelocity, drag: MOUSE_UP_DRAG}); }, /** * This is the "main" method for any component. The React API allows you to * describe the structure of your UI component at *any* point in time. */ render: function() { var transformOrigin = '50% 50%'; var transform = 'rotate(' + this.state.degrees + 'deg)'; var rotationStyle = { WebkitTransformOrigin: transformOrigin, WebkitTransform: transform, // TODO: Figure out why transform-origin don't work in Firefox // transformOrigin: transformOrigin, // transform: transform }; return ( {this.renderGraphic(rotationStyle)} ); }, /** * Better SVG support for React coming soon. */ renderGraphic: function(rotationStyle) { return ( ); } }); var BORDER_PATH = "M3.00191459,4 C1.34400294,4 0,5.34785514 0,7.00550479 L0,220.994495 C0,222.65439 1.34239483,224 3.00191459,224 L276.998085,224 C278.655997,224 280,222.652145 280,220.994495 L280,7.00550479 C280,5.34561033 278.657605,4 276.998085,4 L3.00191459,4 Z M3.00191459,4"; var BG_PATH = "M3.00191459,1 C1.34400294,1 0,2.34785514 0,4.00550479 L0,217.994495 C0,219.65439 1.34239483,221 3.00191459,221 L276.998085,221 C278.655997,221 280,219.652145 280,217.994495 L280,4.00550479 C280,2.34561033 278.657605,1 276.998085,1 L3.00191459,1 Z M3.00191459,1"; var BAR_PATH = "M3.00191459,0 C1.34400294,0 0,1.34559019 0,3.00878799 L0,21 C0,21 0,21 0,21 L280,21 C280,21 280,21 280,21 L280,3.00878799 C280,1.34708027 278.657605,0 276.998085,0 L3.00191459,0 Z M3.00191459,0"; var RED_DOT_PATH = "M12.5,17 C16.0898511,17 19,14.0898511 19,10.5 C19,6.91014895 16.0898511,4 12.5,4 C8.91014895,4 6,6.91014895 6,10.5 C6,14.0898511 8.91014895,17 12.5,17 Z M12.5,17"; var YELLOW_DOT_PATH = "M31.5,17 C35.0898511,17 38,14.0898511 38,10.5 C38,6.91014895 35.0898511,4 31.5,4 C27.9101489,4 25,6.91014895 25,10.5 C25,14.0898511 27.9101489,17 31.5,17 Z M31.5,17"; var GREEN_DOT_PATH = "M50.5,17 C54.0898511,17 57,14.0898511 57,10.5 C57,6.91014895 54.0898511,4 50.5,4 C46.9101489,4 44,6.91014895 44,10.5 C44,14.0898511 46.9101489,17 50.5,17 Z M50.5,17"; var CENTER_DOT_PATH = "M84,105 C92.8365564,105 100,97.8365564 100,89 C100,80.1634436 92.8365564,73 84,73 C75.1634436,73 68,80.1634436 68,89 C68,97.8365564 75.1634436,105 84,105 Z M84,105"; var RING_ONE_PATH = "M84,121 C130.391921,121 168,106.673113 168,89 C168,71.3268871 130.391921,57 84,57 C37.6080787,57 0,71.3268871 0,89 C0,106.673113 37.6080787,121 84,121 Z M84,121"; var RING_TWO_PATH = "M84,121 C130.391921,121 168,106.673113 168,89 C168,71.3268871 130.391921,57 84,57 C37.6080787,57 0,71.3268871 0,89 C0,106.673113 37.6080787,121 84,121 Z M84,121"; var RING_THREE_PATH = "M84,121 C130.391921,121 168,106.673113 168,89 C168,71.3268871 130.391921,57 84,57 C37.6080787,57 0,71.3268871 0,89 C0,106.673113 37.6080787,121 84,121 Z M84,121"; var RING_TWO_ROTATE = "translate(84.000000, 89.000000) rotate(-240.000000) translate(-84.000000, -89.000000)"; var RING_THREE_ROTATE = "translate(84.000000, 89.000000) rotate(-300.000000) translate(-84.000000, -89.000000)"; module.exports = VectorWidget; ================================================ FILE: src/index.js ================================================ /** * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @jsx React.DOM */ var Banner = require('./elements/Banner/Banner.js'); var React = require('React'); var SiteBoilerPlate = require('./core/SiteBoilerPlate.js'); var VectorWidget = require('./elements/VectorWidget/VectorWidget.js'); var index = React.createClass({ render: function() { return ( ); } }); module.exports = index; ================================================ FILE: src/pages/about.js ================================================ /** * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @jsx React.DOM */ var React = require('React'); var SiteBoilerPlate = require('../core/SiteBoilerPlate.js'); var Banner = require('../elements/Banner/Banner.js'); var index = React.createClass({ render: function() { return ( ); } }); module.exports = index; ================================================ FILE: src/style.css ================================================ * { boxSizing: border-box; } h1.banner { opacity: 0; font-family: Helvetica; color: #444; font-weight: bold; margin-top: 60px; margin-bottom: 0; text-align: center; -webkit-user-select: none; font-size: 5vh; /* Chrome bug prevents resizing on window resize! */ width: 100%; /* Putting width 100% causes repaint on resize */ } h1.banner.fadeIn { opacity: 1; transition: opacity 3s ease-in; }