|
| 1 | +import QtQuick 2.15 |
| 2 | +import QtQuick.Controls 2.15 |
| 3 | +import QtQuick.Layouts 1.15 |
| 4 | + |
| 5 | +Rectangle { |
| 6 | + width: 1920 |
| 7 | + height: 1080 |
| 8 | + color: "#0d0719" |
| 9 | + |
| 10 | + Canvas { |
| 11 | + anchors.fill: parent |
| 12 | + onPaint: { |
| 13 | + var ctx = getContext("2d") |
| 14 | + if (!ctx) return |
| 15 | + |
| 16 | + var stars = [ |
| 17 | + [0.08, 0.05, 1.5, 0.9], [0.15, 0.12, 1.0, 0.6], |
| 18 | + [0.22, 0.03, 2.0, 1.0], [0.30, 0.18, 1.2, 0.7], |
| 19 | + [0.05, 0.25, 1.0, 0.5], [0.42, 0.08, 1.8, 0.8], |
| 20 | + [0.55, 0.15, 1.0, 0.4], [0.65, 0.05, 1.3, 0.7], |
| 21 | + [0.35, 0.22, 0.8, 0.5], [0.48, 0.28, 1.5, 0.9], |
| 22 | + [0.60, 0.20, 1.0, 0.6], [0.18, 0.32, 1.2, 0.8], |
| 23 | + [0.25, 0.08, 0.7, 0.4], [0.72, 0.12, 1.6, 0.7], |
| 24 | + [0.10, 0.18, 1.1, 0.5], [0.38, 0.15, 0.9, 0.6], |
| 25 | + [0.50, 0.10, 1.4, 0.8], [0.68, 0.25, 1.0, 0.5], |
| 26 | + [0.20, 0.28, 0.8, 0.7], [0.45, 0.05, 1.2, 0.9] |
| 27 | + ] |
| 28 | + |
| 29 | + for (var i = 0; i < stars.length; i++) { |
| 30 | + var s = stars[i] |
| 31 | + ctx.globalAlpha = s[3] |
| 32 | + ctx.fillStyle = "#ffffff" |
| 33 | + ctx.beginPath() |
| 34 | + ctx.arc(s[0] * width, s[1] * height, s[2], 0, Math.PI * 2) |
| 35 | + ctx.fill() |
| 36 | + } |
| 37 | + ctx.globalAlpha = 1.0 |
| 38 | + } |
| 39 | + } |
| 40 | + |
| 41 | + Canvas { |
| 42 | + anchors.fill: parent |
| 43 | + onPaint: { |
| 44 | + var ctx = getContext("2d") |
| 45 | + if (!ctx) return |
| 46 | + |
| 47 | + var mx = width * 0.78 |
| 48 | + var my = height * 0.15 |
| 49 | + var gradient = ctx.createRadialGradient(mx, my, 10, mx, my, 200) |
| 50 | + gradient.addColorStop(0, "rgba(232, 216, 248, 0.12)") |
| 51 | + gradient.addColorStop(1, "rgba(232, 216, 248, 0)") |
| 52 | + ctx.fillStyle = gradient |
| 53 | + ctx.beginPath() |
| 54 | + ctx.arc(mx, my, 200, 0, Math.PI * 2) |
| 55 | + ctx.fill() |
| 56 | + } |
| 57 | + } |
| 58 | + |
| 59 | + Canvas { |
| 60 | + anchors.fill: parent |
| 61 | + onPaint: { |
| 62 | + var ctx = getContext("2d") |
| 63 | + if (!ctx) return |
| 64 | + |
| 65 | + var mx = width * 0.78 |
| 66 | + var my = height * 0.15 |
| 67 | + |
| 68 | + ctx.beginPath() |
| 69 | + ctx.arc(mx, my, 70, 0, Math.PI * 2) |
| 70 | + ctx.fillStyle = "#f0e8ff" |
| 71 | + ctx.fill() |
| 72 | + |
| 73 | + ctx.save() |
| 74 | + ctx.globalCompositeOperation = "destination-out" |
| 75 | + ctx.beginPath() |
| 76 | + ctx.arc(mx + 22, my - 16, 55, 0, Math.PI * 2) |
| 77 | + ctx.fill() |
| 78 | + ctx.restore() |
| 79 | + } |
| 80 | + } |
| 81 | + |
| 82 | + Rectangle { |
| 83 | + anchors.centerIn: parent |
| 84 | + width: 420 |
| 85 | + height: 420 |
| 86 | + color: "#1a0f30" |
| 87 | + radius: 24 |
| 88 | + border.color: "#3a2a5a" |
| 89 | + border.width: 1 |
| 90 | + |
| 91 | + ColumnLayout { |
| 92 | + anchors.centerIn: parent |
| 93 | + spacing: 20 |
| 94 | + |
| 95 | + Text { |
| 96 | + text: "mochios" |
| 97 | + color: "#e6dcf0" |
| 98 | + font.pixelSize: 52 |
| 99 | + font.bold: true |
| 100 | + Layout.alignment: Qt.AlignHCenter |
| 101 | + } |
| 102 | + |
| 103 | + Text { |
| 104 | + text: "NIGHTLY" |
| 105 | + color: "#9664c8" |
| 106 | + font.pixelSize: 18 |
| 107 | + font.letterSpacing: 8 |
| 108 | + Layout.alignment: Qt.AlignHCenter |
| 109 | + opacity: 0.7 |
| 110 | + } |
| 111 | + |
| 112 | + Item { width: 1; height: 10 } |
| 113 | + |
| 114 | + TextField { |
| 115 | + id: username |
| 116 | + placeholderText: "username" |
| 117 | + Layout.preferredWidth: 280 |
| 118 | + Layout.alignment: Qt.AlignHCenter |
| 119 | + background: Rectangle { color: "#0d0719"; radius: 8 } |
| 120 | + color: "#e6dcf0" |
| 121 | + placeholderTextColor: "#6a5a8a" |
| 122 | + Keys.onReturnPressed: password.forceActiveFocus() |
| 123 | + } |
| 124 | + |
| 125 | + TextField { |
| 126 | + id: password |
| 127 | + placeholderText: "password" |
| 128 | + echoMode: TextInput.Password |
| 129 | + Layout.preferredWidth: 280 |
| 130 | + Layout.alignment: Qt.AlignHCenter |
| 131 | + background: Rectangle { color: "#0d0719"; radius: 8 } |
| 132 | + color: "#e6dcf0" |
| 133 | + placeholderTextColor: "#6a5a8a" |
| 134 | + Keys.onReturnPressed: sddm.login(username.text, password.text) |
| 135 | + } |
| 136 | + |
| 137 | + Button { |
| 138 | + text: "log in" |
| 139 | + Layout.preferredWidth: 280 |
| 140 | + Layout.alignment: Qt.AlignHCenter |
| 141 | + onClicked: sddm.login(username.text, password.text) |
| 142 | + background: Rectangle { color: "#9664c8"; radius: 8 } |
| 143 | + contentItem: Text { text: "log in"; color: "#ffffff"; font.bold: true; horizontalAlignment: Text.AlignHCenter } |
| 144 | + } |
| 145 | + } |
| 146 | + } |
| 147 | + |
| 148 | + Text { |
| 149 | + text: "NIGHTLY BUILD" |
| 150 | + color: "#9664c8" |
| 151 | + font.pixelSize: 13 |
| 152 | + font.bold: true |
| 153 | + letterSpacing: 4 |
| 154 | + opacity: 0.3 |
| 155 | + anchors.right: parent.right |
| 156 | + anchors.bottom: parent.bottom |
| 157 | + anchors.margins: 24 |
| 158 | + } |
| 159 | +} |
0 commit comments