不需要任何插件,纯 CSS 就能打造炫酷文字特效

这篇具有很好参考价值的文章主要介绍了不需要任何插件,纯 CSS 就能打造炫酷文字特效。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

前言

现如今网页越来越趋近于动画,相信大家平时浏览网页或多或少都能看到一些动画效果,今天我们来做一些文字上面的动画效果,下面一起看看吧。


1. 文字抖动

实现效果

不需要任何插件,纯 CSS 就能打造炫酷文字特效


实现思路

其实主要就是通过 animation 添加动画属性,利用 keyframes 来描述动画的开始、过程和结束的状态,核心就是 animation + transform:rotate,话不多说,下面直接看代码。


完整源码

<template>
  <div class="parentBox">
    <div class="contantBox">文字抖动</div>
  </div>
</template>
<style lang="less" scoped>
.parentBox {
  height: 100%;
  background: rgb(31, 31, 31);
  padding: 100px;
  @keyframes cartoon {
    2% {
      transform: translate(6px, -2px) rotate(3.5deg);
    }

    4% {
      transform: translate(5px, 8px) rotate(-0.5deg);
    }

    6% {
      transform: translate(6px, -3px) rotate(-2.5deg);
    }

    8% {
      transform: translate(4px, -2px) rotate(1.5deg);
    }

    10% {
      transform: translate(-6px, 8px) rotate(-1.5deg);
    }

    12% {
      transform: translate(-5px, 5px) rotate(1.5deg);
    }

    14% {
      transform: translate(4px, 10px) rotate(3.5deg);
    }

    16% {
      transform: translate(0px, 4px) rotate(1.5deg);
    }

    18% {
      transform: translate(-1px, -6px) rotate(-0.5deg);
    }

    20% {
      transform: translate(6px, -9px) rotate(2.5deg);
    }

    22% {
      transform: translate(1px, -5px) rotate(-1.5deg);
    }

    24% {
      transform: translate(-9px, 6px) rotate(-0.5deg);
    }

    26% {
      transform: translate(8px, -2px) rotate(-1.5deg);
    }

    28% {
      transform: translate(2px, -3px) rotate(-2.5deg);
    }

    30% {
      transform: translate(9px, -7px) rotate(-0.5deg);
    }

    32% {
      transform: translate(8px, -6px) rotate(-2.5deg);
    }

    34% {
      transform: translate(-5px, 1px) rotate(3.5deg);
    }

    36% {
      transform: translate(0px, -5px) rotate(2.5deg);
    }

    38% {
      transform: translate(2px, 7px) rotate(-1.5deg);
    }

    40% {
      transform: translate(6px, 3px) rotate(-1.5deg);
    }

    42% {
      transform: translate(1px, -5px) rotate(-1.5deg);
    }

    44% {
      transform: translate(10px, -4px) rotate(-0.5deg);
    }

    46% {
      transform: translate(-2px, 2px) rotate(3.5deg);
    }

    48% {
      transform: translate(3px, 4px) rotate(-0.5deg);
    }

    50% {
      transform: translate(8px, 1px) rotate(-1.5deg);
    }

    52% {
      transform: translate(7px, 4px) rotate(-1.5deg);
    }

    54% {
      transform: translate(10px, 8px) rotate(-1.5deg);
    }

    56% {
      transform: translate(-3px, 0px) rotate(-0.5deg);
    }

    58% {
      transform: translate(0px, -1px) rotate(1.5deg);
    }

    60% {
      transform: translate(6px, 9px) rotate(-1.5deg);
    }

    62% {
      transform: translate(-9px, 8px) rotate(0.5deg);
    }

    64% {
      transform: translate(-6px, 10px) rotate(0.5deg);
    }

    66% {
      transform: translate(7px, 0px) rotate(0.5deg);
    }

    68% {
      transform: translate(3px, 8px) rotate(-0.5deg);
    }

    70% {
      transform: translate(-2px, -9px) rotate(1.5deg);
    }

    72% {
      transform: translate(-6px, 2px) rotate(1.5deg);
    }

    74% {
      transform: translate(-2px, 10px) rotate(-1.5deg);
    }

    76% {
      transform: translate(2px, 8px) rotate(2.5deg);
    }

    78% {
      transform: translate(6px, -2px) rotate(-0.5deg);
    }

    80% {
      transform: translate(6px, 8px) rotate(0.5deg);
    }

    82% {
      transform: translate(10px, 9px) rotate(3.5deg);
    }

    84% {
      transform: translate(-3px, -1px) rotate(3.5deg);
    }

    86% {
      transform: translate(1px, 8px) rotate(-2.5deg);
    }

    88% {
      transform: translate(-5px, -9px) rotate(2.5deg);
    }

    90% {
      transform: translate(2px, 8px) rotate(0.5deg);
    }

    92% {
      transform: translate(0px, -1px) rotate(1.5deg);
    }

    94% {
      transform: translate(-8px, -1px) rotate(0.5deg);
    }

    96% {
      transform: translate(-3px, 8px) rotate(-1.5deg);
    }

    98% {
      transform: translate(4px, 8px) rotate(0.5deg);
    }

    0%,
    100% {
      transform: translate(0, 0) rotate(0);
    }
  }
  .contantBox {
    color: #fff;
    animation: cartoon 5s infinite ease-in-out;
  }
}
</style>

