Initial commit

This commit is contained in:
2025-10-04 18:22:24 +03:00
commit 2852c2c054
291 changed files with 38109 additions and 0 deletions

View File

@@ -0,0 +1,703 @@
.cartContainer {
padding: 15px;
transition: all 0.3s ease;
height: 92vh;
overflow: auto;
scrollbar-width: none;
}
.youMightAlsoLikeContainer {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100%;
overflow: auto;
scrollbar-width: none;
}
:global(.darkApp) .youMightAlsoLikeContainer path {
fill: var(--primary);
}
/* Prevent keyboard from appearing automatically on mobile */
@media (max-width: 768px) {
.cartContainer input,
.cartContainer textarea,
.cartContainer select {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: transparent;
font-size: 16px; /* Prevents zoom on iOS */
}
.cartContainer input:focus,
.cartContainer textarea:focus,
.cartContainer select:focus {
outline: none;
-webkit-tap-highlight-color: transparent;
font-size: 16px; /* Prevents zoom on iOS */
}
/* Additional mobile-specific rules */
.cartContainer input[type="text"],
.cartContainer input[type="email"],
.cartContainer input[type="tel"],
.cartContainer input[type="number"],
.cartContainer textarea {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
border-radius: 0;
}
}
/* Enhanced responsive cart container */
@media (min-width: 769px) and (max-width: 1024px) {
.cartContainer {
padding: 24px;
}
}
@media (min-width: 1025px) {
.cartContainer {
padding: 32px;
max-width: 1200px;
margin: 0 auto;
}
}
.cartContent {
width: 100%;
}
.cartItems {
display: flex;
flex-direction: column;
gap: 16px;
}
/* Enhanced responsive cart items */
@media (min-width: 769px) and (max-width: 1024px) {
.cartItems {
gap: 20px;
margin-bottom: 32px;
}
}
@media (min-width: 1025px) {
.cartItems {
gap: 24px;
margin-bottom: 40px;
}
}
.container {
display: flex;
gap: 16px;
overflow-x: auto;
scrollbar-width: none;
-ms-overflow-style: none;
padding: 8px 0;
}
.container::-webkit-scrollbar {
display: none;
}
/* Enhanced responsive container */
@media (min-width: 769px) and (max-width: 1024px) {
.container {
gap: 20px;
padding: 12px 0;
}
}
@media (min-width: 1025px) {
.container {
gap: 24px;
padding: 16px 0;
}
}
.menuItemImage {
object-fit: cover;
border-radius: 8px;
transition: transform 0.3s ease;
width: 90px;
height: 80px;
margin-bottom: 6px;
}
.menuItemImage:hover {
transform: scale(1.05);
}
/* Enhanced responsive menu item images */
@media (min-width: 769px) and (max-width: 1024px) {
.menuItemImage {
border-radius: 12px;
}
}
@media (min-width: 1025px) {
.menuItemImage {
border-radius: 16px;
}
}
.popularMenuItemImage {
width: 73px;
height: 73px;
object-fit: cover;
border-radius: 8px;
transition: transform 0.3s ease;
}
.popularMenuItemImage:hover {
transform: scale(1.05);
}
.popularMenuItemImageMobile {
width: 73px;
height: 73px;
min-height: 73px;
object-fit: cover;
}
.popularMenuItemImageTablet {
width: 90px;
height: 90px;
border-radius: 12px;
}
.popularMenuItemImageDesktop {
width: 110px;
height: 110px;
border-radius: 16px;
}
.itemDescription {
font-size: 12px !important;
transition: color 0.3s ease;
}
.tableNumberCard :global(.ant-select-selector) {
border-radius: 888px !important;
}
.tableNumberCard :global(.ant-select-selection-overflow) {
top: 5px !important;
}
/* Enhanced responsive item description */
@media (min-width: 769px) and (max-width: 1024px) {
.itemDescription {
font-size: 14px !important;
}
}
@media (min-width: 1025px) {
.itemDescription {
font-size: 16px !important;
}
}
.couponApplyIcon {
margin-left: 8px;
font-size: 14px;
}
/* Enhanced responsive coupon apply icon */
@media (min-width: 769px) and (max-width: 1024px) {
.couponApplyIcon {
margin-left: 10px;
font-size: 16px;
}
}
@media (min-width: 1025px) {
.couponApplyIcon {
margin-left: 12px;
font-size: 18px;
}
}
.donateHandIcon {
color: #ffb700;
font-size: 24px;
}
/* Enhanced responsive donate hand icon */
@media (min-width: 769px) and (max-width: 1024px) {
.donateHandIcon {
font-size: 28px;
}
}
@media (min-width: 1025px) {
.donateHandIcon {
font-size: 32px;
}
}
/* Enhanced responsive cart sidebar for desktop */
/* Desktop Cart Layout Styles */
.desktopCartContainer {
max-width: 100vw;
margin: 0 auto;
padding: 40px 24px;
background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
min-height: 100vh;
}
.desktopMainContent {
background: #ffffff;
border-radius: 24px;
padding: 32px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
border: 1px solid rgba(0, 0, 0, 0.06);
}
.desktopSectionHeader {
margin-bottom: 32px;
padding-bottom: 16px;
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.desktopEmptyCart {
text-align: center;
padding: 80px 40px;
background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
border-radius: 20px;
border: 2px dashed rgba(0, 0, 0, 0.1);
}
.desktopEmptyCartIcon {
margin-bottom: 24px;
opacity: 0.6;
}
.desktopEmptyCartIcon svg {
width: 80px;
height: 80px;
color: rgba(0, 0, 0, 0.3);
}
.desktopCartItemsSection {
margin-bottom: 48px;
}
.desktopCartItems {
display: flex;
flex-direction: column;
gap: 24px;
}
.desktopCartItem {
border: 1px solid rgba(0, 0, 0, 0.08);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
overflow: hidden;
}
.desktopImageContainer {
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
border-radius: 16px;
}
.desktopMenuItemImage {
object-fit: cover;
transition: transform 0.3s ease;
}
.desktopCartItem:hover .desktopMenuItemImage {
transform: scale(1.05);
}
.desktopItemDetails {
padding: 8px 0;
}
.desktopItemDescription {
line-height: 1.6;
color: rgba(0, 0, 0, 0.65);
}
.desktopPriceContainer {
margin-top: 16px;
}
.desktopPrice {
font-size: 18px;
color: #1890ff;
}
.desktopActionsContainer {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
margin-top: 4px;
}
.desktopRecommendationsSection {
margin-top: 48px;
padding-top: 48px;
border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.desktopRecommendationsGrid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 24px;
margin-top: 24px;
}
.desktopRecommendationCard {
border: 1px solid rgba(0, 0, 0, 0.06);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
overflow: hidden;
position: relative;
}
.desktopRecommendationCard:hover {
transform: translateY(-6px);
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
border-color: rgba(0, 0, 0, 0.12);
}
.desktopRecommendationContent {
position: relative;
padding: 16px;
}
.desktopQuickAddButton {
position: absolute;
top: 12px;
right: 12px;
z-index: 2;
opacity: 0;
transform: scale(0.8);
transition: all 0.3s ease;
}
.desktopRecommendationCard:hover .desktopQuickAddButton {
opacity: 1;
transform: scale(1);
}
.desktopQuickAddIcon {
background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
border: none;
box-shadow: 0 4px 16px rgba(24, 144, 255, 0.3);
}
.desktopQuickAddIcon:hover {
transform: scale(1.1);
box-shadow: 0 6px 20px rgba(24, 144, 255, 0.4);
}
.desktopRecommendationImage {
border-radius: 16px;
margin-bottom: 16px;
transition: transform 0.3s ease;
}
.desktopRecommendationCard:hover .desktopRecommendationImage {
transform: scale(1.05);
}
.desktopRecommendationInfo {
text-align: center;
}
.desktopRecommendationName {
font-size: 16px;
margin-bottom: 8px;
line-height: 1.4;
}
.desktopRecommendationPrice {
font-size: 14px;
color: #1890ff;
font-weight: 600;
}
/* Desktop Sidebar Styles */
.desktopSidebar {
position: sticky;
top: 24px;
display: flex;
flex-direction: column;
gap: 24px;
}
.desktopSidebarCard {
border: 1px solid rgba(0, 0, 0, 0.06);
border-radius: 20px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
transition: all 0.3s ease;
overflow: hidden;
}
.desktopSidebarCard:hover {
transform: translateY(-2px);
box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
}
.desktopTipCard {
background: linear-gradient(135deg, #fff7e6 0%, #fff2d9 100%);
border: 1px solid rgba(255, 183, 0, 0.2);
}
.desktopTipHeader {
display: flex;
align-items: center;
gap: 16px;
margin-bottom: 16px;
}
.desktopTipIcon {
width: 48px;
height: 48px;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 183, 0, 0.1);
border-radius: 12px;
}
.desktopTipButtons {
display: flex;
flex-direction: column;
gap: 12px;
}
.desktopTipButton {
height: 44px;
font-weight: 500;
transition: all 0.3s ease;
}
.desktopTipButton:hover {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.desktopCheckoutButton {
background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
border: none;
box-shadow: 0 6px 24px rgba(24, 144, 255, 0.3);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.desktopCheckoutButton:hover {
transform: translateY(-2px);
box-shadow: 0 8px 32px rgba(24, 144, 255, 0.4);
background: linear-gradient(135deg, #40a9ff 0%, #69c0ff 100%);
}
.desktopCheckoutButton:active {
transform: translateY(0);
}
.cartItems :global(.ant-card-hoverable:hover) {
box-shadow: 0 0 0 0 !important;
}
[data-theme="dark"] .menuItemImage,
[data-theme="dark"] .popularMenuItemImage {
border-color: rgba(255, 255, 255, 0.1);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .itemDescription {
color: rgba(255, 255, 255, 0.75) !important;
}
/* Enhanced responsive animations */
@media (prefers-reduced-motion: no-preference) {
.cartItems {
animation: fadeInUp 0.6s ease-out;
}
.container {
animation: fadeInUp 1s ease-out;
}
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Enhanced responsive focus states */
.cartContainer:focus,
.menuItemImage:focus,
.popularMenuItemImage:focus {
outline: 2px solid var(--primary);
outline-offset: 2px;
}
@media (min-width: 768px) {
.cartContainer:focus,
.menuItemImage:focus,
.popularMenuItemImage:focus {
outline-offset: 4px;
}
}
/* Enhanced responsive print styles */
@media print {
.cartContainer {
background-color: white !important;
color: black !important;
}
.container {
display: none !important;
}
}
/* Enhanced responsive hover effects */
@media (hover: hover) {
.menuItemImage:hover,
.popularMenuItemImage:hover {
transform: scale(1.05);
}
[data-theme="dark"] .orderSummary:hover {
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
}
/* Enhanced responsive grid for you might also like section */
@media (min-width: 768px) {
.responsive-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
gap: 16px;
overflow-x: visible;
}
}
@media (min-width: 1024px) {
.responsive-grid {
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
gap: 20px;
}
}
@media (min-width: 1280px) {
.responsive-grid {
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
gap: 24px;
}
}
/* Enhanced responsive animations */
@media (prefers-reduced-motion: no-preference) {
.desktopCartItem {
animation: fadeInUp 0.6s ease-out;
}
.desktopRecommendationCard {
animation: fadeInUp 0.6s ease-out;
animation-delay: calc(var(--animation-order, 0) * 0.1s);
}
.desktopSidebarCard {
animation: fadeInRight 0.6s ease-out;
animation-delay: calc(var(--animation-order, 0) * 0.1s);
}
}
@keyframes fadeInRight {
from {
opacity: 0;
transform: translateX(30px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
/* Enhanced focus states for accessibility */
.desktopCartItem:focus-within,
.desktopRecommendationCard:focus-within,
.desktopSidebarCard:focus-within {
outline: 2px solid #1890ff;
outline-offset: 2px;
}
.desktopCheckoutButton:focus {
outline: 2px solid #ffffff;
outline-offset: 2px;
}
/* Print styles for desktop */
@media print {
.desktopCartContainer {
background: none;
box-shadow: none;
}
.desktopMainContent,
.desktopSidebarCard {
box-shadow: none;
border: 1px solid #000;
}
}
/* Responsive adjustments for large desktop */
@media (min-width: 1440px) {
.desktopCartContainer {
max-width: 100vw;
padding: 48px 32px;
}
.desktopMainContent {
padding: 40px;
}
.desktopRecommendationsGrid {
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 32px;
}
.desktopCartItems {
gap: 32px;
}
.desktopSidebar {
gap: 32px;
}
.desktopEmptyCart {
padding: 100px 60px;
}
.desktopEmptyCartIcon svg {
width: 100px;
height: 100px;
}
}
.itemDescriptionIcons svg {
width: 18px;
height: 18px;
}

View File

@@ -0,0 +1,170 @@
import { PlusOutlined } from "@ant-design/icons";
import { Grid, Space } from "antd";
import ArabicPrice from "components/ArabicPrice";
import ImageWithFallback from "components/ImageWithFallback";
import { ItemDescriptionIcons } from "components/ItemDescriptionIcons/ItemDescriptionIcons";
import ProText from "components/ProText";
import { menuItems } from "data/menuItems";
import { addItem } from "features/order/orderSlice";
import { useTranslation } from "react-i18next";
import { useAppDispatch, useAppSelector } from "redux/hooks";
import { colors } from "ThemeConstants";
import { default_image } from "utils/constants";
import { Product } from "utils/types/appTypes";
import styles from "../cart.module.css";
const { useBreakpoint } = Grid;
export default function YouMightAlsoLike() {
const { t } = useTranslation();
const dispatch = useAppDispatch();
const { isRTL } = useAppSelector((state) => state.locale);
const { sm, md } = useBreakpoint();
const isMobile = !sm;
const isTablet = sm && !md;
const handleQuickAdd = (item: Product) => {
dispatch(
addItem({
item: {
id: Number(item.id),
name: item.name,
price: item.price,
image: item.image,
description: item.description,
variant: "None",
},
quantity: 1,
})
);
};
return (
<>
<div style={{ marginBottom: 16 }}>
<ProText
strong
style={{
fontSize: isMobile ? 18 : isTablet ? 18 : 20,
}}
>
{t("cart.youMightAlsoLike")}
</ProText>
</div>
<div className={`${styles.youMightAlsoLikeContainer} responsive-grid`}>
{menuItems.map((item: Product) => (
<div key={item.id}>
<div
style={{
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "space-between",
width: isMobile ? "95px" : isTablet ? "120px" : "140px",
position: "relative",
height: 155,
overflow: "hidden",
}}
>
<div
style={{
width: isMobile ? 18 : 24,
height: isMobile ? 18 : 24,
borderRadius: "50%",
top: isMobile ? 50 : 80,
position: "absolute",
right: isMobile ? 15 : 20,
display: "flex",
flexDirection: "row",
justifyContent: "center",
cursor: "pointer",
backgroundColor: "white",
zIndex: 999,
}}
>
<PlusOutlined
onClick={(e) => {
e.stopPropagation();
handleQuickAdd(item);
}}
style={{
color: colors.primary,
fontSize: isMobile ? 14 : 16,
}}
/>
</div>
<ImageWithFallback
src={item.image}
alt={item.name}
className={`${styles.popularMenuItemImage} ${
isMobile
? styles.popularMenuItemImageMobile
: isTablet
? styles.popularMenuItemImageTablet
: styles.popularMenuItemImageDesktop
}`}
width={isMobile ? 73 : isTablet ? 90 : 110}
height={isMobile ? 73 : isTablet ? 90 : 110}
fallbackSrc={default_image}
/>
<div
style={{
display: "flex",
flexDirection: "row",
justifyContent: "start",
marginTop: 5,
...(isRTL ? { marginRight: -20 } : { marginLeft: -10 }),
}}
>
<ItemDescriptionIcons className={styles.itemDescriptionIcons} />
</div>
<Space
direction="vertical"
size="small"
style={{
flex: 1,
rowGap: 0,
height: 40,
}}
>
<div style={{ height: 25 }}>
<ProText
style={{
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
padding: 3,
fontSize: isMobile ? 12 : isTablet ? 14 : 16,
width: isMobile ? 80 : isTablet ? 100 : 120,
display: "inline-block",
fontWeight: 600,
}}
>
{item.name}
</ProText>
</div>
<ArabicPrice
price={item.price}
style={{
margin: 0,
WebkitLineClamp: 1,
WebkitBoxOrient: "vertical",
overflow: "hidden",
textOverflow: "ellipsis",
padding: 3,
fontSize: isMobile ? 12 : isTablet ? 14 : 16,
fontWeight: 500,
}}
/>
</Space>
</div>
</div>
))}
</div>
</>
);
}

1113
src/pages/cart/page.tsx Normal file

File diff suppressed because it is too large Load Diff