Files
intecsync/uebung2/strasse.html
2019-05-09 13:00:49 +02:00

73 lines
2.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Straße</title>
<meta charset="utf-8">
<style>
html, body {
width: 100%;
height: 100%;
background-image: url("/~zxmpy88/uebung2/assets3/background.svg");
background-size: auto 100%;
background-repeat: repeat-x;
overflow: hidden;
}
img {
width: 40%;
height: 40%;
position: absolute;
}
@keyframes fahren_rechts {
0% {
left: -40%;
}
100% {
left: 100%;
}
}
@keyframes fahren_links {
0% {
left: 100%;
}
100% {
left: -40%;
}
}
.delay {
animation-delay: 2s;
animation-direction: reverse;
}
.lefttoright {
animation: fahren_rechts 10s linear infinite;
bottom: -5%;
left: -40%
//transform: scaleX(-1);
z-index: 1; //weiter vorne/hinten
}
.righttoleft {
animation: fahren_links 10s linear infinite;
bottom: 3%;
left: -40%
transform: scaleX(-1);
z-index: 0; //weiter vorne/hinten
}
</style>
</head>
<body>
<img class="lefttoright" src="/~zxmpy88/uebung2/assets3/car1.svg">
<img class="righttoleft delay" src="/~zxmpy88/uebung2/assets3/car2.svg">
</body>
</html>