Fixed CraftingTab mobile version.

This commit is contained in:
MaksSlyzar 2026-04-03 23:52:18 +03:00
parent f2ed608bfc
commit 72359821b4
2 changed files with 118 additions and 78 deletions

View File

@ -5,6 +5,7 @@ import "./styles/CraftingTab.css";
import CategorySelector from "../components/CategorySelector"; import CategorySelector from "../components/CategorySelector";
import CraftModal from "./components/CraftModal"; import CraftModal from "./components/CraftModal";
import { config } from "../../../config/api"; import { config } from "../../../config/api";
import MeteorRegion from "../../../components/Meteor/MeteorRegion.jsx";
const CraftingTab = () => { const CraftingTab = () => {
const { socket } = useSocket(); const { socket } = useSocket();
@ -109,8 +110,11 @@ const CraftingTab = () => {
}; };
return ( return (
<div className="tab-content active"> <div
<div className="crafting-container"> className="tab-content active"
style={{ height: "100%", display: "flex", flexDirection: "column" }}
>
<MeteorRegion className="crafting-container">
{activeCraft && ( {activeCraft && (
<div className="active-craft-panel"> <div className="active-craft-panel">
<div className="craft-info"> <div className="craft-info">
@ -184,7 +188,7 @@ const CraftingTab = () => {
); );
})} })}
</div> </div>
</div> </MeteorRegion>
<CraftModal <CraftModal
recipe={selectedRecipe} recipe={selectedRecipe}

View File

@ -1,5 +1,8 @@
.crafting-container { .crafting-container {
padding: 20px; padding: 20px;
height: 100%;
display: flex;
flex-direction: column;
} }
.crafting-header { .crafting-header {
@ -9,9 +12,13 @@
margin-bottom: 20px; margin-bottom: 20px;
} }
.crafting-header h2 {
font-size: 1.2rem;
}
.crafting-grid { .crafting-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
gap: 15px; gap: 15px;
margin-top: 20px; margin-top: 20px;
} }
@ -19,7 +26,7 @@
.recipe-card { .recipe-card {
background: var(--bg-secondary); background: var(--bg-secondary);
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
padding: 20px; padding: 15px;
border-radius: 8px; border-radius: 8px;
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
@ -27,7 +34,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: 10px; gap: 8px;
} }
.recipe-card:hover { .recipe-card:hover {
@ -36,22 +43,28 @@
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
} }
.recipe-icon { .recipe-icon img {
font-size: 1.5rem; max-width: 50px;
color: var(--primary-color); height: auto;
} }
.recipe-name { .recipe-name {
font-size: 0.9rem; font-size: 0.85rem;
line-height: 1.2;
color: #fff; color: #fff;
font-weight: 500;
}
.badge-time {
font-size: 0.75rem;
color: var(--text-secondary);
} }
/* Категорії */
.crafting-categories { .crafting-categories {
display: flex; display: flex;
gap: 12px; gap: 10px;
margin-bottom: 20px; margin-bottom: 15px;
padding: 10px 5px; padding: 5px 0;
overflow-x: auto; overflow-x: auto;
scrollbar-width: none; scrollbar-width: none;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
@ -63,24 +76,18 @@
.crafting-cat-btn { .crafting-cat-btn {
flex: 0 0 auto; flex: 0 0 auto;
padding: 10px 22px; padding: 8px 16px;
background: rgba(255, 255, 255, 0.03); background: rgba(255, 255, 255, 0.03);
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
border-radius: 6px; border-radius: 4px;
color: var(--text-secondary); color: var(--text-secondary);
font-family: 'Orbitron', sans-serif; font-family: "Orbitron", sans-serif;
font-size: 0.85rem; font-size: 0.75rem;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 1px; letter-spacing: 0.5px;
white-space: nowrap; white-space: nowrap;
cursor: pointer; cursor: pointer;
transition: all 0.25s ease; transition: all 0.2s ease;
}
.crafting-cat-btn:hover {
background: rgba(var(--primary-rgb), 0.08);
border-color: var(--primary-color);
color: #fff;
} }
.crafting-cat-btn.active { .crafting-cat-btn.active {
@ -88,22 +95,51 @@
border-color: var(--primary-color); border-color: var(--primary-color);
color: #000; color: #000;
font-weight: 700; font-weight: 700;
box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.3);
} }
@media (max-width: 768px) { @media (max-width: 600px) {
.crafting-categories { .crafting-container {
gap: 8px; padding: 12px;
margin-bottom: 15px;
} }
.crafting-cat-btn { .crafting-header {
padding: 8px 16px; margin-bottom: 12px;
font-size: 0.75rem; }
.crafting-header h2 {
font-size: 1rem;
} }
.crafting-grid { .crafting-grid {
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); grid-template-columns: repeat(2, 1fr);
gap: 10px; gap: 8px;
margin-top: 10px;
}
.recipe-card {
padding: 10px;
gap: 6px;
}
.recipe-icon img {
max-width: 40px;
}
.recipe-name {
font-size: 0.75rem;
}
.crafting-cat-btn {
padding: 6px 12px;
font-size: 0.7rem;
} }
} }
.tab-content.active {
height: 100%;
overflow: hidden;
}
.meteor-region-content {
width: 100%;
}