我试图在进入视口时运行过渡。我希望卡片只是不透明...我的 div 中有一个代理元素,并应用背景过滤器来应用“磨砂玻璃”外观。当父级发生任何类型的不透明度更改时,过滤器根本不会应用并导致笨重的动画。这是上下文的 CSS:
.card {
width: 100%;
position: relative;
min-height: 320px;
border-radius: 12px;
overflow: hidden;
padding: 32px 24px;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
text-align: center;
display: flex;
align-items: center;
justify-content: center;
max-width: 45rem;
margin: 8px 0;
transition: all 0.4s ease;
.backdrop {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
border-radius: 12px;
backdrop-filter: blur(32px) brightness(115%);
background-color: rgba(255, 255, 255, 0.16);
}
}
Run Code Online (Sandbox Code Playgroud)
我也尝试过对孩子应用过渡,还尝试将以下内容应用于父母和背景:
-webkit-backface-visibility: hidden;
-webkit-transform: translate3d(0, 0, 0);
-webkit-perspective: 1000;
Run Code Online (Sandbox Code Playgroud) 我正在尝试构建我的 gatsby 项目,但由于 IntersectionObserver 未被识别,我无法构建。我在 InView 组件中使用了intersectionObserver:
import React, { useRef, useState, useEffect } from 'react'
const InView = ({ children }) => {
const [boundingClientY, setBoundingClientY] = useState(null)
const [direction, setDirection] = useState(null)
const [element, setElement] = useState(null)
const [inView, setInView] = useState(false)
const observer = useRef(new IntersectionObserver((entries) => {
const first = entries[0]
const { boundingClientRect } = first
first.isIntersecting && setInView(true)
!first.isIntersecting && setInView(false)
boundingClientRect.y > boundingClientY && setDirection('down')
boundingClientRect.y < boundingClientY && setDirection('up')
boundingClientY && setBoundingClientY(first.boundingClientRect.y) …Run Code Online (Sandbox Code Playgroud) 我正在创建一个图像滚动组件,例如 Apple Airpods Pro 网站。为此,我为此组件的每次迭代使用最多 750 个。我需要将图像绘制到画布上,目前,我正在使用标准 JS - new Image() 函数来生成 HTML 图像组件以绘制到画布上。我想合并下一个/图像缓存功能以确保它尽可能快地运行。这是可以实现的吗?
我正在尝试更新我的 CMS 以启用用户定义的产品滑块。将相关架构添加到我的健全源文件(这有效)并将文档添加到架构后,gatsby 方面没有更新。
我找不到如何在任何地方更新 graphql 模式。我曾尝试删除 sanity 和 gatsby 上的缓存,构建开发版本并尝试使用它们,但没有任何效果
我创建了一个 Sanity.io CMS,在输入内容后对架构进行了一些更改。现在的问题是内容仍然保存在cms内的某个地方,我无法删除它。