<!doctype html>
<html>
<head>
<script>
setInterval(start, 5000);
function start() {
document.getElementById("rightBorder").className = "border right";
document.getElementById("bottomBorder").className = "border bottom";
}
</script>
<style>
.border {
position: absolute;
display: block;
left: 10px;
right: 10px;
top: 10px;
bottom: 10px;
background: orange;
}
.left {
right: auto;
width: 4px;
-webkit-animation: verticalMover 5s linear;
}
.right {
left: auto;
width: 4px;
-webkit-animation: verticalMover 5s linear;
}
.top {
bottom: auto;
height: 4px;
-webkit-animation: horizontalMover 5s linear;
}
.bottom {
top: auto;
height: 4px;
-webkit-animation: horizontalMover 5s linear;
}
.none {
display: none;
}
@-webkit-keyframes verticalMover {
from {
bottom: 100%;
}
to {
bottom: 10px;
}
}
@-webkit-keyframes horizontalMover {
from {
right: 100%;
}
to {
right: 10px;
}
}
</style>
</head>
<body>
<div class="border left" id="leftBorder"></div>
<div class="border none" id="rightBorder"></div>
<div class="border top" id="topBorder"></div>
<div class="border none" id="bottomBorder"></div>
Hello, world!
</body>
</html>