diff --git a/files.cmake b/files.cmake index ee5673320e..39fb1b202e 100644 --- a/files.cmake +++ b/files.cmake @@ -1485,6 +1485,10 @@ set(DUSK_FILES src/dusk/ui/pane.hpp src/dusk/ui/popup.cpp src/dusk/ui/popup.hpp + src/dusk/ui/prelaunch.cpp + src/dusk/ui/prelaunch.hpp + src/dusk/ui/prelaunch_options.cpp + src/dusk/ui/prelaunch_options.hpp src/dusk/ui/select_button.cpp src/dusk/ui/select_button.hpp src/dusk/ui/settings.cpp diff --git a/res/AlegreyaSC-Bold.ttf b/res/AlegreyaSC-Bold.ttf new file mode 100644 index 0000000000..dc73beb916 Binary files /dev/null and b/res/AlegreyaSC-Bold.ttf differ diff --git a/res/AlegreyaSC-Regular.ttf b/res/AlegreyaSC-Regular.ttf new file mode 100644 index 0000000000..31cae6c8ad Binary files /dev/null and b/res/AlegreyaSC-Regular.ttf differ diff --git a/res/prelaunch-bg.png b/res/prelaunch-bg.png new file mode 100644 index 0000000000..045dcbe655 Binary files /dev/null and b/res/prelaunch-bg.png differ diff --git a/res/rml/prelaunch.rcss b/res/rml/prelaunch.rcss new file mode 100644 index 0000000000..f846591497 --- /dev/null +++ b/res/rml/prelaunch.rcss @@ -0,0 +1,169 @@ +*, *:before, *:after { + box-sizing: border-box; +} + +body { + width: 100%; + height: 100%; + font-family: "Fira Sans"; + font-weight: normal; + font-size: 20dp; + color: #FFFFFF; + background-color: #000000; + decorator: image(../prelaunch-bg.png cover left center); +} + +.menu { + position: absolute; + left: 96dp; + top: 50%; + transform: translateY(-50%); + /* Scale based on a reference screen width, 428/1216 */ + width: 35.230264vw; + min-width: 428dp; + max-width: 856dp; + height: auto; + display: flex; + flex-direction: column; + gap: 48dp; +} + +.hero { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + gap: 8dp; +} + +.hero img { + width: 100%; +} + +.eyebrow { + font-family: "Alegreya SC"; + font-size: 32dp; +} + +@media (min-width: 1216dp) { + .eyebrow { + /* Same logic as .menu, 32/1216 */ + font-size: 2.631579vw; + } +} + +.eyebrow span { + font-weight: bold; +} + +#menu-list { + display: flex; + flex-direction: column; + gap: 12dp; +} + +#menu-list button { + width: 428dp; + height: 54dp; + padding: 8dp 16dp; + border-radius: 8dp; + text-transform: uppercase; + font-family: "Fira Sans Condensed"; + font-size: 32dp; + font-weight: normal; + cursor: pointer; + /* Define a fully transparent gradient as the default state, otherwise a white flash occurs */ + decorator: horizontal-gradient(#00000000 #00000000); +} + +#menu-list button[anim-done] { + transition: decorator color 0.1s linear-in-out; +} + +#menu-list button:hover, +#menu-list button:focus-visible { + color: black; + decorator: horizontal-gradient(#FEE685FF #FEE68500); +} + +.disk-status { + position: absolute; + left: 96dp; + bottom: 72dp; + display: flex; + flex-direction: column; + gap: 8dp; +} + +.version-info { + position: absolute; + right: 96dp; + bottom: 72dp; + display: flex; + flex-direction: column; + gap: 8dp; + text-align: right; +} + +.status, +.version { + font-size: 24dp; +} + +.status, +.update { + color: #D8F999; +} + +.status[bad] { + color: #FFC9C9; +} + +/* TODO: Hidden until an actual update checker is introduced */ +.update { + display: none; + font-size: 16dp; + font-weight: bold; + cursor: pointer; +} + +.detail, +.update span { + color: #A6A09B; +} + +/* Startup animation */ +.intro-item { + opacity: 0; + transform: translateY(10dp); + transition: opacity transform 0.3s 0.1s cubic-in-out; +} + +body.animate-in .intro-item { + opacity: 1; + transform: translateY(0dp); +} + +.delay-0 { + transition: opacity transform 0.3s 0.1s cubic-in-out; +} + +.delay-1 { + transition: opacity transform 0.3s 0.2s cubic-in-out; +} + +.delay-2 { + transition: opacity transform 0.3s 0.3s cubic-in-out; +} + +.delay-3 { + transition: opacity transform 0.3s 0.4s cubic-in-out; +} + +.delay-4 { + transition: opacity transform 0.3s 0.5s cubic-in-out; +} + +.delay-5 { + transition: opacity transform 0.3s 0.6s cubic-in-out; +} diff --git a/src/dusk/ui/prelaunch.cpp b/src/dusk/ui/prelaunch.cpp new file mode 100644 index 0000000000..60b5b8ae8b --- /dev/null +++ b/src/dusk/ui/prelaunch.cpp @@ -0,0 +1,230 @@ +#include "prelaunch.hpp" + +#include "dusk/config.hpp" +#include "dusk/file_select.hpp" +#include "dusk/iso_validate.hpp" +#include "dusk/main.h" +#include "dusk/ui/prelaunch_options.hpp" +#include "version.h" + +#include +#include +#include + +namespace dusk::ui { +namespace { + +const Rml::String kDocumentSource = R"RML( + + + + + +