mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Improve main menu for standalone
This commit is contained in:
parent
e4da0e437b
commit
3988d71f5a
BIN
res/ui/kiwi_clicker.png
Normal file
BIN
res/ui/kiwi_clicker.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 317 KiB |
BIN
res/ui/puzzle_460x215_15.png
Normal file
BIN
res/ui/puzzle_460x215_15.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 202 KiB |
@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
grid-template-rows: D(31px) 1fr D(93px);
|
grid-template-rows: 1fr;
|
||||||
|
|
||||||
&[data-columns="1"] {
|
&[data-columns="1"] {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
@ -113,6 +113,105 @@
|
|||||||
&[data-columns="2"] {
|
&[data-columns="2"] {
|
||||||
grid-template-columns: D(290px) 1fr;
|
grid-template-columns: D(290px) 1fr;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
display: flex;
|
||||||
|
flex-grow: 1;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: 20;
|
||||||
|
|
||||||
|
flex-direction: column;
|
||||||
|
@include S(padding-top, 0px);
|
||||||
|
|
||||||
|
img {
|
||||||
|
@include S(width, 710px / 3);
|
||||||
|
@include S(height, 180px / 3);
|
||||||
|
}
|
||||||
|
position: relative;
|
||||||
|
@include S(left, -8px);
|
||||||
|
|
||||||
|
.updateLabel {
|
||||||
|
position: absolute;
|
||||||
|
transform: translateX(50%) rotate(-5deg);
|
||||||
|
color: #fff;
|
||||||
|
@include PlainText;
|
||||||
|
font-weight: bold;
|
||||||
|
@include S(right, 40px);
|
||||||
|
@include S(bottom, 20px);
|
||||||
|
background: $modsColor;
|
||||||
|
@include S(border-radius, $globalBorderRadius);
|
||||||
|
@include S(padding, 0, 5px, 1px, 5px);
|
||||||
|
|
||||||
|
@include InlineAnimation(1.3s ease-in-out infinite) {
|
||||||
|
50% {
|
||||||
|
transform: translateX(50%) rotate(-7deg) scale(1.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.betaWarning {
|
||||||
|
@include S(width, 400px);
|
||||||
|
@include PlainText;
|
||||||
|
background: $colorRedBright;
|
||||||
|
@include S(padding, 10px);
|
||||||
|
@include S(border-radius, $globalBorderRadius);
|
||||||
|
color: #fff;
|
||||||
|
@include S(margin-top, 10px);
|
||||||
|
border: #{D(2px)} solid rgba(0, 10, 20, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sideContainer {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
grid-column: 2 / 3;
|
||||||
|
flex-direction: column;
|
||||||
|
@include S(grid-gap, 20px);
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.mainNews {
|
||||||
|
background: rgb(248, 232, 130);
|
||||||
|
&::before {
|
||||||
|
background: uiResource("kiwi_clicker.png") center center / 100% no-repeat;
|
||||||
|
content: "";
|
||||||
|
@include S(width, 130px);
|
||||||
|
@include S(height, 130px);
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
right: -5%;
|
||||||
|
pointer-events: none;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
box-shadow: 0 D(9px) D(15px) rgba(#000, 0.2);
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
@include S(min-height, 60px);
|
||||||
|
@include S(max-height, 150px);
|
||||||
|
pointer-events: all;
|
||||||
|
flex-grow: 1;
|
||||||
|
z-index: 100;
|
||||||
|
position: relative;
|
||||||
|
grid-row: 2 / 3;
|
||||||
|
@include S(border-radius, $globalBorderRadius);
|
||||||
|
justify-content: center;
|
||||||
|
@include S(padding, 10px);
|
||||||
|
@include S(padding-right, 100px);
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
&:hover {
|
||||||
|
opacity: 0.95;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
@include SuperSmallText;
|
||||||
|
@include S(width, 120px);
|
||||||
|
color: rgba(0, 10, 20, 0.7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.standaloneBanner {
|
.standaloneBanner {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
@ -121,6 +220,7 @@
|
|||||||
@include S(max-width, 370px);
|
@include S(max-width, 370px);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
grid-row: 1 / 3;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -329,67 +429,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
|
||||||
display: flex;
|
|
||||||
flex-grow: 1;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
z-index: 20;
|
|
||||||
|
|
||||||
flex-direction: column;
|
|
||||||
@include S(padding-top, 0px);
|
|
||||||
|
|
||||||
img {
|
|
||||||
@include S(width, 710px / 3);
|
|
||||||
@include S(height, 180px / 3);
|
|
||||||
}
|
|
||||||
position: relative;
|
|
||||||
@include S(left, -8px);
|
|
||||||
|
|
||||||
.updateLabel {
|
|
||||||
position: absolute;
|
|
||||||
transform: translateX(50%) rotate(-5deg);
|
|
||||||
color: #fff;
|
|
||||||
@include PlainText;
|
|
||||||
font-weight: bold;
|
|
||||||
@include S(right, 40px);
|
|
||||||
@include S(bottom, 20px);
|
|
||||||
background: $modsColor;
|
|
||||||
@include S(border-radius, $globalBorderRadius);
|
|
||||||
@include S(padding, 0, 5px, 1px, 5px);
|
|
||||||
|
|
||||||
@include InlineAnimation(1.3s ease-in-out infinite) {
|
|
||||||
50% {
|
|
||||||
transform: translateX(50%) rotate(-7deg) scale(1.1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.betaWarning {
|
|
||||||
@include S(width, 400px);
|
|
||||||
@include PlainText;
|
|
||||||
background: $colorRedBright;
|
|
||||||
@include S(padding, 10px);
|
|
||||||
@include S(border-radius, $globalBorderRadius);
|
|
||||||
color: #fff;
|
|
||||||
@include S(margin-top, 10px);
|
|
||||||
border: #{D(2px)} solid rgba(0, 10, 20, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sideContainer {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
width: 100%;
|
|
||||||
grid-row: 1 / 4;
|
|
||||||
grid-column: 2 / 3;
|
|
||||||
|
|
||||||
.standaloneBanner {
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.puzzleContainer {
|
.puzzleContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -397,14 +436,14 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background: $colorBlueBright;
|
background: $colorBlueBright;
|
||||||
height: 100%;
|
grid-row: 1 / 2;
|
||||||
grid-row: 1 / 4;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
position: relative;
|
position: relative;
|
||||||
@include S(padding, 20px);
|
|
||||||
@include S(border-radius, $globalBorderRadius);
|
@include S(border-radius, $globalBorderRadius);
|
||||||
box-shadow: 0 D(5px) D(15px) rgba(#000, 0.2);
|
box-shadow: 0 D(5px) D(10px) rgba(#000, 0.4);
|
||||||
|
border: D(1px) solid rgba(#000, 0.1);
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
> .badge {
|
> .badge {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@ -432,7 +471,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
> .dlcLogo {
|
> .dlcLogo {
|
||||||
@include S(width, 190px);
|
@include S(width, 120px);
|
||||||
}
|
}
|
||||||
|
|
||||||
> button {
|
> button {
|
||||||
@ -443,18 +482,68 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.owned {
|
||||||
|
@include S(height, 118px);
|
||||||
|
@include S(width, 250px);
|
||||||
|
background: uiResource("puzzle_460x215_15.png") center D(-5px) / cover repeat;
|
||||||
|
.dlcLogo {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
> button {
|
||||||
|
margin: 0;
|
||||||
|
@include S(padding, 2px, 10px);
|
||||||
|
position: absolute;
|
||||||
|
@include S(top, 10px);
|
||||||
|
@include S(right, 10px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&.notOwned {
|
&.notOwned {
|
||||||
|
@include S(height, 200px);
|
||||||
|
@include S(width, 250px);
|
||||||
|
border: 0;
|
||||||
|
background: uiResource("puzzle_460x215_15.png") center D(-5px) / 100% repeat;
|
||||||
|
.dlcLogo {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
&::before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
background: linear-gradient(180deg, rgba(#222529, 0.1) 40%, rgba(#222529, 1) 70%);
|
||||||
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
@include S(bottom, 35px);
|
||||||
|
z-index: 50;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: block;
|
||||||
@include PlainText;
|
@include PlainText;
|
||||||
color: #333;
|
color: rgba(#fff, 0.9);
|
||||||
@include S(margin-top, 10px);
|
@include S(padding, 10px);
|
||||||
@include S(width, 190px);
|
@include SuperSmallText;
|
||||||
}
|
}
|
||||||
> button {
|
> button {
|
||||||
|
pointer-events: all;
|
||||||
|
@include S(padding, 4px, 10px);
|
||||||
|
margin: 0;
|
||||||
|
background: #47c599;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@include S(margin-top, 10px);
|
position: absolute;
|
||||||
@include S(width, 190px);
|
@include S(bottom, 10px);
|
||||||
@include S(padding, 10px, 20px);
|
@include S(right, 10px);
|
||||||
|
z-index: 100;
|
||||||
|
@include PlainText;
|
||||||
|
z-index: 200;
|
||||||
|
color: #111215;
|
||||||
|
box-shadow: 0 D(2px) D(4px) rgba(#000, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -556,6 +645,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.mainContainer {
|
.mainContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -570,7 +660,6 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
justify-self: center;
|
justify-self: center;
|
||||||
grid-row: 1 / 4;
|
|
||||||
grid-column: 1 / 2;
|
grid-column: 1 / 2;
|
||||||
@include S(max-width, 400px);
|
@include S(max-width, 400px);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -25,7 +25,7 @@ export const THIRDPARTY_URLS = {
|
|||||||
standaloneCampaignLink: G_IS_STANDALONE
|
standaloneCampaignLink: G_IS_STANDALONE
|
||||||
? "https://get.shapez.io/bundle/$campaign"
|
? "https://get.shapez.io/bundle/$campaign"
|
||||||
: "https://get.shapez.io/$campaign",
|
: "https://get.shapez.io/$campaign",
|
||||||
puzzleDlcStorePage: "https://store.steampowered.com/app/1625400/shapezio__Puzzle_DLC",
|
puzzleDlcStorePage: "https://get.shapez.io/mm_puzzle_dlc?target=dlc",
|
||||||
|
|
||||||
levelTutorialVideos: {
|
levelTutorialVideos: {
|
||||||
21: "https://www.youtube.com/watch?v=0nUfRLMCcgo&",
|
21: "https://www.youtube.com/watch?v=0nUfRLMCcgo&",
|
||||||
|
@ -41,7 +41,8 @@ export class MainMenuState extends GameState {
|
|||||||
const showLanguageIcon = !G_CHINA_VERSION && !G_WEGAME_VERSION;
|
const showLanguageIcon = !G_CHINA_VERSION && !G_WEGAME_VERSION;
|
||||||
const showExitAppButton = G_IS_STANDALONE;
|
const showExitAppButton = G_IS_STANDALONE;
|
||||||
const showPuzzleDLC =
|
const showPuzzleDLC =
|
||||||
!G_WEGAME_VERSION && (G_IS_STANDALONE || WEB_STEAM_SSO_AUTHENTICATED) && !G_IS_STEAM_DEMO;
|
G_IS_DEV ||
|
||||||
|
(!G_WEGAME_VERSION && (G_IS_STANDALONE || WEB_STEAM_SSO_AUTHENTICATED) && !G_IS_STEAM_DEMO);
|
||||||
const showWegameFooter = G_WEGAME_VERSION;
|
const showWegameFooter = G_WEGAME_VERSION;
|
||||||
const hasMods = MODS.anyModsActive();
|
const hasMods = MODS.anyModsActive();
|
||||||
|
|
||||||
@ -67,7 +68,6 @@ export class MainMenuState extends GameState {
|
|||||||
showExternalLinks && this.app.restrictionMgr.getIsStandaloneMarketingActive();
|
showExternalLinks && this.app.restrictionMgr.getIsStandaloneMarketingActive();
|
||||||
|
|
||||||
const ownsPuzzleDLC =
|
const ownsPuzzleDLC =
|
||||||
G_IS_DEV ||
|
|
||||||
WEB_STEAM_SSO_AUTHENTICATED ||
|
WEB_STEAM_SSO_AUTHENTICATED ||
|
||||||
(G_IS_STANDALONE &&
|
(G_IS_STANDALONE &&
|
||||||
!G_IS_STEAM_DEMO &&
|
!G_IS_STEAM_DEMO &&
|
||||||
@ -165,39 +165,41 @@ export class MainMenuState extends GameState {
|
|||||||
|
|
||||||
<div class="sideContainer">
|
<div class="sideContainer">
|
||||||
${showDemoAdvertisement ? `<div class="standaloneBanner">${bannerHtml}</div>` : ""}
|
${showDemoAdvertisement ? `<div class="standaloneBanner">${bannerHtml}</div>` : ""}
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
${
|
${
|
||||||
showPuzzleDLC && ownsPuzzleDLC && !hasMods
|
showPuzzleDLC
|
||||||
? `
|
? `
|
||||||
<div class="puzzleContainer">
|
|
||||||
<img class="dlcLogo" src="${cachebust(
|
${
|
||||||
G_CHINA_VERSION || G_WEGAME_VERSION
|
ownsPuzzleDLC && !hasMods
|
||||||
? "res/puzzle_dlc_logo_china.png"
|
? `
|
||||||
: "res/puzzle_dlc_logo.png"
|
<div class="puzzleContainer owned">
|
||||||
)}" alt="shapez.io Logo">
|
|
||||||
<button class="styledButton puzzleDlcPlayButton">${T.mainMenu.play}</button>
|
<button class="styledButton puzzleDlcPlayButton">${T.mainMenu.play}</button>
|
||||||
</div>`
|
</div>`
|
||||||
: ""
|
: ""
|
||||||
}
|
}
|
||||||
|
|
||||||
${
|
${
|
||||||
showPuzzleDLC && !ownsPuzzleDLC && !hasMods
|
!ownsPuzzleDLC && !hasMods
|
||||||
? `
|
? `
|
||||||
<div class="puzzleContainer notOwned">
|
<div class="puzzleContainer notOwned">
|
||||||
<img class="dlcLogo" src="${cachebust(
|
|
||||||
G_CHINA_VERSION || G_WEGAME_VERSION
|
|
||||||
? "res/puzzle_dlc_logo_china.png"
|
|
||||||
: "res/puzzle_dlc_logo.png"
|
|
||||||
)}" alt="shapez.io Logo">
|
|
||||||
<p>${T.mainMenu.puzzleDlcText}</p>
|
<p>${T.mainMenu.puzzleDlcText}</p>
|
||||||
<button class="styledButton puzzleDlcGetButton">${
|
<button class="styledButton puzzleDlcGetButton">${T.mainMenu.puzzleDlcViewNow}</button>
|
||||||
T.mainMenu.puzzleDlcViewNow
|
|
||||||
}</button>
|
|
||||||
</div>`
|
</div>`
|
||||||
: ""
|
: ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
<div class="mainNews kiwiClicker">
|
||||||
|
<div class="text">Check out this small side project I am working on right now!</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
${
|
${
|
||||||
hasMods
|
hasMods
|
||||||
? `
|
? `
|
||||||
@ -232,6 +234,9 @@ export class MainMenuState extends GameState {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
${
|
${
|
||||||
showWegameFooter
|
showWegameFooter
|
||||||
? `
|
? `
|
||||||
@ -441,6 +446,7 @@ export class MainMenuState extends GameState {
|
|||||||
".exitAppButton": this.onExitAppButtonClicked,
|
".exitAppButton": this.onExitAppButtonClicked,
|
||||||
".steamLink": this.onSteamLinkClicked,
|
".steamLink": this.onSteamLinkClicked,
|
||||||
".steamLinkSocial": this.onSteamLinkClickedSocial,
|
".steamLinkSocial": this.onSteamLinkClickedSocial,
|
||||||
|
".kiwiClicker": this.onKiwiClickerClicked,
|
||||||
".discordLink": () => {
|
".discordLink": () => {
|
||||||
this.app.platformWrapper.openExternalLink(THIRDPARTY_URLS.discord);
|
this.app.platformWrapper.openExternalLink(THIRDPARTY_URLS.discord);
|
||||||
},
|
},
|
||||||
@ -552,7 +558,13 @@ export class MainMenuState extends GameState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onPuzzleWishlistButtonClicked() {
|
onPuzzleWishlistButtonClicked() {
|
||||||
this.app.platformWrapper.openExternalLink(THIRDPARTY_URLS.puzzleDlcStorePage + "?utm_medium=mmsl2");
|
this.app.platformWrapper.openExternalLink(THIRDPARTY_URLS.puzzleDlcStorePage);
|
||||||
|
}
|
||||||
|
|
||||||
|
onKiwiClickerClicked() {
|
||||||
|
this.app.platformWrapper.openExternalLink(
|
||||||
|
"https://store.steampowered.com/app/1980530/Kiwi_Clicker/?utm_medium=shapez"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
onBackButtonClicked() {
|
onBackButtonClicked() {
|
||||||
|
Loading…
Reference in New Issue
Block a user