|
| 1 | +// |
| 2 | +// AppIcon.swift |
| 3 | +// GitDiffExample |
| 4 | +// |
| 5 | +// Created by Tornike Gomareli on 18.06.25. |
| 6 | +// |
| 7 | + |
| 8 | +import SwiftUI |
| 9 | + |
| 10 | +struct AppIconView: View { |
| 11 | + var body: some View { |
| 12 | + ZStack { |
| 13 | + LinearGradient( |
| 14 | + colors: [.blue, .purple], |
| 15 | + startPoint: .topLeading, |
| 16 | + endPoint: .bottomTrailing |
| 17 | + ) |
| 18 | + |
| 19 | + VStack(spacing: 8) { |
| 20 | + HStack(spacing: 4) { |
| 21 | + Rectangle() |
| 22 | + .fill(Color.green.opacity(0.8)) |
| 23 | + .frame(width: 30, height: 8) |
| 24 | + Rectangle() |
| 25 | + .fill(Color.white.opacity(0.3)) |
| 26 | + .frame(width: 50, height: 8) |
| 27 | + } |
| 28 | + |
| 29 | + HStack(spacing: 4) { |
| 30 | + Rectangle() |
| 31 | + .fill(Color.white.opacity(0.3)) |
| 32 | + .frame(width: 40, height: 8) |
| 33 | + Rectangle() |
| 34 | + .fill(Color.red.opacity(0.8)) |
| 35 | + .frame(width: 35, height: 8) |
| 36 | + } |
| 37 | + |
| 38 | + HStack(spacing: 4) { |
| 39 | + Rectangle() |
| 40 | + .fill(Color.green.opacity(0.8)) |
| 41 | + .frame(width: 45, height: 8) |
| 42 | + Rectangle() |
| 43 | + .fill(Color.white.opacity(0.3)) |
| 44 | + .frame(width: 25, height: 8) |
| 45 | + } |
| 46 | + } |
| 47 | + .rotationEffect(.degrees(-10)) |
| 48 | + } |
| 49 | + .frame(width: 120, height: 120) |
| 50 | + .cornerRadius(26) |
| 51 | + } |
| 52 | +} |
| 53 | + |
| 54 | +struct LaunchScreenView: View { |
| 55 | + @State private var animationAmount = 1.0 |
| 56 | + |
| 57 | + var body: some View { |
| 58 | + ZStack { |
| 59 | + LinearGradient( |
| 60 | + colors: [.blue.opacity(0.3), .purple.opacity(0.3)], |
| 61 | + startPoint: .topLeading, |
| 62 | + endPoint: .bottomTrailing |
| 63 | + ) |
| 64 | + .ignoresSafeArea() |
| 65 | + |
| 66 | + VStack(spacing: 20) { |
| 67 | + AppIconView() |
| 68 | + .scaleEffect(animationAmount) |
| 69 | + .animation( |
| 70 | + Animation.easeInOut(duration: 1.0) |
| 71 | + .repeatForever(autoreverses: true), |
| 72 | + value: animationAmount |
| 73 | + ) |
| 74 | + |
| 75 | + Text("GitDiff") |
| 76 | + .font(.system(size: 40, weight: .bold, design: .rounded)) |
| 77 | + .foregroundColor(.primary) |
| 78 | + |
| 79 | + Text("Beautiful Diff Rendering") |
| 80 | + .font(.headline) |
| 81 | + .foregroundColor(.secondary) |
| 82 | + } |
| 83 | + } |
| 84 | + .onAppear { |
| 85 | + animationAmount = 1.1 |
| 86 | + } |
| 87 | + } |
| 88 | +} |
| 89 | + |
| 90 | +#Preview("App Icon") { |
| 91 | + AppIconView() |
| 92 | +} |
| 93 | + |
| 94 | +#Preview("Launch Screen") { |
| 95 | + LaunchScreenView() |
| 96 | +} |
0 commit comments