diff --git a/Balance/Distraction/Games/GamesView.swift b/Balance/Distraction/Games/GamesView.swift index 23e2f00..7de01eb 100644 --- a/Balance/Distraction/Games/GamesView.swift +++ b/Balance/Distraction/Games/GamesView.swift @@ -17,6 +17,15 @@ struct GamesView: View { VStack(spacing: 20) { sudokuGame crossoverGame + solitaireGame + mahjongGame + twocerofoureightGame + bouncingGame + dailyWordGame + simonGame + colorsGame + bejeweledGame + tetrisGame } .padding(10) .ignoresSafeArea(.all) @@ -38,6 +47,132 @@ struct GamesView: View { GamesCellView(image: "notesIcon", text: "Random Notes") } } + + var bejeweledGame: some View { + NavigationLink( + destination: ActivityLogBaseView( + viewName: "Bejeweled Game", + isDirectChildToContainer: true, + content: { + GamesWebView(gameLink: "https://www.bubbleshooter.net/game/bejeweled/", titleGame: "Bejeweled") + } + ) + ) { + GamesCellView(image: "bejeweledIcon", text: "Bejeweled") + } + } + + var tetrisGame: some View { + NavigationLink( + destination: ActivityLogBaseView( + viewName: "Tetris Game", + isDirectChildToContainer: true, + content: { + GamesWebView(gameLink: "https://www.lumpty.com/amusements/Games/Tetris/tetris.html", titleGame: "Tetris") + } + ) + ) { + GamesCellView(image: "tetrisIcon", text: "Tetris") + } + } + + var colorsGame: some View { + NavigationLink( + destination: ActivityLogBaseView( + viewName: "4Colors Game", + isDirectChildToContainer: true, + content: { + GamesWebView(gameLink: "https://freegames.org/4-colors/", titleGame: "4 Colors") + } + ) + ) { + GamesCellView(image: "colorsIcon", text: "4 Colors") + } + } + + var simonGame: some View { + NavigationLink( + destination: ActivityLogBaseView( + viewName: "Simon Says Game", + isDirectChildToContainer: true, + content: { + GamesWebView(gameLink: "https://freegames.org/simon-says/", titleGame: "Simon Says") + } + ) + ) { + GamesCellView(image: "simonIcon", text: "Simon Says") + } + } + + var dailyWordGame: some View { + NavigationLink( + destination: ActivityLogBaseView( + viewName: "Daily Word Game", + isDirectChildToContainer: true, + content: { + GamesWebView(gameLink: "https://freegames.org/daily-word-search/", titleGame: "Daily Word") + } + ) + ) { + GamesCellView(image: "wordIcon", text: "Daily Word") + } + } + + var bouncingGame: some View { + NavigationLink( + destination: ActivityLogBaseView( + viewName: "Bouncing Ball Game", + isDirectChildToContainer: true, + content: { + GamesWebView(gameLink: "https://freegames.org/bouncing-balls/", titleGame: "Bouncing Ball") + } + ) + ) { + GamesCellView(image: "bouncingIcon", text: "Bouncing") + } + } + + var twocerofoureightGame: some View { + NavigationLink( + destination: ActivityLogBaseView( + viewName: "2048 Game", + isDirectChildToContainer: true, + content: { + GamesWebView(gameLink: "https://play2048.co/", titleGame: "2048") + } + ) + ) { + GamesCellView(image: "2048Icon", text: "2048") + } + } + + var mahjongGame: some View { + NavigationLink( + destination: ActivityLogBaseView( + viewName: "Mahjong Game", + isDirectChildToContainer: true, + content: { + GamesWebView(gameLink: "https://freegames.org/mahjong/", titleGame: "Mahjong") + } + ) + ) { + GamesCellView(image: "mahjongIcon", text: "Mahjong") + } + } + + var solitaireGame: some View { + NavigationLink( + destination: ActivityLogBaseView( + viewName: "Solitaire Game", + isDirectChildToContainer: true, + content: { + GamesWebView(gameLink: "https://freegames.org/solitaire/", titleGame: "Solitaire") + } + ) + ) { + GamesCellView(image: "solitarioIcon", text: "Solitaire") + } + } var crossoverGame: some View { NavigationLink( diff --git a/Balance/Distraction/Games/GamesWebView.swift b/Balance/Distraction/Games/GamesWebView.swift index bc887e6..df37e38 100644 --- a/Balance/Distraction/Games/GamesWebView.swift +++ b/Balance/Distraction/Games/GamesWebView.swift @@ -13,16 +13,19 @@ struct GamesWebView: View { var titleGame: String var body: some View { - HeaderMenu(title: titleGame) - WebView(webView: webViewStore.webView) - .edgesIgnoringSafeArea(.bottom) - .onAppear { - guard let sudokuLink = URL(string: gameLink) else { - return + VStack(spacing: 0) { + HeaderMenu(title: titleGame) + WebView(webView: webViewStore.webView) + .edgesIgnoringSafeArea(.bottom) + .offset(x: 0, y: -22) + .onAppear { + guard let sudokuLink = URL(string: gameLink) else { + return + } + self.webViewStore.webView.load(URLRequest(url: sudokuLink)) } - self.webViewStore.webView.load(URLRequest(url: sudokuLink)) - } - .background(backgroundColor) + .background(backgroundColor) + } } init(gameLink: String, titleGame: String) { diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/2048Icon.imageset/2048Icon.png b/Balance/Supporting Files/Assets.xcassets/GAMES/2048Icon.imageset/2048Icon.png new file mode 100644 index 0000000..1fe52c5 Binary files /dev/null and b/Balance/Supporting Files/Assets.xcassets/GAMES/2048Icon.imageset/2048Icon.png differ diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/2048Icon.imageset/Contents.json b/Balance/Supporting Files/Assets.xcassets/GAMES/2048Icon.imageset/Contents.json new file mode 100644 index 0000000..8780288 --- /dev/null +++ b/Balance/Supporting Files/Assets.xcassets/GAMES/2048Icon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "2048Icon.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/Contents.json b/Balance/Supporting Files/Assets.xcassets/GAMES/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Balance/Supporting Files/Assets.xcassets/GAMES/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/bejeweledIcon.imageset/Contents.json b/Balance/Supporting Files/Assets.xcassets/GAMES/bejeweledIcon.imageset/Contents.json new file mode 100644 index 0000000..57ad393 --- /dev/null +++ b/Balance/Supporting Files/Assets.xcassets/GAMES/bejeweledIcon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "bejeweledIcon.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/bejeweledIcon.imageset/bejeweledIcon.jpg b/Balance/Supporting Files/Assets.xcassets/GAMES/bejeweledIcon.imageset/bejeweledIcon.jpg new file mode 100644 index 0000000..90eddb9 Binary files /dev/null and b/Balance/Supporting Files/Assets.xcassets/GAMES/bejeweledIcon.imageset/bejeweledIcon.jpg differ diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/bouncingIcon.imageset/Contents.json b/Balance/Supporting Files/Assets.xcassets/GAMES/bouncingIcon.imageset/Contents.json new file mode 100644 index 0000000..31976d0 --- /dev/null +++ b/Balance/Supporting Files/Assets.xcassets/GAMES/bouncingIcon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "bouncingIcon.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/bouncingIcon.imageset/bouncingIcon.jpg b/Balance/Supporting Files/Assets.xcassets/GAMES/bouncingIcon.imageset/bouncingIcon.jpg new file mode 100644 index 0000000..b438514 Binary files /dev/null and b/Balance/Supporting Files/Assets.xcassets/GAMES/bouncingIcon.imageset/bouncingIcon.jpg differ diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/colorsIcon.imageset/Contents.json b/Balance/Supporting Files/Assets.xcassets/GAMES/colorsIcon.imageset/Contents.json new file mode 100644 index 0000000..aadf336 --- /dev/null +++ b/Balance/Supporting Files/Assets.xcassets/GAMES/colorsIcon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "colorsIcon.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/colorsIcon.imageset/colorsIcon.jpg b/Balance/Supporting Files/Assets.xcassets/GAMES/colorsIcon.imageset/colorsIcon.jpg new file mode 100644 index 0000000..d921866 Binary files /dev/null and b/Balance/Supporting Files/Assets.xcassets/GAMES/colorsIcon.imageset/colorsIcon.jpg differ diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/mahjongIcon.imageset/Contents.json b/Balance/Supporting Files/Assets.xcassets/GAMES/mahjongIcon.imageset/Contents.json new file mode 100644 index 0000000..c94e9df --- /dev/null +++ b/Balance/Supporting Files/Assets.xcassets/GAMES/mahjongIcon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "mahjongIcon.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/mahjongIcon.imageset/mahjongIcon.jpg b/Balance/Supporting Files/Assets.xcassets/GAMES/mahjongIcon.imageset/mahjongIcon.jpg new file mode 100644 index 0000000..c56c9a8 Binary files /dev/null and b/Balance/Supporting Files/Assets.xcassets/GAMES/mahjongIcon.imageset/mahjongIcon.jpg differ diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/simonIcon.imageset/Contents.json b/Balance/Supporting Files/Assets.xcassets/GAMES/simonIcon.imageset/Contents.json new file mode 100644 index 0000000..1d6d281 --- /dev/null +++ b/Balance/Supporting Files/Assets.xcassets/GAMES/simonIcon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "simonIcon.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/simonIcon.imageset/simonIcon.jpg b/Balance/Supporting Files/Assets.xcassets/GAMES/simonIcon.imageset/simonIcon.jpg new file mode 100644 index 0000000..e3173d3 Binary files /dev/null and b/Balance/Supporting Files/Assets.xcassets/GAMES/simonIcon.imageset/simonIcon.jpg differ diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/solitarioIcon.imageset/Contents.json b/Balance/Supporting Files/Assets.xcassets/GAMES/solitarioIcon.imageset/Contents.json new file mode 100644 index 0000000..dcda3b7 --- /dev/null +++ b/Balance/Supporting Files/Assets.xcassets/GAMES/solitarioIcon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "solitarioIcon.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/solitarioIcon.imageset/solitarioIcon.jpg b/Balance/Supporting Files/Assets.xcassets/GAMES/solitarioIcon.imageset/solitarioIcon.jpg new file mode 100644 index 0000000..a2d5d7d Binary files /dev/null and b/Balance/Supporting Files/Assets.xcassets/GAMES/solitarioIcon.imageset/solitarioIcon.jpg differ diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/tetrisIcon.imageset/Contents.json b/Balance/Supporting Files/Assets.xcassets/GAMES/tetrisIcon.imageset/Contents.json new file mode 100644 index 0000000..48488aa --- /dev/null +++ b/Balance/Supporting Files/Assets.xcassets/GAMES/tetrisIcon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "tetrisIcon.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/tetrisIcon.imageset/tetrisIcon.jpg b/Balance/Supporting Files/Assets.xcassets/GAMES/tetrisIcon.imageset/tetrisIcon.jpg new file mode 100644 index 0000000..4a827a6 Binary files /dev/null and b/Balance/Supporting Files/Assets.xcassets/GAMES/tetrisIcon.imageset/tetrisIcon.jpg differ diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/wordIcon.imageset/Contents.json b/Balance/Supporting Files/Assets.xcassets/GAMES/wordIcon.imageset/Contents.json new file mode 100644 index 0000000..e616a5c --- /dev/null +++ b/Balance/Supporting Files/Assets.xcassets/GAMES/wordIcon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "wordIcon.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Balance/Supporting Files/Assets.xcassets/GAMES/wordIcon.imageset/wordIcon.jpg b/Balance/Supporting Files/Assets.xcassets/GAMES/wordIcon.imageset/wordIcon.jpg new file mode 100644 index 0000000..8c1ee54 Binary files /dev/null and b/Balance/Supporting Files/Assets.xcassets/GAMES/wordIcon.imageset/wordIcon.jpg differ