项目作者: afeiship

项目描述 :
React fade in mask.
高级语言: JavaScript
项目地址: git://github.com/afeiship/react-fade-in-mask.git
创建时间: 2019-08-22T02:05:29Z
项目社区:https://github.com/afeiship/react-fade-in-mask

开源协议:MIT License

下载


react-fade-in-mask

React fade in mask.

@jswork/react-fade-in-mask"">version
license
size
@jswork/react-fade-in-mask"">download

installation

  1. npm install -S @jswork/react-fade-in-mask

properties

Name Type Required Default Description
className string false - The extended className for component.
value bool false false The visible value.

usage

  1. import css

    1. @import "~@jswork/react-fade-in-mask/dist/style.css";
    2. // or use sass
    3. @import "~@jswork/react-fade-in-mask/dist/style.scss";
    4. // customize your styles:
    5. $react-fade-in-mask-options: ()
  2. import js

    1. import ReactDemokit from '@jswork/react-demokit';
    2. import React from 'react';
    3. import ReactDOM from 'react-dom';
    4. import ReactFadeInMask from '@jswork/react-fade-in-mask';
    5. import './assets/style.scss';
    6. class App extends React.Component {
    7. constructor(inProps) {
    8. super(inProps);
    9. this.state = {
    10. value: false
    11. };
    12. }
    13. handleMouseEnter = (e) => {
    14. this.setState({ value: true });
    15. };
    16. handleMouseLeave = (e) => {
    17. this.setState({ value: false });
    18. };
    19. render() {
    20. const { value } = this.state;
    21. return (
    22. <ReactDemokit
    23. className="p-3 app-container"
    24. url="https://github.com/afeiship/react-fade-in-mask">
    25. <div
    26. className="is-box-item"
    27. onMouseEnter={this.handleMouseEnter}
    28. onMouseLeave={this.handleMouseLeave}>
    29. <img src="https://my.ishadowx.biz/img/portfolio/05-small.jpg" />
    30. <ReactFadeInMask value={value}>
    31. CONTENT FOR FADE_IN MASK!
    32. </ReactFadeInMask>
    33. </div>
    34. </ReactDemokit>
    35. );
    36. }
    37. }
    38. ReactDOM.render(<App ></App>, document.getElementById('app'));

documentation

license

Code released under the MIT license.