- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
所以我有这个动画(悬停时触发)。 --> Morph Animation on CodePen
在 Safari 中运行非常流畅,在 Chrome 中运行起来非常不和谐,但在 Firefox 中根本无法运行。
如果有人能指出正确的方向,我将不胜感激。这甚至可以通过某种方式解决吗?
代码:
HTML:
<div class="shape-container">
<div class="shape"></div>
</div>
SCSS:
$globalWidth: 48px;
$globalHeight: 48px;
$zenGreen: #38CA4B;
$zenRed: #F32847;
@mixin transition($duration) {
transition: all $duration cubic-bezier(0.785, 0.135, 0.150, 0.860);;
}
@mixin shapeStroke() {
}
/* Center the demo */
html, body { height: 100%; background: #008ace;}
body {
display: flex;
justify-content: center;
align-items: center;
}
.shape-container {
width: $globalWidth;
height: $globalHeight;
@include transition(600ms);
&:hover {
@include transition(600ms);
transform: rotateZ(-180deg);
.shape {
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
transform: scaleX(1);
&:before {
clip-path: polygon(5% 5%, 95% 5%, 95% 95%, 5% 95%);
background: $zenGreen;
}
&:after {
clip-path: polygon(25% 48%, 43% 62%, 75% 20%, 89% 31%, 75% 49%, 61% 68%, 45% 87%, 14% 61%);
transform: rotateZ(180deg) translateY(8px);
}
}
}
}
.shape {
width: $globalWidth;
height: $globalHeight;
background: white;
clip-path: polygon(50% 0, 50% 0, 100% 100%, 0 100%);
@include transition(600ms);
transform: scaleX(1.2);
position: relative;
&:before {
@include transition(600ms);
content: "";
display: block;
background: $zenRed;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
clip-path: polygon(50% 10%, 50% 10%, 92% 95%, 8% 95%);
}
&:after {
@include transition(600ms);
content: "";
display: block;
position: absolute;
width: 50%;
height: 50%;
top: 20px;
left: 12px;
z-index: 1000;
clip-path: polygon(41% 10%, 57% 10%, 57% 50%, 41% 50%, 41% 57%, 56% 57%, 57% 73%, 41% 73%);
background: white;
}
}
最佳答案
截至目前,clip-path 的 aren't that well supported , 然而。我自己遇到了很多问题,而且我没有解决 clip-path 的所有问题的方法。我做 知道的是,overflow: hidden
有时可以挽救局面。好吧,在这种情况下是 50%。
选项 1:将 overflow: hidden
添加到 .shape
。此时,“三 Angular 形到方框”动画在 Chrome 中运行良好。
选项 2:从 .shape-container:hover .shape:after
中删除转换。此时,“感叹号到复选标记”动画将正常工作。
缺点是这两者出于某种原因不能组合。选项 2 没有给出正确的结果,尽管您可以通过围绕旋转中心硬编码测谎点 180 度来将复选标记的形状旋转 180 度(然后您可以向下移动 8 像素,因为这也是您翻译的内容)。
不过,我确实有一个解决方案。在过去的几个小时里,我一直在尝试用 得到广泛支持的东西来改造您的笔。你可以看看this Fiddle .
我已将包含元素更改为内部带有多边形的 svg 元素,它始终保持相同的笔画宽度。它的动画是由一小段 JavaScript 触发的。还有,感叹号和复选标记的动画和你的完全不同,但我觉得它看起来很整洁。
虽然这是一个迟到的答案,但我希望它仍然对你有帮助。
关于CSS 'clip-path' 变形动画在 Chrome 和 Firefox 中不起作用,在 Safari 中完美运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30194605/
我在 Eclipse 上制作了一个视频游戏,我将制作一首菜单歌曲并停止该歌曲,但 Clip.stop();不工作我不知道为什么请帮助我。菜单歌曲Clip.play();和Clip.loop(Clip.
我想制作一个类似于单元测试的框架,允许我为各个规则编写自定义测试。我希望每个测试都在它自己的文件中,即 test_R1.clp 将是规则 R1 的测试文件。每个测试都应该能够加载它自己的事实文件。我已
我注意到使用 clip 属性也会删除 box-shadow 属性。有没有办法在同一个元素上同时使用两者? 一些背景:我为三种类型的产品设置了三列。每个产品都有一个图像,每个图像的大小都不同。我想标准化
我这里有一些代码,这让我很困惑;我想弄清楚为什么会出现空指针异常。我设置了一个 for-each-loop 来初始化每个剪辑。如果我自己初始化每一个,它就可以正常工作,并且可以播放剪辑。 musi
在我看来,Instance可以做到Fact可以做到的一切,Fact存在的意义是什么?换句话说,实例和事实有什么区别?有没有只能用Fact的情况? 这让我很困扰,我搜索了很多但没有给我答案,有人可以帮助
我正在尝试循环播放一个小的“.wav”音频文件。我使用的代码运行良好,但我想在循环音频之间设置一些时间间隔。下面提供了代码。 try { // from a wave File
我对将 Clips 嵌入到 C 和 C++ 中的区别感到困惑。我已按照高级编程指南(第 4.17 章)中的步骤成功将 Clips 嵌入到 C 程序中现在,我想将 Clips 嵌入到 C++ 程序中,我
我正在编写一个小脚本,让用户可以将自定义图像加载到网页的 Canvas 中。到目前为止,效果非常好。 Canvas 使用 fabric.js 脚本进行初始化,以便让用户执行一些简单的编辑任务。 “上传
当我第一次启动 App Clip 时,iOS 决定自动显示应用横幅。我们的 App Clip 本质上是该应用的完整版本,因此我们不希望我们的用户立即升级到该应用。 有没有办法在启动时隐藏它? 最佳答案
Sutherland-Hodgman 算法中解释了 4 条用于裁剪多边形的规则: 如果两个顶点都在裁剪区域内 - 保存第二个 如果第一个顶点在内部,第二个在外部 - 计算与裁剪区域边界的交点并保存 如
我创建了一个“登录页面”,它是一个影片剪辑。我的另一个页面是“主页”,这是另一个影片剪辑。所以我想做的是.. 我想将我的一个移动剪辑导航到另一个影片剪辑。和 `我不想使用时间线。 只需在actions
有人可以提供有关如何在 linux 环境中安装 clips 和 clipspy 的分步过程。 pip install clipspy 对我不起作用,因为我的组织不允许使用 pip。我需要从源代码构建。
我写了一个程序来断言这条规则的 LHS 中的事实: (defrule check-open-better (declare (salience 50)) ?f1 (assert (node
我有 10 个观察环境的传感器。如果正常,则传感器为 1,否则为 0。 如果至少有 3 个传感器处于 0 状态,我需要创建一个函数,它将向终端打印一条警告消息,并且消息警告只显示一次。这是我需要在剪辑
我正在尝试为示例规则绘制一个 Rete 网络,该规则在不同模式的变量之间没有绑定(bind)。我知道beta网络是用来确保不同模式下的弯曲变量是一致的。 (defrule R1 (type1 c1
我正在使用 剪辑 ( http://clipsrules.sourceforge.net/ ) 用于大学项目,但我无法直接从文件运行程序,在这种情况下,我不想使用提示插入 FACTS 和 RULES。
我想在运行规则时增加安全性。现在,它什么也没有改变。事实(human_resources n)确实存在。 (defglobal?security = 0) (第1条规则 (human_resource
[注意:寻找一个跨浏览器的解决方案,它不会在每一波 goo 之间瞬间闪烁 body 的背景,如 ccprog 的回答中所见;理想情况下,解决方案不应涉及等到第一波结束才开始显示第二波,以便两个波可以同
我在以下无法理解的代码中遇到错误 imgColor = cv2.imread(fileName, cv2.IMREAD_COLOR) imgColor1= cv2.cvtColor(imgColor,
我通过使用 CLIPSJNI 改编 WineDemo.clp 示例来尝试此操作。 (defmodule SEVERITY (import MAIN ?ALL) (exp
我是一名优秀的程序员,十分优秀!