1.0.6 • Published 2 years ago
@jswork/react-full-image v1.0.6
react-full-image
Full page background image for react.
installation
npm install -S @jswork/react-full-image
properties
usage
import css
@import "~@jswork/react-full-image/dist/style.css"; // or use sass @import "~@jswork/react-full-image/dist/style.scss"; // customize your styles: $react-full-image-options: ()
import js
import ReactDemokit from '@jswork/react-demokit'; import React from 'react'; import ReactDOM from 'react-dom'; import ReactFullImage from '@jswork/react-full-image'; import './assets/style.scss'; import '@jswork/next-sample'; const images = [ 'bg-2.jpg', 'bg.jpg', 'welcome_bg.2233ee0f.png', 'yuanhua1.jpg', 'alo7.png' ]; class App extends React.Component { render() { const item = nx.sample(images); console.log(item); return ( <ReactDemokit className="p-3 app-container" url="https://github.com/afeiship/react-full-image"> <ReactFullImage animation="blur" src={require(`./assets/${item}`).default} style={{ backgroundColor: '#eef4fa' }} /> </ReactDemokit> ); } } ReactDOM.render(<App />, document.getElementById('app'));
documentation
license
Code released under the MIT license.