<div class="controls">
  <select id="writingMode">
    <option value="horizontal-tb">horizontal-tb</option>
    <option value="vertical-lr">vertical-lr</option>
    <option value="vertical-rl">vertical-rl</option>
  </select>
</div>

<div class="grid" id="grid">
  <div class="item"></div>
  <div class="item"></div>
  <div class="item"></div>
</div>
@import url("https://fonts.googleapis.com/css?family=Gochi+Hand");

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


body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background-color: #291642;
  font-family: "Gochi Hand", sans-serif;
  font-size: 130%;
  letter-spacing: 0.1rem;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}


.controls {
  background-color: rgba(255,255,255,.5);
  padding: 10px;
  border-radius: .5em;
  border: 1px solid rgba(0,0,0,.2);
  margin: 0 0 2em 0
}

.controls select {
  font-size: .9em;
}

.grid {
  inline-size: 80vh;
  block-size: 50vh;
  border: 1px solid currentColor;
  color: #fff;
  border-radius: 2vh;
  display: grid;
  box-shadow: 0px 0px .2vh .3vh rgba(173, 89, 89, 0.5);
  counter-reset: gridCounter;
  gap: 5vh;
  writing-mode: horizontal-tb;
}

.item {
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid currentColor;
  counter-increment: gridCounter;
  border-radius: 2vh;
  box-shadow:inset 0 0 3px 3px currentColor;
  text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff;
}

.item::before {
  content: counter(gridCounter);
  display: inline-flex;
  inline-size: 5vh;
  block-size: 5vh;
  border-radius: 50%;
  background-color: #f35689;
  justify-content: center;
  align-items: center;
  padding: 2vh;
  font-size: 2rem;
}

.item:nth-child(1) {
  inline-size: 15vh;
  color: #00f2ff;
  justify-self: start;
}

.item:nth-child(2) {
  inline-size: 30vh;
  color: #ffca00;
  justify-self: center;
}

.item:nth-child(3) {
  inline-size: 20vh;
  color: #3b21c4;
  justify-self: end;
}


View Compiled
var writingMode = document.getElementById("writingMode");
writingMode.addEventListener("change", function (evt) {
  document.getElementById("grid").style.writingMode = evt.target.value;
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.