찾다
웹 프론트엔드CSS 튜토리얼몇 가지 일반적인 로딩 효과 구현

이번에는 몇 가지 일반적인 로딩 효과 구현에 대해 이야기하고, 로딩 효과 구현 시 주의해야 할 사항은 다음과 같습니다.

<html>
       <head>
              <meta charset="UTF-8">
              <title>Loading</title>
              <link rel="stylesheet" type="text/css" href="loading.css">
              <style>
                     .loader {
                            float: left;
                     }
                    
                     .loader {
                            position: relative;
                            width: 5rem;
                            height: 5rem;
                     }
                    
                     .loader.small {
                            -webkit-transform: scale(.5);
                            transform: scale(.5);
                     }
                    
                     .loader.circle-line,
                     .loader.circle-round {
                            height: 5rem;
                     }
                     /*circle-line*/
                    
                     .loader.circle-line span {
                            position: absolute;
                            display: inline-block;
                            width: 1.5rem;
                            height: .5rem;
                            border-top-left-radius: .25rem;
                            border-bottom-left-radius: .25rem;
                            background: #1ABC9C;
                            opacity: .05;
                            -webkit-animation: circle-line 1s ease infinite;
                            animation: circle-line 1s ease infinite;
                     }
                    
                     .loader.circle-line span:nth-child(1) {
                            top: 50%;
                            left: 0;
                            margin-top: -.25rem;
                            -webkit-animation-delay: .13s;
                            animation-delay: .13s;
                     }
                    
                     .loader.circle-line span:nth-child(2) {
                            top: 1rem;
                            left: .5rem;
                            -webkit-transform: rotate(45deg);
                            transform: rotate(45deg);
                            -webkit-animation-delay: .26s;
                            animation-delay: .26s;
                     }
                    
                     .loader.circle-line span:nth-child(3) {
                            left: 50%;
                            top: .5rem;
                            margin-left: -.75rem;
                            -webkit-transform: rotate(90deg);
                            transform: rotate(90deg);
                            -webkit-animation-delay: .39s;
                            animation-delay: .39s;
                     }
                    
                     .loader.circle-line span:nth-child(4) {
                            right: .5rem;
                            top: 1rem;
                            -webkit-transform: rotate(145deg);
                            transform: rotate(145deg);
                            -webkit-animation-delay: .52s;
                            animation-delay: .52s;
                     }
                    
                     .loader.circle-line span:nth-child(5) {
                            left: 3.5rem;
                            top: 50%;
                            margin-top: -.25rem;
                            -webkit-transform: rotate(180deg);
                            transform: rotate(180deg);
                            -webkit-animation-delay: .65s;
                            animation-delay: .65s;
                     }
                    
                     .loader.circle-line span:nth-child(6) {
                            bottom: 1rem;
                            right: .5rem;
                            -webkit-transform: rotate(-145deg);
                            transform: rotate(-145deg);
                            -webkit-animation-delay: .78s;
                            animation-delay: .78s;
                     }
                    
                     .loader.circle-line span:nth-child(7) {
                            left: 50%;
                            bottom: .5rem;
                            margin-left: -15px;
                            -webkit-transform: rotate(-90deg);
                            transform: rotate(-90deg);
                            -webkit-animation-delay: .91s;
                            animation-delay: .91s;
                     }
                    
                     .loader.circle-line span:nth-child(8) {
                            bottom: 1rem;
                            left: .5rem;
                            -webkit-transform: rotate(-45deg);
                            transform: rotate(-45deg);
                            -webkit-animation-delay: 1.04s;
                            animation-delay: 1.04s;
                     }
                    
                     @keyframes circle-line {
                            0% {
                                   opacity: .05;
                            }
                            100% {
                                   opacity: .7;
                            }
                     }
                    
                     @-webkit-keyframes circle-line {
                            0% {
                                   opacity: .05;
                            }
                            100% {
                                   opacity: .7;
                            }
                     }
                     /*circle-line-spin*/
                    
                     .loader.circle-line-spin .circle-line-inner {
                            width: 100%;
                            height: 100%;
                            -webkit-animation: circle-line-spin 1.5s linear infinite;
                            animation: circle-line-spin 1.5s linear infinite;
                     }
                    
                     .loader.circle-line-spin span {
                            position: absolute;
                            display: inline-block;
                            width: 1.5rem;
                            height: .5rem;
                            border-top-left-radius: .25rem;
                            border-bottom-left-radius: .25rem;
                            background: #1ABC9C;
                            opacity: .7;
                     }
                    
                     .loader.circle-line-spin span:nth-child(1) {
                            top: 50%;
                            left: 0;
                            margin-top: -.25rem;
                     }
                    
                     .loader.circle-line-spin span:nth-child(2) {
                            top: 1rem;
                            left: .5rem;
                            -webkit-transform: rotate(45deg);
                            transform: rotate(45deg);
                     }
                    
                     .loader.circle-line-spin span:nth-child(3) {
                            left: 50%;
                            top: .5rem;
                            margin-left: -.75rem;
                            -webkit-transform: rotate(90deg);
                            transform: rotate(90deg);
                     }
                    
                     .loader.circle-line-spin span:nth-child(4) {
                            right: .5rem;
                            top: 1rem;
                            -webkit-transform: rotate(145deg);
                            transform: rotate(145deg);
                     }
                    
                     .loader.circle-line-spin span:nth-child(5) {
                            left: 3.5rem;
                            top: 50%;
                            margin-top: -.25rem;
                            -webkit-transform: rotate(180deg);
                            transform: rotate(180deg);
                     }
                    
                     .loader.circle-line-spin span:nth-child(6) {
                            bottom: 1rem;
                            right: .5rem;
                            -webkit-transform: rotate(-145deg);
                            transform: rotate(-145deg);
                     }
                    
                     .loader.circle-line-spin span:nth-child(7) {
                            left: 50%;
                            bottom: .5rem;
                            margin-left: -15px;
                            -webkit-transform: rotate(-90deg);
                            transform: rotate(-90deg);
                     }
                    
                     .loader.circle-line-spin span:nth-child(8) {
                            bottom: 1rem;
                            left: .5rem;
                            -webkit-transform: rotate(-45deg);
                            transform: rotate(-45deg);
                     }
                    
                     @keyframes circle-line-spin {
                            0% {
                                   transform: rotate(0);
                            }
                            100% {
                                   transform: rotate(360deg);
                            }
                     }
                    
                     @-webkit-keyframes circle-line-spin {
                            0% {
                                   -webkit-transform: rotate(0);
                            }
                            100% {
                                   -webkit-transform: rotate(360deg);
                            }
                     }
                     /*circle-round*/
                    
                     .loader.circle-round span {
                            opacity: .05;
                            -webkit-animation: circle-round 1s ease infinite;
                            animation: circle-round 1s ease infinite;
                     }
                    
                     .loader.circle-round-fade span {
                            -webkit-animation: circle-round-fade 1s ease infinite;
                            animation: circle-round-fade 1s ease infinite;
                     }
                    
                     .loader.circle-round span,
                     .loader.circle-round-fade span {
                            position: absolute;
                            width: .8rem;
                            height: .8rem;
                            display: inline-block;
                            border-radius: 50%;
                            background: #1ABC9C;
                     }
                    
                     .loader.circle-round span:nth-child(1),
                     .loader.circle-round-fade span:nth-child(1) {
                            top: 50%;
                            left: 0;
                            margin-top: -.4rem;
                            -webkit-animation-delay: -1.04s;
                            animation-delay: -1.04s;
                     }
                    
                     .loader.circle-round span:nth-child(2),
                     .loader.circle-round-fade span:nth-child(2) {
                            top: .7rem;
                            left: .7rem;
                            -webkit-animation-delay: -.91s;
                            animation-delay: -.91s;
                     }
                    
                     .loader.circle-round span:nth-child(3),
                     .loader.circle-round-fade span:nth-child(3) {
                            top: 0;
                            left: 50%;
                            margin-left: -.4rem;
                            -webkit-animation-delay: -.78s;
                            animation-delay: -.78s;
                     }
                    
                     .loader.circle-round span:nth-child(4),
                     .loader.circle-round-fade span:nth-child(4) {
                            right: .7rem;
                            top: .7rem;
                            -webkit-animation-delay: -.65s;
                            animation-delay: -.65s;
                     }
                    
                     .loader.circle-round span:nth-child(5),
                     .loader.circle-round-fade span:nth-child(5) {
                            right: 0;
                            top: 50%;
                            margin-top: -.4rem;
                            -webkit-animation-delay: -.52s;
                            animation-delay: -.52s;
                     }
                    
                     .loader.circle-round span:nth-child(6),
                     .loader.circle-round-fade span:nth-child(6) {
                            bottom: .7rem;
                            right: .7rem;
                            -webkit-animation-delay: -.39s;
                            animation-delay: -.39s;
                     }
                    
                     .loader.circle-round span:nth-child(7),
                     .loader.circle-round-fade span:nth-child(7) {
                            bottom: 0;
                            left: 50%;
                            margin-left: -.4rem;
                            -webkit-animation-delay: -.26s;
                            animation-delay: -.26s;
                     }
                    
                     .loader.circle-round span:nth-child(8),
                     .loader.circle-round-fade span:nth-child(8) {
                            left: .7rem;
                            bottom: .7rem;
                            -webkit-animation-delay: -.13s;
                            animation-delay: -.13s;
                     }
                    
                     @keyframes circle-round {
                            0% {
                                   opacity: .05;
                            }
                            100% {
                                   opacity: .7;
                            }
                     }
                    
                     @-webkit-keyframes circle-round {
                            0% {
                                   opacity: .05;
                            }
                            100% {
                                   opacity: .7;
                            }
                     }
                    
                     @keyframes circle-round-fade {
                            0% {
                                   opacity: .25;
                                   transform: scale(.2);
                            }
                            100% {
                                   opacity: 1;
                                   transform: scale(1);
                            }
                     }
                    
                     @-webkit-keyframes circle-round-fade {
                            0% {
                                   opacity: .25;
                                   transform: scale(.2);
                            }
                            100% {
                                   opacity: 1;
                                   transform: scale(1);
                            }
                     }
                     /*line-square*/
                    
                     .loader.line-square {
                            width: 6rem;
                            height: .8rem;
                     }
                    
                     .loader.line-square span {
                            position: absolute;
                            top: 0;
                            width: .8rem;
                            height: .8rem;
                            display: inline-block;
                            background: #1ABC9C;
                            -webkit-animation: line-square 1s ease infinite;
                            animation: line-square 1s ease infinite;
                     }
                    
                     .loader.line-square span:nth-child(1) {
                            left: 0;
                            -webkit-animation-delay: .13s;
                            animation-delay: .13s;
                     }
                    
                     .loader.line-square span:nth-child(2) {
                            left: 1.3rem;
                            -webkit-animation-delay: .26s;
                            animation-delay: .26s;
                     }
                    
                     .loader.line-square span:nth-child(3) {
                            left: 2.6rem;
                            -webkit-animation-delay: .39s;
                            animation-delay: .39s;
                     }
                    
                     .loader.line-square span:nth-child(4) {
                            left: 3.9rem;
                            -webkit-animation-delay: .52s;
                            animation-delay: .52s;
                     }
                    
                     .loader.line-square span:nth-child(5) {
                            left: 5.2rem;
                            -webkit-animation-delay: .65s;
                            animation-delay: .65s;
                     }
                    
                     @keyframes line-square {
                            0% {
                                   opacity: 1;
                                   transform: scale(1.2);
                                   -webkit-transform: scale(1.2);
                            }
                            100% {
                                   opacity: .2;
                                   transform: scale(.2);
                                   -webkit-transform: scale(.2);
                            }
                     }
                    
                     @-webkit-keyframes line-square {
                            0% {
                                   opacity: 1;
                                   transform: scale(1.2);
                                   -webkit-transform: scale(1.2);
                            }
                            100% {
                                   opacity: .2;
                                   transform: scale(.2);
                                   -webkit-transform: scale(.2);
                            }
                     }
                     /*line-round*/
                    
                     .loader.line-round {
                            width: 6rem;
                            height: .8rem;
                     }
                    
                     .loader.line-round span {
                            position: absolute;
                            top: 0;
                            width: .8rem;
                            height: .8rem;
                            border-radius: 50%;
                            display: inline-block;
                            background: #1ABC9C;
                            -webkit-animation: line-round 1s ease infinite;
                            animation: line-round 1s ease infinite;
                     }
                    
                     .loader.line-round span:nth-child(1) {
                            left: 0;
                            -webkit-animation-delay: .13s;
                            animation-delay: .13s;
                     }
                    
                     .loader.line-round span:nth-child(2) {
                            left: 1.3rem;
                            -webkit-animation-delay: .26s;
                            animation-delay: .26s;
                     }
                    
                     .loader.line-round span:nth-child(3) {
                            left: 2.6rem;
                            -webkit-animation-delay: .39s;
                            animation-delay: .39s;
                     }
                    
                     .loader.line-round span:nth-child(4) {
                            left: 3.9rem;
                            -webkit-animation-delay: .52s;
                            animation-delay: .52s;
                     }
                    
                     .loader.line-round span:nth-child(5) {
                            left: 5.2rem;
                            -webkit-animation-delay: .65s;
                            animation-delay: .65s;
                     }
                    
                     @keyframes line-round {
                            0% {
                                   opacity: 1;
                                   transform: scale(1.2);
                                   -webkit-transform: scale(1.2);
                            }
                            100% {
                                   opacity: .2;
                                   transform: scale(.2);
                                   -webkit-transform: scale(.2);
                            }
                     }
                    
                     @-webkit-keyframes line-round {
                            0% {
                                   opacity: 1;
                                   transform: scale(1.2);
                                   -webkit-transform: scale(1.2);
                            }
                            100% {
                                   opacity: .2;
                                   transform: scale(.2);
                                   -webkit-transform: scale(.2);
                            }
                     }
                     /*line-bounce*/
                    
                     .loader.line-bounce {
                            width: 6rem;
                            height: 2.5rem;
                     }
                    
                     .loader.line-bounce span {
                            position: absolute;
                            top: 0;
                            width: .5rem;
                            height: 2.5rem;
                            border-radius: 5px;
                            display: inline-block;
                            background: #1ABC9C;
                            -webkit-animation: line-bounce 1s ease infinite;
                            animation: line-bounce 1s ease infinite;
                     }
                    
                     .loader.line-bounce span:nth-child(1) {
                            left: 0;
                            -webkit-animation-delay: -.65s;
                            animation-delay: -.65s;
                     }
                    
                     .loader.line-bounce span:nth-child(2) {
                            left: 1.3rem;
                            -webkit-animation-delay: -.78s;
                            animation-delay: -.78s;
                     }
                    
                     .loader.line-bounce span:nth-child(3) {
                            left: 2.6rem;
                            -webkit-animation-delay: -.91s;
                            animation-delay: -.91s;
                     }
                    
                     .loader.line-bounce span:nth-child(4) {
                            left: 3.9rem;
                            -webkit-animation-delay: -.78s;
                            animation-delay: -78s;
                     }
                    
                     .loader.line-bounce span:nth-child(5) {
                            left: 5.2rem;
                            -webkit-animation-delay: -.65s;
                            animation-delay: -.65s;
                     }
                    
                     @keyframes line-bounce {
                            0% {
                                   transform: scaleY(1);
                            }
                            50% {
                                   transform: scaleY(.3);
                            }
                            100% {
                                   transform: scaleY(1);
                            }
                     }
                    
                     @-webkit-keyframes line-bounce {
                            0% {
                                   -webkit-transform: scaleY(1);
                            }
                            50% {
                                   -webkit-transform: scaleY(.3);
                            }
                            100% {
                                   -webkit-transform: scaleY(1);
                            }
                     }
                     /*circle-spin*/
                    
                     .loader.circle-spin {
                            border-radius: 50%;
                            border: .2rem solid rgba(0, 0, 0, .05);
                            width: 4rem;
                            height: 4rem;
                            box-sizing: content-box;
                     }
                    
                     .loader.circle-spin .loader-placeholder {
                            position: absolute;
                            top: -.2rem;
                            left: -.2rem;
                            border-radius: 50%;
                            border: .2rem solid transparent;
                            border-top: .2rem solid #1ABC9C;
                            width: 4rem;
                            height: 4rem;
                            box-sizing: content-box;
                            -webkit-animation: circle-spin 1s ease infinite;
                            animation: circle-spin 1s ease infinite;
                     }
                    
                     @keyframes circle-spin {
                            0% {
                                   transform: rotate(0);
                            }
                            100% {
                                   transform: rotate(360deg);
                            }
                     }
                    
                     @-webkit-keyframes circle-spin {
                            0% {
                                   -webkit-transform: rotate(0);
                            }
                            100% {
                                   -webkit-transform: rotate(360deg);
                            }
                     }
              </style>
       </head>
 
       <body>
              <div>
                     <div class="loader circle-line small">
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                     </div>
                     <div class="loader circle-line-spin small">
                            <div>
                                   <span></span>
                                   <span></span>
                                   <span></span>
                                   <span></span>
                                   <span></span>
                                   <span></span>
                                   <span></span>
                                   <span></span>
                            </div>
                     </div>
                     <div class="loader circle-round small">
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                     </div>
                     <div class="loader circle-round-fade small">
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                     </div>
                     <div class="loader line-square small">
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                     </div>
                     <div class="loader line-round small">
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                     </div>
                     <div class="loader line-bounce small">
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                            <span></span>
                     </div>
                     <div class="loader circle-spin small">
                            <div></div>
                     </div>
              </div>
 
       </body>
