React Measure Demo

Developer
Size
3,718 Kb
Views
42,504

How do I make an react measure demo?

React Measure Demo https://github.com/souporserious/react-measure. What is a react measure demo? How do you make a react measure demo? This script and codes were developed by Travis Arnold on 12 September 2022, Monday.

React Measure Demo Previews

React Measure Demo - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>React Measure Demo</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ .square { width: 50%; height: 300px; background: orange;
}
.animate { animation: animateInOut 1000ms infinite;
}
@keyframes animateInOut { 0%, 100% { width: 50%; height: 300px; } 50% { width: 100%; height: 600px; }
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div id="app"></div> <script src='https://cdn.rawgit.com/que-etc/resize-observer-polyfill/master/dist/ResizeObserver.global.js'></script>
<script src='https://fb.me/react-15.2.1.js'></script>
<script src='https://fb.me/react-dom-15.2.1.js'></script>
<script src='https://unpkg.com/get-node-dimensions/dist/get-node-dimensions.js'></script>
<script src='https://unpkg.com/react-measure/dist/react-measure.js'></script> <script src="js/index.js"></script>
</body>
</html>

React Measure Demo - Script Codes CSS Codes

.square { width: 50%; height: 300px; background: orange;
}
.animate { animation: animateInOut 1000ms infinite;
}
@keyframes animateInOut { 0%, 100% { width: 50%; height: 300px; } 50% { width: 100%; height: 600px; }
}

React Measure Demo - Script Codes JS Codes

'use strict';
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _React = React;
var Component = _React.Component;
var Children = _React.Children;
var PropTypes = _React.PropTypes;
var AnimatingChild = function (_Component) { _inherits(AnimatingChild, _Component); function AnimatingChild() { _classCallCheck(this, AnimatingChild); return _possibleConstructorReturn(this, _Component.apply(this, arguments)); } AnimatingChild.prototype.render = function render() { var animate = this.props.animate; return React.createElement( Measure, null, function (dimensions) { return React.createElement( 'div', { className: 'square ' + (animate ? 'animate' : '') }, React.createElement( 'strong', null, animate ? 'Click to stop animating' : 'Click to animate' ), Object.keys(dimensions).map(function (dimension, i) { return React.createElement( 'div', { key: i }, dimension, ': ', dimensions[dimension] ); }) ); } ); }; return AnimatingChild;
}(Component);
var App = function (_Component2) { _inherits(App, _Component2); function App(props) { _classCallCheck(this, App); var _this2 = _possibleConstructorReturn(this, _Component2.call(this, props)); _this2.state = { animate: false }; return _this2; } App.prototype.render = function render() { var _this3 = this; var animate = this.state.animate; return React.createElement( 'div', { onClick: function onClick() { return _this3.setState({ animate: !animate }); } }, React.createElement(AnimatingChild, { animate: animate }) ); }; return App;
}(Component);
ReactDOM.render(React.createElement(App, null), document.getElementById('app'));
React Measure Demo - Script Codes
React Measure Demo - Script Codes
Home Page Home
Developer Travis Arnold
Username souporserious
Uploaded September 12, 2022
Rating 3
Size 3,718 Kb
Views 42,504
Do you need developer help for React Measure Demo?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Travis Arnold (souporserious) Script Codes
Create amazing captions with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!