Skip to content

Commit

Permalink
Feature/bal 185 gp new games (#186)
Browse files Browse the repository at this point in the history
Co-authored-by: Gonzalo Perisset <>
Co-authored-by: gperisset <[email protected]>

- New Games Added
  • Loading branch information
gperissetcelteeka authored Nov 8, 2023
1 parent f4d6657 commit aa396f4
Show file tree
Hide file tree
Showing 21 changed files with 342 additions and 9 deletions.
135 changes: 135 additions & 0 deletions Balance/Distraction/Games/GamesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand 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(
Expand Down
21 changes: 12 additions & 9 deletions Balance/Distraction/Games/GamesWebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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
}
}
6 changes: 6 additions & 0 deletions Balance/Supporting Files/Assets.xcassets/GAMES/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit aa396f4

Please sign in to comment.