Initial commit
This commit is contained in:
commit
9eea07b17f
10623 files changed
+1510829
No files matched your search
+57
@@ -0,0 +1,57 @@
|
||||
@import "tailwindcss/base";
|
||||
@import "tailwindcss/components";
|
||||
@import "tailwindcss/utilities";
|
||||
|
||||
body {
|
||||
@apply text-white bg-[#190032] select-none;
|
||||
}
|
||||
|
||||
img {
|
||||
transition: transform 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
img:hover {
|
||||
transform: scale(1.08);
|
||||
}
|
||||
|
||||
#right-bar {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
#right-bar img {
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
/* Container for the dropdown */
|
||||
.dropdown-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* Styling the dropdown itself */
|
||||
.dropdown {
|
||||
font-size: 16px;
|
||||
padding: 8px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
background-color: #1e1e1e;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
/* Change background color when hovered */
|
||||
.dropdown:hover {
|
||||
background-color: #222222;
|
||||
}
|
||||
|
||||
/* Option styling */
|
||||
.dropdown option {
|
||||
font-size: 16px;
|
||||
padding: 8px;
|
||||
background-color: #1e1e1e;
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
import { useState } from "react";
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import "./App.css";
|
||||
|
||||
document.addEventListener('contextmenu', (e) => e.preventDefault());
|
||||
document.addEventListener('dragstart', (e) => e.preventDefault());
|
||||
|
||||
function App() {
|
||||
const [result, setResult] = useState(false);
|
||||
const [selectedVersion, setSelectedVersion] = useState<number>(0);
|
||||
|
||||
async function launch() {
|
||||
setResult(await invoke("launch", { ver: selectedVersion }));
|
||||
}
|
||||
|
||||
const handleChange = (event: React.ChangeEvent<HTMLSelectElement>) => {
|
||||
setSelectedVersion(Number(event.target.value));
|
||||
};
|
||||
|
||||
return (
|
||||
<main className="container">
|
||||
<div id="top-bar" className="relative w-full h-16 top-0">
|
||||
<img src="/close.png" width="96" className="m-2 fixed left-0 cursor-pointer" />
|
||||
<img src="/settings.png" width="96" className="m-2 fixed right-0" />
|
||||
</div>
|
||||
<div id="launch-menu" className="absolute top-[15%] left-1/2 transform -translate-x-1/2">
|
||||
<img src="/launch.png" width="180" className="m-1 cursor-pointer" onClick={launch} />
|
||||
<div className="dropdown-container">
|
||||
<select className="dropdown" onChange={handleChange}>
|
||||
<option value="0">2.2</option>
|
||||
<option value="1">2.1</option>
|
||||
<option value="2">2.0</option>
|
||||
<option value="3">1.9</option>
|
||||
</select>
|
||||
</div>
|
||||
<p>{result}</p>
|
||||
</div>
|
||||
<div id="bottom-bar">
|
||||
<div id="right-bar">
|
||||
<a href="https://xps.lncvrt.xyz/discord" target="_blank"><img src="/discord.png" width="80" /></a>
|
||||
<a href="https://xps.lncvrt.xyz/twitter" target="_blank"><img src="/twitter.png" width="80" /></a>
|
||||
<a href="https://xps.lncvrt.xyz/youtube" target="_blank"><img src="/youtube.png" width="80" /></a>
|
||||
<a href="https://xps.lncvrt.xyz/twitch" target="_blank"><img src="/twitch.png" width="80" /></a>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
@@ -0,0 +1,14 @@
|
||||
import "./App.css";
|
||||
|
||||
document.addEventListener('contextmenu', (e) => e.preventDefault());
|
||||
document.addEventListener('dragstart', (e) => e.preventDefault());
|
||||
|
||||
function Loading() {
|
||||
return (
|
||||
<main className="container">
|
||||
<p>loading</p>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
export default Loading;
|
||||
@@ -0,0 +1,15 @@
|
||||
import "./App.css";
|
||||
|
||||
document.addEventListener('contextmenu', (e) => e.preventDefault());
|
||||
document.addEventListener('dragstart', (e) => e.preventDefault());
|
||||
|
||||
function UpdateRequired() {
|
||||
return (
|
||||
<main className="container">
|
||||
<p>update required</p>
|
||||
<a href="https://xps.lncvrt.xyz/download/windows">click here to update</a>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
export default UpdateRequired;
|
||||
@@ -0,0 +1,31 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import App from "./App";
|
||||
import UpdateRequired from "./UpdateRequired";
|
||||
import Loading from "./Loading";
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
|
||||
function Root() {
|
||||
const [isVersionValid, setIsVersionValid] = useState<boolean | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
async function checkVersion() {
|
||||
const result = await invoke("check_version") as boolean;
|
||||
setIsVersionValid(result);
|
||||
}
|
||||
|
||||
checkVersion();
|
||||
}, []);
|
||||
|
||||
if (isVersionValid === null) {
|
||||
return <Loading />;
|
||||
}
|
||||
|
||||
return isVersionValid ? <App /> : <UpdateRequired />;
|
||||
}
|
||||
|
||||
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
|
||||
<React.StrictMode>
|
||||
<Root />
|
||||
</React.StrictMode>
|
||||
);
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
/// <reference types="vite/client" />
|
||||
Reference in new issue
Block a user