首页 > 其他分享 >CSS动画效果(炫酷登录页面)

CSS动画效果(炫酷登录页面)

时间:2024-06-02 11:29:50浏览次数:8  
标签:动画 center 100% width 炫酷 login border ring CSS

1.整体效果

https://mmbiz.qpic.cn/sz_mmbiz_gif/EGZdlrTDJa6ibiceejK9loT70yREYASOhuSRaI6vQtQ42zN48oafaWDzdndicRuicL31ZuK3mhD82oJThcFHYuSCkw/640?wx_fmt=gif&from=appmsg&wxfrom=13

一个酷炫的登录页不仅能够吸引用户的注意力,还能够提升品牌形象,增加用户的信任感。CSS动画效果的引入,可以为登录页增添活力,创造更加动态和互动的用户体验。本文将探讨如何使用CSS来实现各种动画效果,从微妙的背景渐变到引人注目的登录框动画,一步步指导您打造出一个既美观又实用的酷炫登录页。

2.完整代码

HTML

<!DOCTYPE html>  
<html lang="en">  
<head>  
    <meta charset="UTF-8">  
    <title>Title</title>  
    <link rel="stylesheet" type="text/css" href="6_2.css">  
</head>  
<body>  
<div class="ring">  
    <i style="--clr:#ffd500;"></i>  
    <i style="--clr:#ff0057;"></i>  
    <i style="--clr:#084ee3;"></i>  
    <div class="login">  
        <h2>用户登录系统</h2>  
        <div class="inputBx">  
            <input type="text" placeholder="用户名">  
        </div>        <div class="inputBx">  
            <input type="password" placeholder="密码">  
        </div>        <div class="inputBx">  
            <input type="submit" value="登录">  
        </div>        <div class="links">  
            <a href="#">记住密码</a>  
            <a href="#">忘记密码</a>  
        </div>    </div></div>  
</body>  
</html>

CSS

