纯CSS3文章边角悬停气泡化填充动效

文章介绍了使用CSS3和伪元素实现的气泡角效果,以及关于微信视频号创作者分成计划的一些注意事项,涉及HTML代码示例。

29a92686186c2a6c65664188e006d055.gif

示例代码

<template>
   <div>
         <div class="wrapper">
            <div class="desc">
               <h1>气泡角效应</h1>
               <p>纯CSS气泡角效果,用于在悬停时显示短消息.</p>
            </div>
            <div class="box">
               <div class="bubble-aprox"></div>
               <div class="bubble">
                     <span class="bubble__icon">i</span>
                     <div class="bubble__content">
                       一个靠前排的 90 后,具有情怀的技匠,路上正追逐斜杠青年的践行者
                     </div>
               </div>
               <div class="box__content">
                     <p>这是一个我个人的后花园,我的网站,我做主。

虽说,哪里有流量,哪里就有市场,但无论是在哪个第三方平台上,在国内,并非完全言论自由。

一定程度上,会受到管制约束,况且哪一天,你也无法保证,一些第三方平台就挂了的,随之,你的记录也会消失,数据只有掌握在自己手上,心里才无比的踏实。

如果说阅读是知识的输入,那么写作就是知识理解的输出,同时也是一个炼化知识的过程。

它是能够增强锻炼自己的表达能力的,即使口头表达跟不上,但是思考却要快于表达,有的人擅长思考,有的人善于表达,同时二者都兼具的人

不说是牛人,但至少是一个很厉害的人。
</p>
               </div>
            </div>
        </div>
   </div>
</template>
<style>
.wrapper {
    width: 40em;
    margin: 4em auto;
    background: #fff;
    padding: 4em;
    border-radius: 8px;
    border: 1px solid #f5f5f5;
}
.wrapper >:first-child {
    margin-top: 0;
}
.wrapper >:last-child {
    margin-bottom: 0;
}
.desc {
    font-size: 1.2em;
}
.todo {
    background: #f9f9f9;
    padding: 1em;
    border-radius: 4px;
    color: #ccc;
    font-style: italic;
    font-weight: lighter;
    font-size: 0.9em;
}
.todo ul {
    margin: 0.4em 0;
    padding: 0 1em;
}
.todo ul li {
    list-style-position: inside;
}
h1 {
    margin: 0;
}
a {
    text-decoration: none;
    color: #2196f3;
}
a:hover {
    text-decoration: underline;
}
.emoticon-face {
    background: #ffeb3b;
    border-radius: 100%;
    width: 1.7em;
    height: 1.7em;
    transform: rotate(90deg);
    display: inline-block;
    vertical-align: middle;
    line-heigh: 1;
    margin: -0.4em 0.2em 0;
    text-align: center;
    border: 1px solid #fdd835;
    padding-left: 0.1em;
    -webkit-font-smoothing: antialiased;
}
.emoticon-face--no-rotation {
    transform: rotate(0deg);
}
code {
    padding: 0.2em 0.3em;
    background: #f5f5f5;
    margin: 0 0.2em;
    border-radius: 4px;
    font-size: 0.95em;
    font-family: 'Source Code Pro';
}
.tac {
    text-align: center;
}
.box {
    margin: 1em auto;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2em;
    overflow: hidden;
    position: relative;
    color: #333;
    line-height: 1.6;
    font-size: 1.2em;
    z-index: 2;
}
.box *:first-child {
    margin-top: 0;
}
.box *:last-child {
    margin-bottom: 0;
}
.bubble-aprox {
    width: 3em;
    height: 3em;
    top: 0;
    left: 0;
    position: absolute;
    border-radius: 0 0% 100% 0;
}
.bubble-aprox:hover + .bubble,
.bubble-aprox:hover + .bubble:before {
    padding: 0.2em;
    border-radius: 0 0 90% 0;
}
.bubble {
    position: absolute;
    color: #fff;
    height: 2.5em;
    width: 2.5em;
    transform-style: preserve-3d;
    border-radius: 0 0% 100% 0;
    top: 0;
    left: 0;
    z-index: 2;
    transition: 0.4s ease;
}
.bubble:before {
    content: '';
    height: 2.5em;
    width: 2.5em;
    transition: 0.8s ease;
    border-radius: 0 0% 100% 0;
    background: #7cb342;
    top: 0;
    left: 0;
    position: absolute;
    z-index: 1;
}
.bubble:hover {
    width: 100%;
    height: 100%;
}
.bubble:hover:before {
    border-radius: 0;
    width: 150%;
    height: 150%;
    transition: 0.8s ease;
}
.bubble:hover .bubble__icon {
    top: -50%;
    left: -50%;
    transition: 0.8s ease;
}
.bubble:hover .bubble__content {
    transition: 0.8s ease;
    top: 50%;
    left: 0;
    z-index: 4;
}
.bubble__icon {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    transition: 0.8s ease;
    padding: 0.6em 0.9em;
    line-height: 1;
    font-size: 1em;
}
.bubble__content {
    position: absolute;
    top: -200%;
    transform: translateY(-50%);
    transition: 0.4s ease;
    text-align: center;
    width: 100%;
    color: #fff;
    left: -200%;
    padding: 1.2em;
} 
</style>

实现这个效果,主要是利用伪元素,以及结合css3当中的transform,鼠标移动到指定的元素,从左上角,到右下角,气泡遮盖层是一个绝对定位元素

鼠标hover元素上时,改变top,left,width,height元素即可实现

微信视频号创作者分成计划注意事项

2023-07-26

9621a1aaa574bac6d166089565118b15.jpeg

聊一下从小到大老师教我们的道德这两个字

2023-07-25

197451b7443557e18b3bc5255567ca82.jpeg

企业公司社保人员-如何增减及避免监管局罚款

2023-07-24

dd224106b56136bcdf06db40fc843d96.jpeg

企业如何新增办税人员(日常开票及税务申报)

2023-07-23

1d4c658669ab36b1467b5bf8668aa634.jpeg

企业增值税及个税逾期未申报处理

2023-07-22

4563e8d920b8820941ac8294badcf5cd.jpeg

f9ed04a3e3594dad6a6189292004a416.png

(能绘画,能问答)

cf6f88fd14013e62245a50f2389580b4.jpeg

038f35844a4fa9f39348f302918ba791.png

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值