可缩放矢量图形(SVG)是一种基于XML的二维矢量图形格式,也可以在HTML中使用。不要仅仅因为您的项目使用SVG而添加此标记。相反,如果您的问题是关于SVG或与其密切相关的问题,请添加标记,例如如何使用SVG实现某些功能。
点的照片 当我从 Figma 导出 SVG 时,它在特定路径的笔划中给出了这个不需要的小点。 点的照片 当我从 Figma 导出 SVG 时,它在特定路径的笔划中给出了这个不需要的小点。 <svg width="33" height="38" viewBox="0 0 33 38" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M29.4874 5.96259C29.185 4.56022 28.3062 3.5063 27.0896 2.95241C26.005 2.4586 24.8396 2.44183 23.8865 2.56268C21.9671 2.80607 19.8967 3.73641 18.2979 4.85872C18.1219 4.98229 17.613 5.20669 16.6039 5.39113C15.6562 5.56436 14.4991 5.66288 13.2344 5.7034C10.7078 5.78434 8.0053 5.62774 6.16576 5.5055C5.32871 5.44988 4.51956 5.81779 4.01123 6.48514C3.50291 7.15249 3.36318 8.0303 3.63917 8.8225C4.71631 11.9142 5.5 15.2666 5.5 18.5C5.5 23.1366 4.75649 27.3225 2.81385 30.8244C2.33564 31.6865 2.40866 32.7491 3.0003 33.5376C3.59194 34.3261 4.59172 34.6933 5.55309 34.4752C10.7908 33.287 17.524 30.4418 22.595 25.8288C27.7383 21.1501 31.3214 14.4693 29.4874 5.96259ZM29.4874 5.96259L27.0483 6.48844L29.4874 5.96258C29.4874 5.96258 29.4874 5.96259 29.4874 5.96259Z" fill="url(#paint0_linear_43_112)" stroke="#63310E" stroke-width="5" stroke-linejoin="round"/> <defs> <linearGradient id="paint0_linear_43_112" x1="16.2359" y1="5" x2="16.2359" y2="32.0372" gradientUnits="userSpaceOnUse"> <stop stop-color="#E76B13"/> <stop offset="1" stop-color="#813C0B"/> </linearGradient> </defs> </svg> 我正在尝试为一个名为 Ducky 的小团体制作一个徽标。我希望它能像 Figma 中那样显示笔画。 看起来怎么样 这是你在svg代码中添加的一小段造成的 <svg width="33" height="38" viewBox="0 0 33 38" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M29.4874 5.96259C29.185 4.56022 28.3062 3.5063 27.0896 2.95241C26.005 2.4586 24.8396 2.44183 23.8865 2.56268C21.9671 2.80607 19.8967 3.73641 18.2979 4.85872C18.1219 4.98229 17.613 5.20669 16.6039 5.39113C15.6562 5.56436 14.4991 5.66288 13.2344 5.7034C10.7078 5.78434 8.0053 5.62774 6.16576 5.5055C5.32871 5.44988 4.51956 5.81779 4.01123 6.48514C3.50291 7.15249 3.36318 8.0303 3.63917 8.8225C4.71631 11.9142 5.5 15.2666 5.5 18.5C5.5 23.1366 4.75649 27.3225 2.81385 30.8244C2.33564 31.6865 2.40866 32.7491 3.0003 33.5376C3.59194 34.3261 4.59172 34.6933 5.55309 34.4752C10.7908 33.287 17.524 30.4418 22.595 25.8288C27.7383 21.1501 31.3214 14.4693 29.4874 5.96259Z" fill="url(#paint0_linear_43_112)" stroke="#63310E" stroke-width="5" stroke-linejoin="round"/> <defs> <linearGradient id="paint0_linear_43_112" x1="16.2359" y1="5" x2="16.2359" y2="32.0372" gradientUnits="userSpaceOnUse"> <stop stop-color="#E76B13"/> <stop offset="1" stop-color="#813C0B"/> </linearGradient> </defs> </svg> 具体细分 ” L27.0483 6.48844“
Laravel 项目中 AdminLTE 和 Bootstrap 分页按钮中不需要的 SVG 图标
我在 Laravel 项目中使用 AdminLTE 和 Bootstrap,并且遇到了 SVG 图标(左箭头和右箭头)出现在我的分页按钮中的问题。这些 SVG 图标似乎有所不同...
我从 Figma 将图像导出为 SVG,它结合了其他 11 个图像来制作这个拼贴画。它不会在 Safari 上呈现。在我的 MacBook 和 iPhone 上都没有,但在 Chrome 上渲染得很好。怎么了...
我有一个剪辑路径,可以切割某种形状。问题是它是用绝对坐标设置的。如果我把 % 放在那里,它就会崩溃。如何缩放它以使其适合画布边框并伸展...
我正在尝试在路径上实现这种弯曲效果,此效果采用现有路径(骨架)并允许人们在形状路径中“弯曲”它。弯曲路径的样式取自
我目前正在使用 HTML 制作游戏,我设置了一个临时页面来测试某些功能是否有效。我试图通过输入 JavaScript 将文件夹中的一些 SVG 文件放在我的 HTML 网站上: 我目前正在使用 HTML 制作游戏,我设置了一个临时页面来测试某些功能是否有效。我试图通过输入 JavaScript 将文件夹中的一些 SVG 文件放在我的 HTML 网站上: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>SVG Gallery</title> </head> <body> <h1>SVG Gallery</h1> <div id="svg-container"></div> <script> async function fetchSVGs() { try { const response = await fetch('/assets/svg/props/items'); const text = await response.text(); // This will parse the directory listing to extract SVG file names. const parser = new DOMParser(); const doc = parser.parseFromString(text, 'text/html'); const links = Array.from(doc.querySelectorAll('a')) .filter(link => link.href.endsWith('.svg')); // Load each SVG file dynamically const container = document.getElementById('svg-container'); links.forEach(link => { const svgPath = link.getAttribute('href'); const img = document.createElement('img'); img.src = svgPath; container.appendChild(img); }); } catch (error) { console.error('Error loading SVGs:', error); } } fetchSVGs(); </script> </body> </html> 如您所见,我想将它们全部列出在页面上。它确实设法进入项目文件夹并查看其中的所有项目,但无法加载它们。上面说 Failed to load resource: the server responded with a status of 404 以下是我的文件夹中的项目以及访问它们但未加载图像的系统: 在此输入图片描述 在此输入图片描述 404错误通常发生在文件路径错误时。请检查您的文件是否正确。如果您的 HTML 文件位于根目录中,请确保 assets/svg/props/items 文件夹结构与此匹配。 如果您有已知的 SVG 文件名列表,则可以使用 JavaScript 为每个文件动态添加元素。 <script> // List of SVG filenames const svgFiles = ['image1.svg', 'image2.svg', 'image3.svg']; const folderPath = '/assets/svg/props/items/'; const container = document.getElementById('svg-container'); svgFiles.forEach(file => { const img = document.createElement('img'); img.src = folderPath + file; img.alt = file; // Optional alt attribute for accessibility container.appendChild(img); }); </script>
我只想在我的reactjs应用程序中渲染三个svg图像。我读过几十篇文章和帖子,但想知道在 Re 中渲染 svg 的最佳/正确方法是什么...
如何使用 PHP 将 SVG 图像转换为 PNG 而不丢失尺寸
我尝试使用 meyfa/php-svg PHP 库将 SVG 图像转换为 PNG。 这是代码 我尝试使用 meyfa/php-svg PHP 库将 SVG 图像转换为 PNG。 这是代码 <?php require __DIR__ . '/vendor/autoload.php'; use SVG\SVG; $image = SVG::fromFile('new.svg'); $doc = $image->getDocument(); $rasterImage = $image->toRasterImage(1024,1024); imagepng($rasterImage,'output.png'); ?> 这是转换后的png输出 这是原始的 svg svg 文件:https://drive.google.com/file/d/1jDNOzoU9aG2sDj-No_v-psjMiQ1wVPEA/view?usp=sharing <?xml version="1.0" encoding="utf-8"?> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 320.8 417.7" xml:space="preserve" style="enable-background: new 0 0 320.8 417.7" width="1024" height="720"> <style type="text/css"> <![CDATA[ @import url('https://online-qr-generator.com/themes/altum/assets/fonts/style.css?family=GT-Walsheim-Pro'); .st1 { font-family: 'GT-Walsheim-Pro'; } .st2 { font-size: 42px; } .black-area { fill: #000000; } .white-area { fill: #ffffff; } .text-color { fill: #FFF; } ]]> </style> <g> <path class="black-area" d="M320.8,14.9C320.8,4,317.2,0,306.9,0H13.6C4.6,0,2.3,1.9,0,10.5v396.3c0.5,5.7,2.8,9.9,9,11h302.4c3.6-1,7-2.3,8.3-6.3 c0.9-2.9,1.2-5.9,1.1-8.8v-49.3C320.8,240.5,320.8,127.7,320.8,14.9z M307.5,303.6c0,4.1-0.9,5.1-5.1,5.1 c-94.8-0.1-189.7-0.1-284.5,0c-4.1,0-5.1-0.9-5.1-5.1c0.2-47.5,0.1-94.9,0.1-142.4c0-47.6,0.1-95.3-0.1-142.9 c0-4.1,0.9-5.1,5.1-5.1c94.8,0.1,189.7,0.1,284.5,0c4.1,0,5.1,0.9,5.1,5.1C307.4,113.5,307.4,208.5,307.5,303.6z" /> <path class="white-area" d="M307.5,303.6c0,4.1-0.9,5.1-5.1,5.1c-94.8-0.1-189.7-0.1-284.5,0c-4.1,0-5.1-0.9-5.1-5.1 c0.2-47.5,0.1-94.9,0.1-142.4c0-47.6,0.1-95.3-0.1-142.9c0-4.1,0.9-5.1,5.1-5.1c94.8,0.1,189.7,0.1,284.5,0c4.1,0,5.1,0.9,5.1,5.1 C307.4,113.5,307.4,208.5,307.5,303.6z" /> <text x="55" y="0" transform="matrix(1 0 0 1 105.65 380.0901)" class="st1 st2 text-color" style="text-anchor: middle">Scan me!</text> </g> <g> <defs> <linearGradient id="linear"> <stop offset="30%" style="stop-color: GLC1;" /> <stop offset="70%" style="stop-color: GLC2;" /> </linearGradient> </defs> <defs> <radialGradient id="radial"> <stop offset="10%" style="stop-color: GRC1" /> <stop offset="90%" style="stop-color: GRC2" /> </radialGradient> </defs> <defs> <linearGradient id="linear-b"> <stop offset="30%" style="stop-color: GLCB1;" /> <stop offset="70%" style="stop-color: GLCB2;" /> </linearGradient> </defs> <defs> <radialGradient id="radial-b"> <stop offset="10%" style="stop-color: GRCB1" /> <stop offset="90%" style="stop-color: GRCB2" /> </radialGradient> </defs> </g> <image xlink:href="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI1MCIgaGVpZ2h0PSIyNTAiIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMjUwIiBoZWlnaHQ9IjI1MCIgZmlsbD0iI2ZmZmZmZiIvPjxnIHRyYW5zZm9ybT0ic2NhbGUoOC4wNjUpIj48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxLDEpIj48Zz48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgzLjUsMy41KSI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNLTMuNSAtMy41TDMuNSAtMy41TDMuNSAzLjVML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gMTJMMTkgMTFMMTggMTFMMTggMTJMMTcgMTJMMTcgMTFaTTI4IDExTDI4IDEyTDI5IDEyTDI5IDExWk0xNCAxMkwxNCAxM0wxNiAxM0wxNiAxNEwxNSAxNEwxNSAxNUwxNCAxNUwxNCAxNkwxNSAxNkwxNSAxNUwxOSAxNUwxOSAxNEwxNyAxNEwxNyAxM0wxNiAxM0wxNiAxMlpNMTggMTJMMTggMTNMMTkgMTNMMTkgMTJaTTYgMTRMNiAxNUw4IDE1TDggMTRaTTE3IDE2TDE3IDE3TDE4IDE3TDE4IDE2Wk0wIDE3TDAgMjFMMSAyMUwxIDE3Wk0xOCAyMUwxOCAyMkwxOSAyMkwxOSAyMVpNMjEgMjFMMjEgMjRMMjQgMjRMMjQgMjFaTTI1IDIxTDI1IDIyTDI3IDIyTDI3IDIxWk0yMiAyMkwyMiAyM0wyMyAyM0wyMyAyMlpNMTQgMjZMMTQgMjdMMTUgMjdMMTUgMjhMMTYgMjhMMTYgMjdMMTUgMjdMMTUgMjZaTTI2IDI2TDI2IDI3TDI1IDI3TDI1IDI4TDI0IDI4TDI0IDI5TDI3IDI5TDI3IDI3TDI4IDI3TDI4IDI4TDI5IDI4TDI5IDI3TDI4IDI3TDI4IDI2Wk0yMSAyOEwyMSAyOUwyMyAyOUwyMyAyOFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9nPjwvc3ZnPgo=" x="35" y="30" width="250" height="250" /> </svg> 如何将 svg 图像转换为具有正确尺寸的 png? 您可以尝试choowx/rasterize-svg和chillerlan/php-qrcode。样本: 注意事项: 图像转换模块使用sharp,需要nodejs。 Sharp lib 依赖于 libvips,您可以直接使用 [php-vips](https://github.com/libvips/php-vips]。使用 php-vips 的示例代码: require __DIR__ . '/vendor/autoload.php'; use Jcupitt\Vips; try { // Load the SVG file // You can specify the desired dimensions using the 'dpi' option $image = Vips\Image::newFromFile("input.svg", [ "dpi" => 300 // Adjust DPI as needed for desired resolution ]); // Save as PNG $image->writeToFile("output.png"); } catch (Exception $e) { echo "Error: " . $e->getMessage() . "\n"; }
有什么想法可以在flutter中的行程帽.屁股或行程帽.方形上创建边框半径吗?
我们的目标是从这个半圆环图过渡到那个半圆环图。正如你所看到的,我们希望保持 笔画平方 或者 。屁股 然后在......的角上实现圆角边缘...
为什么此 svg 的文本在 Edge 和 Firefox 中以不同的宽度显示?
我有这个简单的 svg 图像: 我有这个简单的 svg 图像: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg width="340" height="275" viewBox="0 0 256 206" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> <rect x="0" y="113" width="256" height="22" style="fill:#a9e780" /> <text x="15" y="127" style="font-size:8px;font-family:'Verdana'"> Lorem ipsum dolor sit amet, consetetur sadipscing elitr,</text> </svg> 这两个浏览器中的文本宽度不同: 微软边缘: 火狐: 为什么文字宽度差别这么大?有谁知道这个问题的解决方案?将文本转换为路径不是一种选择,因为图像会非常大。 我试图在svg中找到关键且负责的代码部分,我简化了代码。不过,这似乎不是现有代码的原因。 这对我有用,我创建了这个CSS text-rendering: optimizeLegibility; font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
我正在使用 Pygraphviz 库和 python 2.7。我正在生成“svg”输出图像。我喜欢做的是使用“svg”图像作为图表的标签。为此,我使用 html 标签 (http://...
我是 svg 新手,正在尝试创建类似于附图的内部阴影。我已经尝试过其他堆栈溢出答案,但阴影似乎没有 png 附件那么强......
我有一个内联 SVG 对象,其中有一些线条。我试图将一半的线画成实线,另一半画成虚线。 我有一个内联 SVG 对象,其中有一些线条。我正在尝试将一半的线画成实线,另一半画成虚线。 <svg height="30" width="300"> <g fill="none" stroke="black" stroke-width="4"> <line stroke-dasharray="50%,1%,1%,1%" x1="10" x2="280" y1="10" y2="10" /> </g> </svg> 在 pathLength="100" 上放置 line,以便总长度计算为 100 单位 https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/pathLength 将 stroke-dasharray 单位设置为您想要的图案: <svg> <line pathLength="100" stroke-dasharray="50,2,5,2,5,2,5,2,21" stroke="black" stroke-width="8" x1="10" x2="280" y1="10" y2="10" /> </svg> 最简单的是使用 2 个线对象。一个用于制作实线,另一个用于制作虚线。这是一个例子: <svg height="30" width="300"> <g fill="none" stroke="black" stroke-width="4"> <line x1="10" x2="150" y1="10" y2="10" /> <line stroke-dasharray="5,5" x1="150" x2="280" y1="10" y2="10" /> </g> </svg> 中风破折号属性将无限重复,因此如果您输入的“模式”没有持续到行尾,它将再次使用第一个值并重复该模式。 您可以看到,在您的示例中,长破折号(50% 值)重复了 3 次,中间有 3 个小破折号(1% 值)(2 个空破折号和 1 个实心破折号)。
我有一个普通的 Vite 5.0.4 设置,没有任何 svg 加载器插件。 我想在我的 css 文件中包含一个背景 svg 图像,如下所示: 背景图像: url("@assets/file.svg?url"); 如果我...
Shopify 自定义动画 css 仅适用于 ios 设备,但适用于网络和 Android 设备
Shopify 自定义动画 css 仅适用于 ios 设备,但适用于网络和 Android 设备。 我的 Shopify 代码: {{“MyLandAnimation.css”|资产网址 |样式表标签}} Shopify 自定义动画 css 仅适用于 ios 设备,但适用于网络和 Android 设备。 我的 Shopify 代码: {{ "MyLandAnimation.css" | asset_url | stylesheet_tag }} <div class="myContainer"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 300"> <defs> <g id="path-1"> <path d="M600 198c-3.5-5.2-9.3-10.7-15.7-12.2c-18.6-3.2-28.4 17.2-48.8 12.8c-5.7-1.3-9.3-6.2-12.5-11.1c-7.6-11.9-22.1-20.5-35.7-16.9c-9.7 2.6-16.9 10.5-25.8 14.8a37.5 37.5 0 0 1-21.7 3.3c-11.2-4.6.7-29-14.3-39.3c-17-11.4-23.8 10.6-40.3 7s-5.6-14.7-3.2-30.7c2.8-18.8-6.3-31.4-20.6-32.3s-17.8-17.9-17.8-17.9l-2.3-9.7a46.1 46.1 0 0 0-7.2-16.3a36.5 36.5 0 0 0-7.1-7.6a41.5 41.5 0 0 0-24.4-8.4a10 10 0 0 0-4.3.8v260h306z" class="hair hair-main"></path> </g> <g id="path-2"> <path d="M0 12s-12.8 3-13.9-12c0 0 14.2-1.8 13.9 12z" class="leaf-2" /> <path d="M0 12s-12.8 3-13.9-12c0 0 3.9 2.9 7 5.6a71.5 71.5 0 0 1 6.9 6.4z" class="leaf-1" /> </g> <g id="path-3"> <path d="M24 12s-5.3 9.3-14.8 1.5c0 0 6.8-9.4 14.8-1.5z" class="leaf-4" /> <path d="M24 12s-5.3 9.3-14.8 1.5c0 0 3.8-.7 7.2-1a57.3 57.3 0 0 1 7.6-.5z" class="leaf-3" /> </g> </defs> <use xlink:href="#path-1" x="0" y="0" /> <g transform="translate(300, 0) scale(-1, 1) translate(-300, 0)"> <use xlink:href="#path-1" x="0" y="0" /> </g> <g transform="translate(195, 233) scale(-1,1) translate(-195, -233)"> <g> <use href="#path-2" x="195" y="235" /> <animateTransform id="anim1" attributeName="transform" attributeType="XML" type="rotate" from="6,185, 233" to="-12,185, 233" dur=".75s" begin="0s;anim2.end" /> <animateTransform id="anim2" attributeName="transform" attributeType="XML" type="rotate" from="-12,185, 233" to="6,185, 233" dur=".75s" begin="anim1.end" /> </g> </g> <g transform="translate(195, 233) scale(-1,-1) translate(-195, -233)"> <g> <use href="#path-2" x="195" y="233" /> <animateTransform id="anim1" attributeName="transform" attributeType="XML" type="rotate" from="2,185, 233" to="-12,185, 233" dur=".75s" begin="0s;anim2.end" /> <animateTransform id="anim2" attributeName="transform" attributeType="XML" type="rotate" from="-12,185, 233" to="2,185, 233" dur=".75s" begin="anim1.end" /> </g> </g> <g> <use href="#path-2" x="410" y="235" /> <animateTransform id="anim1" attributeName="transform" attributeType="XML" type="rotate" from="2,400, 235" to="-12,400, 235" dur=".75s" begin="0s;anim2.end" /> <animateTransform id="anim2" attributeName="transform" attributeType="XML" type="rotate" from="-12,400, 235" to="2,400, 235" dur=".75s" begin="anim1.end" /> </g> <g transform="translate(410, 233) scale(1,-1) translate(-410, -233)"> <g> <use href="#path-2" x="410" y="233" /> <animateTransform id="anim1" attributeName="transform" attributeType="XML" type="rotate" from="6,400, 233" to="-12,400, 233" dur=".75s" begin="0s;anim2.end" /> <animateTransform id="anim2" attributeName="transform" attributeType="XML" type="rotate" from="-12,400, 233" to="6,400, 233" dur=".75s" begin="anim1.end" /> </g> </g> <use xlink:href="#path-3" x="174" y="222" /> <use xlink:href="#path-3" x="398" y="222" /> <path class="text" fill-rule="evenodd" transform="translate(220, 215)" d="M 0 0.361 L 0 30.871 L 9.855 30.871 L 9.855 30.016 C 9.855 18.946 1.98 24.526 1.17 4.006 C 2.056 6.842 2.288 7.409 3.542 11.639 A 493.23 493.23 0 0 1 3.6 11.836 A 8.942 8.942 0 0 0 4.473 13.833 C 7.457 18.82 14.04 17.572 14.04 24.391 L 15.165 24.391 C 15.165 16.786 23.355 19.216 25.605 11.836 C 26.865 7.516 27.09 6.886 27.945 4.141 A 65.034 65.034 0 0 1 27.695 7.873 C 26.135 23.857 19.35 19.681 19.35 30.016 L 19.35 30.871 L 29.205 30.871 L 29.205 0.361 L 28.035 0.361 A 34.377 34.377 0 0 0 24.001 0.569 C 20.661 0.999 18.298 2.315 16.98 6.369 A 15.409 15.409 0 0 0 16.875 6.706 C 15.66 10.846 15.795 10.171 14.805 13.726 C 14.715 14.041 14.625 14.356 14.58 14.671 L 14.355 13.726 C 13.41 10.171 13.545 10.846 12.285 6.706 C 10.583 0.935 6.889 0.411 1.415 0.365 A 167.965 167.965 0 0 0 0 0.361 Z M 135.63 6.526 L 134.46 6.526 A 35.99 35.99 0 0 0 134.346 7.769 C 133.897 13.889 135.514 16.085 138.723 16.315 A 8.367 8.367 0 0 0 139.32 16.336 A 4.994 4.994 0 0 0 140.784 16.135 C 144.313 15.059 143.658 9.941 145.231 8.15 A 1.741 1.741 0 0 1 146.07 7.606 A 4.518 4.518 0 0 1 146.736 7.465 C 149.117 7.161 150.212 9.442 149.22 16.921 A 26.765 26.765 0 0 0 147.152 16.77 A 47.213 47.213 0 0 0 145.395 16.741 A 32.262 32.262 0 0 0 141.156 16.994 C 138.166 17.393 135.999 18.257 134.635 19.565 A 5.736 5.736 0 0 0 132.885 23.896 C 132.885 28.254 136.108 30.742 143.152 31.024 A 34.774 34.774 0 0 0 144.54 31.051 C 148.32 31.051 149.49 29.836 149.76 28.126 A 6.217 6.217 0 0 0 151.367 29.87 C 155.008 32.515 160.871 30.217 163.973 27.053 A 10.155 10.155 0 0 0 164.835 26.056 L 164.16 25.336 A 6.91 6.91 0 0 1 163.822 25.652 C 162.611 26.711 161.388 26.967 160.365 26.287 A 2.751 2.751 0 0 1 160.065 26.056 A 3.985 3.985 0 0 1 158.755 23.415 C 158.582 22.068 158.795 20.403 159.12 18.406 C 160.017 12.806 157.622 8.38 152.687 6.818 A 14.008 14.008 0 0 0 148.455 6.211 C 143.546 6.211 140.743 9.126 138.048 9.426 A 3.955 3.955 0 0 1 137.61 9.451 C 136.27 9.451 135.736 8.424 135.645 7 A 7.425 7.425 0 0 1 135.63 6.526 Z M 66.15 11.161 L 66.87 11.881 A 6.443 6.443 0 0 1 67.397 11.407 C 68.632 10.417 69.902 10.255 70.965 11.161 A 3.985 3.985 0 0 1 72.275 13.801 C 72.448 15.149 72.235 16.813 71.91 18.811 A 14.909 14.909 0 0 0 71.729 20.625 C 71.557 25.335 73.847 28.999 78.22 30.415 A 14.117 14.117 0 0 0 82.575 31.051 C 93.093 31.051 97.615 13.463 95.313 7.484 A 4.417 4.417 0 0 0 94.815 6.526 L 81.765 6.526 A 8.964 8.964 0 0 1 84.476 8.909 C 88.601 14.114 90.358 24.562 87.09 28.224 A 3.809 3.809 0 0 1 84.375 29.521 A 4.05 4.05 0 0 1 84.112 29.53 C 82.198 29.53 80.668 28.013 81.872 19.576 A 65.651 65.651 0 0 1 81.945 19.081 C 82.393 16.048 82.735 13.068 81.921 10.606 A 7.012 7.012 0 0 0 80.82 8.506 C 77.338 4.163 70.535 6.646 67.07 10.114 A 10.413 10.413 0 0 0 66.15 11.161 Z M 44.46 6.526 L 44.46 30.871 L 54.315 30.871 L 54.225 11.071 A 7.005 7.005 0 0 1 54.295 10.023 C 54.455 8.979 54.903 8.323 55.8 8.461 A 1.718 1.718 0 0 1 57.031 9.403 C 58.274 11.507 58.206 16.336 62.91 16.336 C 66.565 16.336 68.658 14.199 68.445 7.493 A 34.164 34.164 0 0 0 68.4 6.526 L 67.23 6.526 C 67.23 8.085 66.796 9.29 65.52 9.436 A 2.373 2.373 0 0 1 65.25 9.451 A 1.888 1.888 0 0 1 64.483 9.296 C 62.998 8.651 62.53 6.211 57.96 6.211 A 5.975 5.975 0 0 0 56.408 6.408 C 53.95 7.064 52.693 9.159 50.43 9.768 A 4.815 4.815 0 0 1 50.04 9.856 C 47.831 10.257 46.017 10.05 45.652 7.538 A 7.059 7.059 0 0 1 45.585 6.526 L 44.46 6.526 Z M 106.02 19.891 C 122.22 15.931 121.86 6.211 109.98 6.211 A 15.626 15.626 0 0 0 103.589 7.486 C 99.198 9.445 96.525 13.515 96.525 18.676 A 12.482 12.482 0 0 0 98.658 25.877 C 100.286 28.226 102.777 29.918 105.89 30.7 A 16.776 16.776 0 0 0 109.98 31.186 C 116.312 31.186 119.211 29.219 122.641 25.464 A 60.933 60.933 0 0 0 123.48 24.526 A 22.275 22.275 0 0 1 123.122 24.153 C 122.965 23.989 122.802 23.822 122.625 23.671 A 15.953 15.953 0 0 1 120.397 25.734 C 116.143 28.925 111.677 28.037 107.444 22.086 A 28.245 28.245 0 0 1 106.605 20.836 A 8.787 8.787 0 0 1 106.156 20.127 A 40.578 40.578 0 0 1 106.02 19.891 Z M 121.32 0.361 L 121.32 30.871 L 131.175 30.871 L 131.175 7.606 A 4.191 4.191 0 0 0 131.015 6.393 C 129.83 2.464 122.445 6.114 122.445 0.361 L 121.32 0.361 Z M 31.905 30.871 L 41.76 30.871 L 41.76 15.391 A 4.059 4.059 0 0 0 41.595 14.178 C 41.047 12.424 39.224 12.181 37.406 11.938 A 44.129 44.129 0 0 1 36.675 11.836 C 34.11 11.431 32.625 10.666 31.905 9.721 L 31.905 30.871 Z M 42.615 5.401 C 42.615 2.206 40.32 0.001 36.855 0.001 A 6.683 6.683 0 0 0 34.139 0.538 C 32.303 1.35 31.17 3.029 31.099 5.184 A 6.57 6.57 0 0 0 31.095 5.401 A 5.336 5.336 0 0 0 32.041 8.532 C 32.732 9.505 33.774 10.209 35.075 10.541 A 7.187 7.187 0 0 0 36.855 10.756 A 6.717 6.717 0 0 0 39.539 10.233 C 41.448 9.405 42.606 7.654 42.615 5.427 A 6.457 6.457 0 0 0 42.615 5.401 Z M 149.085 17.956 L 149.085 18.136 A 40.201 40.201 0 0 0 148.631 22.085 A 29.08 29.08 0 0 0 148.59 22.996 C 148.59 25.437 148.875 28.164 148.178 29.085 A 0.81 0.81 0 0 1 147.87 29.341 A 2.365 2.365 0 0 1 146.938 29.588 C 145.495 29.653 143.992 28.265 142.683 25.1 A 21.268 21.268 0 0 1 142.56 24.796 C 141.779 22.871 141.569 21.171 141.939 19.953 A 2.571 2.571 0 0 1 143.28 18.316 A 4.424 4.424 0 0 1 144.26 17.978 C 145.274 17.744 146.58 17.713 147.986 17.834 A 22.952 22.952 0 0 1 149.085 17.956 Z M 110.327 12.283 A 6.228 6.228 0 0 0 109.845 11.341 C 107.955 8.281 105.255 7.471 103.545 8.551 A 2.454 2.454 0 0 0 102.565 9.738 C 101.982 11.225 102.615 13.53 104.045 16.394 A 44.538 44.538 0 0 0 105.435 18.946 A 8.263 8.263 0 0 0 108.577 17.624 C 110.303 16.391 111.221 14.494 110.327 12.283 Z" /> <path d="M290.1 137.5s2.5 12.9-.5 22.4a1.7 1.7 0 0 0 .6 1.9 14 14 0 0 0 16.7 0v-.1a1.6 1.6 0 0 0 .7-1.7 47.4 47.4 0 0 1 0-22.5l-10.3-5.8z" class="face" /> <path d="M290.7 138.5a21 21 0 0 0 19.3-1c20.3-13 23-36.6 21.7-48.8-1.7-15.3-5.9-18-11.7-25.2s-14.1-12.3-23-12.9a12.2 12.2 0 0 0-7.9 1.7c-1 .7-1.7 2-2.8 2.7-26.7 14-31.5 65 4.4 83.5z" class="face" /> <path d="M333.1 93.8a100.2 100.2 0 0 1-.5 9.7c-4.5-5.9-1.5-11.7-4.9-25.3a18.2 18.2 0 0 0-9.6-12.4c-4.6-2.6-9.9-4-14-7.1a21 21 0 0 1-2.3-2 13.2 13.2 0 0 1-3.2-5 9.2 9.2 0 0 1-.5-2.3h4.3a23.6 23.6 0 0 1 14.8 5.5 35 35 0 0 1 6.9 7.5l.5.7c5.2 8 8.5 18.8 8.5 30.7z" class="hair" /> <path d="M299.5 48.8a8.3 8.3 0 0 1-.5 2.3 12.7 12.7 0 0 1-2.7 4.3 22 22 0 0 1-2.9 2.5 36.7 36.7 0 0 1-7.8 4.1c-6.6 2.8-13.5 5.4-15.9 15-3.3 13.3-.3 19-4.9 24.7l-.2-2q-.3-3.6-.3-7.3a53.5 53.5 0 0 1 10.5-32.7 31.3 31.3 0 0 1 9-7.7 23.3 23.3 0 0 1 11.5-3.1z" class="hair" /> <g class="heart"> <path d="M402.5 131s-13.6-20-2.6-23.1c6-1.7 8.9 7.9 8.9 7.9s8.1-5.5 11.8-.1c6.5 9.5-18 15.3-18 15.3z" /> <path d="M401.6 95.7s-9.6-8.9-4.2-11.8c3-1.6 5.7 3 5.7 3s3.6-3.8 6.2-1.4c4.5 4.2-7.7 10.2-7.7 10.2z" /> <path d="M426.3 106.1s-3.4-6.2 0-6.8c1.7-.3 2.3 2.6 2.3 2.6s2.5-1.4 3.4.3c1.6 3-5.7 4-5.7 4z" /> <path d="M196 131s13.7-20 2.7-23.1c-6-1.7-9 7.9-9 7.9s-8-5.5-11.8-.1C171.4 125.2 196 131 196 131z" /> <path d="M197 95.7s9.5-8.9 4.1-11.8c-3-1.6-5.6 3-5.6 3s-3.6-3.8-6.2-1.4c-4.6 4.2 7.6 10.2 7.6 10.2z" /> <path d="M172.2 106.1s3.4-6.2.1-6.8c-1.8-.3-2.4 2.6-2.4 2.6s-2.5-1.4-3.4.3c-1.6 3 5.7 4 5.7 4z" /> </g> <path d="M262 53.2a.3.3 0 0 1-.2 0 .4.4 0 0 1 0-.6 54.3 54.3 0 0 1 10.4-7.6c6-3.4 15.4-7.4 26.6-7a55.7 55.7 0 0 1 25.9 7.2 43.2 43.2 0 0 1 9 6.7.4.4 0 0 1 0 .6.4.4 0 0 1-.5 0 43 43 0 0 0-9-6.7 55 55 0 0 0-25.5-7.1c-11-.4-20.2 3.5-26.1 7a54 54 0 0 0-10.3 7.4.4.4 0 0 1-.2.1z" class="leaf-3" /> <path d="M300.3 38.2c.1-1.8-.1-5.3-3.6-6.6a2 2 0 0 0-2.7 2c0 1.8.9 4.2 4.3 5.4-1.8-.2-4.7.1-6.2 3a2 2 0 0 0 1.8 3 5.6 5.6 0 0 0 5.5-3.6 5.6 5.6 0 0 0 3 5.7 2 2 0 0 0 3-1.8 5.7 5.7 0 0 0-3.9-5.7c4 .3 5.6-1.7 6.4-3.5a2 2 0 0 0-1.8-2.7c-3.7 0-5.2 3-5.8 4.8z" class="flower-1" transform-origin="300 38" transform="scale(1.5)" /> <path d="M300.8 38.2c1-1.5 2.7-4.5.4-7.5a2 2 0 0 0-3.3.2c-.9 1.6-1.5 4.1.8 7-1.5-1.2-4-2.5-6.9-.8a2 2 0 0 0 0 3.4 5.7 5.7 0 0 0 6.6 0 5.6 5.6 0 0 0-.5 6.4 2 2 0 0 0 3.4.2 5.6 5.6 0 0 0-.3-7c3.2 2.4 5.7 1.5 7.3.4a2 2 0 0 0 0-3.3c-3.2-2-6-.2-7.5 1z" class="flower-2" transform-origin="300 38" transform="scale(1.5)" /> <path d="M335.4 48.8c1-1.5 2.7-4.5.4-7.5a2 2 0 0 0-3.3.2c-1 1.6-1.5 4.1.8 7-1.5-1.2-4-2.5-6.9-.8a2 2 0 0 0 0 3.4 5.6 5.6 0 0 0 6.5 0 5.6 5.6 0 0 0-.4 6.4 2 2 0 0 0 3.4.1 5.6 5.6 0 0 0-.3-6.9c3.2 2.3 5.7 1.5 7.3.4a2 2 0 0 0 0-3.3c-3.2-2-6.1-.2-7.5 1z" class="flower-1" transform-origin="335 48" transform="scale(1.35)" /> <path d="M334.8 48.5c0-1.9-.6-5.3-4.2-6.3a2 2 0 0 0-2.5 2.2c.2 1.8 1.2 4.2 4.8 5-1.9 0-4.7.6-6 3.7a2 2 0 0 0 2 2.7 5.6 5.6 0 0 0 5.3-4 5.6 5.6 0 0 0 3.5 5.4 2 2 0 0 0 2.8-2 5.7 5.7 0 0 0-4.4-5.3c4-.1 5.4-2.3 6-4.1a2 2 0 0 0-2-2.6c-3.7.3-5 3.5-5.3 5.3z" class="flower-2" transform-origin="335 48" transform="scale(1.35)" /> <path d="M265.8 48.8c1.1-1.5 2.7-4.5.5-7.5a2 2 0 0 0-3.3.2c-1 1.6-1.6 4.1.7 7-1.5-1.2-4-2.5-6.9-.8a2 2 0 0 0 0 3.4 5.6 5.6 0 0 0 6.6 0 5.6 5.6 0 0 0-.5 6.4 2 2 0 0 0 3.5.1 5.6 5.6 0 0 0-.4-6.9c3.2 2.3 5.7 1.5 7.3.4a2 2 0 0 0 0-3.3c-3.2-2-6-.2-7.5 1z" class="flower-1" transform-origin="265 48" transform="scale(1.35)" /> <path d="M266 49.6c2-.4 5.2-1.5 5.6-5.2a2 2 0 0 0-2.6-2.1c-1.8.5-3.9 2-4.2 5.6-.3-1.9-1.3-4.6-4.5-5.3A2 2 0 0 0 258 45a5.6 5.6 0 0 0 4.9 4.5 5.6 5.6 0 0 0-4.8 4.4 2 2 0 0 0 2.4 2.4 5.7 5.7 0 0 0 4.6-5.2c.7 3.8 3.1 5 5 5.3a2 2 0 0 0 2.3-2.5c-1-3.6-4.4-4.3-6.2-4.3z" class="flower-2" transform-origin="265 48" transform="scale(1.35)" /> <g> <path d="M340 69.1s2-12.3 15.6-7.8c0 0-3.6 13.1-15.6 7.8z" class="leaf-2" /> <path d="M340 69.1s2-12.3 15.6-7.8c0 0-4 2.4-7.5 4.1a70.2 70.2 0 0 1-8.1 3.7z" class="leaf-1" /> </g> <g> <path d="M340.2 71.9s6.4-3.5 9.1 4.3c0 0-7.3 3-9-4.3z" class="leaf-4" /> <path d="M340.2 71.9s6.4-3.5 9.1 4.3c0 0-2.5-1-4.5-2a41.4 41.4 0 0 1-4.6-2.3z" class="leaf-3" /> </g> <g> <path d="M259.8 69.1s-2-12.3-15.6-7.8c0 0 3.6 13.1 15.6 7.8z" class="leaf-2" /> <path d="M259.8 69.1s-2-12.3-15.6-7.8c0 0 4 2.4 7.5 4.1a70.3 70.3 0 0 0 8.1 3.7z" class="leaf-1" /> </g> <g> <path d="M259.6 71.9s-6.3-3.5-9 4.3c0 0 7.2 3 9-4.3z" class="leaf-4" /> <path d="M259.6 71.9s-6.3-3.5-9 4.3l4.5-2a39.6 39.6 0 0 0 4.5-2.3z" class="leaf-3" /> </g> </svg> </div> {% schema %} { "name": "My Land Animation", "settings": [], "presets": [ { "name": "My Land Animation" } ] } {% endschema %} 这是我的CSS: @keyframes hair-flow { from { d: path("M600 198c-3.5-5.2-9.3-10.7-15.7-12.2c-18.6-3.2-28.4 17.2-48.8 12.8c-5.7-1.3-9.3-6.2-12.5-11.1c-7.6-11.9-22.1-20.5-35.7-16.9c-9.7 2.6-16.9 10.5-25.8 14.8a37.5 37.5 0 0 1-21.7 3.3c-11.2-4.6.7-29-14.3-39.3c-17-11.4-23.8 10.6-40.3 7s-5.6-14.7-3.2-30.7c2.8-18.8-6.3-31.4-20.6-32.3s-17.8-17.9-17.8-17.9l-2.3-9.7a46.1 46.1 0 0 0-7.2-16.3a36.5 36.5 0 0 0-7.1-7.6a41.5 41.5 0 0 0-24.4-8.4a10 10 0 0 0-4.3.8v260h306"); } to { d: path("M600 198c-3.5 5.2-9.3 10.7-15.7 10.2c-14.6 3.2-25.4-19.6-48.8-18.8c-6.5 1.2-9.3 6.2-12.5 11.1c-7.6 11.9-22.1 5.5-35.7-10.9c-9.7-16.6-16.9-20.5-25.8-12.8a37.5 47.5 0 0 1 -21.7 3.3c-12.2-4.6.7-29-16.3-39.3c-17-11.4-23.8 10.6-38.3 6s-5.6-20.7-1.2-35.7c2.8-18.8-6.3-26.4-18.6-24.3s-20.8-20.9-20.8-22.9l-4.3-9.7a46.1 46.1 0 0 0-17.2-16.3a36.5 36.5 0 0 0-19.1 -3.6a10 10 0 0 0-4.3.8a1 1 0 0 0-1.3.8v260h306"); } } @-webkit-keyframes hair-flow { from { d: path("M600 198c-3.5-5.2-9.3-10.7-15.7-12.2c-18.6-3.2-28.4 17.2-48.8 12.8c-5.7-1.3-9.3-6.2-12.5-11.1c-7.6-11.9-22.1-20.5-35.7-16.9c-9.7 2.6-16.9 10.5-25.8 14.8a37.5 37.5 0 0 1-21.7 3.3c-11.2-4.6.7-29-14.3-39.3c-17-11.4-23.8 10.6-40.3 7s-5.6-14.7-3.2-30.7c2.8-18.8-6.3-31.4-20.6-32.3s-17.8-17.9-17.8-17.9l-2.3-9.7a46.1 46.1 0 0 0-7.2-16.3a36.5 36.5 0 0 0-7.1-7.6a41.5 41.5 0 0 0-24.4-8.4a10 10 0 0 0-4.3.8v260h306"); } to { d: path("M600 198c-3.5 5.2-9.3 10.7-15.7 10.2c-14.6 3.2-25.4-19.6-48.8-18.8c-6.5 1.2-9.3 6.2-12.5 11.1c-7.6 11.9-22.1 5.5-35.7-10.9c-9.7-16.6-16.9-20.5-25.8-12.8a37.5 47.5 0 0 1 -21.7 3.3c-12.2-4.6.7-29-16.3-39.3c-17-11.4-23.8 10.6-38.3 6s-5.6-20.7-1.2-35.7c2.8-18.8-6.3-26.4-18.6-24.3s-20.8-20.9-20.8-22.9l-4.3-9.7a46.1 46.1 0 0 0-17.2-16.3a36.5 36.5 0 0 0-19.1 -3.6a10 10 0 0 0-4.3.8a1 1 0 0 0-1.3.8v260h306"); } } @-o-keyframes hair-flow { from { d: path("M600 198c-3.5-5.2-9.3-10.7-15.7-12.2c-18.6-3.2-28.4 17.2-48.8 12.8c-5.7-1.3-9.3-6.2-12.5-11.1c-7.6-11.9-22.1-20.5-35.7-16.9c-9.7 2.6-16.9 10.5-25.8 14.8a37.5 37.5 0 0 1-21.7 3.3c-11.2-4.6.7-29-14.3-39.3c-17-11.4-23.8 10.6-40.3 7s-5.6-14.7-3.2-30.7c2.8-18.8-6.3-31.4-20.6-32.3s-17.8-17.9-17.8-17.9l-2.3-9.7a46.1 46.1 0 0 0-7.2-16.3a36.5 36.5 0 0 0-7.1-7.6a41.5 41.5 0 0 0-24.4-8.4a10 10 0 0 0-4.3.8v260h306"); } to { d: path("M600 198c-3.5 5.2-9.3 10.7-15.7 10.2c-14.6 3.2-25.4-19.6-48.8-18.8c-6.5 1.2-9.3 6.2-12.5 11.1c-7.6 11.9-22.1 5.5-35.7-10.9c-9.7-16.6-16.9-20.5-25.8-12.8a37.5 47.5 0 0 1 -21.7 3.3c-12.2-4.6.7-29-16.3-39.3c-17-11.4-23.8 10.6-38.3 6s-5.6-20.7-1.2-35.7c2.8-18.8-6.3-26.4-18.6-24.3s-20.8-20.9-20.8-22.9l-4.3-9.7a46.1 46.1 0 0 0-17.2-16.3a36.5 36.5 0 0 0-19.1 -3.6a10 10 0 0 0-4.3.8a1 1 0 0 0-1.3.8v260h306"); } } @-moz-keyframes hair-flow { from { d: path("M600 198c-3.5-5.2-9.3-10.7-15.7-12.2c-18.6-3.2-28.4 17.2-48.8 12.8c-5.7-1.3-9.3-6.2-12.5-11.1c-7.6-11.9-22.1-20.5-35.7-16.9c-9.7 2.6-16.9 10.5-25.8 14.8a37.5 37.5 0 0 1-21.7 3.3c-11.2-4.6.7-29-14.3-39.3c-17-11.4-23.8 10.6-40.3 7s-5.6-14.7-3.2-30.7c2.8-18.8-6.3-31.4-20.6-32.3s-17.8-17.9-17.8-17.9l-2.3-9.7a46.1 46.1 0 0 0-7.2-16.3a36.5 36.5 0 0 0-7.1-7.6a41.5 41.5 0 0 0-24.4-8.4a10 10 0 0 0-4.3.8v260h306"); } to { d: path("M600 198c-3.5 5.2-9.3 10.7-15.7 10.2c-14.6 3.2-25.4-19.6-48.8-18.8c-6.5 1.2-9.3 6.2-12.5 11.1c-7.6 11.9-22.1 5.5-35.7-10.9c-9.7-16.6-16.9-20.5-25.8-12.8a37.5 47.5 0 0 1 -21.7 3.3c-12.2-4.6.7-29-16.3-39.3c-17-11.4-23.8 10.6-38.3 6s-5.6-20.7-1.2-35.7c2.8-18.8-6.3-26.4-18.6-24.3s-20.8-20.9-20.8-22.9l-4.3-9.7a46.1 46.1 0 0 0-17.2-16.3a36.5 36.5 0 0 0-19.1 -3.6a10 10 0 0 0-4.3.8a1 1 0 0 0-1.3.8v260h306"); } } .hair-main { animation:hair-flow 0.75s infinite alternate ease-in-out; -webkit-animation:hair-flow 0.75s infinite alternate ease-in-out; -o-animation:hair-flow 0.75s infinite alternate ease-in-out; -moz-animation:hair-flow 0.75s infinite alternate ease-in-out; } 大家好 我目前面临 CSS 动画在 iOS 设备上无法按预期工作的问题。尽管使用关键帧实现标准 CSS 动画,但动画在 iPhone 和 iPad 上无法触发或无法流畅播放。 以下是有关我的设置的一些详细信息: 动画类型:我正在使用 CSS 关键帧来为 svg 头发设置动画。 测试的浏览器:我在 iOS 上的 Safari 上进行了测试。 使用的CSS属性:在代码中解释。 预期行为:动画应该在 IOS 设备(例如网络和 Android 设备)上播放。 当前行为:在 iOS 上,动画无法触发,头发没有上下波动。 我怀疑这可能与 iOS 对动画或特定 CSS 属性的处理有关。有其他人遇到过这个问题吗?您对故障排除或解决方案有什么建议吗?任何帮助将不胜感激! 我尝试使用 -webkit- 但仍然不起作用......顺便说一句,我只关注“头发”的动画 谢谢! 迄今为止(2024 年)webkit 无法通过 d 更改 presentation 属性 path()。 作为解决方法,您可以使用 SMIL 动画来代替 @keyframes hair-flow { from { d: path("M600 198c-3.5-5.2-9.3-10.7-15.7-12.2c-18.6-3.2-28.4 17.2-48.8 12.8c-5.7-1.3-9.3-6.2-12.5-11.1c-7.6-11.9-22.1-20.5-35.7-16.9c-9.7 2.6-16.9 10.5-25.8 14.8a37.5 37.5 0 0 1-21.7 3.3c-11.2-4.6.7-29-14.3-39.3c-17-11.4-23.8 10.6-40.3 7s-5.6-14.7-3.2-30.7c2.8-18.8-6.3-31.4-20.6-32.3s-17.8-17.9-17.8-17.9l-2.3-9.7a46.1 46.1 0 0 0-7.2-16.3a36.5 36.5 0 0 0-7.1-7.6a41.5 41.5 0 0 0-24.4-8.4a10 10 0 0 0-4.3.8v260h306"); } to { d: path("M600 198c-3.5 5.2-9.3 10.7-15.7 10.2c-14.6 3.2-25.4-19.6-48.8-18.8c-6.5 1.2-9.3 6.2-12.5 11.1c-7.6 11.9-22.1 5.5-35.7-10.9c-9.7-16.6-16.9-20.5-25.8-12.8a37.5 47.5 0 0 1 -21.7 3.3c-12.2-4.6.7-29-16.3-39.3c-17-11.4-23.8 10.6-38.3 6s-5.6-20.7-1.2-35.7c2.8-18.8-6.3-26.4-18.6-24.3s-20.8-20.9-20.8-22.9l-4.3-9.7a46.1 46.1 0 0 0-17.2-16.3a36.5 36.5 0 0 0-19.1 -3.6a10 10 0 0 0-4.3.8a1 1 0 0 0-1.3.8v260h306"); } } .hair-main2 { fill: red; animation: hair-flow 0.75s infinite alternate ease-in-out; } <h3>SVG SMIL animation</h3> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 300"> <defs> <g id="path-1"> <path d="" class="hair hair-main"> <animate attributeName="d" attributeType="XML" values="M600 198c-3.5-5.2-9.3-10.7-15.7-12.2c-18.6-3.2-28.4 17.2-48.8 12.8c-5.7-1.3-9.3-6.2-12.5-11.1c-7.6-11.9-22.1-20.5-35.7-16.9c-9.7 2.6-16.9 10.5-25.8 14.8a37.5 37.5 0 0 1-21.7 3.3c-11.2-4.6.7-29-14.3-39.3c-17-11.4-23.8 10.6-40.3 7s-5.6-14.7-3.2-30.7c2.8-18.8-6.3-31.4-20.6-32.3s-17.8-17.9-17.8-17.9l-2.3-9.7a46.1 46.1 0 0 0-7.2-16.3a36.5 36.5 0 0 0-7.1-7.6a41.5 41.5 0 0 0-24.4-8.4a10 10 0 0 0-4.3.8v260h306; M600 198c-3.5 5.2-9.3 10.7-15.7 10.2c-14.6 3.2-25.4-19.6-48.8-18.8c-6.5 1.2-9.3 6.2-12.5 11.1c-7.6 11.9-22.1 5.5-35.7-10.9c-9.7-16.6-16.9-20.5-25.8-12.8a37.5 47.5 0 0 1 -21.7 3.3c-12.2-4.6.7-29-16.3-39.3c-17-11.4-23.8 10.6-38.3 6s-5.6-20.7-1.2-35.7c2.8-18.8-6.3-26.4-18.6-24.3s-20.8-20.9-20.8-22.9l-4.3-9.7a46.1 46.1 0 0 0-17.2-16.3a36.5 36.5 0 0 0-19.1 -3.6a10 10 0 0 0-4.3.8a1 1 0 0 0-1.3.8v260h306; M600 198c-3.5-5.2-9.3-10.7-15.7-12.2c-18.6-3.2-28.4 17.2-48.8 12.8c-5.7-1.3-9.3-6.2-12.5-11.1c-7.6-11.9-22.1-20.5-35.7-16.9c-9.7 2.6-16.9 10.5-25.8 14.8a37.5 37.5 0 0 1-21.7 3.3c-11.2-4.6.7-29-14.3-39.3c-17-11.4-23.8 10.6-40.3 7s-5.6-14.7-3.2-30.7c2.8-18.8-6.3-31.4-20.6-32.3s-17.8-17.9-17.8-17.9l-2.3-9.7a46.1 46.1 0 0 0-7.2-16.3a36.5 36.5 0 0 0-7.1-7.6a41.5 41.5 0 0 0-24.4-8.4a10 10 0 0 0-4.3.8v260h306" dur="1.5s" repeatCount="indefinite" keyTimes="0; 0.5; 1" keySplines="0.42 0 0.58 1; 0.42 0 0.58 1" calcMode="spline" fill="freeze" /> </path> </g> </defs> <use href="#path-1" x="0" y="0" /> <use href="#path-1" x="0" y="0" transform="translate(300, 0) scale(-1, 1) translate(-300, 0)" /> </svg> <h3>CSS animation (not working in webkit)</h3> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 300"> <defs> <path id="path" d="" class="hair hair-main2" /> </defs> <use href="#path" x="0" y="0" /> <use href="#path" x="0" y="0" transform="translate(300, 0) scale(-1, 1) translate(-300, 0)" /> </svg> 您可以在 <animate> 内嵌套 <path> 元素(或通过 href 属性引用它。 values:包含逗号分隔的d(路径数据)值数组。我们需要复制第一个值,因为 SMIL 没有像 CSS alternate 那样在每次迭代中来回播放动画的本机方法 repeatCount="indefinite"使动画无限循环 keyTimes="0; 0.5; 1"指定不同动画“关键帧”的时间 keySplines="0.42 0 0.58 1; 0.42 0 0.58 1" calcMode="spline" 模拟 ease-in-out 缓动行为 另请参阅 SVG 动画指南 (SMIL)
我使用剪辑路径(id:contour1-contourMask)在Plotly创建的轮廓SVG上定义德黑兰市的边界。这里是代码:https://codepen.io/mojtaba_codepen/pen/abeKJRX 虽然它...
将 SVG 添加到 FabricJS 画布时出现类型错误(不可迭代)
我有一个fabricjs画布,我正在尝试向其中添加一个SVG。但无论我做什么,我都会遇到问题。它一直在说: “未捕获(承诺中)类型错误:t 不可迭代”。 让 svg = ` 我有一个fabricjs画布,我正在尝试向其中添加一个SVG。但无论我做什么,我都会遇到问题。它一直在说: “未捕获(承诺中)类型错误:t 不可迭代”。 let svg = `<svg viewBox="-8 -8 136 136"> <path stroke="#000000" stroke-width="8" d="m0 51.82677l0 0c0 -28.623135 23.203636 -51.82677 51.82677 -51.82677l0 0c13.745312 0 26.927654 5.4603047 36.64706 15.17971c9.719406 9.719404 15.17971 22.901749 15.17971 36.64706l0 0c0 28.623135 -23.203636 51.82677 -51.82677 51.82677l0 0c-28.623135 0 -51.82677 -23.203636 -51.82677 -51.82677zm25.913385 0l0 0c0 14.311565 11.60182 25.913387 25.913385 25.913387c14.311565 0 25.913387 -11.601822 25.913387 -25.913387c0 -14.311565 -11.601822 -25.913385 -25.913387 -25.913385l0 0c-14.311565 0 -25.913385 11.60182 -25.913385 25.913385z" fill="none"></path> </svg>`; let canvas = new fabric.Canvas("canvas"); let path = fabric.loadSVGFromString(svg, function(objects, options) { let obj = fabric.util.groupSVGElements(objects, options); obj.set({ left: canvas.width / 2 - obj.width / 2, top: canvas.height / 2 - obj.height / 2 }); canvas.add(obj).renderAll(); }); 希望有人可以帮助我 我不确定您使用的是哪个版本,但我已将您的代码添加到可运行的代码片段中,它似乎对我来说工作得很好: let svg = `<svg viewBox="-8 -8 136 136"> <path stroke="#000000" stroke-width="8" d="m0 51.82677l0 0c0 -28.623135 23.203636 -51.82677 51.82677 -51.82677l0 0c13.745312 0 26.927654 5.4603047 36.64706 15.17971c9.719406 9.719404 15.17971 22.901749 15.17971 36.64706l0 0c0 28.623135 -23.203636 51.82677 -51.82677 51.82677l0 0c-28.623135 0 -51.82677 -23.203636 -51.82677 -51.82677zm25.913385 0l0 0c0 14.311565 11.60182 25.913387 25.913385 25.913387c14.311565 0 25.913387 -11.601822 25.913387 -25.913387c0 -14.311565 -11.601822 -25.913385 -25.913387 -25.913385l0 0c-14.311565 0 -25.913385 11.60182 -25.913385 25.913385z" fill="none"></path> </svg>`; let canvas = new fabric.Canvas("canvas"); let path = fabric.loadSVGFromString(svg, function(objects, options) { let obj = fabric.util.groupSVGElements(objects, options); obj.set({ left: canvas.width / 2 - obj.width / 2, top: canvas.height / 2 - obj.height / 2 }); canvas.add(obj).renderAll(); }); canvas.renderAll(); <script src="//cdnjs.cloudflare.com/ajax/libs/fabric.js/1.7.6/fabric.js"></script> <canvas id="canvas" width="800" height="600"></canvas><br/>
我需要在React Native中设计这个底部选项卡,我该如何实现呢? 我正在尝试使用 React Native SVG 来完成此操作,但没有得到所需的结果。 如果可能的话,还建议一个解决方案...
我需要在本机反应中设计这个底部选项卡,我怎样才能实现这一点。 我正在尝试使用 React Native svg 来做到这一点,但没有得到结果。 如果可能的话,还建议一个解决方案,使其动态...
使用 CSS 将 SVG 图标的路径动画化以从中心顺时针旋转
我正在尝试旋转/旋转此 SVG 的内部路径,使其顺时针旋转。 是否有任何好的资源可以展示 CSS 可用的不同类型的动画方法? 现在...