</html>


이 사례를 읽으신 후 방법을 마스터하셨다고 생각합니다. 더 흥미로운 정보를 보려면 PHP 중국어 웹사이트의 다른 관련 기사를 주목하세요!

관련 읽기:

HTML5 반응형 배너 제작 튜토리얼

H5를 사용하여 물방울 특수 효과를 만드는 튜토리얼

HTML 웹페이지 최적화 및 압축을 구현하는 단계

위 내용은 몇 가지 일반적인 로딩 효과 구현의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
드래그 ' 및 Droppin ' 반응에서드래그 ' 및 Droppin ' 반응에서Apr 17, 2025 am 11:52 AM

React Ecosystem은 모두 드래그 앤 드롭의 상호 작용에 중점을 둔 많은 라이브러리를 제공합니다. 우리는 React-dnd, React-beautiful-dnd를 가지고 있습니다.

빠른 소프트웨어빠른 소프트웨어Apr 17, 2025 am 11:49 AM

최근 빠른 소프트웨어에 대해 놀랍도록 상호 연결된 것들이있었습니다.

배경 클립이있는 중첩 된 그라디언트배경 클립이있는 중첩 된 그라디언트Apr 17, 2025 am 11:47 AM

나는 자주 배경 클립을 사용한다고 말할 수 없습니다. I ' D WART IT IT는 일상적인 CSS 작업에서 거의 사용되지 않았습니다. 그러나 나는 Stefan Judis의 게시물에서 그것을 상기시켰다.

