간단한 FLEX 예제 > 퍼블리셔팁

퍼블리셔팁

퍼블리싱과 관련된 유용한 정보를 공유하세요.
질문은 상단의 QA에서 해주시기 바랍니다.

간단한 FLEX 예제 정보

HTML 간단한 FLEX 예제

본문


<!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>
추천
0

댓글 0개

전체 1,264
퍼블리셔팁 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT