首页 > 其他分享 >box-shadow内阴影实现各种效果收集

box-shadow内阴影实现各种效果收集

时间:2023-11-22 19:34:04浏览次数:26  
标签:box 100% 50% 阴影 stroke shadow 0px

1. 月牙       

详见 一步步打造自己的纯CSS单标签图标库

.moon {
    display:inline-block;
    height: 1.5em;
    width: 1.5em;
    box-shadow: inset -.4em 0 0;
    border-radius: 2em;
    transform: rotate(20deg);
}

2. 向内填充动画   

详见 SVG描边动画(路径动画、线条动画)

<svg class="checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
    <circle class="checkmark__circle" cx="26" cy="26" r="25" fill="none" />
    <path class="checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8" />
</svg>
/* 定义svg */
.checkmark {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    stroke-width: 2;
    stroke: #fff;
    box-shadow: inset 0px 0px 0px #7ac142; 
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark__circle {
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    stroke: #7ac142;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 34;
    stroke-dashoffset: 34;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}
@keyframes scale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}
@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px #7ac142;
    }
}

3. 引导蒙层椭圆   

详见 腾讯微云黑色遮罩引导蒙版更好的CSS实现方式 

.cover::before {
    content: '';
    width: 100%; 
    height:100%;
    border-radius: 50%;
    border: 400px solid #000;
    position: absolute;
    left: -400px; 
    top: -400px;
    box-shadow: inset 0 0 5px 2px rgba(0,0,0,.75);
}

 

标签:box,100%,50%,阴影,stroke,shadow,0px
From: https://www.cnblogs.com/mengff/p/17850108.html

相关文章

  • 纯CSS实现炫酷文本阴影效果
    如图所示,这是一个文本阴影效果,阴影有多个颜色,鼠标悬停时文本阴影效果消失,文本回到正常的效果。让我们逐步分解代码,看看如何使用纯CSS实现这个效果的。基于以上动图可以分析出以下是本次实现的主要几个功能点:文本有多个颜色的阴影的效果文本有空心镂空的效果鼠标悬停时文本回......
  • delphi dev cxLookupComboBox 模糊搜索
    //不是过滤DATASET,适合用在下拉数据很多的情况。过滤的必须是下拉有添加的列procedurecxLookupComboBoxLikeSearchInitPopup(Sender:TObject);varFEdit:TcxLookupComboBoxabsoluteSender;i:integer;begin//ifFEdit.Properties.IncrementalSearchthen//FEdit......
  • VirtualBox安装Debian12
    下载地址:VirtualBox7.0官网:https://www.virtualbox.org/wiki/DownloadsDebian12官网:https://www.debian.org/index.zh-cn.html安装打开VirtualBox,点击新建,根据提示安装。安装时网络不佳建议断网,避免更新下载耗时太久。使用putty/xshell连接服务器,需要设置网络为桥......
  • 无法安装ensp ?各种报错解决方案(virtualbox无法运行,启动AR失败,错误代码40等)
    安装eNSP。发现软件中路由器无法启动。VirtualBox是华为eNSP使用的必须运行环境,它提供虚拟网卡设备作为服务器为软件提供运行环境。1.提示出现VirtualBoxOracle无法在此项目运行。我根据百度上的方法,重新还原系统。无果。之前计算机中安装VirtualBox版本为6.0,重新下载了5.3版本的......
  • WPF --- TextBox的输入校验
    引言在WPF应用程序开发中,数据校验是确保用户输入数据的正确性和完整性的重要一环。之前在做一些参数配置功能时,最是头疼各种参数校验,查阅一些资料后,我总结了数据校验方式有两种:ValidationRuleIDataErrorInfo接下来分别介绍这两种校验方式。ValidationRuleValidationRule......
  • JavaScript: Checkbox onChange event is differently processed by IE and FF
     DropDownList onchange=""TextBoxonchange=""CheckBoxonclick=""RadioButtononclick="" JavaScript:CheckboxonChangeeventisdifferentlyprocessedbyIEandFFTrytoclick thefollowingbuttonsonIEandFirefox.U......
  • WPF中设置RichTextBox的行间距
    可以通过设置Paragraph的LineHeight属性来达到设置行间距的效果。privatevoidUpdateTranslate(RichTextBoxtbx,IEnumerable<BaiduTranslateInfo>items){tbx.Document.Blocks.Clear();if(items.IsNullOrEmpty())return;Paragraphpara=newPara......
  • mkfs.xfs报错 mkfs.xfs: /dev/new/new_box appears to contain an existing fil
    在设置逻辑卷文件类型时候报错mkfs.xfs:/dev/new/new_boxappearstocontainanexistingfilesystem(ext4).mkfs.xfs:Usethe-foptiontoforceoverwrite.上面是说目标分区,已经存在一个文件系统但是我们有很需要他更改文件系统的话就加一个-f选项[root@server~]......
  • 如何在mapbox中将标注添加到面
    consttestGeoJOSN=()=>{//加载GeoJSON数据map.addSource("geojson",{type:"geojson",data:china,generateId:true,});map.addLayer({id:"china",type:"fill",......
  • WPF TextBox 允许输入数字及字母的工具类
    usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Text.RegularExpressions;usingSystem.Windows.Controls;usingSystem.Windows.Input;namespace命名空间{///<summary>///TextBox输入控制///&......