JSFiddle - React, Tailwind, and code Playground
by WoJWoJ
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js"></script>
<div class="clock" id="clock">
<span class="el" id="hour">{{hour}}</span>
<span class="el" id="minute">{{minute}}</span>
<span class="vl"></span>
<span class="vl"></span>
</div>
CSS
.clock {
display: grid;
grid-template-columns: 1fr 1fr;
grid-column-gap: 20px;
align-items: center;
width: 400px;
}
.el {
display: flex;
justify-content: center;
align-items: center;
width: 200px;
height: 200px;
font-size: 120px;
background-color: black;
color: white;
font-family: sans-serif;
font-weight: bolder;
border-radius: 30px;
}
.vl {
border-top: 2px solid white;
height: 200px;
position: relative;
top: -100px;
}
JavaScript
new Vue({
el: "#clock",
data: {
hour: 0,
minute: 0,
},
mounted() {
now = new Date
this.hour = now.getHours()
this.minute = now.getMinutes()
}
})