html代码
效果展示
jQuery文本洗牌效果插件
<div class="container">
<p class="lead">文本洗牌动画特效</p>
<h1 id="basic">A time to seek,</h1>
<h1 id="custom">and a time to lose;</h1>
</div>
css样式
*,html{font-family:Inter;box-sizing:border-box}
body{background-color:#fafafa;line-height:1.6}
.lead{font-size:1.5rem;font-weight:300}
.container{margin:150px auto;max-width:960px}
.btn{padding:1.25rem;border:0;border-radius:3px;background-color:#4f46e5;color:#fff;cursor:pointer}
.output{background:#e5e7eb;padding:2rem 1rem;border-radius:5px;margin:2rem auto;font-size:1.5rem}
js代码
<script src="cryptoWriter.js"></script>
<script>
new cryptoWriter(document.querySelector("#basic"));
var emoji = "😀😃😄😁😆😅😂🤣🥲😊😇🙂🙃😉😌";
emojis = Array.from(emoji);
new cryptoWriter(document.querySelector("#custom"), {
customSet: emojis
});
</script>