js+css实现悬浮阴影特效的待办事项效果代码

代码语言:html

所属分类:悬停

代码描述:js+css实现悬浮阴影特效的待办事项效果代码

代码标签: css 悬浮 阴影 特效 待办 事项

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <link href="https://fonts.googleapis.com/css2?family=Raleway:wght@300&display=swap" rel="stylesheet">



    <style>
        body {
          background-color: #f1f1f1;
          color: #666;
          margin: 0;
          font-family: "Courier New";
          font-family: "Raleway", sans-serif;
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
        }
        
        ul {
          list-style-type: none;
          padding: 0;
          margin: 0;
        }
        
        h1 {
          background-color: white;
          padding: 15px;
          margin: 0px;
          margin-top: 20px;
          margin-bottom: 20px;
          border-radius: 3px;
          width: 500px;
          box-shadow: 0px 0px 20px 2px rgba(0, 0, 0, 0.2);
          display: block;
        }
        
        ul#main {
          display: flex;
          flex-direction: column;
          min-height: 600px;
          justify-content: space-between;
          perspective: 500px;
        }
        ul#main li {
          width: 485px;
          height: 50px;
          line-height: 53px;
          padding: 15px;
          padding-right: 0px;
          padding-left: 45px;
          border-radius: 3px;
          background-color: white;
          box-shadow: 0px 0px 20px 2px rgba(0, 0, 0, 0.2);
          cursor: pointer;
          transition: all 0.3s ease-in-out;
          transform: scale(1) rotateY(0deg) translateX(0px);
          opacity: 1;
          text-shadow: 0px 0px 1px rgba(0, 0, 0, 0.5);
        }
        ul#main li:hover {
          transform: scale(1.01) rotateY(-10deg) translateX(0px);
          line-height: 44px;
          text-shadow: 12px 12px 3px rgba(0, 0, 0, 0.5);
          line-height: 45px;
          text-shadow: 11px 11px 3px rgba(0, 0, 0, 0.5);
          line-height: 46px;
          text-shadow: 10px 10px 3px rgba(0, 0, 0, 0.5);
          line-height: 47px;
          text-shadow: 9px 9px 3px rgba(0, 0, 0, 0.5);
          line-height: 48px;
          text-shadow: 8px 8px 3px rgba(0, 0, 0, 0.5);
          line-height: 49px;
          text-shadow: 7px 7px 3px rgba(0, 0, 0, 0.5);
        }
        ul#main li:hover::before {
          border: 1px solid dodgerblue;
          box-shadow: inset 0px 0px 5px 1px rgba(30, 144, 255, 0.4);
        }
        ul#main li::before {
          content: "";
          position: absolute;
          top: 50%;
          left: 10px;
          height: 20px;
          width: 20px;
          border: 1px solid silver;
          box-shadow: inset 0px 0px 5px 1px rgba(0, 0, 0, 0.2);
          border-radius: 3px;
          transform: translateY(-50%);
          transition: all 0.3s ease-in-out;
        }
        ul#main li::after {
          content: "";
          position: absolute;
          top: 50%;
          left: 15px;
          height: 10px;
          width: 20px;
          border: none;
          border-left: 2px solid dodgerblue;
          border-bottom: 2px solid dodgerblue;
          transform: rotateZ(-45deg) skew(-10deg) translate(0px, 0px);
          opacity: 0;
          transition: all 0.3s ease-in-out;
        }
        ul#main li.hidden {
          transform: scale(1) rotateY(0deg) translateX(30px);
          opacity: 0;
          transition: all 0s ease-in-out;
        }
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0