2. 文字缩放

实现效果

不需要任何插件,纯 CSS 就能打造炫酷文字特效


实现思路

实现的思路核心在于 scale3d 属性让其变形,配合 animation-timing-function 属性指定动画完成的周期实现该效果。


完整源码

<template>
  <div class="parentBox">
    <div class="contantBox">文字缩放</div>
  </div>
</template>
<style lang="less" scoped>
.parentBox {
  height: 100%;
  background: rgb(31, 31, 31);
  padding: 100px;
  @keyframes zoomMeans {
    40% {
      opacity: 1;
      transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
      animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    }

    to {
      opacity: 0;
      transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 2000px, 0);
      animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    }
  }
  .contantBox {
    animation: 2s linear 0s infinite alternate zoomMeans;
    font-weight: bold;
    color: white;
    font-size: 20px;
    text-align: center;
  }
}
</style>

3. 文字鼠标悬浮

实现效果

不需要任何插件,纯 CSS 就能打造炫酷文字特效


实现思路

上图的效果实现起来其实就非常的简单了,我们只需要通过 hover 事件在鼠标触摸文字时设置其样式和效果即可。


完整源码

<template>
  <div class="parentBox">
    <h1>hello word!(鼠标悬浮特效)</h1>
  </div>
</template>
<style lang="less" scoped>
.parentBox {
  height: 100%;
  background: rgb(31, 31, 31);
  padding: 100px;
  h1 {
    display: inline-block;
    color: white;
    font-size: 56px;
    transition: 0.5s;
    cursor: pointer;
  }

  h1:hover {
    text-shadow: 0 1px 0 #ccc, 0 2px 0 #ccc, 0 3px 0 #ccc, 0 4px 0 #ccc,
      0 5px 0 #ccc, 0 6px 0 #ccc, 0 7px 0 #ccc, 0 8px 0 #ccc, 0 9px 0 #ccc,
      0 10px 0 #ccc, 0 11px 0 #ccc, 0 12px 0 #ccc,
      0 20px 30px rgba(0, 0, 0, 0.5);
  }
}
</style>

当然你还可以如下图这样⤵

不需要任何插件,纯 CSS 就能打造炫酷文字特效


完整源码

<template>
  <div class="parentBox">
    <h1>hello word!(鼠标悬浮特效)</h1>
  </div>
</template>
<style lang="less" scoped>
.parentBox {
  height: 100%;
  background: rgb(31, 31, 31);
  padding: 100px;
  h1 {
    display: inline-block;
    color: #fff;
    cursor: pointer;
    -webkit-box-reflect: below 0 -webkit-linear-gradient(transparent, transparent
          50%, rgba(255, 255, 255, 0.3));
    font: bold 50px/1.231 georgia, sans-serif;
    text-transform: uppercase;
  }
}
</style>

4. 文字动画下划线

实现效果

不需要任何插件,纯 CSS 就能打造炫酷文字特效

完整源码

<template>
  <div>
    <h2 class="titleBox">
      <span>People who have no culture are not sad. Taste miss not often meet.</span>
    </h2>
  </div>
</template>
<style scoped>
.titleBox span {
  line-height: 1.5;
  padding-bottom: 4px;
  background: linear-gradient(to right, rgb(255, 64, 96), rgb(47, 216, 47))
    no-repeat right bottom;
  background-size: 0px 3px;
  transition: background-size 1200ms;
}
.titleBox span:hover {
  background-position-x: left;
  background-size: 100% 3px;
}
</style>

5. 文字穿透效果

实现效果

不需要任何插件,纯 CSS 就能打造炫酷文字特效

完整源码

<template>
  <div>
    <div class="box">
      <h1>Hello word</h1>
    </div>
  </div>
</template>

<style scoped>
.box {
  background: rgba(0, 0, 0.7);
  width: 100%;
  height: 100%;
}

