Skip to content

Commit

Permalink
new frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
lynchee-owo committed Jul 11, 2023
1 parent 1c532b3 commit 82f242c
Show file tree
Hide file tree
Showing 31 changed files with 1,273 additions and 31 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,5 @@ cython_debug/
.chroma
*.ipynb
google_credentials.json

./node_modules
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ XI_API_KEY=<api key>
```sh
alembic upgrade head
```
4. Setup `.env`: update API keys and select component
```sh
mv .env.example .env
```
4. Run the app & then go to http://localhost:8000/static/index.html
```sh
uvicorn realtime_ai_character.main:app --reload
Expand Down
456 changes: 456 additions & 0 deletions app/ios/rac/rac.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "255",
"green" : "177",
"red" : "148"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions app/ios/rac/rac/Assets/Assets.xcassets/Contents.json
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 app/ios/rac/rac/Assets/Assets.xcassets/logo.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "logo.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
15 changes: 15 additions & 0 deletions app/ios/rac/rac/Assets/Assets.xcassets/logo.imageset/logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/ios/rac/rac/Assets/Prompt-Medium.ttf
Binary file not shown.
Binary file added app/ios/rac/rac/Assets/Prompt-Regular.ttf
Binary file not shown.
Binary file added app/ios/rac/rac/Assets/Prompt-SemiBold.ttf
Binary file not shown.
18 changes: 18 additions & 0 deletions app/ios/rac/rac/Extension/View+Extensions.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// View+Extensions.swift
// rac
//
// Created by ZongZiWang on 7/9/23.
//

import SwiftUI

extension View {
@ViewBuilder func `if`<Content: View>(_ condition: Bool, transform: (Self) -> Content) -> some View {
if condition {
transform(self)
} else {
self
}
}
}
12 changes: 12 additions & 0 deletions app/ios/rac/rac/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIAppFonts</key>
<array>
<string>Prompt-SemiBold.ttf</string>
<string>Prompt-Regular.ttf</string>
<string>Prompt-Medium.ttf</string>
</array>
</dict>
</plist>
27 changes: 27 additions & 0 deletions app/ios/rac/rac/Interactive/InteractiveView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// InteractiveView.swift
// rac
//
// Created by ZongZiWang on 7/9/23.
//

import SwiftUI

struct InteractiveView: View {

var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundColor(.accentColor)
Text("Interactive")
}
.padding()
}
}

struct InteractiveView_Previews: PreviewProvider {
static var previews: some View {
InteractiveView()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
42 changes: 42 additions & 0 deletions app/ios/rac/rac/RootView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// RootView.swift
// rac
//
// Created by ZongZiWang on 7/9/23.
//

import SwiftUI

struct RootView: View {
@State var interactive = false

var body: some View {
NavigationView {
VStack {
if interactive {
InteractiveView()
} else {
WelcomeView { option in
interactive = true
}
}
}
.navigationBarTitleDisplayMode(.inline)
.navigationBarItems(leading: LogoView().padding(.leading, 44),
trailing: EmptyView())
}
}
}

struct LogoView: View {
var body: some View {
Image("logo")
.resizable()
}
}

struct RootView_Previews: PreviewProvider {
static var previews: some View {
RootView()
}
}
50 changes: 50 additions & 0 deletions app/ios/rac/rac/SharedUI/CtaButton.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//
// CtaButton.swift
// rac
//
// Created by ZongZiWang on 7/9/23.
//

import SwiftUI

struct CtaButton: View {
let action: () -> Void
let text: String

var body: some View {
Button(action: action) {
Text(text)
.font(
Font.custom("Prompt", size: 18)
.weight(.medium)
)
.foregroundColor(.white)
.padding(.horizontal, 20)
.padding(.vertical, 9)
.frame(maxWidth: .infinity, minHeight: 52, maxHeight: 52, alignment: .center)
.background(Color(red: 0.01, green: 0.03, blue: 0.11))
.cornerRadius(4)
}
.buttonStyle(CustomButtonStyle())
}
}

struct CustomButtonStyle: ButtonStyle {
@Environment(\.isEnabled) var isEnabled: Bool

func makeBody(configuration: Configuration) -> some View {
configuration.label
.opacity(!isEnabled ? 0.25 : configuration.isPressed ? 0.8 : 1.0)
}
}

struct CtaButton_Previews: PreviewProvider {
static var previews: some View {
VStack {
CtaButton(action: { }, text: "Contribute")

CtaButton(action: { }, text: "Contribute")
.disabled(true)
}
}
}
64 changes: 64 additions & 0 deletions app/ios/rac/rac/Welcome/About/AboutView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
//
// AboutView.swift
// rac
//
// Created by ZongZiWang on 7/9/23.
//

import SwiftUI

struct AboutView: View {

var body: some View {
ScrollView {
VStack(alignment: .leading) {

Spacer(minLength: 24)

Text("Realtime (AI Character)")
.font(
Font.custom("Prompt", size: 16).weight(.semibold)
)
.foregroundColor(Color(red: 0.4, green: 0.52, blue: 0.83))
+ Text(" is a revolutionary project enabling dynamic audio-visual interactions between humans and AI.\n\nPowered by Language Learning Model (LLM), it offers instant, natural, and context-aware responses, paving the way for a new era of interactive AI experiences.")
.font(
Font.custom("Prompt", size: 16).weight(.regular)
)

Spacer(minLength: 40)

Text("Authors")
.font(
Font.custom("Prompt", size: 16).weight(.semibold)
)
.foregroundColor(Color(red: 0.4, green: 0.52, blue: 0.83))

Text("Shaunwei, lynchee-owo, ZongZiWang, pycui")
.font(
Font.custom("Prompt", size: 16).weight(.regular)
)

Spacer(minLength: 40)

Text("Realtime is Open Source")
.font(
Font.custom("Prompt", size: 16).weight(.semibold)
)
.foregroundColor(Color(red: 0.4, green: 0.52, blue: 0.83))

Spacer(minLength: 20)

CtaButton(action: {
UIApplication.shared.open(URL(string: "https://github.com/Shaunwei/Realtime-AI-Character")!)
}, text: "Contribute")
}
}
}
}

struct AboutView_Previews: PreviewProvider {
static var previews: some View {
AboutView()
.frame(width: 310)
}
}

0 comments on commit 82f242c

Please sign in to comment.