Giter Club home page Giter Club logo

Comments (3)

joogps avatar joogps commented on July 17, 2024 1

also, this is such a great use of this effect. are you using it to make app previews?

from glur.

mpdifran avatar mpdifran commented on July 17, 2024 1

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.

joogps avatar joogps commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.