h1 {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 10vw;
  text-stroke: 1px #fff;
  -webkit-text-stroke: 1px #fff;
  background: url("../../img/1.png")
    no-repeat center/cover;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
</style>

6. 文字交融效果

实现效果

不需要任何插件,纯 CSS 就能打造炫酷文字特效

完整源码

<template>
  <div>
    <span>Hello word</span>
  </div>
</template>

<style scoped>
div {
  text-align: center;
  background: #000;
  filter: contrast(30);
}
span {
  font-size: 100px;
  color: #fff;
  animation: shadow 3s forwards;
}
@keyframes shadow {
  from {
    letter-spacing: -50px;
    filter: blur(10px);
  }
  to {
    letter-spacing: 10px;
    filter: blur(2px);
  }
}
</style>

持续更新中...文章来源地址https://www.toymoban.com/news/detail-429269.html

到了这里,关于不需要任何插件,纯 CSS 就能打造炫酷文字特效的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • uniapp 前端实现文字识别,身份证识别,营业执照识别 (兼容APP、H5、小程序 不需要任何SDK)

    本文将介绍如何使用uniapp和百度AI开放平台的OCR(光学字符识别)API实现身份证、营业执照等卡证的识别和文字识别功能。 APP 小程序 H5 √ √ √ 1. 注册百度账号 前往百度AI开放平台官网,点击“登录”。使用百度账号登录,如果没有可以先注册百度账号。 登录成功后,点击右上角

    2024年02月10日
    浏览(43)
  • 五个拿来就能用的炫酷登录页面

    ------------- 写在前面 ------------- 上次的博文十个拿来就能用的网页炫酷特效 ,得到了大家的支持!这次我将收藏了很久的炫酷登录页面分享给大家,如果觉得有帮助可以 点赞收藏 支持一下,能 关注 一下就再好不过了o(≧▽≦*)o,之后还会分享更多干货内容,谢谢大家啦!

    2024年02月12日
    浏览(34)
  • 十几款拿来就能用的炫酷表白代码

    「作者主页」: 士别三日wyx 「作者简介」: CSDN top100、阿里云博客专家、华为云享专家、网络安全领域优质创作者 「推荐专栏」: 小白零基础《Python入门到精通》 复制到文本文件,后缀名改成 vbs 就能运行,效果如下。 完整代码如下,复制就能用 为了防止有些小伙伴关机

    2024年02月11日
    浏览(40)
  • 五款拿来就能用的炫酷表白代码

    「作者主页」: 士别三日wyx 「作者简介」: CSDN top100、阿里云博客专家、华为云享专家、网络安全领域优质创作者 「推荐专栏」: 小白零基础《Python入门到精通》 Python弹窗表白代码,根据电脑性能设置弹窗个数,效果图如下: 完整代码如下,不用导入模块,复制就能用

    2024年02月12日
    浏览(34)
  • ThreeJS 炫酷特效旋转多面体Web页 Demo 01《ThreeJS 炫酷特效制作》

    本案例为一个 threejs 的特效网页,大小球体进行包裹,外球体为透明材质,但是进行了线框渲染,使其能够通过外球踢查看其内球体。 注:案例参考源于互联网,在此做代码解释,侵删 本案例除 ThreeJS 外不适用任何第三方框架,放心食用 懒的同学可以直接下载代码,打赏作

    2024年02月08日
    浏览(43)
  • 网页炫酷特效拿来即可用(看板娘&鼠标点击&炫酷登录页面&樱花特效&生日祝福&彩虹屁)

    作为一个乐于分享知识的程序员来说,博客必不可少。 在制作博客的过程中,改前端改得让人不言而喻🤡 其次,为了大伙们不步我后尘,给大家陆续分享出来,如果觉得有帮助可以 点赞收藏 支持一下,如果能 关注 一下就再好不过了ヾ(≧▽≦*)o,之后还会分享许多内容,

    2024年02月09日
    浏览(47)
  • python炫酷特效代码简单,python制作的炫酷动画

    本篇文章给大家谈谈python炫酷特效代码简单,以及python好看的图案代码,希望对各位有所帮助,不要忘了收藏本站喔。 可以生成下面这种图 import random import turtle def random_color():     rgbl=[255,0,0]     random.shuffle(rgbl)     return tuple(rgbl) def koch(size,n):     if n==0:         (size)  

    2024年02月07日
    浏览(34)
  • vscode超炫酷的编码特效详解

    1.在扩展中搜索         插件:Power Mode    2.在设置里搜索Code Actions On Save   3.点击在settings.json中编辑  

    2024年02月12日
    浏览(47)
  • 炫酷的花式滑块滑动无缝切换特效

    💂 个人网站:【 海拥】【小霸王游戏机】【大转盘】 🤟 风趣幽默的前端学习课程:👉28个案例趣学前端 💅 想寻找共同学习交流、摸鱼划水的小伙伴,请点击【摸鱼学习群】【学习文档】 💬 免费且实用的计算机相关知识题库:👉进来逛逛 给大家安利一个免费且实用的前

    2024年02月21日
    浏览(41)
  • 国庆发生的那些事儿------编写了炫酷的HTML动态鼠标特效,超级炫酷酷酷!

    国庆假期的欢乐,当然少不了编码爱好者!假期编写了炫酷的HTML动态鼠标特效,超级炫酷酷酷!让你的页面变得更加炫酷,让你的小伙伴们羡慕的大神编码!快来看看大神是如何编写的吧! HTML动态鼠标特效 效果图 动态鼠标效果.html mouse.js 效果图 炫酷的HTML动态鼠标特效,超

    2024年02月02日
    浏览(65)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包