css+div实现人物角色气泡文字显示动画效果代码

代码语言:html

所属分类:布局界面

代码描述:css+div实现人物角色气泡文字显示动画效果代码。

代码标签: css div 人物 角色 气泡 文字 显示 动画

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

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

<head>
 
<meta charset="UTF-8">
 

 
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=delicious-handrawn:400" rel="stylesheet" />
 
 
<link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Rubik+Bubbles&amp;display=swap'>
 
<style>
*,
::before,
::after{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
img{
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
body{
    min-height: 100svh;
    font-family: 'Delicious Handrawn', handwriting;
    font-size: 1.2rem;
    display: grid;
    place-content: center;
    background-color: teal;
}

.developer input[name=joke]{
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.developer{
    --_speed: 500ms;
    position: relative;
}

.developer label{
    cursor: pointer;
    display: block;
    position: relative;
    transition: all 300ms ease-in-out;
}
.avatar{
    border: 4px solid black;
    border-top-left-radius: 155px 115px;
    border-top-right-radius: 175px 225px;
    border-bottom-right-radius: 225px 125px;
    border-bottom-left-radius:195px 255px;
    overflow: hidden;
    width: 150px;
    height: 150px;
                box-shadow: 5px 5px 0 0 rgba(0, 0, 0, 0.16);
}

.developer .speech {
    --_bg: #EDEDED;
    position: absolute;
    top: -120px;
    left: -40px;
    width: 290px;
    padding: 1.5rem 3rem;
    border: .25rem solid #000;
    background-color: var(--_bg);
    box-shadow: 5px 5px 0 0 rgba(0, 0, 0, 0.16);
    border-radius: 50%;
    font-size: 1.3rem;
    transition: all 500ms ease-in-out;
    scale: 0;
    display: grid;
    place-content: center;
    grid-template-areas: 'stack';
}

.speech::before {
    content: "";
    position: absolute;
    left: 90px;
    bottom: -50px;
    width: 8rem;
    height: 4.........完整代码请登录后点击上方下载按钮下载查看

网友评论0