Comments (3)
also, this is such a great use of this effect. are you using it to make app previews?
from glur.
Yeah that's the plan! I saw Glur, and I was like, this is such a cool effect to have in app screenshots, I have it integrate it haha.
Let me take a look at what is included in the item I'm blurring. Without revealing too much about the code I'm using to create the device frame, I'm using the following modifiers before applying the Glur effect:
.opacity
Group
to handle if conditions on modifiers
.shadow
.overlay
.blendMode
.onDrop
.simultaneousGesture
.onTapGesture
.scaleEffect
I'm drawing the device at full size (somewhere around 1242 x 2688), then using scaleEffect to scale it down in the app, before applying Glur. I was having trouble getting Glur to work before the scale effect, but moving it to after seemed to help. I still have problems for certain large devices even after the scale, like iPads.
Here's my View extension that leverages Group
:
public extension View {
func `if`<Content: View>(_ condition: Bool, content: (Self) -> Content) -> some View {
Group {
if condition {
content(self)
} else {
self
}
}
}
}
from glur.
hey!
I think I know what this is. when SwiftUI isn't able to rasterize a view (such as through .drawingGroup) it displays a red prohibited icon over a yellow background.
this might be what's happening here, as your background view might not work with .drawingGroup on Mac specifically... is it just a gradient or is there something else?
from glur.
Related Issues (9)
- LayerEffect doesn't work when applied to a ScrollView HOT 7
- Blur Easing HOT 1
- Blur relates from frame modifier. Some values cause entire view to disappear HOT 3
- Support for projects with minimum deployment target less that iOS 17. HOT 2
- Improve edge handling HOT 1
- Drop/use compatibility mode for watchOS targets HOT 1
- RTL support
- Glur can affect hittesting between independent views HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glur.