Skip to content

Commit

Permalink
#72-regen-strength-display
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrwang committed Feb 29, 2024
1 parent eccc581 commit 63ad539
Show file tree
Hide file tree
Showing 2 changed files with 212 additions and 0 deletions.
128 changes: 128 additions & 0 deletions NERODesign/content/Lightning.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import QtQuick 2.15
import QtQuick.Shapes

Item {
id: lightning
property int dimension: 150
property string primaryColor: "#14f504"
property string secondaryColor: "black"

width: dimension
height: dimension

Shape {
id: shape2
width: lightning.width + dimension / 5
height: lightning.height + dimension / 5
anchors.centerIn: parent

ShapePath {
id: background
fillColor: lightning.secondaryColor
strokeColor: "transparent"
strokeWidth: 1

startX: 47 / 80 * shape2.width
startY: 32 / 80 * shape2.width

PathLine { x: 60 / 80 * shape2.width; y: 32 / 80 * shape2.width }

// rounded right corner
PathQuad {
x: 62 / 80 * shape2.width
y: 37.75 / 80 * shape2.width
controlX: 65 / 80 * shape2.width
controlY: 33.75 / 80 * shape2.width
}

PathLine { x: 38 / 80 * shape2.width; y: 69.75 / 80 * shape2.width }

// rounded bottom corner
PathQuad {
x: 33 / 80 * shape2.width
y: 68.75 / 80 * shape2.width
controlX: 35 / 80 * shape2.width
controlY: 73.75 / 80 * shape2.width
}

PathLine { x: 33 / 80 * shape2.width; y: 48 / 80 * shape2.width }
PathLine { x: 20 / 80 * shape2.width; y: 48 / 80 * shape2.width }

// rounded left corner
PathQuad {
x: 18 / 80 * shape2.width
y: 42.25 / 80 * shape2.width
controlX: 15 / 80 * shape2.width
controlY: 46.25 / 80 * shape2.width
}

PathLine { x: 42 / 80 * shape2.width; y: 10.25 / 80 * shape2.width }

// rounded top corner
PathQuad {
x: 47 / 80 * shape2.width
y: 11.25 / 80 * shape2.width
controlX: 45 / 80 * shape2.width
controlY: 6.25 / 80 * shape2.width
}
}
}

Shape {
id: shape
width: lightning.width
height: lightning.height
anchors.centerIn: parent

ShapePath {
id: foreground
fillColor: lightning.primaryColor
strokeColor: "transparent"
strokeWidth: 1

startX: 45 / 80 * shape.width
startY: 33.75 / 80 * shape.width

PathLine { x: 60 / 80 * shape.width; y: 33.75 / 80 * shape.width }

// rounded right corner
PathQuad {
x: 62 / 80 * shape.width
y: 37.75 / 80 * shape.width
controlX: 65 / 80 * shape.width
controlY: 33.75 / 80 * shape.width
}

PathLine { x: 38 / 80 * shape.width; y: 69.75 / 80 * shape.width }

// rounded bottom corner
PathQuad {
x: 35 / 80 * shape.width
y: 68.75 / 80 * shape.width
controlX: 35 / 80 * shape.width
controlY: 73.75 / 80 * shape.width
}

PathLine { x: 35 / 80 * shape.width; y: 46.25 / 80 * shape.width }
PathLine { x: 20 / 80 * shape.width; y: 46.25 / 80 * shape.width }

// rounded left corner
PathQuad {
x: 18 / 80 * shape.width
y: 42.25 / 80 * shape.width
controlX: 15 / 80 * shape.width
controlY: 46.25 / 80 * shape.width
}

PathLine { x: 42 / 80 * shape.width; y: 10.25 / 80 * shape.width }

// rounded top corner
PathQuad {
x: 45 / 80 * shape.width
y: 11.25 / 80 * shape.width
controlX: 45 / 80 * shape.width
controlY: 6.25 / 80 * shape.width
}
}
}
}
84 changes: 84 additions & 0 deletions NERODesign/content/RegenStrength.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import QtQuick 6.5
import QtQuick.Controls 6.5
import QtQuick.Layouts
import QtQuick.Shapes

Item {
id: thermometer
property int value: 0
property int horizontalPadding: width / 20
property int maxValue: 65
property int minValue: -15
property string color: "red"
height: 300
width: height

Rectangle {
id: lightningBackground
width: parent.width / 3
height: parent.height / 4
color: "white"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: - parent.height / 20
radius: 20
rotation: -45
anchors.centerIn: parent
}

Rectangle {
id: topSemiCircle
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
width: parent.width / 4
height: parent.width / 4
radius: parent.width / 4
color: "white"
}

Rectangle {
id: outerRectangle
anchors.top: topSemiCircle.verticalCenter
anchors.bottom: bottomOuterCircle.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width / 4
height: parent.height / 2
color: "white"
}

Rectangle {
id: bottomOuterCircle
anchors.horizontalCenter: parent.horizontalCenter
y: parent.height / 2
width: thermometer.width / 2
height: thermometer.width / 2
radius: thermometer.width / 2
color: "white"

Rectangle {
id: fillBottomCircle
anchors.centerIn: parent
width: parent.width * 0.8
height: parent.height * 0.8
radius: parent.radius
color: thermometer.color
}
}

Rectangle {
id: fillRectangle
anchors.fill: outerRectangle

anchors.leftMargin: thermometer.horizontalPadding
anchors.rightMargin: thermometer.horizontalPadding
color: thermometer.color
}

Lightning {
id: mainLightning
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: - parent.height / 20
dimension: parent.height / 2.25
}
}

0 comments on commit 63ad539

Please sign in to comment.