GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - sparrowcode/PerspectiveKit: 3D tilt with a dynamic shadow, like widget previews in iOS. UIKit and SwiftUI.

BranchesTags
Open more actions menu

Latest commit

 

History

150 Commits
150 Commits

Folders and files

NameName
Last commit message
Last commit date
Assets/Readme
Assets/Readme
 
 
Sources/PerspectiveKit
Sources/PerspectiveKit
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
Package.swift
Package.swift
 
 
README.md
README.md
 
 

Repository files navigation

PerspectiveKit

3D tilt with a dynamic shadow, like widget previews in iOS. SwiftUI & UIKit.

Installation

In Xcode: File → Add Package Dependencies → paste URL:

https://github.com/sparrowcode/PerspectiveKit

Usage

SwiftUI

WidgetPreview()
    .perspective(.widgetAnimatable)

UIKit

// Content goes into contentView, like in UIVisualEffectView
let perspectiveView = PerspectiveView(config: .widgetAnimatable)
perspectiveView.contentView.addSubview(widgetPreview)

// A single rounded card with a background gets a cheaper shadow from its shape
widgetPreview.layer.cornerRadius = 22
widgetPreview.clipsToBounds = true

// Tilt off and on with a transition
perspectiveView.setTilted(false, animated: true)
perspectiveView.setTilted(true, animated: true)

// Start the transition later
perspectiveView.setTilted(true, animated: true, delay: 0.3)

// Appear: grayscale right away, color returns together with the tilt
perspectiveView.setTilted(true, animated: true, fromGrayscale: true, delay: 0.3)

// Without animation
perspectiveView.isTilted = false

Config

// .widgetStatic tilts without animation. Every value is configurable
var config = PerspectiveConfig.widgetAnimatable
config.angle = 14
config.corner = .topLeft
config.animation = PerspectiveAnimation(duration: 10, direction: .counterclockwise)
config.shadow?.opacity = 0.4

About

3D tilt with a dynamic shadow, like widget previews in iOS. UIKit and SwiftUI.

sparrowcode.io/frameworks

Topics

animationiosperspectiveshadowswiftswift-packageswiftuiuikitwidget

Resources

Readme
MIT license
Activity
Custom properties

Stars

344 stars

Watchers

8 watching

Forks

27 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.