react实现文字输入框字数限制提示动画效果代码

代码语言:html

所属分类:表单美化

代码描述:react实现文字输入框字数限制提示动画效果代码

代码标签: 输入 字数 限制 提示 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
 <style>
        h1 {
            font-size: 27px;
            margin-bottom: 10px;
            color: #272727;
        }
        .container {
            background: #76daff;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            height: 100%;
            width: 100%;
            position: fixed;
        }
        /* loader Styles started*/
        .loader-wrapper {
            display: inline-block;
            margin: 10px;
            width: 300px;
        }
        .input-wrapper {
            border-width: 5px;
            border-style: solid;
            border-color: #9be4ff;
            border-radius: 10px;
            overflow: hidden;
            position: relative;
            display: block;
            position: relative;
        }
        textarea,
        input {
            font-size: 18px;
            outline: 0;
            border: 0;
            padding: 10px;
            width: 100%;
            display: block;
            box-sizing: border-box;
        }
        .count {
            font-size: 22px;
            margin-top: 10px;
            color: #727272;
            position: relative;
            right: 0;
            text-align: right;
            display: block;
        }
        .loader {
            position: absolute;
            bottom: 0;
            border-top: 2px solid;
            width: 100px;
            height: 0px;
            display: block;
            transition: 0.27s all linear;
        }
        /* loader Styles ended */

    </style>


</head>

<body>

    <div class="container">
        <div id="root">
        </div>
    </div>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/react.15.4.2.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/react-dom.15.4.2.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/prop-types.min.js"></script>



    <script>
        var _createClass = function () {
            function defineProperties(target, props) {
                for (var i = 0; i < props.length; i++) {
                    var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor);
                }
            } return function (Constructor, protoProps, staticProps) {
                if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor;
            };
        }();

        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,
        Component = _React.Component;
        var _ReactDOM = ReactDOM,
        render = _ReactDOM.render;

        var TextLoader = function (_Component) {
            _inherits(TextLoader, _Component);

            function TextLoader() {
                var _ref;

                var _temp,
                _this,
                _ret;

                _classCallCheck(this, TextLoader);

                for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
                    args[_key] = arguments[_key];
                }

                return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TextLoader.__proto__ || Object.getPrototypeOf(TextLoader)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
    .........完整代码请登录后点击上方下载按钮下载查看

网友评论0