Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0696bd2
Merge pull request #149 from Resaki1/main
therealhoodboy May 15, 2024
6a68b5d
Improved BuildMenu UI
invalid-email-address May 16, 2024
a041f86
Changed gold icon
invalid-email-address May 16, 2024
fcd9af4
Optimized map rendering
invalid-email-address May 17, 2024
317c272
Improved graphics
invalid-email-address May 17, 2024
f23705a
Added webkit backdrop filter for BuildMenu
invalid-email-address May 17, 2024
03e5bfc
Removed warnings
invalid-email-address May 17, 2024
ba5369c
Removed comments, Added license
Sep 2, 2024
2747b25
UI enhancements
invalid-email-address Sep 8, 2024
645cd8e
Added basic location saving feature
invalid-email-address Sep 10, 2024
0c6c790
Disabled zoom on input
invalid-email-address Sep 11, 2024
694ff17
Added save-home feature
invalid-email-address Sep 11, 2024
c95faa8
Added animations and improved UI consistency
invalid-email-address Sep 11, 2024
823639e
Added fadeout animation
invalid-email-address Sep 11, 2024
eb6dfa6
Code formatting
invalid-email-address Sep 11, 2024
81a94c7
Merge branch 'dev' of https://github.com/Resaki1/taal into dev
invalid-email-address Sep 11, 2024
8dba6aa
Removed warnings, fixed location saving
invalid-email-address Sep 12, 2024
a5cabaa
Added emojis to buildings ressources
invalid-email-address Sep 12, 2024
49d4dff
Fix BuildMenu after changes
invalid-email-address Sep 12, 2024
c714bf7
Added various animations
invalid-email-address Sep 12, 2024
511d6fa
BuildMenuEntry fix
invalid-email-address Sep 12, 2024
910dac0
Fixed animation not appearing
invalid-email-address Sep 12, 2024
9186300
Increase general size of elements
invalid-email-address Sep 12, 2024
fd5edc9
Increased animation speed
invalid-email-address Sep 24, 2024
50c1f58
Removed rgb pulse
invalid-email-address Sep 24, 2024
4b5058d
Optimized imports
invalid-email-address Sep 24, 2024
1f18768
Removed unused css properties
invalid-email-address Sep 24, 2024
741dba2
Code cleanup
invalid-email-address Sep 24, 2024
451ed77
Removed unused function
invalid-email-address Sep 24, 2024
4f176a9
Code cleanup
invalid-email-address Sep 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Build your own town in a 3D procedurally generated cubic world with Taal!" />
<link rel="apple-touch-icon" href="/ios/192.png" />
Expand Down
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^29.5.11",
"@types/lodash.debounce": "^4.0.7",
"@types/node": "^20.8.9",
"@types/react": "^18.2.48",
"@types/react-dom": "^18.2.7",
"@types/three": "^0.164.0",
"@types/lodash.debounce": "^4.0.7",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.8.0",
"@vitejs/plugin-react": "^4.2.1",
"classnames": "^2.3.2",
"eslint": "^8.45.0",
"eslint-plugin-react": "^7.33.2",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.33.2",
"firebase": "^10.1.0",
"prettier": "^3.0.3",
"prettier": "^3.3.3",
"sass": "^1.77.1",
"typescript": "^5.4.5",
"vite": "^5.2.11",
Expand Down
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useStore } from './store/store';
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
import { DirectionalLight, Vector3 } from 'three';
import './App.scss';
import { TilePropertiesMenu } from './components/TilePropertiesMenu/TilePropertiesMenu';

const App = () => {
const sun = useRef<DirectionalLight>(null!);
Expand Down Expand Up @@ -51,6 +52,7 @@ const App = () => {
</Canvas>
<BuildMenu />
<RessourceMenu />
<TilePropertiesMenu />
</div>
);
};
Expand Down
85 changes: 72 additions & 13 deletions src/components/BuildMenu/BuildMenu.scss
Original file line number Diff line number Diff line change
@@ -1,25 +1,84 @@
$build-menu-height: 64px;

@keyframes fadeIn {
from {
opacity: 0;
filter: blur(4px);
}
to {
opacity: 1;
filter: blur(0);
}
}

@keyframes fadeOut {
from {
opacity: 1;
filter: blur(0);
}
to {
opacity: 0;
filter: blur(4px);
}
}

.fade-in {
animation: fadeIn 0.2s ;
will-change: opacity, filter;
}

.fade-out {
animation: fadeOut 0.2s ;
will-change: opacity, filter;
}

.build-menu {
position: absolute;
bottom: 0;
bottom: env(safe-area-inset-bottom);
width: 100%;
background-color: #21494db3;
color: white;
height: 0;
transition: transform 0.2s cubic-bezier(0.59, 0.33, 0.16, 1.29);
position: fixed;
left: 50cqi;
bottom: calc(env(safe-area-inset-bottom) + 8%);
border-radius: 20px;
height: fit-content;
width: fit-content;

background-color: rgba(33, 73, 77, 0.702);
@media (prefers-color-scheme: light) {
background-color: #d3c57a66;
}
@media (prefers-color-scheme: dark) {
background-color: rgba(33, 73, 77, 0.702);
}
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
color: #e6e6e6;
display: flex;
flex-direction: row;
justify-content: center;
padding: 8px;
gap: 32px;
box-sizing: border-box;
align-items: baseline;
padding: 10px 48px;
gap: 38px;
box-sizing: content-box;
backdrop-filter: saturate(180%) blur(30px);
transform: translateY($build-menu-height);
-webkit-backdrop-filter: saturate(180%) blur(30px);

animation: fadeOut 0.4s forwards ease-out;
transform: translateX(50%);

&--visible {
transform: translateY(0);
opacity: 1;
animation: fadeIn 0.3s forwards ease-in;

transform: translateX(-50%) translateY(0);
height: $build-menu-height;
}

&--hidden {
opacity: 0;
height: $build-menu-height;
}

@media (orientation: landscape) {
max-height: 30%;
left: 20cqi;
top: 36cqi;
}
}
7 changes: 3 additions & 4 deletions src/components/BuildMenu/BuildMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,16 @@ export const BuildMenu = () => {
const hasEnoughRessources = (building: BuildingType) => {
const recipe = getCostsOfBuilding(building);
let hasEnough = true;
Object.entries(recipe).forEach((cost) => {
if (ressources[cost[0] as Ressources] < recipe[cost[0] as Ressources]!) hasEnough = false;
});
Object.entries(recipe).forEach(([key, value]) => {
if (ressources[key as Ressources] < value.amount) hasEnough = false; });
return hasEnough;
};

return (
<div
className={classNames({
'build-menu': true,
'build-menu--visible': selected,
'build-menu--visible': selected && (existingBuilding !== undefined || getPossibleBuildingType().length > 0),
})}
>
{selected && existingBuilding === undefined ? (
Expand Down
Loading