Fixed CraftingTab mobile version.
This commit is contained in:
parent
f2ed608bfc
commit
72359821b4
@ -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}
|
||||||
|
|||||||
@ -1,109 +1,145 @@
|
|||||||
.crafting-container {
|
.crafting-container {
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.crafting-header {
|
.crafting-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
.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;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
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 {
|
||||||
transform: translateY(-5px);
|
transform: translateY(-5px);
|
||||||
border-color: var(--primary-color);
|
border-color: var(--primary-color);
|
||||||
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;
|
||||||
color: #fff;
|
line-height: 1.2;
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
.crafting-categories::-webkit-scrollbar {
|
.crafting-categories::-webkit-scrollbar {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.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 {
|
||||||
background: var(--primary-color);
|
background: var(--primary-color);
|
||||||
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 {
|
|
||||||
padding: 8px 16px;
|
|
||||||
font-size: 0.75rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.crafting-grid {
|
.crafting-header {
|
||||||
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
|
margin-bottom: 12px;
|
||||||
gap: 10px;
|
}
|
||||||
}
|
|
||||||
|
.crafting-header h2 {
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.crafting-grid {
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
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%;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user