찾다
웹 프론트엔드CSS 튜토리얼CSS에서 물결선과 큐브를 구현하기 위한 코드 예제

이 글의 내용은 CSS에서 물결선과 큐브를 구현하기 위한 코드 예제입니다. 필요한 친구들이 참고할 수 있기를 바랍니다.

최근 프로젝트에서는 물결선 효과를 그리는 방법에 대해 설명합니다. 즉, 원을 그린 다음 배경색을 사용하여 원의 일부를 덮습니다. 큐브 구현을 위한 회전

1.css 물결선 구현

  • html

<div>
    <div>
        <div></div>
        <!-- 实现波浪线的div -->
        <div></div>
        <div></div>
    </div>
</div>
  • css

.card-list{
    display: flex;
    padding: 20px;
    width: 100%;
}
.wave-container{
    position: relative;
    margin-right: 28px;
    width: 20%;
}
.wave{
    width: 100%;
    height: 90px;
    background: linear-gradient(to right, rgb(85, 181, 255), rgb(207, 224, 232));
}
/* 波浪线 */
.wave-left-decorate{
    position: absolute;
    top: -4px;
    width: 90px;
    height: 8px;
    transform-origin: center left;
    transform: rotate(90deg);
    background: radial-gradient(circle, #fff 2px, #fff, transparent 3px, transparent 4px, transparent 4px, transparent);
    background-size: 8px 8px;
}
Rendering

CSS에서 물결선과 큐브를 구현하기 위한 코드 예제

2. 큐브

  • html file

<div>
    <div>
        <div>
            <div>
                <img  class="leftContentImg lazy" src="/static/imghwm/default1.png" data-src="images/rabbit.jpg" alt="CSS에서 물결선과 큐브를 구현하기 위한 코드 예제" >
                <img  class="leftContentImg lazy" src="/static/imghwm/default1.png" data-src="images/rabbit.jpg" alt="CSS에서 물결선과 큐브를 구현하기 위한 코드 예제" >
                <img  class="leftContentImg lazy" src="/static/imghwm/default1.png" data-src="images/rabbit.jpg" alt="CSS에서 물결선과 큐브를 구현하기 위한 코드 예제" >
                <img  class="leftContentImg lazy" src="/static/imghwm/default1.png" data-src="images/rabbit.jpg" alt="CSS에서 물결선과 큐브를 구현하기 위한 코드 예제" >
                <img  class="leftContentImg lazy" src="/static/imghwm/default1.png" data-src="images/rabbit.jpg" alt="CSS에서 물결선과 큐브를 구현하기 위한 코드 예제" >
                <img  class="leftContentImg lazy" src="/static/imghwm/default1.png" data-src="images/rabbit.jpg" alt="CSS에서 물결선과 큐브를 구현하기 위한 코드 예제" >
            </div>
        </div>
    </div>
</div>
  • css file

.content{
    position: relative;
    display: flex;
    margin: 0 auto;
    padding-top: 50px;
    width: 1200px;
    height: 380px;
    background: url(../images/bg2.jpg) no-repeat;
    background-size: 1200px 100%;
}
.content .leftContent{
    margin-right: 25px;
    padding-left: 45px;
    padding-bottom: 30px;
    box-sizing: border-box;
}
/* 旋转的图片 */
.content .leftContent .leftContentItem{
    width: 350px;
    height: 350px;
    /* 设置景深 */
    perspective: 1000px;
    /* 设置背景颜色在中间为椭圆形 */
    /*background: radial-gradient(ellipse at center, #430d6d 0%, #000 100%);*/
}
.leftContent .leftContentItem .itemImg{
    position: absolute;
    left: 20%;
    top: 20%;
    width: 200px;
    height: 200px;
    /* 实现3D呈现 */
    transform-style: preserve-3d;
    transform: rotateX(-20deg) rotateY(-20deg);
    -webkit-animation: 6s imgRotate linear infinite;
    -o-animation: 6s imgRotate linear infinite;
    animation: 6s imgRotate linear infinite;
}
.leftContent .leftContentItem .itemImg *{
    position: absolute;
    width: 100%;
    height: 100%;
    box-shadow: 0 0 25px rgba(0, 128, 0, .4);
}
.leftContentItem .itemImg .leftContentImg{
    position: absolute;
    width: 100%;
    height: 100%;
}
/* 分别对各个面进行旋转、平移操作 */
.leftContentItem .itemImg .leftContentImg:nth-child(1){
    transform: translateZ(100px);
}
.leftContentItem .itemImg .leftContentImg:nth-child(2){
    transform: rotateX(180deg) translateZ(100px);
}
.leftContentItem .itemImg .leftContentImg:nth-child(3){
    transform: rotateY(-90deg) translateZ(100px);
}
.leftContentItem .itemImg .leftContentImg:nth-child(4){
    transform: rotateY(90deg) translateZ(100px);
}
.leftContentItem .itemImg .leftContentImg:nth-child(5){
    transform: rotateX(90deg) translateZ(100px);
}
.leftContentItem .itemImg .leftContentImg:nth-child(6){
    transform: rotateX(-90deg) translateZ(100px);
}
@-webkit-keyframes imgRotate {
    from{
        transform: translateZ(-100px) rotateX(0) rotateY(0);
    }
    to{
        transform: translateZ(-100px) rotateX(360deg) rotateY(360deg);
    }
}
Rendering

CSS에서 물결선과 큐브를 구현하기 위한 코드 예제

가장 중요한 것은 심도 원근을 설정한 다음 각 면을 회전 및 이동하는 것입니다

위 내용은 이 글의 전체 내용입니다. . CSS에 대한 더 많은 지식을 얻으려면 PHP 중국어 웹사이트의

css 비디오 튜토리얼 칼럼을 따라가세요! ! !

위 내용은 CSS에서 물결선과 큐브를 구현하기 위한 코드 예제의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명
이 기사는 segmentfault思否에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제
Google 글꼴을 태그하고 Goofonts.com을 작성한 방법Google 글꼴을 태그하고 Goofonts.com을 작성한 방법Apr 12, 2025 pm 12:02 PM

Goofonts는 개발자 부인과 디자이너 남편이 서명 한 사이드 프로젝트로, 둘 다 타이포그래피의 큰 팬입니다. 우리는 Google에 태그를 지정했습니다

시대를 초월한 웹 개발 기사시대를 초월한 웹 개발 기사Apr 12, 2025 am 11:44 AM

Pavithra Kodmad

섹션 요소와의 거래섹션 요소와의 거래Apr 12, 2025 am 11:39 AM

두 기사가 정확히 같은 날에 출판되었습니다.

JavaScript API 상태로 GraphQL 쿼리를 연습하십시오JavaScript API 상태로 GraphQL 쿼리를 연습하십시오Apr 12, 2025 am 11:33 AM

GraphQL API를 구축하는 방법을 배우는 것은 매우 어려울 수 있습니다. 그러나 10 분 안에 GraphQL API를 사용하는 방법을 배울 수 있습니다! 그리고 그것은 완벽하게 얻었습니다

구성 요소 수준 CMS구성 요소 수준 CMSApr 12, 2025 am 11:09 AM

구성 요소가 데이터를 쿼리하는 환경에 거주하면 근처에 사는 경우 시각적 구성 요소와

오프셋 경로로 원에 유형을 설정하십시오오프셋 경로로 원에 유형을 설정하십시오Apr 12, 2025 am 11:00 AM

여기 Yuanchuan의 합법적 인 CSS 속임수입니다. 이 CSS 속성 오프셋 경로가 있습니다. 옛날 옛적에, 그것은 모션 경로라고 불렸다가 이름이 바뀌 었습니다. 나

CSS에서 '리버 트'는 무엇을합니까?CSS에서 '리버 트'는 무엇을합니까?Apr 12, 2025 am 10:59 AM

Miriam Suzanne 은이 주제에 대한 Mozilla 개발자 비디오에서 설명합니다.

현대 애호가현대 애호가Apr 12, 2025 am 10:58 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를 무료로 생성하십시오.

인기 기사

R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 최고의 그래픽 설정
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 아무도들을 수없는 경우 오디오를 수정하는 방법
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25 : Myrise에서 모든 것을 잠금 해제하는 방법
4 몇 주 전By尊渡假赌尊渡假赌尊渡假赌

뜨거운 도구

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

안전한 시험 브라우저

안전한 시험 브라우저

안전한 시험 브라우저는 온라인 시험을 안전하게 치르기 위한 보안 브라우저 환경입니다. 이 소프트웨어는 모든 컴퓨터를 안전한 워크스테이션으로 바꿔줍니다. 이는 모든 유틸리티에 대한 액세스를 제어하고 학생들이 승인되지 않은 리소스를 사용하는 것을 방지합니다.

에디트플러스 중국어 크랙 버전

에디트플러스 중국어 크랙 버전

작은 크기, 구문 강조, 코드 프롬프트 기능을 지원하지 않음

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

WebStorm Mac 버전

WebStorm Mac 버전

유용한 JavaScript 개발 도구