Admin Panel

by waleedbinahmed

HTML

<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>30 Day Plan</title>
    <link rel="stylesheet" href="styles.css">
  </head>

  <body>
    <div class="main-container">
      <div class="left-column">
        <div class="calendar-wrapper">
          <h2 class="calendar-title">30 Day Plan</h2>
          <div class="calendar-container" id="calendarContainer">
            <!-- Days will be generated by JavaScript -->
          </div>
        </div>
        <div class="growth-rate-wrapper">
          <h2 class="growth-rate-title">Growth Rate</h2>
          <div class="growth-rate-content" id="growthRateContent">
            <div class="growth-rate-figure">
              <span class="growth-number">1.2M</span>
              <span class="growth-description">Users</span>
            </div>
            <div class="growth-rate-percentage">
              <span class="growth-percentage">15.1%</span>
              <span class="growth-timeframe">Since last month</span>
            </div>
          </div>
        </div>
      </div>
      <div class="details-wrapper" id="detailsWrapper">
        <h2 class="details-title" id="detailsTitle">Day 1</h2>
        <div class="details-content">
          <!-- Dynamic content based on the day will be generated by JavaScript -->
        </div>
      </div>
    </div>


    <script src="script.js"></script>
  </body>

</html>

CSS

body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
  background: #333; /* Assuming a dark background */
}

.main-container {
  display: flex;
  padding: 20px;
  box-sizing: border-box;
}

.left-column {
  width: 48%;
  margin-right: 4%; /* Spacing between the columns */
}

.calendar-wrapper,
.growth-rate-wrapper,
.details-wrapper {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
  margin-bottom: 20px; /* Spacing between calendar and growth rate */
}

.calendar-title,
.growth-rate-title,
.details-title {
  margin: 0;
  padding: 20px;
  font-size: 18px;
  font-weight: bold;
  text-align: left;
  background: #f4f4f4;
  border-radius: 8px 8px 0 0; /* Rounded corners on top */
}

.calendar-container {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  background: #f4f4f4;
}

.growth-rate-content,
.details-content {
  padding: 20px;
}

.day {
  background-color: #D3D3D3;
  border-radius: 50%; /* This ensures the day divs are circles */
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 5px;
  height: 60px; /* Set a fixed height */
  width: 60px; /* Set a fixed width to match the height, creating a circle */
  transition: background-color 0.3s;
}
.growth-rate-wrapper {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
  padding: 20px;
  margin-top: 20px;
}

.growth-rate-title {
  margin: 0 0 10px 0;
  padding: 0;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  text-align: left;
}

.growth-rate-content {
  background: #f4f4f4;
  border-radius: 8px;
  padding: 15px;
  font-size: 16px;
  color: #333;
}

.growth-rate-figure,
.growth-rate-percentage {
  text-align: center;
  margin: 10px 0;
}

.growth-number {
  display: block;
  font-size: 2em;
  color: #4CAF50;
}

.growth-description {
  font-size: 1em;
}

.growth-percentage {
  display: block;
  font-size:...

JavaScript

document.addEventListener('DOMContentLoaded', function() {
  const container = document.getElementById('calendarContainer');
  createCalendarDays(container, 30);
  // Initialize the growth rate content
  updateGrowthRateContent();
});

function createCalendarDays(container, numberOfDays) {
  for (let i = 1; i <= numberOfDays; i++) {
    let day = document.createElement('div');
    day.className = 'day';
    day.textContent = `Day ${i}`; // Only set the textContent for the day number
    day.addEventListener('click', function() {
      updateDetailsTitle(i);
      document.querySelectorAll('.day').forEach(d => d.classList.remove('active'));
      day.classList.add('active');
    });
    container.appendChild(day);
  }
}

function updateDetailsTitle(dayNumber) {
  const detailsTitle = document.getElementById('detailsTitle');
  detailsTitle.textContent = `Day ${dayNumber}`;
}