diff --git a/app.go b/app.go index 0d0e6f3..d21ea79 100644 --- a/app.go +++ b/app.go @@ -1,15 +1,25 @@ package main import ( + "conjure-os/lib/inputs" + "conjure-os/lib/models" + "conjure-os/lib/provider" "context" "fmt" - - "conjure-os/lib/inputs" - "conjure-os/lib/provider" + "os" + "os/exec" + "time" "github.com/wailsapp/wails/v2/pkg/runtime" ) +var ( + games []models.Metadata + lastEmitTimestamp = time.Now().Add(-10 * time.Second) + emitInterval = 150 * time.Millisecond + gameIsOpen = false +) + // App struct type App struct { ctx context.Context @@ -20,23 +30,93 @@ func NewApp() *App { return &App{} } -// startup is called when the app starts. The context is saved +// Startup is called when the app starts. The context is saved // so we can call the runtime methods -func (a *App) startup(ctx context.Context) { +func (a *App) Startup(ctx context.Context) { a.ctx = ctx - inputs.Start() + inputs.Start(a.onControllerChange) provider.Update() } -// Greet returns a greeting for the given name -func (a *App) Greet(name string) string { - runtime.LogInfo(a.ctx, "Test : "+name) - return fmt.Sprintf("Hello %s, It's show time!", name) +func (a *App) onControllerChange(state inputs.ControllerState) { + now := time.Now() + + if now.Sub(lastEmitTimestamp) >= emitInterval && !gameIsOpen { + if state.Buttons != 0 { + for _, button := range inputs.ConjureControllerButtons { + if state.Buttons&(1<=18" } }, + "node_modules/@iconify/types": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz", + "integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==", + "dev": true + }, + "node_modules/@iconify/vue": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@iconify/vue/-/vue-5.0.0.tgz", + "integrity": "sha512-C+KuEWIF5nSBrobFJhT//JS87OZ++QDORB6f2q2Wm6fl2mueSTpFBeBsveK0KW9hWiZ4mNiPjsh6Zs4jjdROSg==", + "dev": true, + "dependencies": { + "@iconify/types": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/cyberalien" + }, + "peerDependencies": { + "vue": ">=3" + } + }, "node_modules/@isaacs/fs-minipass": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", diff --git a/frontend/package.json b/frontend/package.json index 7b01076..ab60aaf 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -20,6 +20,7 @@ }, "devDependencies": { "@babel/types": "^7.18.10", + "@iconify/vue": "^5.0.0", "@tailwindcss/vite": "^4.1.11", "@types/qrcode": "^1.5.5", "@vitejs/plugin-vue": "^6.0.0", diff --git a/frontend/package.json.md5 b/frontend/package.json.md5 index 3dd94f5..242a7e4 100755 --- a/frontend/package.json.md5 +++ b/frontend/package.json.md5 @@ -1 +1 @@ -1f77c5bc2ac4189b53ca32c331845b25 \ No newline at end of file +063583417fe9e58bc0e2d6b154be7c49 \ No newline at end of file diff --git a/frontend/src/App.vue b/frontend/src/App.vue index bdced78..7e27ab5 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,62 +1,81 @@ \ No newline at end of file diff --git a/frontend/src/components/CustomCard.vue b/frontend/src/components/CustomCard.vue new file mode 100644 index 0000000..9da3d17 --- /dev/null +++ b/frontend/src/components/CustomCard.vue @@ -0,0 +1,34 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/components/DevCard.vue b/frontend/src/components/DevCard.vue new file mode 100644 index 0000000..1f373db --- /dev/null +++ b/frontend/src/components/DevCard.vue @@ -0,0 +1,28 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/components/GameCard.vue b/frontend/src/components/GameCard.vue new file mode 100644 index 0000000..9cfe232 --- /dev/null +++ b/frontend/src/components/GameCard.vue @@ -0,0 +1,31 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/components/GameCarousel.vue b/frontend/src/components/GameCarousel.vue index 2465388..79139ad 100644 --- a/frontend/src/components/GameCarousel.vue +++ b/frontend/src/components/GameCarousel.vue @@ -1,22 +1,13 @@ @@ -44,6 +134,7 @@ defineEmits(['qr']); img { transition: transform 0.2s; } + img:hover { transform: scale(1.05); } diff --git a/frontend/src/components/ImageCarousel.vue b/frontend/src/components/ImageCarousel.vue new file mode 100644 index 0000000..a7f30bb --- /dev/null +++ b/frontend/src/components/ImageCarousel.vue @@ -0,0 +1,67 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/components/LoadingModal.vue b/frontend/src/components/LoadingModal.vue new file mode 100644 index 0000000..f7a9992 --- /dev/null +++ b/frontend/src/components/LoadingModal.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/frontend/src/components/LocalImage.vue b/frontend/src/components/LocalImage.vue new file mode 100644 index 0000000..94a62b0 --- /dev/null +++ b/frontend/src/components/LocalImage.vue @@ -0,0 +1,27 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/components/OptionsModal.vue b/frontend/src/components/OptionsModal.vue index b1bf70d..36a9581 100644 --- a/frontend/src/components/OptionsModal.vue +++ b/frontend/src/components/OptionsModal.vue @@ -1,5 +1,5 @@