React 후크와 함께 requestAnimationFrame 사용React 후크와 함께 requestAnimationFrame 사용Apr 17, 2025 am 11:46 AM

requestAnimationFrame을 사용하여 애니메이션은 쉬워야하지만 React의 문서를 철저히 읽지 않으면 몇 가지 문제가 발생할 수 있습니다.

페이지 상단으로 스크롤해야합니까?페이지 상단으로 스크롤해야합니까?Apr 17, 2025 am 11:45 AM

아마도이를 사용자에게 제공하는 가장 쉬운 방법은 요소의 ID를 대상으로하는 링크 일 것입니다. 그래서 ...처럼 ...

최고 (GraphQL) API는 귀하가 작성한 것입니다최고 (GraphQL) API는 귀하가 작성한 것입니다Apr 17, 2025 am 11:36 AM

들어보세요, 나는 GraphQL 전문가가 아니지만 함께 일하는 것을 좋아합니다. 프론트 엔드 개발자로서 데이터를 노출시키는 방법은 꽤 멋지다. 메뉴와 같습니다

주간 플랫폼 뉴스 : 텍스트 간격 북마크, 최상위 차단, 새로운 앰프 로딩 표시기주간 플랫폼 뉴스 : 텍스트 간격 북마크, 최상위 차단, 새로운 앰프 로딩 표시기Apr 17, 2025 am 11:26 AM

