css - 页面加载时输入文本和段落的过渡 CSS 以及它们何时出现
问题描述
如何在页面加载时在输入文本字段上添加看起来像进度条的过渡?该网站创建一个短网址。您可以看到,当创建短网址时,输入和按钮消失了。我想要所有组件出现时的进度类型转换。
render() {
return (
<div>
<div className="metrics">
{ this.state.active!==true ?
<>
<input
placeholder="Paste your URL here"
onChange={(event) => this.setState({ longUrl: event.target.value })}
/>
<button
className="buttons"
disabled={this.state.active}
onClick={this.handleButtonShortUrl}
>
ShortURL
</button>
</> : null }
<div className="shortcopy">
{this.state.active ? (
<>
<p className="shorturl">{this.state.shortUrl}</p>
<button
className="buttons"
onClick={() => {
navigator.clipboard.writeText(this.state.shortUrl);
alert("short URL copied");
}}
>
<FileCopySharpIcon style={{fill: "white"}}/>
</button>
</>
) : null}
</div>
<div className="apicopy">
{this.state.active ? (
<>
<p className="apikey">{this.state.apiKey}</p>
<button
className="buttons"
onClick={() => {
navigator.clipboard.writeText(this.state.apiKey);
alert("apiKey copied");
}}
>
<FileCopySharpIcon style={{fill: "white"}}/>
</button>
</>
) : null}
</div>
{this.state.active ? (
<button className="buttons" onClick={this.handleButtonNewShortUrl}>
{" "}
New short url
</button>
) : null}
</div>
解决方案
推荐阅读
- ruby-on-rails - FrozenError - 无法修改冻结字符串(ruby 2.5+)
- r - 如何从R中的函数设置数据框中的列名
- echarts - 在折线图中捕捉点击事件(ngx-echarts)
- symfony - Twig 检查日期是圣诞节还是复活节
- javascript - 在基于路径的活动链接上打开 Materialise 嵌套可折叠
- rust - 为什么这不能算作不可变借款?
- android - Firebase中IN关键字的替代品是什么?
- c# - 发布 ASP.NET MVC 应用程序时找不到扩展方法
- vb.net - 如何在另一台计算机上从 VB 2008 成功设置工作?
- swift - 这个层次结构应该如何运作?