Skip to content

Commit

Permalink
🔀 Merge branch 'hugo/feature/Upgrade-AnswerViews-UI-styles'
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Sep 20, 2023
2 parents 5098475 + 0083f10 commit dd06565
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
18 changes: 14 additions & 4 deletions Modules/GameEngineKit/Sources/UI/Views/ColoredAnswerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ struct ColoredAnswerView: View {

@ViewBuilder
var view: some View {
let circle = Circle()
.foregroundColor(color)
let circle = Image(systemName: "circle.fill")
.foregroundStyle(color)
.font(.system(size: size))
.frame(
width: size,
height: size
width: size * 1.05,
height: size * 1.05
)

switch status {
Expand Down Expand Up @@ -74,3 +75,12 @@ struct ColoredAnswerView: View {
view
}
}

struct ColoredAnswerView_Previews:
PreviewProvider
{
static var previews: some View {
ColoredAnswerView(color: "red", size: 500, status: .playingRightAnimation)
.previewInterfaceOrientation(.landscapeLeft)
}
}
22 changes: 17 additions & 5 deletions Modules/GameEngineKit/Sources/UI/Views/TextAnswerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Copyright 2023 APF France handicap
// SPDX-License-Identifier: Apache-2.0

import DesignKit
import SwiftUI

struct TextAnswerView: View {
Expand All @@ -15,15 +16,17 @@ struct TextAnswerView: View {
@ViewBuilder
var view: some View {
let circle = ZStack {
Circle()
.fill(.gray.opacity(0.8))
Image(systemName: "circle.fill")
.foregroundStyle(DesignKitAsset.Colors.lekaDarkBlue.swiftUIColor)
.font(.system(size: size))
.frame(
width: size,
height: size
width: size * 1.05,
height: size * 1.05
)

Text(text.uppercased())
.font(.title.bold())
.font(.largeTitle.uppercaseSmallCaps())
.foregroundColor(.white)
}

switch status {
Expand Down Expand Up @@ -67,3 +70,12 @@ struct TextAnswerView: View {
view
}
}

struct TextAnswerView_Previews:
PreviewProvider
{
static var previews: some View {
TextAnswerView(text: "Hello", size: 500, status: .playingRightAnimation)
.previewInterfaceOrientation(.landscapeLeft)
}
}

0 comments on commit dd06565

Please sign in to comment.