테스트 사이트 - 개발 중인 베타 버전입니다

간단한 FLEX 예제

· 2년 전 · 1179

[code]

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>test04.html</title>
    <script
      src="https://code.jquery.com/jquery-3.6.4.min.js"
      integrity="sha256-oP6HI9z1XaZNBrJURtCoUT5SUnxFr8s3BzRl+cbzUq8="
      crossorigin="anonymous"
    ></script>
    <script
      src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"
      integrity="sha256-lSjKY0/srUM9BE3dPm+c4fBo1dky2v27Gdjm2uoZaL0="
      crossorigin="anonymous"
    ></script>
    <link
      rel="stylesheet"
      href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
    />
    <link rel="stylesheet" href="css/style.css" />
    <style>
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        font-family: "Roboto", sans-serif;
      }
      section {
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 40px 0;
        min-height: 100vh;
        background-color: #350048;
      }
      section::before {
        content: "";
        position: absolute;
        width: 100%;
        height: 50px;
        background-color: #bd00ff;
      }
      .container {
        width: 900px;
        display: flex;
        /* flex-direction: column; 개인적으로 추가  */
        align-items: center; /* 개인적으로 추가  */
        flex-wrap: wrap;
        justify-content: space-around;
      }
      .container .card {
        position: relative;
        width: 250px;
        height: 300px;
        text-align: center;
        z-index: 10;
        margin: 20px 20px 60px;
        transition: 0.5s;
      }
      .container .card .box {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: rgba(255, 255, 255, 0.05);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(15px);
        border: 1px solid rgba(0, 0, 0, 0.1);
        z-index: 10;
        border-radius: 10px;
      }
      .percent {
        /* position: absolute; */
        position: relative;
        width: 150px;
        height: 150px;
        border-radius: 50%;
        z-index: 100;
      }
      .percent .number {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
      }
      .percent .number h2 {
        color: #fff;
        font-weight: 700;
        font-size: 50px;
      }
      .percent .number h2 span {
        font-size: 24px;
      }
      .text {
        position: absolute;
        /* top: 0; */
        bottom: -42px;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        padding: 30px 20px 10px;
        background-color: #f00;
        border-radius: 10px;
        font-weight: 800;
        letter-spacing: 1px;
        text-transform: uppercase;
        /* box-shadow: 0 15px 35px rgba(255, 255, 255, 0.1); */
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
        z-index: 1;
        /* z-index: 12; */
        pointer-events: none;
        transition: bottom 0.5s, z-index 0s, transform 0.5s, padding 0.5s;
        transition-delay: 0.5s, 0.5s, 0s, 0.5s;
        color: #fff;
      }
      .card:hover .text {
        transition-delay: 0s, 0.5s, 0.5s, 0s;
        bottom: -70px;
        z-index: 11;
        transform: translateX(-50%) translateY(-50px);
        padding: 10px 20px 10px;
      }
      .card:nth-child(1) .text {
        background-color: #ff0461;
      }
      .card:nth-child(2) .text {
        background-color: #2bd2ff;
      }
      .card:nth-child(3) .text {
        background-color: #18d539;
      }
      svg {
        /* display: inline; */
        /* display: none; */
        position: relative;
        width: 150px;
        height: 150px;
      }
      svg circle {
        width: 100%;
        height: 100%;
        fill: none;
        stroke-width: 10;
        stroke: rgba(255, 255, 255, 0.05); /*#fff;*/
        transform: translate(5px, 5px);
        stroke-linecap: round;
      }
      svg circle:nth-child(2) {
        /* width: 100%; */
        /* height: 100%; */
        /* fill: none; */
        /* stroke-width: 10; */
        stroke: #fff;
        stroke-dasharray: 440px;
        stroke-dashoffset: 440px;
      }
      .card:nth-child(1) svg circle:nth-child(2) {
        /* width: 100%; */
        /* height: 100%; */
        /* fill: none; */
        /* stroke-width: 10; */
        /* stroke: #fff; */
        /* stroke-dasharray: 440px; */
        stroke-dashoffset: calc(440px - (440px * 90) / 100);
      }
      .card:nth-child(2) svg circle:nth-child(2) {
        /* width: 100%; */
        /* height: 100%; */
        /* fill: none; */
        /* stroke-width: 10; */
        /* stroke: #fff; */
        /* stroke-dasharray: 440px; */
        stroke-dashoffset: calc(440px - (440px * 82) / 100);
      }
      .card:nth-child(3) svg circle:nth-child(2) {
        /* width: 100%; */
        /* height: 100%; */
        /* fill: none; */
        /* stroke-width: 10; */
        /* stroke: #fff; */
        /* stroke-dasharray: 440px; */
        stroke-dashoffset: calc(440px - (440px * 65) / 100);
      }
    </style>
  </head>
  <body>
    <section>
      <div class="container">
        <div class="card">
          <div class="box">
            <div>
              <div class="percent">
                <svg>
                  <circle cx="70" cy="70" r="70"></circle>
                  <circle cx="70" cy="70" r="70"></circle>
                </svg>
                <div class="number">
                  <h2>90<span>%</span></h2>
                </div>
              </div>
            </div>
          </div>
          <div class="text">Html</div>
        </div>
        <div class="card">
          <div class="box">
            <div>
              <div class="percent">
                <svg>
                  <circle cx="70" cy="70" r="70"></circle>
                  <circle cx="70" cy="70" r="70"></circle>
                </svg>
                <div class="number">
                  <h2>82<span>%</span></h2>
                </div>
              </div>
            </div>
          </div>
          <div class="text">CSS</div>
        </div>
        <div class="card">
          <div class="box">
            <div>
              <div class="percent">
                <svg>
                  <circle cx="70" cy="70" r="70"></circle>
                  <circle cx="70" cy="70" r="70"></circle>
                </svg>
                <div class="number">
                  <h2>65<span>%</span></h2>
                </div>
              </div>
            </div>
          </div>
          <div class="text">Javascript</div>
        </div>
      </div>
    </section>
  </body>
</html>

[/code]

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

게시글 목록

번호 제목
3530
3529
3497
3472
3471
3451
3442
3441
3437
3436
3425
3421
3420
3405
3402
3399
3397
3394
3393
3392
3391
3390
3389
3388
3387
3386
3385
3384
3383
3382