# Camko ![](https://i.imgur.com/fDiqULm.png) https://camko.netlify.app/ --- ![](https://i.imgur.com/GpNnYmT.jpg) --- ![](https://i.imgur.com/aw4e9ZS.png) --- ## Planing S(t)ages ![image](https://media.giphy.com/media/9xAtq58rypAHeZmdd2/giphy.gif) --- ### The Whole Structure ![](https://i.imgur.com/74HIZ3y.png) --- ### Compnents and relations ![](https://i.imgur.com/wOXgLhM.png) --- ### UI/UX Stuff ![](https://i.imgur.com/xLSpB9R.png) --- ### Design Inspo ![](https://i.imgur.com/DkNS37D.jpg) --- ### Folder Stricture ![](https://i.imgur.com/5sOI21N.png) --- ## Lesssons + Struggles - It's good to keep states on the top level so you can pass them where needed - Plan states carefully as it can get messy! ```jsx= // fetched data const [data, setData] = React.useState(null); // provided username const [username, setUsername] = React.useState(""); const [gameMode, setGameMode] = React.useState(""); // oponentsData const [opponent, setOpponent] = React.useState(null); const [err, setErr] = React.useState('') ``` --- - SO MANY TERNARIES ```jsx= {name && name !== 'Giovanna L R T Aveiro' ? name : login} ``` --- ## Updateing results ```jsx= const Result = ({ data, setData, opponent, setGameMode, setOpponent }) => { const { public_repos, followers, following } = data; const userPower = public_repos + followers + following; const opponentPower = opponent.public_repos + opponent.followers + opponent.following; React.useEffect(() => { if (userPower >= opponentPower) { data.followers += 10; setData(data); } else { data.following += 2; setData(data); } }, []); ``` --- # CSS ```css= background: -webkit-linear-gradient(red, orange, yellow); -webkit-background-clip: border-box; -webkit-text-fill-color: black; ``` ```jsx= className={username === login ? "fighter-profile" : "opponent"} ``` --- ## More Time - Refactror code and states - Cool animations for fight and fight entrance - Fight log ` - Tests
{"metaMigratedAt":"2023-06-15T07:55:14.592Z","metaMigratedFrom":"Content","title":"Camko","breaks":true,"contributors":"[{\"id\":\"11eba2be-5fbb-4639-85ec-7ad40264d41d\",\"add\":1042,\"del\":66},{\"id\":\"3c970cbc-e792-4aab-bd26-9f18c46b45b6\",\"add\":1973,\"del\":924}]"}
    194 views