You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

283 lines
5.5 KiB
CSS

2 years ago
/* ---------------Animationen Startseite----------------- */
:root {
--width1: calc(100% - 100px);
--width2: 0px;
--width3: calc(100% - 200px);
}
/* ---------------Beispiel auf der Startseite--------------*/
2 years ago
#beispiel {
2 years ago
background-color: aqua;
color: black;
border: 3px solid rgb(255, 0, 0);
border-radius: 0.4em;
animation-timing-function: ease;
width: 100px;
height: 100px;
animation-name: beispiel;
animation-duration: 5s;
animation-iteration-count: infinite;
animation-direction: alternate;
text-align: center;
align-self: end;
position: relative;
}
@keyframes beispiel {
0% {
transform: rotate(0deg);
2 years ago
left: var(--width2);
2 years ago
}
25% {
transform: rotate(90deg);
2 years ago
left: var(--width2);
2 years ago
background-color: blue;
border-color: orange;
2 years ago
2 years ago
}
50% {
transform: scale(1.5);
background-color: blueviolet;
border-color: green;
transform: rotate(180deg);
2 years ago
left: var(--width1);
2 years ago
}
75% {
transform: rotate(270deg);
2 years ago
left: var(--width1);
2 years ago
background-color: red;
border-color: lightblue;
}
100% {
background-color: yellow;
border-color: pink;
transform: rotate(360deg);
2 years ago
left: var(--width2);
2 years ago
}
2 years ago
2 years ago
}
2 years ago
2 years ago
/* -----------------Animationen Beispiele--------------------------- */
/* -------Das Stempel Beispiel als Beispiel für die @keyframes-------*/
2 years ago
#stempel1 {
2 years ago
color: red;
border: 2px solid red;
padding: 10px;
width: 120px;
text-align: center;
font-size: 25px;
position: relative;
animation-name: stempel1;
animation-duration: 5s;
animation-fill-mode: forwards;
}
@keyframes stempel1 {
2 years ago
0% {
2 years ago
transform: scale(1) rotate(10deg)
}
2 years ago
50% {
2 years ago
transform: scale(1.5) rotate(30deg);
}
2 years ago
100% {
2 years ago
transform: scale(1) rotate(10deg)
}
}
/* ---------------Beispiel 1 für die animation duration--------------- */
#beispiel6 {
color: red;
border: 2px solid yellow;
padding: 10px;
width: 100px;
height: px;
text-align: center;
font-size: 25px;
position: relative;
animation-name: beispiel6;
animation-duration: 5s;
animation-iteration-count: infinite;
}
@keyframes beispiel6 {
2 years ago
0% {
2 years ago
transform: scale(1);
2 years ago
left: var(--width2);
2 years ago
}
2 years ago
50% {
2 years ago
transform: scale(1.5);
2 years ago
left: var(--width3);
2 years ago
}
2 years ago
100% {
2 years ago
transform: scale(1);
2 years ago
left: var(--width2);
2 years ago
}
}
/* ---------------Beispiel 1 für die animation duration ---------------*/
#beispiel7 {
color: red;
border: 2px solid yellow;
padding: 10px;
width: 100px;
height: px;
text-align: center;
font-size: 25px;
position: relative;
animation-name: beispiel7;
animation-duration: 10s;
animation-iteration-count: infinite;
}
@keyframes beispiel7 {
2 years ago
0% {
2 years ago
transform: scale(1);
2 years ago
left: var(--width2);
2 years ago
}
2 years ago
50% {
2 years ago
transform: scale(1.5);
2 years ago
left: var(--width3);
2 years ago
}
2 years ago
100% {
2 years ago
transform: scale(1);
2 years ago
left: var(--width2);
2 years ago
}
}
/*--------------- Beispiel 1 für die animation direction ---------------*/
#beispiel4 {
color: red;
border: 2px solid yellow;
border-radius: 0.4em;
padding: 10px;
width: 100px;
height: px;
text-align: center;
font-size: 25px;
position: relative;
animation-name: beispiel4;
animation-duration: 5s;
animation-iteration-count: infinite;
animation-direction: normal;
}
@keyframes beispiel4 {
2 years ago
0% {
2 years ago
transform: rotate(0deg);
}
2 years ago
50% {
2 years ago
transform: rotate(180deg);
}
2 years ago
100% {
2 years ago
transform: rotate(360deg)
}
}
/*--------------- Beispiel 2 für die animation direction ---------------*/
#beispiel5 {
color: red;
border: 2px solid yellow;
border-radius: 0.4em;
padding: 10px;
width: 100px;
text-align: center;
font-size: 25px;
position: relative;
animation-name: beispiel5;
animation-duration: 5s;
animation-iteration-count: infinite;
animation-direction: reverse;
}
@keyframes beispiel5 {
2 years ago
0% {
2 years ago
transform: rotate(0deg);
}
2 years ago
50% {
2 years ago
transform: rotate(180deg);
}
2 years ago
100% {
2 years ago
transform: rotate(360deg)
}
}
/*--------------- Beispiel 1 für die animation timing funktion ---------------*/
#beispiel1 {
color: red;
border: 2px solid yellow;
padding: 10px;
width: 100px;
text-align: center;
font-size: 25px;
position: relative;
animation-name: beispiel1;
animation-duration: 5s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
@keyframes beispiel1 {
2 years ago
0% {
2 years ago
transform: scale(1);
2 years ago
left: var(--width2);
2 years ago
}
2 years ago
50% {
2 years ago
transform: scale(1.5);
2 years ago
left: var(--width3);
2 years ago
}
2 years ago
100% {
2 years ago
transform: scale(1);
2 years ago
left: var(--width2);
2 years ago
}
}
/*--------------- Beispiel 2 für die animation timing funktion ---------------*/
#beispiel2 {
color: red;
border: 2px solid yellow;
padding: 10px;
width: 100px;
text-align: center;
font-size: 25px;
position: relative;
animation-name: beispiel2;
animation-duration: 5s;
animation-iteration-count: infinite;
animation-timing-function: ease;
}
@keyframes beispiel2 {
2 years ago
0% {
2 years ago
transform: scale(1);
2 years ago
left: var(--width2);
2 years ago
}
2 years ago
50% {
2 years ago
transform: scale(1.5);
2 years ago
left: var(--width3);
2 years ago
}
2 years ago
100% {
2 years ago
transform: scale(1);
2 years ago
left: var(--width2);
2 years ago
}
2 years ago
}