* {  
    margin: 0;  
    padding: 0;  
    box-sizing: border-box;  
    font-family: "Quicksand", sans-serif;  
}  
body {  
    display: flex;  
    justify-content: center;  
    align-items: center;  
    min-height: 100vh;  
    background: #111;  
    width: 100%;  
    overflow: hidden;  
}  
.ring {  
    position: relative;  
    width: 500px;  
    height: 500px;  
    display: flex;  
    justify-content: center;  
    align-items: center;  
}  
.ring i {  
    position: absolute;  
    inset: 0;  
    border: 2px solid #fff;  
    transition: 0.5s;  
}  
.ring i:nth-child(1) {  
    border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%;  
    animation: animate 6s linear infinite;  
}  
.ring i:nth-child(2) {  
    border-radius: 41% 44% 56% 59%/38% 62% 63% 37%;  
    animation: animate 4s linear infinite;  
}  
.ring i:nth-child(3) {  
    border-radius: 41% 44% 56% 59%/38% 62% 63% 37%;  
    animation: animate2 10s linear infinite;  
}  
.ring:hover i {  
    border: 6px solid var(--clr);  
    filter: drop-shadow(0 0 20px var(--clr));  
}  
@keyframes animate {  
    0% {  
        transform: rotate(0deg);  
    }  
    100% {  
        transform: rotate(360deg);  
    }  
}  
@keyframes animate2 {  
    0% {  
        transform: rotate(360deg);  
    }  
    100% {  
        transform: rotate(0deg);  
    }  
}  
.login {  
    position: absolute;  
    width: 300px;  
    height: 100%;  
    display: flex;  
    justify-content: center;  
    align-items: center;  
    flex-direction: column;  
    gap: 20px;  
}  
.login h2 {  
    font-size: 2em;  
    color: #fff;  
}  
.login .inputBx {  
    position: relative;  
    width: 100%;  
}  
.login .inputBx input {  
    position: relative;  
    width: 100%;  
    padding: 12px 20px;  
    background: transparent;  
    border: 2px solid #fff;  
    border-radius: 40px;  
    font-size: 1.2em;  
    color: #fff;  
    box-shadow: none;  
    outline: none;  
}  
.login .inputBx input[type="submit"] {  
    width: 100%;  
    background: #0078ff;  
    background: linear-gradient(45deg, #ff357a, #fff172);  
    border: none;  
    cursor: pointer;  
}  
.login .inputBx input::placeholder {  
    color: rgba(255, 255, 255, 0.75);  
}  
.login .links {  
    position: relative;  
    width: 100%;  
    display: flex;  
    align-items: center;  
    justify-content: space-between;  
    padding: 0 20px;  
}  
.login .links a {  
    color: #fff;  
    text-decoration: none;  
}

标签:动画,center,100%,width,炫酷,login,border,ring,CSS
From: https://blog.csdn.net/2303_82176667/article/details/139388985

相关文章

  • QT通过qss/css修改单一控件样式
    通过.ui文件创建的界面,控件的QObjectName会自动添加,如果是通过.cpp和.h文件创建的控件需要加这句话open_dir_btn->setObjectName("open_dir_btn");,为按钮open_dir_btn添加设置ID。QTCreator设计模式中添加了一个按钮,它的objectName是自动添加的:只修改单个按钮的样式:QPushButt......
  • CSS tutorials (w3school)
    CSStutorials(w3school)https://www.schoolsw3.com/css/index.php (Русскийязык)https://www.w3schools.com/css/css_intro.asp (English)https://www.w3school.com.cn/css/index.asp(中文) css01CSSIntroductioncss02CSSSyntaxcss03CSSSelect......
  • 关于css预处理器sass详解
    Sass(SyntacticallyAwesomeStylesheets)是一种强大的CSS预处理器,旨在简化CSS的编写并增强其功能。以下是对Sass的详细解释,包括其特点、功能、语法格式以及使用方式。1.Sass的特点扩展CSS功能:Sass在CSS的基础上增加了变量、嵌套、混合(mixins)、继承等高级功能,使得CSS的编......
  • QT添加样式表QSS/CSS文件后不起作用
    .qss和.css文件类似,CSS即层叠样式表(CascadingStyleSheets)可以修改组件的样式。在QT项目需要.css文件对组件进行样式设置,在qrc文件夹下添加文件之后,读取会失败,原因是添加文件需要点击添加现有文件,尽管所需文件在某个目录下,也不要选择添加目录。分别使用绝对路径、相对路径添......
  • css45 CSS Math Functions
    https://www.w3schools.com/css/css_math_functions.asp TheCSSmathfunctionsallowmathematicalexpressionstobeusedaspropertyvalues.Here,wewillexplainthecalc(),max()andmin()functions.Thecalc()FunctionThecalc()functionperformsac......
  • css43 CSS Specificity
    https://zhuanlan.zhihu.com/p/670589063CSSSpecificity(CSS特异性)是一个用来决定当多个CSS规则应用于同一个元素时,哪个规则将优先应用的机制。 WhatisSpecificity?IftherearetwoormoreCSSrulesthatpointtothesameelement,theselectorwiththehighest......
  • css44 CSS The !important Rule
    https://www.w3schools.com/css/css_important.asp Whatis!important?The!importantruleinCSSisusedtoaddmoreimportancetoaproperty/valuethannormal.Infact,ifyouusethe!importantrule,itwilloverrideALLpreviousstylingrulesforthat......
  • css42 CSS Units
    https://www.w3schools.com/css/css_units.asp CSSUnitsCSShasseveraldifferentunitsforexpressingalength.ManyCSSpropertiestake"length"values,suchaswidth,margin,padding,font-size,etc.Lengthisanumberfollowedbyalengthun......
  • CSS(4)(学习笔记)
    一、定位1.1为什么需要定位有些效果,标准流或浮动都无法快速实现,此时需要定位来实现。(浮动不会压住文字和图片,浮动指挥影响后面的盒子不会影响前面的盒子)比如:所以:1.浮动可以让多个块级盒子一行没有缝隙排列显示,经常用于横向排列盒子。2.定位则是可以让盒子自由的在某个盒......
  • css41 CSS Website Layout
    https://www.w3schools.com/css/css_website_layout.asp WebsiteLayoutAwebsiteisoftendividedintoheaders,menus,contentandafooter: Therearetonsofdifferentlayoutdesignstochoosefrom.However,thestructureabove,isoneofthemostcomm......