๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
[๊ฐœ๋ฐœ] Practice/HTML CSS

[HTML/CSS] Admin Page ๋งŒ๋“ค๊ธฐ

by Connecting-the-dots 2022. 3. 2.
728x90
๋ฐ˜์‘ํ˜•

๐Ÿ’ก ์‹ค์Šต ํฌ์ธํŠธ!

  • ์ด์ „์— ๊ณต๋ถ€ํ•œ ์• ๋‹ˆ๋ฉ”์ด์…˜ ํšจ๊ณผ, Font Awesome, Bootstrap ๊นŒ์ง€ ํ™œ์šฉํ•˜์—ฌ Admin Page ๋ ˆ์ด์•„์›ƒ์„ ๋งŒ๋“ค์–ด๋ณด์•˜๋‹ค.
  • ์•„์ง ์• ๋‹ˆ๋ฉ”์ด์…˜ ํšจ๊ณผ์— ๋Œ€ํ•œ ์ดํ•ด๊ฐ€ ๋ถ€์กฑํ•œ์ง€ ์‚ฌ์ด๋“œ๋ฐ”์— ์• ๋‹ˆ๋ฉ”์ด์…˜ ํšจ๊ณผ๋ฅผ ๋„ฃ์„ ๋•Œ ์ƒ๋‹นํžˆ ํ—ค๋งธ๋‹ค..
  • Tasks ๋ฆฌ์ŠคํŠธ ๋ชฉ๋ก์—์„œ๋„ ์›ํ•˜๋Š” ๋ ˆ์ด์•„์›ƒ์ด ๋‚˜์˜ค์ง€ ์•Š์•„ 30๋ถ„ ์ •๋„ ์ด๊ฒƒ์ €๊ฒƒ ํ•ด๋ณด๋ฉด์„œ ๊ณ ๋ฏผ์„ ํ–ˆ๋‹ค.
  • ๋”๋ถˆ์–ด ์˜ค๋Š˜์€ Chart.js ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์กฐ๊ธˆ์ด๋‚˜๋งˆ ๊ณต๋ถ€ํ•ด๋ณด์•˜๋‹ค. ๋‹ค์Œ๋ฒˆ์— ์ฐจํŠธ๋ฅผ ๋„ฃ์–ด์•ผ ํ•˜๋Š” ํ”„๋กœ์ ํŠธ๊ฐ€ ์žˆ์œผ๋ฉด ํ•œ ๋ฒˆ ์ ์šฉํ•ด๋ด๋„ ์žฌ๋ฏธ์žˆ์„ ๊ฒƒ ๊ฐ™๋‹ค.

๐Ÿ’œ PC ํ™”๋ฉด


๐Ÿ’œ ๋ชจ๋ฐ”์ผ ํ™”๋ฉด


๐Ÿ’œ ๊ณต๋ถ€๊ฐ€ ์ข€ ๋” ํ•„์š”ํ•œ Sidebar

<div class="sidebar">
    <div>
      <i class="fas fa-home"></i>
      <span>Home</span>
    </div>
    <div>
      <i class="fas fa-car"></i>
      <span>History</span>
    </div>
</div>

 

.sidebar {
  width: 150px;
  height: 100vh;
  background: #484bb3;
  position: fixed;
  z-index: 5;
  color: white;

  transition: all 0.5s;
  transform: translateX(-100px);
}

.sidebar:hover {
  transform: translateX(0px);
  transition: all 0.5s;
  cursor: pointer;
}

.sidebar:hover div {
  animation-name: slide;
  animation-duration: 1s;
}

@keyframes slide {
  0% {
    transform: translateX(-100px);
  }

  50% {
    transform: translateX(50px) skewX(-30deg);
  }
  100% {
    transform: translateX(0px);
  }
}

.sidebar i {
  transition: all 0.5s;
  transform: translateX(100px);
}

.sidebar:hover i {
  transform: translateX(0px);
}

.sidebar div {
  margin: 12px 0px 0px 15px;
}

๐Ÿ’œ ์ฒ˜์Œ ์ ‘ํ•ด์„œ ๋ˆˆ์น˜๊ป ์จ๋ณธ Chart.js

  • ๊ธฐ๋ณธ ์†์„ฑ๊ฐ’๋“ค์€ ๋ˆˆ์น˜๊ป ์ˆ˜์ •ํ•˜๋ฉด ๋˜๊ณ ...
  • type ์—๋Š” line ์™ธ์—๋„ bar, pie, doughnut ๋“ฑ ๋‹ค์–‘ํ•œ ์ข…๋ฅ˜์˜ ์ฐจํŠธ๊ฐ€ ์žˆ๋‹ค.
  • fill : true ๋ฅผ ๋„ฃ์œผ๋ฉด ๊ทธ๋ž˜ํ”„๊ฐ€ ์ƒ‰์น ๋œ๋‹ค.
  • tension : 0.3 ๊ณผ ๊ฐ™์ด tension ์†์„ฑ์„ ๋„ฃ์œผ๋ฉด ๋พฐ์กฑํ•œ ๊ทธ๋ž˜ํ”„๊ฐ€ ๊ณก์„ ์œผ๋กœ ๋ฐ”๋€๋‹ค.
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <script>
    var ctx = document.getElementById('myChart').getContext('2d');
    var myChart = new Chart(ctx, {
        type: 'line',
        data: {
            labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
            datasets: [{
                label: 'Monthly',
                data: [0, 10, 5, 3, 20, 30, 45],
                fill: true,
                tension: 0.3,
                backgroundColor: 'rgba(19, 29, 170, 0.8)',
                borderColor: 'rgba(19, 29, 170, 1)',
                borderWidth: 1
            }]
        },
        options: {
            scales: {
                y: {
                    beginAtZero: true
                }
            }
        }
    });
    </script>
728x90
๋ฐ˜์‘ํ˜•