Skip to content
Merged
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
46 changes: 29 additions & 17 deletions src/ui/qml/GameCard.qml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Effects

Rectangle {
id: cardRoot

Expand All @@ -20,23 +18,25 @@ Rectangle {

signal launchRequested(string path)

radius: 16
color: hoverArea.containsMouse ? "#111d29" : "#0c131b"
border.color: hoverArea.containsMouse ? "#00e5ff66" : "#172533"
function iconUrl(path) {
if (!path || path.length === 0)
return "qrc:/qt/qml/VoidOne.App/assets/branding/voidone-mark.svg"
if (path.startsWith("qrc:/") || path.startsWith("file:/") || path.startsWith("http://") || path.startsWith("https://"))
return path
if (path.startsWith(":/"))
return "qrc" + path
if (path.startsWith("/"))
return "file://" + path
return "file:///" + path.replace(/\\/g, "/")
}

radius: 14
color: hoverArea.containsMouse ? "#111e2a" : "#0c141d"
border.color: hoverArea.containsMouse ? "#00e5ff66" : "#1a2a39"
border.width: 1

scale: hoverArea.containsMouse ? 1.018 : 1.0
Behavior on scale { NumberAnimation { duration: 150; easing.type: Easing.OutCubic } }
Behavior on color { ColorAnimation { duration: 150 } }
Behavior on border.color { ColorAnimation { duration: 150 } }

layer.enabled: hoverArea.containsMouse
layer.effect: MultiEffect {
shadowEnabled: true
shadowColor: "#00e5ff"
shadowBlur: 0.22
shadowOpacity: 0.25
}
Behavior on color { ColorAnimation { duration: 120 } }
Behavior on border.color { ColorAnimation { duration: 120 } }

Rectangle {
anchors.left: parent.left
Expand Down Expand Up @@ -71,12 +71,24 @@ Rectangle {
color: "#00e5ff10"
border.color: "#00e5ff22"

Image {
id: gameIcon
anchors.centerIn: parent
width: parent.width * 0.72
height: width
source: cardRoot.iconUrl(cardRoot.iconPath)
fillMode: Image.PreserveAspectFit
visible: status === Image.Ready
asynchronous: true
}

Image {
anchors.centerIn: parent
width: parent.width * 0.48
height: width
source: "qrc:/qt/qml/VoidOne.App/assets/branding/voidone-mark.svg"
fillMode: Image.PreserveAspectFit
visible: gameIcon.status !== Image.Ready
}
}

Expand Down
52 changes: 25 additions & 27 deletions src/ui/qml/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ Window {

width: Screen.desktopAvailableWidth * 0.86
height: Screen.desktopAvailableHeight * 0.86
minimumWidth: 1040
minimumHeight: 700
minimumWidth: 900
minimumHeight: 600
visible: true
title: qsTr("VoidOne")
color: theme.background

property string currentPage: "home"
property bool sidebarCompact: false
readonly property bool narrowLayout: width < 1100

QtObject {
id: theme
Expand Down Expand Up @@ -131,7 +132,7 @@ Window {
}

Rectangle {
Layout.preferredWidth: 300
Layout.preferredWidth: root.narrowLayout ? 190 : 300
Layout.preferredHeight: 38
radius: 10
color: "#0b1118"
Expand Down Expand Up @@ -184,11 +185,6 @@ Window {
height: 7
radius: 4
color: theme.success
SequentialAnimation on opacity {
loops: Animation.Infinite
NumberAnimation { to: 0.25; duration: 900 }
NumberAnimation { to: 1; duration: 900 }
}
}
Text {
text: qsTr("LOCAL")
Expand Down Expand Up @@ -237,12 +233,12 @@ Window {

ColumnLayout {
id: homeColumn
width: parent.width
width: Math.max(0, parent.width - 56)
anchors.top: parent.top
anchors.topMargin: 30
anchors.leftMargin: 34
anchors.rightMargin: 34
spacing: 24
anchors.topMargin: 26
anchors.left: parent.left
anchors.leftMargin: 28
spacing: 22

RowLayout {
Layout.fillWidth: true
Expand All @@ -253,7 +249,7 @@ Window {
Text {
text: qsTr("Your games. Your hardware. Your rules.")
color: theme.text
font.pixelSize: 29
font.pixelSize: root.narrowLayout ? 23 : 29
font.bold: true
}
Text {
Expand Down Expand Up @@ -285,8 +281,8 @@ Window {
// Hero
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 220
radius: 22
Layout.preferredHeight: root.narrowLayout ? 185 : 220
radius: 18
color: "#0d151e"
border.color: "#1b2b3b"
clip: true
Expand All @@ -310,10 +306,10 @@ Window {

ColumnLayout {
anchors.left: parent.left
anchors.leftMargin: 68
anchors.leftMargin: root.narrowLayout ? 28 : 68
anchors.verticalCenter: parent.verticalCenter
width: parent.width * 0.58
spacing: 12
width: parent.width * (root.narrowLayout ? 0.72 : 0.58)
spacing: 10

Text {
text: qsTr("WELCOME BACK")
Expand All @@ -326,7 +322,7 @@ Window {
Text {
text: gameModel && gameModel.count > 0 ? qsTr("Ready to play.") : qsTr("Build your library.")
color: theme.text
font.pixelSize: 31
font.pixelSize: root.narrowLayout ? 25 : 31
font.bold: true
}

Expand Down Expand Up @@ -368,6 +364,7 @@ Window {
}

Text {
visible: !root.narrowLayout
anchors.right: parent.right
anchors.rightMargin: 42
anchors.verticalCenter: parent.verticalCenter
Expand Down Expand Up @@ -396,14 +393,14 @@ Window {
}
StatCard {
Layout.fillWidth: true
label: qsTr("CONTROL")
value: "100%"
detail: qsTr("your library")
label: qsTr("LAUNCH")
value: qsTr("DIRECT")
detail: qsTr("from your library")
}
}

Text {
text: qsTr("RECENTLY ADDED")
text: qsTr("YOUR LIBRARY")
color: theme.muted
font.pixelSize: 10
font.bold: true
Expand All @@ -412,9 +409,10 @@ Window {

GridView {
Layout.fillWidth: true
Layout.preferredHeight: Math.max(190, Math.ceil((gameModel ? gameModel.count : 0) / 3) * 190)
property int columns: width < 560 ? 1 : (width < 900 ? 2 : 3)
Layout.preferredHeight: Math.max(190, Math.ceil((gameModel ? gameModel.count : 0) / columns) * 190)
interactive: false
cellWidth: width / 3
cellWidth: width / columns
cellHeight: 180
model: typeof gameModel !== "undefined" ? gameModel : null

Expand Down Expand Up @@ -445,7 +443,7 @@ Window {
Item {
ColumnLayout {
anchors.fill: parent
anchors.margins: 32
anchors.margins: 24
spacing: 18

RowLayout {
Expand Down
6 changes: 3 additions & 3 deletions src/ui/qml/Sidebar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Rectangle {

ColumnLayout {
anchors.fill: parent
anchors.topMargin: 18
anchors.bottomMargin: 16
spacing: 14
anchors.topMargin: 16
anchors.bottomMargin: 14
spacing: 12

RowLayout {
Layout.fillWidth: true
Expand Down