mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-28 23:54:32 +00:00
Restored files from old Mac, force pushing
This commit is contained in:
parent
5dd95228b8
commit
5040381840
126 changed files with 10431 additions and 67 deletions
80
DynamicIsland/components/Onboarding/ActivationView.swift
Normal file
80
DynamicIsland/components/Onboarding/ActivationView.swift
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
//
|
||||
// OnboardingSettings.swift
|
||||
// boringNotch
|
||||
//
|
||||
// Created by Richard Kunkli on 2024. 09. 26..
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ActivationWindow: View {
|
||||
@State private var email: String = ""
|
||||
@State private var key: String = ""
|
||||
var body: some View {
|
||||
VStack {
|
||||
Image("logo")
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(height: 80)
|
||||
.padding(.top, 30)
|
||||
.padding(.bottom, 10)
|
||||
Text("Activate your license")
|
||||
.font(.largeTitle.bold())
|
||||
.fontDesign(.rounded)
|
||||
Text("Transform your notch truly yours")
|
||||
.foregroundStyle(.secondary)
|
||||
.font(.title2)
|
||||
.padding(.bottom, 20)
|
||||
Group {
|
||||
TextField("Email address", text: $email)
|
||||
.padding(.horizontal, 8)
|
||||
.padding(.vertical, 4)
|
||||
.background(.white.opacity(0.1), in: RoundedRectangle(cornerRadius: 8))
|
||||
TextField("License key", text: $key)
|
||||
.padding(.horizontal, 8)
|
||||
.padding(.vertical, 4)
|
||||
.background(.white.opacity(0.1), in: RoundedRectangle(cornerRadius: 8))
|
||||
}
|
||||
.textFieldStyle(PlainTextFieldStyle())
|
||||
.scrollContentBackground(.hidden)
|
||||
.toggleStyle(.switch)
|
||||
Spacer()
|
||||
VStack(alignment: .center, spacing: 14) {
|
||||
HStack(alignment: .center) {
|
||||
HStack {
|
||||
Button {} label: {
|
||||
Text("Cancel")
|
||||
.padding(.horizontal, 18)
|
||||
}
|
||||
.buttonStyle(AccessoryBarButtonStyle())
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
Image("dynamicisland")
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(height: 18)
|
||||
.offset(y: 4)
|
||||
.blendMode(.overlay)
|
||||
HStack {
|
||||
Button {} label: {
|
||||
Text("Activate")
|
||||
.padding(.horizontal, 18)
|
||||
}
|
||||
.buttonStyle(BorderedProminentButtonStyle())
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .trailing)
|
||||
|
||||
}
|
||||
.controlSize(.extraLarge)
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
|
||||
.ignoresSafeArea()
|
||||
.background {
|
||||
VisualEffectView(material: .hudWindow, blendingMode: .behindWindow)
|
||||
.ignoresSafeArea()
|
||||
}
|
||||
.frame(width: 350, height: 350)
|
||||
}
|
||||
}
|
||||
105
DynamicIsland/components/Onboarding/ProOnboarding.swift
Normal file
105
DynamicIsland/components/Onboarding/ProOnboarding.swift
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
//
|
||||
// ProOnboarding.swift
|
||||
// boringNotch
|
||||
//
|
||||
// Created by Richard Kunkli on 2024. 09. 26..
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import SwiftUIIntrospect
|
||||
|
||||
struct ProOnboard: View {
|
||||
var body: some View {
|
||||
ZStack(alignment: .top) {
|
||||
ZStack {
|
||||
Image("spotlight")
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.padding(.bottom)
|
||||
.blur(radius: 3)
|
||||
.offset(y: -5)
|
||||
.background(SparkleView().opacity(0.6))
|
||||
VStack(spacing: 8) {
|
||||
Image("logo")
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: 100, height: 100)
|
||||
.padding(.bottom, 8)
|
||||
Text("TheDynamicIsland")
|
||||
.font(.system(.largeTitle, design: .serif))
|
||||
Text("Welcome")
|
||||
.font(.title)
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(.bottom, 30)
|
||||
if false {
|
||||
Text("PRO")
|
||||
.font(.system(size: 18, design: .rounded))
|
||||
.fontWeight(.bold)
|
||||
.foregroundStyle(.white)
|
||||
.padding(.horizontal, 12)
|
||||
.padding(.vertical, 3)
|
||||
.background(
|
||||
Capsule()
|
||||
.fill(LinearGradient(colors: [.white.opacity(0.7), .white.opacity(0.3)], startPoint: .topLeading, endPoint: .bottomTrailing))
|
||||
.strokeBorder(LinearGradient(stops: [.init(color: .white.opacity(0.7), location: 0.3), .init(color: .clear, location: 0.6)], startPoint: .topLeading, endPoint: .bottomTrailing))
|
||||
.blendMode(.overlay)
|
||||
)
|
||||
.padding(.bottom, 30)
|
||||
}
|
||||
Button {
|
||||
if let url = URL(string: "https://buymeacoffee.com/jfxh67wvfxq") {
|
||||
NSWorkspace.shared.open(url)
|
||||
}
|
||||
} label: {
|
||||
Label("Buy us a coffee", systemImage: "cup.and.saucer.fill")
|
||||
.font(.headline)
|
||||
.foregroundColor(Color.black)
|
||||
.padding(.horizontal, 20)
|
||||
.padding(.vertical, 10)
|
||||
.background(Color.yellow)
|
||||
.cornerRadius(8)
|
||||
}
|
||||
.buttonStyle(PlainButtonStyle())
|
||||
.padding(.bottom, 20)
|
||||
|
||||
Button {
|
||||
NSApp.keyWindow?.close()
|
||||
} label: {
|
||||
Text("Get started")
|
||||
.padding(.horizontal, 20)
|
||||
.padding(.vertical, 6)
|
||||
}
|
||||
.buttonStyle(BorderedProminentButtonStyle())
|
||||
}
|
||||
.padding(.top)
|
||||
}
|
||||
|
||||
Image("dynamicisland")
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(height: 22)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .bottom)
|
||||
.padding()
|
||||
.padding(.bottom, 36)
|
||||
.blendMode(.overlay)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
|
||||
.ignoresSafeArea()
|
||||
.background {
|
||||
VisualEffectView(material: .hudWindow, blendingMode: .behindWindow)
|
||||
.ignoresSafeArea()
|
||||
}
|
||||
.onAppear {
|
||||
NSApp.mainWindow?.standardWindowButton(.zoomButton)?.isHidden = true
|
||||
NSApp.mainWindow?.standardWindowButton(.closeButton)?.isHidden = true
|
||||
NSApp.mainWindow?.standardWindowButton(.miniaturizeButton)?.isHidden = true
|
||||
NSApp.mainWindow?.styleMask.remove(.resizable)
|
||||
}
|
||||
.frame(width: 350, height: 500)
|
||||
.introspect(.window, on: .macOS(.v14, .v15)) { window in
|
||||
window.titlebarAppearsTransparent = true
|
||||
window.titleVisibility = .hidden
|
||||
window.center()
|
||||
}
|
||||
}
|
||||
}
|
||||
76
DynamicIsland/components/Onboarding/SparkleView.swift
Normal file
76
DynamicIsland/components/Onboarding/SparkleView.swift
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
//
|
||||
// SparkleView.swift
|
||||
// boringNotch
|
||||
//
|
||||
// Created by Richard Kunkli on 2024. 09. 26..
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import AppKit
|
||||
|
||||
class SparkleNSView: NSView {
|
||||
private var emitterLayer: CAEmitterLayer?
|
||||
|
||||
override init(frame frameRect: NSRect) {
|
||||
super.init(frame: frameRect)
|
||||
self.wantsLayer = true
|
||||
setupEmitterLayer()
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
private func setupEmitterLayer() {
|
||||
let emitterLayer = CAEmitterLayer()
|
||||
emitterLayer.emitterShape = .rectangle
|
||||
emitterLayer.emitterMode = .surface
|
||||
emitterLayer.renderMode = .oldestFirst
|
||||
|
||||
let cell = CAEmitterCell()
|
||||
cell.contents = NSImage(named: "sparkle")?.cgImage(forProposedRect: nil, context: nil, hints: nil)
|
||||
cell.birthRate = 50
|
||||
cell.lifetime = 5
|
||||
cell.velocity = 10
|
||||
cell.velocityRange = 5
|
||||
cell.emissionRange = .pi * 2
|
||||
cell.scale = 0.2
|
||||
cell.scaleRange = 0.1
|
||||
cell.alphaSpeed = -0.5
|
||||
cell.yAcceleration = 10 // Add a slight downward motion
|
||||
|
||||
emitterLayer.emitterCells = [cell]
|
||||
|
||||
self.layer?.addSublayer(emitterLayer)
|
||||
self.emitterLayer = emitterLayer
|
||||
|
||||
updateEmitterForCurrentBounds()
|
||||
}
|
||||
|
||||
private func updateEmitterForCurrentBounds() {
|
||||
guard let emitterLayer = self.emitterLayer else { return }
|
||||
|
||||
emitterLayer.frame = self.bounds
|
||||
emitterLayer.emitterSize = self.bounds.size
|
||||
emitterLayer.emitterPosition = CGPoint(x: bounds.width / 2, y: bounds.height / 2)
|
||||
|
||||
// Adjust birth rate based on view size
|
||||
let area = bounds.width * bounds.height
|
||||
let baseBirthRate: Float = 50
|
||||
let adjustedBirthRate = 20 // Assuming 200x200 as base size
|
||||
emitterLayer.emitterCells?.first?.birthRate = Float(adjustedBirthRate)
|
||||
}
|
||||
|
||||
override func setFrameSize(_ newSize: NSSize) {
|
||||
super.setFrameSize(newSize)
|
||||
updateEmitterForCurrentBounds()
|
||||
}
|
||||
}
|
||||
|
||||
struct SparkleView: NSViewRepresentable {
|
||||
func makeNSView(context: Context) -> SparkleNSView {
|
||||
return SparkleNSView()
|
||||
}
|
||||
|
||||
func updateNSView(_ nsView: SparkleNSView, context: Context) {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue