fix semantic zoom animation
This commit is contained in:
parent
d8715825dc
commit
a6552d8927
|
|
@ -33,6 +33,7 @@
|
||||||
<li><a href="spreadsheet-graph.html">Spreadsheet Graph</a></li>
|
<li><a href="spreadsheet-graph.html">Spreadsheet Graph</a></li>
|
||||||
<li><a href="spreadsheet-propagator.html">Spreadsheet Propagator</a></li>
|
<li><a href="spreadsheet-propagator.html">Spreadsheet Propagator</a></li>
|
||||||
<li><a href="wiggly.html">Wiggly</a></li>
|
<li><a href="wiggly.html">Wiggly</a></li>
|
||||||
|
<li><a href="semantic-zoom.html">Semantic Zoom</a></li>
|
||||||
<!-- <li><a href="chains-of-thought/index.html">Chains of thought</a></li> -->
|
<!-- <li><a href="chains-of-thought/index.html">Chains of thought</a></li> -->
|
||||||
</ul>
|
</ul>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,16 @@
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
input {
|
::view-transition-group(slider),
|
||||||
margin-top: 1rem;
|
::view-transition-old(slider),
|
||||||
|
::view-transition-new(slider) {
|
||||||
|
animation-duration: 0s !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
fc-connection {
|
fc-connection {
|
||||||
|
|
@ -95,13 +103,9 @@
|
||||||
width: 20px;
|
width: 20px;
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
|
||||||
h2,
|
|
||||||
p {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body[zoom='0'] fc-geometry :is(h2, p),
|
||||||
body[zoom='50'] fc-geometry p {
|
body[zoom='50'] fc-geometry p {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
@ -110,7 +114,7 @@
|
||||||
<body zoom="1">
|
<body zoom="1">
|
||||||
<label>
|
<label>
|
||||||
Zoom:
|
Zoom:
|
||||||
<input type="range" min="0" max="100" value="100" />
|
<input type="range" min="0" max="100" value="100" style="view-transition-name: slider" />
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<fc-geometry id="box1" x="100" y="100">
|
<fc-geometry id="box1" x="100" y="100">
|
||||||
|
|
@ -152,13 +156,13 @@
|
||||||
FolkGeometry.register();
|
FolkGeometry.register();
|
||||||
FolkConnection.register();
|
FolkConnection.register();
|
||||||
|
|
||||||
const range = document.querySelector('input');
|
|
||||||
|
|
||||||
document.body.querySelectorAll('fc-geometry').forEach((el, i) => (el.style.viewTransitionName = `g${i}`));
|
document.body.querySelectorAll('fc-geometry').forEach((el, i) => (el.style.viewTransitionName = `g${i}`));
|
||||||
document.body.querySelectorAll('fc-connection').forEach((el, i) => (el.style.viewTransitionName = `c${i}`));
|
document.body.querySelectorAll('fc-connection').forEach((el, i) => (el.style.viewTransitionName = `c${i}`));
|
||||||
document.body.querySelectorAll('h2').forEach((el, i) => (el.style.viewTransitionName = `h${i}`));
|
document.body.querySelectorAll('h2').forEach((el, i) => (el.style.viewTransitionName = `h${i}`));
|
||||||
document.body.querySelectorAll('p').forEach((el, i) => (el.style.viewTransitionName = `p${i}`));
|
document.body.querySelectorAll('p').forEach((el, i) => (el.style.viewTransitionName = `p${i}`));
|
||||||
|
|
||||||
|
const range = document.querySelector('input');
|
||||||
|
|
||||||
range.addEventListener('input', (e) => {
|
range.addEventListener('input', (e) => {
|
||||||
const currentZoom = range.valueAsNumber;
|
const currentZoom = range.valueAsNumber;
|
||||||
let semanticZoom;
|
let semanticZoom;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue