<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 id="container">
<div class="box logical"> Logical Property</div>
<div class="box physical"> Physical Property</div>
</div>
@import 'https://fonts.googleapis.com/css?family=Share+Tech+Mono';
@import 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css';
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
width: 100vw;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/1376484/jess-harding-lqT6NAmTaiY-unsplash.jpg'),radial-gradient(#28a3dd, #0d7751);
background-size: cover;
background-position: center;
font-family: "Share Tech Mono", monospace;
font-size: 2rem;
background-blend-mode: multiply,screen, overlay;
}
#container {
position: relative;
background-size: cover;
background-position: center;
backdrop-filter: blur(20px);
background-color: rgba(255, 255, 255, 0.5);
border-radius: 5px;
padding:5vw;
box-sizing: border-box;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
transition: .3s ease;
margin: 2vw;
display: flex;
justify-content: center;
}
.control {
padding-bottom: 5vh;
margin-bottom: 6vh;
border-bottom: 3px double currentColor;
color: #fff;
text-shadow: 1px 1px 2px rgba(0,0,0,.5);
font-size: 6vh;
}
.box {
background: #FF9800;
border-radius: 5px;
margin: 5px;
box-shadow: 0 0 3px rgba(0,0,0,.5);
display: flex;
justify-content: center;
align-items: center;
color: #fff;
text-shadow: 1px 1px 2px rgba(0,0,0,.5);
position: relative;
&.logical{
inline-size: 25vw;
block-size: 25vh;
background-color: #8BC34A;
}
&.physical{
width: 25vw;
height: 25vh;
}
}
View Compiled
var writingMode = document.getElementById("writingMode");
writingMode.addEventListener("change", function (evt) {
document.getElementById("container").style.writingMode = evt.target.value;
});
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.