- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试为主屏幕上的图像(飞机飞行)制作动画,并想让它看起来好像飞机从远处开始,随着时间的推移越来越近。
我将两张图像叠加在一起以创建 3D 效果,并且能够成功地为“天空”背景制作动画,使其看起来就像飞机在移动一样。我可以使用 animate.css 轻松地为飞机设置动画,使其从上方或下方飞入,但我更希望实现的是一种透视。我玩过透视属性,但还没有让它以任何合理的方式工作。
当我尝试缩放飞机的 img 时,我从一个负数开始(所做的只是将 img 上下颠倒)。从 1 开始并缩放到更高并不能真正使飞机看起来好像从远处开始变小并随着它接近观察者而变大。
对此有什么想法吗?
.jumbotron {
background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url('../img/fluffy-cloud-cloudscape-sky-584414.jpeg');
background-size: cover;
z-index: 1;
background-position: 0px 0px;
background-repeat: repeat-y;
animation: animatedBackground 3s linear infinite;
}
@keyframes animatedBackground {
from {
background-position: 0 1510px;
}
to {
background-position: 0 0;
}
}
<div class="jumbotron jumbotron-fluid">
<div class="container">
<img src="assets/img/stealth.png" alt="">
</div>
</div>
飞机 img 没有 CSS,因为还没有任何东西可以接近实现这种效果。
当背景图片以其无限动画变化时,也希望这个边框消失。
最佳答案
您可以动画平面img
的宽度
和高度
:
body {width:100%;margin:0}
.jumbotron {
/*z-index: 1; the element needs to be positioned anything else other than static to be taken into account */
background: linear-gradient(rgba(0,0,0,.2), rgba(0,0,0,.2)), url('/image/fk18j.png') repeat-y;
background-size: cover;
background-position: 0px 0px;
animation: animateBackground 3s linear infinite;
}
.container {
display: flex;
justify-content: center;
align-items: center;
}
.container > img {
display: block;
animation: animatePlate 3s linear infinite;
}
@keyframes animatePlate {
from {
width: 0;
height: 0;
}
to {
width: 300px;
height: 300px;
}
}
@keyframes animateBackground {
from {
background-position: 0 1510px;
}
to {
background-position: 0 0;
}
}
<div class="jumbotron jumbotron-fluid">
<div class="container">
<img src="https://cdn.officialpsds.com/imageview/78/5z/785z6w_large.png?1395542934" alt="">
</div>
</div>
关于jquery - 使图像看起来好像越来越近 - CSS Perspective?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48468601/
-webkit-transform: perspective 和 -webkit-perspective 之间有什么区别(作为供应商在 -webkit- 上给出。) 我在同样的情况下试过这个,但他们返
他们应该做同样的事情吧?还要给 child 设置3d视角?但是在浏览器支持或其他方面有什么不同吗? 最佳答案 透视 CSS 属性通过影响 Z 平面和用户之间的距离为元素提供 3D 空间。 效果的强度由
这是我正在尝试获取透视原点的 css #perspective { width: 200px; height: 200px; margin: 75px 0 0 75px; bo
如果我使用透视,我有一个翻转动画,我有一个简单的卡片,当鼠标悬停时会翻转。根据我的理解,透视属性和转换属性 perspective() 是相同的,只是透视应用于父级并在其子级上呈现,而 perspec
在这个具有不同视角的立方体示例中: http://codepen.io/HugoGiraudel/pen/GLbca 右边的有 -webkit-perspective: 250px; 而左边的有 -w
|-- Car |-- Green | |-- Audi | |--
我无法理解 glm::perspective。我知道它的作用,但不明白它的机制。有谁知道源代码/程序是什么? 最佳答案 全部开源,看the code : template GLM_FUNC_QUAL
如果我有 div 包装器,它就可以工作: .body { perspective: 1px; width: 100%; height: 100vh; overflow-x: hidde
我正在尝试制作具有正面文本和背面文本的卡片翻转动画。但是,我一直坚持让背景文字出现。 这是 CSS: body{ font-family: Arial; font-size: 40px;
TL;DR: 是否可以为直接通过 transform: perspective( ),而不是通过 perspective: 从父级继承它? 您可以在 http://jsbin.com/fevik/2/
我在 body 上设置了 perspective-origin: 50% 50% 并且沿 Z 轴移动的所有元素都以相对于文档高度的透视图显示。我想将透视原点设置到我的浏览器窗口的中间,以便在我垂直或水
HTML: CSS: div { width: 50px; height: 50px; background: red; border: 10px solid yel
我正在阅读 CSS 的第 8 章:权威指南,第 4 版。书中有这样一段话: div#inner { transform: perspective(750px) translateZ(60px) r
我正在尝试为主屏幕上的图像(飞机飞行)制作动画,并想让它看起来好像飞机从远处开始,随着时间的推移越来越近。 我将两张图像叠加在一起以创建 3D 效果,并且能够成功地为“天空”背景制作动画,使其看起来就
透视动画 我正在玩弄 css perspective() 动画。但是,在 Chrome 和 Opera 中对其进行测试时,我遇到了一些奇怪的行为。 Chrome 和 Opera 在 动画 上反复快速悬
我正在制作一个简单的示例来演示 CSS3 Perspective 属性添加 3D 侧翻效果。但是下面的简单例子,无法完成! .div1{height:300px;width:300px;
我找不到答案的“简单”问题 -- -webkit-perspective 实际上在数学上做了什么? (我知道它的效果,它基本上就像一个焦距控制)例如-webkit-perspective: 500 是
结构CATransform3D的m34是什么意思,我只知道可以改变视角,但是-0.001和0.001的值是什么意思呢? 最佳答案 以下是一些我认为读者在回答问题之前应该了解的主题的背景知识: iOS
我很难理解 Gradle 的 Groovy DSL 是如何工作的。 不幸的是,Gradle 是我在日常工作中遇到的 Groovy 的主要用例,而且我注意到对于许多开发人员来说,他们完全通过 Gradl
我有一个场景有两个摄像头,一个是正交的,另一个是透视的,当正交相机处于事件状态时,一切看起来都很正常,但透视相机显示场景 X 轴倒置,有什么办法可以解决它?我的两个摄像头正常添加到场景中: camer
我是一名优秀的程序员,十分优秀!