mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 20:03:21 +00:00
Add color change to Join the Community!
This commit is contained in:
parent
8a2b860932
commit
8c0045a8d7
@ -86,8 +86,14 @@
|
||||
}
|
||||
|
||||
.HomePage_Discord {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
border-radius: 10px;
|
||||
|
||||
max-height: 40px;
|
||||
max-width: 150px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
gap: 8px;
|
||||
align-self: center;
|
||||
@ -98,13 +104,27 @@
|
||||
height: 100%;
|
||||
max-width: 44px;
|
||||
max-height: 30px;
|
||||
|
||||
fill: #5865F2;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 16px;
|
||||
max-width: 90px;
|
||||
}
|
||||
}
|
||||
|
||||
.HomePage_Discord:hover {
|
||||
cursor: pointer;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
max-height: 50px;
|
||||
max-width: 160px;
|
||||
|
||||
background-color: #5865F2;
|
||||
}
|
||||
|
||||
.HomePage_Text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
@ -4,6 +4,8 @@ import HomeButton from "@widgets/HomeButton";
|
||||
|
||||
import { ReactComponent as DiscordLogo } from "@icons/discord.svg";
|
||||
|
||||
import { openUrl } from "@app/utils";
|
||||
|
||||
import "@css/pages/HomePage.scss";
|
||||
|
||||
class HomePage extends React.Component<any, any> {
|
||||
@ -39,7 +41,10 @@ class HomePage extends React.Component<any, any> {
|
||||
<p>trademarks and copyrights of HoYoverse.</p>
|
||||
</div>
|
||||
|
||||
<div className={"HomePage_Discord"}>
|
||||
<div
|
||||
className={"HomePage_Discord"}
|
||||
onClick={() => openUrl("https://discord.gg/grasscutter")}
|
||||
>
|
||||
<DiscordLogo />
|
||||
<p>Join the Community!</p>
|
||||
</div>
|
||||
|
@ -144,3 +144,13 @@ export async function fetchEntityData(entity: Entity): Promise<EntityInfo> {
|
||||
export async function copyToClipboard(text: string): Promise<void> {
|
||||
await navigator.clipboard.writeText(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens a URL in a new tab.
|
||||
* Uses the window.open() method.
|
||||
*
|
||||
* @param url The URL to open.
|
||||
*/
|
||||
export function openUrl(url: string): void {
|
||||
window.open(url, "_blank");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user