d test

by batcave

HTML

<style>
</style> <!-- Header -->

<header class="header">
  <h1>State of Javascript</h1>
</header> <!-- Main -->

<main class="main">
  <div class="fw-row" data-cy="chart-header">
    <div class="fw-name"></div>

    <div *ngFor="let survey of frameworks[0].surveys" class="fw-year">{{ survey.year }}</div>

    <div class="fw-name"></div>
  </div>

  <div class="fw-row" data-cy="chart-row" *ngFor="let framework of frameworks" [style.color]="framework.color">
    <div data-cy="row-line" class="fw-line" [style.border-color]="framework.color"></div>

    <div class="fw-name" data-cy="chart-cell">{{ framework.name }}</div>

    <ng-container *ngFor="let _ of [].constructor(framework.surveys[0].year - 2016)">
      <div data-cy="chart-cell" class="fw-value"></div>
    </ng-container>

    <ng-container *ngFor="let survey of framework.surveys">
      <div data-cy="chart-cell" class="fw-value">
        <div data-cy="chart-circle" class="fw-value-circle" [style.border-color]="framework.color">{{ survey.retention + '%' }}</div>
      </div>
    </ng-container>

    <div class="fw-name" data-cy="chart-cell">{{ framework.name }}</div>
  </div>
</main>

<footer class="footer">
  <button>Retention</button> <button>Interest</button> <button>Usage</button> <button>Awerness</button>
</footer>

CSS

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.header {
  display: flex;
  color: white;
  background-color: #111111;
  justify-content: center;
}

.main {
  display: inline-flex;
  flex-direction: column;
}

.fw-row {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px;
  gap: 25px;
  background-color: aqua;
}

.fw-row > *:not(.fw-line) {
  position: relative;
  font-size: 14px;
}

.fw-name {
  padding: 10px;
  width: 80px;
  background-color: red;
}

.fw-year {
  width: 50px;
  text-align: center;
  color: white;
}

.fw-value-circle {
  border-radius: 100%;
  border: 2px solid;
  display: flex;
  align-items: center;
  text-align: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background-color: rgb(43, 41, 41);
}

.fw-line {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 2px;
  width: 100%;
  background-color: deepskyblue;
  z-index: 0;
}

.fw-value {
  width: 50px;
  height: 50px;
  background-color: deeppink;
}

.footer {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Responsive Styles */
@media screen and (max-width: 767px) {

  .header,
  .main {
    text-align: center;
  }

  table {
    font-size: 0.8em;
  }
}

@media screen and (max-width: 575px) {
  table {
    font-size: 0.6em;
  }
}