绘制SVG路径的最简单方法(Simplest way to draw an SVG path)
我从这里尝试了以下的tutiroal: http ://jakearchibald.com/2013/animated-line-drawing-svg/
var path = document.querySelector(".svg1"); var length = path.getTotalLength(); path.style.transition = path.style.WebkitTransition = "none"; path.style.strokeDasharray = length; path.style.strokeDashoffset = length; path.getBoundingClientRect(); path.style.transition = path.style.WebkitTransition = "stroke-dashoffset 1s ease-out"; path.style.strokeDashoffset = 0;
HTML如下:
<path class="svg1" style="fill: none; stroke: #3498db; stroke-width: 7; stroke-linecap: round; stroke-linejoin: miter; stroke-miterlimit: 4;" d="M247 103 A130 130 0 1 1 247 363 A130 130 0 1 1 247 103" />
问题是当我在Firefox中使用它时,它可以工作。 但是,如果我选择使用Chrome,那么动画会以75%的速度冻结,并在30秒内立即跳至100%。 我注意到,动画在一种情况下不会冻结 - 如果我使用
stroke-dashoffset 530ms ease-out
,即530ms或更少。有人可以建议一个解决方案或建议一个很好的方法来动画svg路径没有大量无用的代码?
I tried the following tutiroal from here: http://jakearchibald.com/2013/animated-line-drawing-svg/
var path = document.querySelector(".svg1"); var length = path.getTotalLength(); path.style.transition = path.style.WebkitTransition = "none"; path.style.strokeDasharray = length; path.style.strokeDashoffset = length; path.getBoundingClientRect(); path.style.transition = path.style.WebkitTransition = "stroke-dashoffset 1s ease-out"; path.style.strokeDashoffset = 0;
HTML is as following:
<path class="svg1" style="fill: none; stroke: #3498db; stroke-width: 7; stroke-linecap: round; stroke-linejoin: miter; stroke-miterlimit: 4;" d="M247 103 A130 130 0 1 1 247 363 A130 130 0 1 1 247 103" />
The thing is when I use it in Firefox, it works. But if I go for Chrome, the animation freezes at something like 75% and instantly jumps to 100% in like 30s. I've noticed, that the animation doesn't freeze only in one case - if I use
stroke-dashoffset 530ms ease-out
, i.e. 530ms or less.Could someone suggest a solution for that or recommend a good way to animate an svg path without tons of useless code?
原文:https://stackoverflow.com/questions/26640478
最满意答案
既然您正在寻找最佳实践,我相信为每个用户(开发人员?)提供单独的分支永远都不是好事,而在这种意义上,“CI”根本不是CI - 它更像是个人构建而不是其他任何东西。
对于TeamCity中的分支,您可以在Project中添加特定于分支的构建配置。 例如,如果存在“构建”构建配置,则可以为发布分支等添加“构建发布”。
Since you are looking for best practices, I believe it is never good to have individual branches for each user ( developer? ) and "CI" in this sense is not CI at all - it is more a personal build than anything else.
For branches in TeamCity, you can add branch specific build configuration within the Project. For example if there is a "build" build configuration, you can add "build-release" for the release branch etc.
相关问答
更多-
配置TeamCity从SVN中继,分支和/或标签构建(Configure TeamCity to build from SVN trunk, branches and/or tags)[2021-09-20]
首先,确保您的VCS根目录是您管理面板中SVN存储库的根目录,而不是指向中继目录。 然后,对于每个构建配置,编辑VCS配置中的结帐规则。 添加您所需的结帐规则。 例如,对于您的'trunk'构建配置,您将拥有一个结账规则: +:trunk => . 。 如果您想要构建标签或分支,只需使用相应的结帐规则创建新的构建配置即可。 'release-1.1'的标签的结账规则为: +:tags/release-1.1 => . 这里是关于结帐规则的文档: http : //confluence.jetbrains.n ... -
TeamCity的替代品[关闭](TeamCity Alternatives [closed])[2022-03-25]
如果这是您所说的不可销售的话,Team City有一个开源许可选项。 如果没有,请看哈德森 。 编辑: 这里是在Windows上运行从站的说明。 Team City has an Open Source licensing option if that is what you mean by non-sellable. If not, look at Hudson. EDIT: Here are the instructions for running a slave on Windows. -
根据Teamcity,截至今天(2012年11月28日)尚未支持。 我找到了一个替代方案。你可以做的是创建像Bugzilla或Redmine这样的bug跟踪器的多个实例。 使用正则表达式来跟踪错误号,但该模式应该是唯一的。 要记住的是,要将项目名称添加为带有错误编号的前缀,它将起作用。 As per Teamcity this is not yet supported as of today (28th Nov,2012). I have found an alternate .What you can d ...
-
如果我理解正确,听起来你想要使用VCS结帐规则 (TeamCity v9链接)。 而且我假设您有一个特定于您的存储库中每个project_x的构建配置。 在构建配置中的VCS根目录上,单击“查看结帐规则”并输入以下内容: +:relative/path/to/project_x 如果配置了VCS触发器,则触发器将仅检测作用于结帐规则定义的位置的更改。 If I understand correctly, it sounds like you want to make use of VCS checkout ...
-
嗯,显然这都归功于VCS root设置。 基本上最好的选择是将根设置为main,然后编辑结帐规则: VCS root: http://my.svn.root/main checkout rules: +:Project1=>. 这似乎更稳定,并且在构建触发方面也更具响应性。 Hmmm, apparently it's all due to the VCS root settings. Basically the best option would be to have a root set up to ...
-
TeamCity:禁用所有TeamCity项目的构建触发器(TeamCity: Disable build trigger for all TeamCity projects)[2023-05-15]
使用Team City REST API。 鉴于您的Team City已部署在http://dummyhost.com,并且您启用了具有系统管理员角色的访客访问权限(否则只需从URL中的guestAuth切换到httpAuth ,并在请求中指定具有密码的用户,详细信息在文档中)您可以执行下一步操作: 获取所有构建配置GET http://dummyhost.com/guestAuth/app/rest/buildTypes/ 对于每个构建配置获取所有触发器GET http://dummyhost.com/g ... -
如何将Branch Name传递给TeamCity中的MSBuild脚本?(How do I pass Branch Name to an MSBuild script in TeamCity?)[2023-12-19]
只需创建一个构建参数: system.branch_name = %teamcity.build.vcs.branch.Your_Project% 项目名称中的任何非字母数字字符都应替换为“_”。 在你的msbuild中使用$(branch_name)来引用参数。 像魅力一样工作:-) Just create a build parameter: system.branch_name = %teamcity.build.vcs.branch.Your_Project% Any non-alpha-num ... -
既然您正在寻找最佳实践,我相信为每个用户(开发人员?)提供单独的分支永远都不是好事,而在这种意义上,“CI”根本不是CI - 它更像是个人构建而不是其他任何东西。 对于TeamCity中的分支,您可以在Project中添加特定于分支的构建配置。 例如,如果存在“构建”构建配置,则可以为发布分支等添加“构建发布”。 Since you are looking for best practices, I believe it is never good to have individual branches f ...
-
每种模式都有其优点和缺点: 对于两个分支具有不同VCS根的第一种方法,每个分支都指向分支的完整TFS路径,这使得事情简单易懂。 但是,每次创建构建配置时,都需要添加新的VCS根并在清除构建配置后删除它,因为在删除构建配置时没有选项可以自动执行该VCS根删除。 拥有共享VCS根目录和参数化一些路径的第二种方法是使事情变得复杂,如果团队中有多个人负责构建配置维护,那么所有人都应该知道这些参数是哪些设置,可能你可能需要记录相同的。 对于团队中的新手来说,这将是一个完全未知的,这些是这些参数。 我每次都不会这样做。 ...
-
如何在TeamCity中使用多个远程Git存储库?(How to work with multiple remote Git repositories in TeamCity?)[2023-12-27]
您应该从配置中创建一个构建配置模板,然后从它继承两次,而不是复制,每个存储库根目录一次。 这样,您可以在一个位置维护配置,从而影响两种配置。 但是,是的,我认为这是唯一的方法。 至少据我所知。 然后在将多个VCS根添加到一个配置中的意义是,如果您的软件被分成多个存储库,例如每个模块一个,则可以将它们全部拉入构建。 Instead of copying you should create a build configuration template out of your configuration and ...