-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from dscyrescotti/develop
Develop
- Loading branch information
Showing
1,701 changed files
with
3,632 additions
and
868 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import SwiftUI | ||
|
||
struct LandmarkCard: View { | ||
let landmark: Landmark | ||
|
||
var body: some View { | ||
ZStack(alignment: .bottomLeading) { | ||
Image(landmark.image) | ||
.resizable() | ||
LinearGradient( | ||
colors: [ | ||
.clear, | ||
.clear, | ||
.black.opacity(0.7) | ||
], | ||
startPoint: .top, | ||
endPoint: .bottom | ||
) | ||
VStack(alignment: .leading) { | ||
Text(landmark.name) | ||
.font(.title.bold()) | ||
Text(landmark.location) | ||
.font(.title3.bold()) | ||
} | ||
.foregroundColor(.white) | ||
.padding() | ||
} | ||
.frame(width: 300, height: 400) | ||
.cornerRadius(20) | ||
.shadow(radius: 10) | ||
} | ||
} | ||
|
||
struct LandmarkCard_Previews: PreviewProvider { | ||
static var previews: some View { | ||
LandmarkCard( | ||
landmark: Landmark( | ||
id: "shwedagon_pagoda", | ||
image: "shwedagon_pagoda", | ||
name: "Shwedagon Pagoda", | ||
location: "Yangon, Myanmar", | ||
lat: 0, | ||
long: 0, | ||
background: "" | ||
) | ||
) | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
Demo/Demo/Demos/ShuffleDeck/Scenes/ShuffleDeckDemoView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import SwiftUI | ||
import Combine | ||
import ShuffleIt | ||
import MapKit | ||
|
||
struct ShuffleDeckDemoView: View { | ||
@Environment(\.dismiss) var dismiss | ||
@State private var landmark: Landmark? | ||
|
||
let landmarks: [Landmark] = .landmarks() | ||
|
||
var body: some View { | ||
VStack(alignment: .leading, spacing: 0) { | ||
VStack(alignment: .leading) { | ||
Text("Captivating Landmarks") | ||
.font(.title.bold()) | ||
Text("For Your Next Adventure") | ||
.font(.title2.bold()) | ||
} | ||
.padding() | ||
Spacer() | ||
ShuffleDeck( | ||
landmarks, | ||
initialIndex: 0 | ||
) { landmark in | ||
LandmarkCard(landmark: landmark) | ||
} | ||
.shuffleDeckAnimation(.easeInOut) | ||
.shuffleDeckScale(0.5) | ||
.onShuffleDeck { context in | ||
landmark = landmarks[context.index] | ||
} | ||
.padding(.vertical) | ||
Spacer() | ||
Spacer() | ||
} | ||
.overlay(alignment: .topTrailing) { | ||
Button(action: { | ||
dismiss() | ||
}) { | ||
Image(systemName: "xmark.circle.fill") | ||
.font(.largeTitle) | ||
.foregroundStyle(.white) | ||
.background { | ||
Circle() | ||
.foregroundColor(.black.opacity(0.4)) | ||
.padding(4) | ||
} | ||
} | ||
.buttonStyle(.plain) | ||
.padding([.top, .horizontal]) | ||
} | ||
.background { | ||
if let landmark = landmark { | ||
GeometryReader { proxy in | ||
ZStack { | ||
Circle() | ||
.scale(1.1, anchor: .bottomTrailing) | ||
.position(x: proxy.size.width, y: proxy.size.height / 2.5) | ||
.foregroundColor(Color(hex: landmark.background).opacity(0.3)) | ||
Circle() | ||
.scale(0.7, anchor: .bottomTrailing) | ||
.position(x: 0, y: proxy.size.height / 1.5) | ||
.foregroundColor(Color(hex: landmark.background).opacity(0.2)) | ||
} | ||
.blur(radius: 40) | ||
.background(.white) | ||
.ignoresSafeArea() | ||
} | ||
} | ||
} | ||
.onAppear { | ||
landmark = landmarks.first | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import MapKit | ||
import Foundation | ||
|
||
struct Landmark: Decodable, Identifiable { | ||
let id: String | ||
let image: String | ||
let name: String | ||
let location: String | ||
let lat: Double | ||
let long: Double | ||
let background: String | ||
|
||
var coordinate: CLLocationCoordinate2D { | ||
CLLocationCoordinate2D(latitude: lat, longitude: long) | ||
} | ||
} | ||
|
||
extension Array where Element == Landmark { | ||
static func landmarks() -> Self { | ||
guard let path = Bundle.main.url(forResource: "Landmarks", withExtension: "json"), let data = try? Data(contentsOf: path), let landmarks = try? JSONDecoder().decode([Landmark].self, from: data) else { return [] } | ||
return landmarks | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Demo/Demo/Resources/Assets.xcassets/landmarks/christ_the_redeemer.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "christ_the_redeemer.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "original" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
.../Assets.xcassets/landmarks/christ_the_redeemer.imageset/christ_the_redeemer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions
15
Demo/Demo/Resources/Assets.xcassets/landmarks/eiffel_tower.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "eiffel_tower.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "original" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...Demo/Resources/Assets.xcassets/landmarks/eiffel_tower.imageset/eiffel_tower.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions
15
Demo/Demo/Resources/Assets.xcassets/landmarks/great_wall_of_china.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "great_wall_of_china.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "original" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
.../Assets.xcassets/landmarks/great_wall_of_china.imageset/great_wall_of_china.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions
15
Demo/Demo/Resources/Assets.xcassets/landmarks/merlion_statue.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "merlion_statue.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "original" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
.../Resources/Assets.xcassets/landmarks/merlion_statue.imageset/merlion_statue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions
15
Demo/Demo/Resources/Assets.xcassets/landmarks/niagara_falls.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "niagara_falls.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "original" | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...mo/Resources/Assets.xcassets/landmarks/niagara_falls.imageset/niagara_falls.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions
15
Demo/Demo/Resources/Assets.xcassets/landmarks/petronas_towers.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "petronas_towers.svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "original" | ||
} | ||
} |
Oops, something went wrong.