mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 23:46:03 +01:00
refactor(nui): Styling and sizing changes
This commit is contained in:
@@ -12,6 +12,7 @@ import { fetchNui } from "../utils/fetchNui";
|
|||||||
interface Props {
|
interface Props {
|
||||||
duration: number;
|
duration: number;
|
||||||
position?: "middle" | "bottom";
|
position?: "middle" | "bottom";
|
||||||
|
percent?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
debugData([
|
debugData([
|
||||||
@@ -74,9 +75,11 @@ const CircleProgressbar: React.FC = () => {
|
|||||||
<ScaleFade in={visible} unmountOnExit>
|
<ScaleFade in={visible} unmountOnExit>
|
||||||
<CircularProgress
|
<CircularProgress
|
||||||
value={value}
|
value={value}
|
||||||
size="7rem"
|
size="5rem"
|
||||||
|
trackColor="rgba(0, 0, 0, 0.6)"
|
||||||
onAnimationEnd={progressComplete}
|
onAnimationEnd={progressComplete}
|
||||||
color={cancelled ? "rgb(198, 40, 40)" : "blue.400"}
|
thickness={6}
|
||||||
|
color={cancelled ? "rgb(198, 40, 40)" : "white"}
|
||||||
sx={
|
sx={
|
||||||
!cancelled
|
!cancelled
|
||||||
? {
|
? {
|
||||||
@@ -95,7 +98,9 @@ const CircleProgressbar: React.FC = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<CircularProgressLabel color="black">{value}%</CircularProgressLabel>
|
<CircularProgressLabel fontFamily="Fira Mono">
|
||||||
|
{value}%
|
||||||
|
</CircularProgressLabel>
|
||||||
</CircularProgress>
|
</CircularProgress>
|
||||||
</ScaleFade>
|
</ScaleFade>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@@ -67,8 +67,10 @@ const Progressbar: React.FC = () => {
|
|||||||
<Progress
|
<Progress
|
||||||
value={100}
|
value={100}
|
||||||
height="2.8rem"
|
height="2.8rem"
|
||||||
|
borderRadius="sm"
|
||||||
fontFamily="Inter"
|
fontFamily="Inter"
|
||||||
flex="1 1 auto"
|
flex="1 1 auto"
|
||||||
|
boxShadow="lg"
|
||||||
onAnimationEnd={progressComplete}
|
onAnimationEnd={progressComplete}
|
||||||
sx={
|
sx={
|
||||||
!cancelled
|
!cancelled
|
||||||
@@ -76,6 +78,7 @@ const Progressbar: React.FC = () => {
|
|||||||
// really scuffed solution but works, wonder if there's a better way to do this?
|
// really scuffed solution but works, wonder if there's a better way to do this?
|
||||||
"> div:first-of-type": {
|
"> div:first-of-type": {
|
||||||
animation: `progress-bar linear ${duration}ms`,
|
animation: `progress-bar linear ${duration}ms`,
|
||||||
|
borderRadius: "none",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
@@ -86,7 +89,9 @@ const Progressbar: React.FC = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<ProgressLabel fontSize={20}>{label}</ProgressLabel>
|
<ProgressLabel fontSize={22} fontWeight="light">
|
||||||
|
{label}
|
||||||
|
</ProgressLabel>
|
||||||
</Progress>
|
</Progress>
|
||||||
</ScaleFade>
|
</ScaleFade>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -48,7 +48,14 @@ const TextUI: React.FC = () => {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<ScaleFade in={visible} unmountOnExit>
|
<ScaleFade in={visible} unmountOnExit>
|
||||||
<Box bg="blue.400" p={3} fontFamily="Poppins" style={data.style}>
|
<Box
|
||||||
|
bg="gray.700"
|
||||||
|
boxShadow="lg"
|
||||||
|
p={3}
|
||||||
|
fontFamily="Poppins"
|
||||||
|
style={data.style}
|
||||||
|
borderRadius="md"
|
||||||
|
>
|
||||||
<Text>{data.text}</Text>
|
<Text>{data.text}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</ScaleFade>
|
</ScaleFade>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;700&display=swap");
|
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;700&display=swap");
|
||||||
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&display=swap");
|
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500&display=swap");
|
||||||
|
@import url("https://fonts.googleapis.com/css2?family=Fira+Mono&display=swap");
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background: none !important;
|
background: none !important;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ library.add(fas, far, fab);
|
|||||||
if (isEnvBrowser()) {
|
if (isEnvBrowser()) {
|
||||||
const root = document.getElementById("root");
|
const root = document.getElementById("root");
|
||||||
|
|
||||||
|
// https://i.imgur.com/iPTAdYV.png - Night time img
|
||||||
root!.style.backgroundImage = 'url("https://i.imgur.com/3pzRj9n.png")';
|
root!.style.backgroundImage = 'url("https://i.imgur.com/3pzRj9n.png")';
|
||||||
root!.style.backgroundSize = "cover";
|
root!.style.backgroundSize = "cover";
|
||||||
root!.style.backgroundRepeat = "no-repeat";
|
root!.style.backgroundRepeat = "no-repeat";
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ export const theme = extendTheme({
|
|||||||
Progress: {
|
Progress: {
|
||||||
baseStyle: {
|
baseStyle: {
|
||||||
filledTrack: {
|
filledTrack: {
|
||||||
bg: 'blue.400'
|
bg: 'green.400'
|
||||||
},
|
},
|
||||||
track: {
|
track: {
|
||||||
bg: 'rgba(0, 0, 0, 0.6)'
|
bg: 'rgba(0, 0, 0, 0.6)'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user