이번 주에 타이포그래피를 검사하기위한 편리한 북마크 인 Roundup, JavaScript 모듈과 Facebook의 Facebook 등을 어떻게 가져 오는지 땜질하기 위해 대기하는 편리한 북마크 인 Roundup과 Facebook의

테두리 반경을 보존하는 동안 상자를 확장하는 다양한 방법테두리 반경을 보존하는 동안 상자를 확장하는 다양한 방법Apr 17, 2025 am 11:19 AM

나는 최근 코데 펜에서 흥미로운 변화를 발견했다.

See all articles

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

뜨거운 도구

VSCode Windows 64비트 다운로드

VSCode Windows 64비트 다운로드

Microsoft에서 출시한 강력한 무료 IDE 편집기

맨티스BT

맨티스BT

Mantis는 제품 결함 추적을 돕기 위해 설계된 배포하기 쉬운 웹 기반 결함 추적 도구입니다. PHP, MySQL 및 웹 서버가 필요합니다. 데모 및 호스팅 서비스를 확인해 보세요.

ZendStudio 13.5.1 맥

ZendStudio 13.5.1 맥

강력한 PHP 통합 개발 환경

Dreamweaver Mac版

Dreamweaver Mac版

시각적 웹 개발 도구

MinGW - Windows용 미니멀리스트 GNU

MinGW - Windows용 미니멀리스트 GNU

이 프로젝트는 osdn.net/projects/mingw로 마이그레이션되는 중입니다. 계속해서 그곳에서 우리를 팔로우할 수 있습니다. MinGW: GCC(GNU Compiler Collection)의 기본 Windows 포트로, 기본 Windows 애플리케이션을 구축하기 위한 무료 배포 가능 가져오기 라이브러리 및 헤더 파일로 C99 기능을 지원하는 MSVC 런타임에 대한 확장이 포함되어 있습니다. 모든 MinGW 소프트웨어는 64비트 Windows 플랫폼에서 실행될 수 있습니다.