Animation & Positioning
Mål: Bygge "levende" sites
Loading...
Loading...
Loading...
Loading...
.element {
animation: rotate 2s linear;
}0s
2s
1s
0%
100%
50%
.element {
animation: progress linear both;
animation-timeline: scroll(root);
}.element {
animation: progress linear both;
animation-timeline: scroll(); /* nearest */
}.element {
animation: reveal linear both;
animation-timeline: view();
animation-range: entry 0% exit 100%;
}Loading...
Loading...
Loading...
h1 {
animation: ;
animation-timeline: ;
animation-range: ;
}Loading...
Optimized flip-animations
Loading...
Loading...
Loading...
.box-1 {
view-transition-name: box-1;
}
.box-2 {
view-transition-name: box-2;
}.box {
view-transition-name: match-element;
}.box {
view-transition-name: match-element;
}btn.addEventListener("click", () => {
document.startViewTransition(() => grid.classList.toggle("col-count"));
});.box {
view-transition-name: match-element;
}btn.addEventListener("click", () => {
if (document.startViewTransition) {
document.startViewTransition(() => grid.classList.toggle("col-count"));
} else {
grid.classList.toggle("col-count");
}
});.box {
view-transition-name: match-element;
view-transition-class: boxes;
}
::view-transition-new(boxes) {
animation: scale-in .5s both;
}
::view-transition-old(boxes) {
animation: scale-in .5s both reverse;
}@view-transition {
navigation: auto;
}Mål: Gøre sig bekendt med moderne positioning
<span>⚓️ Anker</span>
<div>
<h2>Heading</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Saepe.</p>
</div>Properties
[popover] {
position-area: top;
}[...] automatically links the invoker button to the popover element
Basic Burgermenu
button {
position: fixed;
}Fikseret til elementet
Fikseret til elementet
Fikseret til elementet
Til temaopgaven...
Til temaopgaven...
Dynamisk positionering
Dynamisk positionering