Keyframes
page = canvas(size=(100mm,60mm), stylesheet="keyframes.lcss", background="#ffffff")card = page.add(rect(size=(25mm,20mm), fill="#0d6efd", border_radius=2mm), target=page.top_left, offset=(12mm,20mm))s = page.step(name="Custom keyframes", start="after-previous", hold=1s)s.animate(card, class="motion")@keyframes move { from { opacity: 0; transform: translateX(0mm); } 50% { opacity: 1; animation-timing-function: ease-out; } to { opacity: 1; transform: translateX(35mm); }}.motion { animation: move 2s ease-in-out both; }预览
背景
正在准备动画…
依赖文件
examples/animation/keyframes.layexamples/animation/keyframes.lcss
复现
laymesh validate examples/animation/keyframes.laylaymesh render examples/animation/keyframes.lay -o figure.svglaymesh render examples/animation/keyframes.lay -o figure.pdflaymesh render examples/animation/keyframes.lay -o figure.png --dpi 300