Skip to content

Commit

Permalink
massive UI improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
zin-lin committed Dec 20, 2023
1 parent 9f22b45 commit 0c5b0e1
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import Payment from "./views/Payment";
import {Elements} from "@stripe/react-stripe-js";
import { loadStripe } from '@stripe/stripe-js';
import {createProxyMiddleware, RequestHandler} from 'http-proxy-middleware';
import Project from "./views/Project";

// main app
function App() {
Expand All @@ -48,6 +49,7 @@ function App() {
<Route path='/eventadd/' element={<EventAdd/>} />
<Route path='/eventview/' element={<EventView/>} />
<Route path='/pay/:uid' element={<Payment/>} />
<Route path='/project/:pid' element={<Project/>} />
</Routes>
</div>
<MobileNav/>
Expand Down
28 changes: 26 additions & 2 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ body { background: var(--primary);
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
scrollbar-face-color: transparent; /* Hide the face of the scrollbar */
scrollbar-highlight-color: transparent; /* Hide the highlight of the scrollbar */
}

code {
Expand All @@ -46,9 +48,14 @@ App{
/* width */
::-webkit-scrollbar {
width: 10px;
height: 10px;
margin-right: 10px;
}

::-webkit-scrollbar-corner {
background: transparent;
}


/* Handle */
::-webkit-scrollbar-thumb:hover {
Expand Down Expand Up @@ -615,7 +622,7 @@ button.white-shadow:focus {

hr {
border: 0.2px solid #0000000c;
color: #00000054;
color: rgba(0, 0, 0, 0.71);
}

.panelList {
Expand Down Expand Up @@ -854,6 +861,23 @@ p.aText {
box-shadow: 2px 2px 7px rgba(0, 0, 0, 0.4);
}

.highlight-less-dark{
border-radius: 7px;
padding: 5px;
padding-left: 14px;
padding-right: 14px;
background-color: rgba(14, 17, 17, 0.13);
color: #c9c9c9;
font-size: 15px;
color: rgba(128, 153, 169, 0.6);
transition: 0.4s ease;
}

.highlight-less-dark:hover{
background-color: rgba(7, 7, 7, 0.63);
box-shadow: 2px 2px 7px rgba(0, 0, 0, 0.4);
}

.dark{
color: #eee;
}
Expand Down Expand Up @@ -1172,7 +1196,7 @@ p.aText {

/* Handle */
.full-bg-img-mask::-webkit-scrollbar-thumb:hover {
background: rgba(202, 202, 204, 0.79);
background: rgba(202, 202, 204, 0.48);
}

.full-bg-img-mask::-webkit-scrollbar-thumb {
Expand Down
4 changes: 3 additions & 1 deletion src/views/BookViewPorts/updateBookPC.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ const UpdateBookPC: React.FC<Props>= (props:Props)=>{
<div style={{display: 'inline-block'}}>
<img src={sc} width={200}/>
<br/>
<button className='redx shRed' style={{padding: 10, marginTop: 50, width: 200}} onClick={updateMode}>
<button className='redx shRed' style={{padding: 10, marginTop: 50, width: 200}} onClick={()=>{
navigate('/project/'+bid)
}}>
<p>Start Working with Data Preparation</p></button>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/views/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import axios from "axios";
import {type} from "os";
import {useNavigate} from "react-router-dom";
import ProfilePage from "./ProfilePage";
import {ClipLoader} from "react-spinners";

interface Object {
email: string;
Expand Down Expand Up @@ -146,7 +147,7 @@ function Renderer (){
</div>
</div> : <ProfilePage name={email} id = {authed}></ProfilePage>}</div> :
<div id = 'loading' style={{display: 'flex', justifyContent: 'center'}}>
<img src={loading} style={{width: '60px', margin: '100px'}}/>
<ClipLoader color={'#f146cf'} loading={true}/>
</div>
}
</div>
Expand Down
125 changes: 125 additions & 0 deletions src/views/Project.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
import React, {useEffect, useState} from "react";
import {useNavigate, useParams} from "react-router-dom";
import {
GridLoader,
} from "react-spinners";
import InfiniteLoader from "flatlist-react/lib/___subComponents/InfiniteLoader";

interface Props{
bid : string;
}

interface Set {
attributes: string [];
status: number;
len: number;
rows: { [key: string]: any }[];

}
const Project: React.FC= ()=> {
const {pid} = useParams();
const [title, setTitle] = useState('Loading...')
const [load, setLoad] = useState(true);
const [len, setLen] = useState(10);
const [set, setSet] = useState<Set | undefined>(undefined);
const navigate = useNavigate();
const [attr, setAttribute] = useState('');

const setMode = (att:string) => {
setAttribute(att);
alert(att);
}

useEffect(()=>{
fetch(`/api/getbook/${pid}`).then(res => res.json()).then(data =>{
setTitle(data['title']);
fetch(`/api/get-project-rows/${len}/${pid}`).then(resp => resp.json()).then(
(dat:Set )=>{
if (dat.status !== 0){
setSet(dat)
console.log(dat)
}
}
)
setLoad(false)
console.log(data)
});
}, []);

return (<div className='page' style={{overflow:'hidden'}}>
<div style={{width:'100%', height:'100%', overflow:'auto',display:'flex', flex:1, position:'relative', transition:'0.6s ease', justifyContent:'center' }} className='full-bg-img-book' >
<div style={{width:'100%', textAlign:'center', height:'100%'}}>
<div style={{display:'flex', justifyContent:'center', alignItems:'center'}}>
<p style={{color:'#e534c8', fontSize:28, fontWeight:'bold'}}>{title}</p>
<span className="material-symbols-outlined highlight-dark" style={{color:'rgba(243,58,58,0.42)', marginLeft:10}}>
edit
</span>
<span className="material-symbols-outlined highlight-dark" style={{color:'rgba(72,175,231,0.42)', marginLeft:10}}
onClick={()=>{
navigate(`/updatebook/${pid}`)
}}>
arrow_back_ios
</span>
<span className="material-symbols-outlined highlight-dark" style={{color:'rgba(238,238,238,0.42)', marginLeft:10}}>
apps
</span>
<span className="material-symbols-outlined highlight-dark" style={{color:'rgba(213,56,205,0.42)', marginLeft:10}}>
category
</span>
<span className="material-symbols-outlined highlight-dark" style={{color:'rgba(56,82,213,0.42)', marginLeft:10}}>
group
</span>
</div>
{set !== undefined? <div style={{width:'100%', height:'80%', display:'flex', justifyContent:'center'}}>
<div style={{width:'calc(80% - 80px)', height:'calc(100% - 80px)', borderRadius:30, background:'rgba(34,26,40,0.68)', padding:40,
boxShadow:'2px 2px 16px rgba(10,10,10,0.6)'}}>
<div style={{width:'100%', height:'100%', overflow:'auto'}}>
<div style={{display:'flex', justifyContent:'center', alignItems:'center'}}>


</div>

<div style={{width:'100%', display:'flex', }}>
<div style={{height:10, width:10, background:'#882c88'}}></div>
{
set?.attributes.map(att=>{
return <div style={{marginLeft:40, minWidth:180, wordWrap:'break-word', }} onClick={()=>{setMode(att)}} >
<p className='highlight-dark' style={{flexWrap:'wrap',
}}>{att}</p></div>
})
}
</div>
<hr style={{width: set.attributes.length*220}}/>

{
set.rows.map(row=>{
return <div>
<div style={{width:'100%', display:'flex', }}>
{
set?.attributes.map(at=>{
return <div style={{marginLeft:40, minWidth:180, wordWrap:'break-word', }}>
<p className='highlight-less-dark' style={{flexWrap:'wrap',
}}>{row[at]}</p>
</div>
})
}
</div>
<hr style={{width: set.attributes.length*220}}/>
</div>
})
}

</div>
</div>
</div>:
<div style={{width:'100%', justifyContent:'center', display:'flex', height:'100%', alignItems:'center'}}>
<GridLoader loading={true} color={'#e23ce8'} size={40}/>
</div>
}
</div>
</div>
</div>);
}

export default Project;

0 comments on commit 0c5b0e1

Please sign in to comment.