Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions eye-chat/eye-chat/Navigation/RouteScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ enum RouteScreen: Hashable {
case video
case videoStream
case savedRooms
case topicsComponent
case emojiComponent
case fullKeyboard
}
5 changes: 5 additions & 0 deletions eye-chat/eye-chat/UI/Components/CreateRoomComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
import SwiftUI

struct CreateRoomComponent: View {

var anyView: AnyView {
return AnyView(self)
}

var body: some View {
Text(ContentComponent.CREATE)
.font(.custom(ContentComponent.B, size: 40))
Expand Down
5 changes: 5 additions & 0 deletions eye-chat/eye-chat/UI/Components/DeleteKeycapComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
import SwiftUI

struct DeleteKeycapComponent: View {

var anyView: AnyView {
return AnyView(self)
}

var body: some View {
Image(systemName: ContentComponent.DELETE)
.font(.system(size: 45))
Expand Down
95 changes: 72 additions & 23 deletions eye-chat/eye-chat/UI/Components/FullKeyboardComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,82 @@

import SwiftUI

struct Teste3: View {

var body: some View {
VStack {
Color(ColorAsset.LIGHT_GRAY)
}
.frame(width: 309, height: 145)
}

var anyView: AnyView {
return AnyView(self)
}
}

struct FullKeyboardComponent: View {

@EnvironmentObject var coordinator: ViewCordinator

@State var elements: [AnyView] = [
KeycapsComponent(style: .aeiou).anyView,
KeycapsComponent(style: .srndm).anyView,
KeycapsComponent(style: .tclpv).anyView,
KeycapsComponent(style: .ghqbf).anyView,
KeycapsComponent(style: .zjxkw).anyView,
KeycapsComponent(style: .others).anyView,
DeleteKeycapComponent().anyView,
SpaceKeycapComponent().anyView,
CreateRoomComponent().anyView
]

public func goBack(){
coordinator.pop()
}

public func grid0 () {
elements[0] = KeycapsComponent(style: .aeiou).anyView
}
public func grid1 () {
elements[1] = KeycapsComponent(style: .srndm).anyView
}
public func grid2 () {
elements[2] = KeycapsComponent(style: .tclpv).anyView
}
public func grid3 () {
elements[3] = KeycapsComponent(style: .ghqbf).anyView
}
public func grid4 () {
elements[4] = KeycapsComponent(style: .zjxkw).anyView
}
public func grid5 () {
elements[5] = KeycapsComponent(style: .others).anyView
}
public func grid6 () {
elements[6] = DeleteKeycapComponent().anyView
}
public func grid7 () {
elements[7] = SpaceKeycapComponent().anyView
}
public func grid8 () {
elements[8] = CreateRoomComponent().anyView
}


let chat: ChatStyle

var body: some View {
VStack (spacing: 35) {
Grid() {
GridRow {
KeycapsComponent(style: .aeiou)
KeycapsComponent(style: .srndm)
KeycapsComponent(style: .tclpv)
}
GridRow {
KeycapsComponent(style: .ghqbf)
KeycapsComponent(style: .zjxkw)
KeycapsComponent(style: .others)
}
HStack {
DeleteKeycapComponent()
SpaceKeycapComponent()
if chat == .inside {
PrintKeycapComponent()
} else {
CreateRoomComponent()
}
}
.frame(minHeight: UIScreen.screenHeight - 171.86.su)
}
VStack {
Spacer(minLength: 280)
EyeTrackingTemplate(
axisXFirstSectionTrigger: [grid0, grid1, grid2],
axisXSecondSectionTrigger: [grid3, grid4, grid5],
axisXThirdSectionTrigger: [grid6, grid7, grid8],
goBack: goBack,
style: StyleCard(spacing: 0, borderColor: .yellow),
elements: elements
)
if chat == .inside {
HStack (alignment: .center) {
Circle()
Expand All @@ -47,6 +95,7 @@ struct FullKeyboardComponent: View {
.fill(Color(ColorAsset.PET_ORANGE))
.frame(width: 14, height: 14)
}
Spacer(minLength: 250)
}
}
}
Expand Down
89 changes: 70 additions & 19 deletions eye-chat/eye-chat/UI/Components/KeyboardReactionsComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,77 @@

import SwiftUI

struct Teste2: View {

var body: some View {
VStack {
Color(ColorAsset.LIGHT_GRAY)
}
.frame(width: 309, height: 145)
}

var anyView: AnyView {
return AnyView(self)
}
}

struct KeyboardReactionsComponent: View {

@EnvironmentObject var coordinator: ViewCordinator

@State var elements: [AnyView] = [ReactionsComponent(style: .smileEmoji).anyView,
ReactionsComponent(style: .heartFaceEmoji).anyView,
ReactionsComponent(style: .laughEmoji).anyView,
ReactionsComponent(style: .cryingEmoji).anyView,
ReactionsComponent(style: .judgingEmoji).anyView,
ReactionsComponent(style: .angryEmoji).anyView,
ReactionsComponent(style: .sadEmoji).anyView,
ReactionsComponent(style: .omgEmoji).anyView,
ReactionsComponent(style: .thinkingEmoji).anyView]

public func goBack(){
coordinator.pop()
}

public func grid0 () {
elements[0] = ReactionsComponent(style: .smileEmoji).anyView
}
public func grid1 () {
elements[1] = ReactionsComponent(style: .heartFaceEmoji).anyView
}
public func grid2 () {
elements[2] = ReactionsComponent(style: .laughEmoji).anyView
}
public func grid3 () {
elements[3] = ReactionsComponent(style: .cryingEmoji).anyView
}
public func grid4 () {
elements[4] = ReactionsComponent(style: .judgingEmoji).anyView
}
public func grid5 () {
elements[5] = ReactionsComponent(style: .angryEmoji).anyView
}
public func grid6 () {
elements[6] = ReactionsComponent(style: .sadEmoji).anyView
}
public func grid7 () {
elements[7] = ReactionsComponent(style: .omgEmoji).anyView
}
public func grid8 () {
elements[8] = ReactionsComponent(style: .thinkingEmoji).anyView
}

var body: some View {
VStack (spacing: 35) {
Grid {
GridRow {
ReactionsComponent(style: .smileEmoji)
ReactionsComponent(style: .heartFaceEmoji)
ReactionsComponent(style: .laughEmoji)
}
GridRow {
ReactionsComponent(style: .cryingEmoji)
ReactionsComponent(style: .judgingEmoji)
ReactionsComponent(style: .angryEmoji)
}
GridRow {
ReactionsComponent(style: .sadEmoji)
ReactionsComponent(style: .omgEmoji)
ReactionsComponent(style: .thinkingEmoji)
}
}
.frame(minHeight: UIScreen.screenHeight - 171.86.su)
VStack {
Spacer(minLength: 280)
EyeTrackingTemplate(
axisXFirstSectionTrigger: [grid0, grid1, grid2],
axisXSecondSectionTrigger: [grid3, grid4, grid5],
axisXThirdSectionTrigger: [grid6, grid7, grid8],
goBack: goBack,
style: StyleCard(spacing: 10, borderColor: .yellow),
elements: elements
)
HStack (alignment: .center) {
Circle()
.fill(Color(ColorAsset.PET_ORANGE))
Expand All @@ -39,6 +89,7 @@ struct KeyboardReactionsComponent: View {
.fill(Color(ColorAsset.LIGHT_ORANGE))
.frame(width: 14, height: 14)
}
Spacer(minLength: 250)
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions eye-chat/eye-chat/UI/Components/ReactionsComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import SwiftUI

struct ReactionsComponent: View {

var anyView: AnyView {
return AnyView(self)
}

let style: EmojiStyle

var body: some View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI
struct RoomCreatedPopupComponent: View {

public func didUserTapOffer(){
coordinator.push(view: .savedRooms)
coordinator.push(view: .emojiComponent)
}

public func didUserTapReceive(){
Expand Down
5 changes: 5 additions & 0 deletions eye-chat/eye-chat/UI/Components/SpaceKeycapComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
import SwiftUI

struct SpaceKeycapComponent: View {

var anyView: AnyView {
return AnyView(self)
}

var body: some View {
Text("")
.frame(maxWidth: 70.285.su, maxHeight: 23.28.su)
Expand Down
28 changes: 3 additions & 25 deletions eye-chat/eye-chat/UI/Components/TopicsBoardComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ struct TopicsBoardComponent: View {

public func goBack(){
coordinator.pop()

// o que eu quero?
// componente de forma específica
// o que eu tenho?
//
// o que eu posso fazer?
}


Expand Down Expand Up @@ -77,6 +71,7 @@ struct TopicsBoardComponent: View {

var body: some View {
VStack (spacing: 0) {
Spacer(minLength: 280)
HStack (spacing: 10) {
Text("Respostas rápidas")
.font(.custom(ContentComponent.SB, size: 24))
Expand Down Expand Up @@ -106,25 +101,6 @@ struct TopicsBoardComponent: View {
)
.foregroundColor(.white)
}
// Grid() {
// GridRow {
// Grid {
// FirstTopicsCardComponent(style: .yes, columnName: "Respostas rápidas")
// TopicsCardComponent(style: .no)
// TopicsCardComponent(style: .maybe)
// }
// Grid {
// FirstTopicsCardComponent(style: .family, columnName: "Tópicos")
// TopicsCardComponent(style: .entertainment)
// TopicsCardComponent(style: .health)
// }
// Grid {
// FirstTopicsCardComponent(style: .day, columnName: "Perguntas")
// TopicsCardComponent(style: .story)
// TopicsCardComponent(style: .sorry)
// }
// }
// }
EyeTrackingTemplate(
axisXFirstSectionTrigger: [grid0, grid1, grid2],
axisXSecondSectionTrigger: [grid3, grid4, grid5],
Expand All @@ -133,6 +109,7 @@ struct TopicsBoardComponent: View {
style: StyleCard(spacing: 10, borderColor: .yellow),
elements: elements
)
Spacer()
HStack (alignment: .center) {
Circle()
.fill(Color(ColorAsset.LIGHT_ORANGE))
Expand All @@ -144,6 +121,7 @@ struct TopicsBoardComponent: View {
.fill(Color(ColorAsset.LIGHT_ORANGE))
.frame(width: 14, height: 14)
}
Spacer(minLength: 250)
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion eye-chat/eye-chat/eye_chatApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ struct eye_chatApp: App {
VideoStream(webRTCClient: web.connection.webRTCClient)
case .savedRooms:
RoomsView()

case .topicsComponent:
TopicsBoardComponent()
case .emojiComponent:
KeyboardReactionsComponent()
case .fullKeyboard:
ChatScreenView(cameraSizeStyle: .small, keycapStyle: .aeiou)
}
}
}
Expand Down