diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 2f88d12a..98cb52b9 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,62 +1,13 @@ + + diff --git a/frontend/src/assets/scss/app.scss b/frontend/src/assets/scss/app.scss index 9d86ab36..e13cadf9 100644 --- a/frontend/src/assets/scss/app.scss +++ b/frontend/src/assets/scss/app.scss @@ -1,7 +1,5 @@ -// general @import "libs/normalize.scss"; +@import "common.scss"; @import "fonts.scss"; -@import "ds-system/ds.scss"; -@import "visually-hidden.scss"; @import "scaffolding.scss"; -@import "mixins/mixins"; +@import "visually-hidden.scss"; \ No newline at end of file diff --git a/frontend/src/assets/scss/common.scss b/frontend/src/assets/scss/common.scss new file mode 100644 index 00000000..5d06db4d --- /dev/null +++ b/frontend/src/assets/scss/common.scss @@ -0,0 +1,289 @@ +@import "ds-system/ds.scss"; +@import "mixins/mixins.scss"; + +.content { + padding-top: 20px; +} + +.content__wrapper { + display: flex; + align-items: flex-start; + flex-wrap: wrap; + + width: 920px; + margin: 0 auto; + padding-right: 2.12%; + padding-bottom: 30px; + padding-left: 2.12%; +} + +.sheet { + padding-top: 15px; + + border-radius: 8px; + background-color: $white; + box-shadow: $shadow-light; +} + +.sheet__title { + padding-right: 18px; + padding-left: 18px; +} + +.sheet__content { + display: flex; + align-items: center; + flex-wrap: wrap; + + margin-top: 8px; + padding-top: 18px; + padding-right: 18px; + padding-left: 18px; + + border-top: 1px solid rgba($green-500, 0.1); +} + +.title { + box-sizing: border-box; + width: 100%; + margin: 0; + + color: $black; + + &--big { + @include b-s36-h42; + } + + &--small { + @include b-s18-h21; + } +} + +.radio { + cursor: pointer; + + span { + @include r-s16-h19; + + position: relative; + + padding-left: 28px; + + &:before { + @include p_center-v; + + display: block; + + box-sizing: border-box; + width: 20px; + height: 20px; + + content: ""; + transition: 0.3s; + + border: 1px solid $purple-400; + border-radius: 50%; + background-color: $white; + } + } + + &:hover { + input:not(:checked):not(:disabled) + span { + &:before { + border-color: $purple-800; + } + } + } + + input { + display: none; + + &:checked + span { + &:before { + border: 6px solid $green-500; + } + } + + &:disabled { + & + span { + &:before { + border-color: $purple-400; + background-color: $silver-200; + } + } + + &:checked + span { + &:before { + border: 6px solid $purple-400; + } + } + } + } +} + +.button { + $bl: &; + + @include b-s18-h21; + font-family: inherit; + display: block; + + box-sizing: border-box; + margin: 0; + padding: 0; + + cursor: pointer; + transition: 0.3s; + text-align: center; + + color: $white; + border: none; + border-radius: 8px; + outline: none; + box-shadow: $shadow-medium; + + background-color: $green-500; + + &:hover:not(:active):not(:disabled) { + background-color: $green-400; + } + + &:active:not(:disabled) { + background-color: $green-600; + } + + &:focus:not(:disabled) { + opacity: 0.5; + } + + &:disabled { + background-color: $green-300; + color: rgba($white, 0.2); + cursor: default; + } + + &--border { + background-color: transparent; + border: 1px solid $green-500; + color: $black; + box-shadow: none; + + &:hover:not(:active):not(:disabled) { + color: $green-500; + border-color: $green-500; + background-color: transparent; + } + + &:active:not(:disabled) { + color: $green-600; + border-color: $green-600; + background-color: transparent; + } + + &:disabled { + opacity: 0.5; + } + } + + &--transparent { + @include b-s14-h16; + background-color: transparent; + box-shadow: none; + color: $black; + + &:hover:not(:active):not(:disabled) { + color: $red-800; + background-color: transparent; + } + + &:active:not(:disabled) { + color: $red-900; + background-color: transparent; + } + + &:disabled { + opacity: 0.25; + } + } + + &--arrow { + &::before { + content: ""; + background-image: url("@/assets/img/button-arrow.svg"); + background-position: center; + background-repeat: no-repeat; + margin-right: 16px; + width: 18px; + height: 18px; + display: inline-block; + vertical-align: middle; + transform: translateY(-1px); + } + } + + &--white { + background-color: $white; + color: $green-500; + } +} + +.input { + display: block; + + span { + @include r-s14-h16; + + display: block; + + margin-bottom: 4px; + } + + input { + @include r-s16-h19; + + display: block; + + box-sizing: border-box; + width: 100%; + margin: 0; + padding: 8px 16px; + + transition: 0.3s; + + color: $black; + border: 1px solid $purple-400; + border-radius: 8px; + outline: none; + background-color: $white; + + font-family: inherit; + + &:focus { + border-color: $green-500; + } + } + + &:hover { + input { + border-color: $black; + } + } + + &--big-label { + display: flex; + align-items: center; + + span { + @include b-s16-h19; + + margin-right: 16px; + + white-space: nowrap; + } + } +} + +.container { + width: 770px; + margin: 0 auto; +} \ No newline at end of file diff --git a/frontend/src/common/components/AppCounter.vue b/frontend/src/common/components/AppCounter.vue new file mode 100644 index 00000000..48861838 --- /dev/null +++ b/frontend/src/common/components/AppCounter.vue @@ -0,0 +1,199 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/common/components/AppDrag.vue b/frontend/src/common/components/AppDrag.vue new file mode 100644 index 00000000..193b1919 --- /dev/null +++ b/frontend/src/common/components/AppDrag.vue @@ -0,0 +1,30 @@ + + + \ No newline at end of file diff --git a/frontend/src/common/components/AppDrop.vue b/frontend/src/common/components/AppDrop.vue new file mode 100644 index 00000000..2ef19b67 --- /dev/null +++ b/frontend/src/common/components/AppDrop.vue @@ -0,0 +1,25 @@ + + + \ No newline at end of file diff --git a/frontend/src/common/constants/index.js b/frontend/src/common/constants/index.js new file mode 100644 index 00000000..fd81a0d6 --- /dev/null +++ b/frontend/src/common/constants/index.js @@ -0,0 +1,2 @@ +export const DATA_TRANSFER_PAYLOAD = "payload"; +export const MAX_INGREDIENT_COUNT = 3; \ No newline at end of file diff --git a/frontend/src/common/helpers/normalize.js b/frontend/src/common/helpers/normalize.js new file mode 100644 index 00000000..5a9652b6 --- /dev/null +++ b/frontend/src/common/helpers/normalize.js @@ -0,0 +1,32 @@ +import doughSizes from "@/common/data/doughSizes"; +import ingredients from "@/common/data/ingredients"; +import sauces from "@/common/data/sauces"; +import sizes from "@/common/data/sizes"; + +export const normalizeDough = (dough) => { + return { + ...dough, + value: doughSizes[dough.id], + }; +}; + +export const normalizeSize = (size) => { + return { + ...size, + value: sizes[size.id], + }; +}; + +export const normalizeIngredients = (ingredient) => { + return { + ...ingredient, + value: ingredients[ingredient.id], + }; +}; + +export const normalizeSauces = (sauce) => { + return { + ...sauce, + value: sauces[sauce.id], + }; +}; \ No newline at end of file diff --git a/frontend/src/layouts/AppLayout.vue b/frontend/src/layouts/AppLayout.vue new file mode 100644 index 00000000..798bcd83 --- /dev/null +++ b/frontend/src/layouts/AppLayout.vue @@ -0,0 +1,36 @@ + + + diff --git a/frontend/src/layouts/DefaultHeader.vue b/frontend/src/layouts/DefaultHeader.vue new file mode 100644 index 00000000..e9524cb7 --- /dev/null +++ b/frontend/src/layouts/DefaultHeader.vue @@ -0,0 +1,176 @@ + + \ No newline at end of file diff --git a/frontend/src/layouts/DefaultLayout.vue b/frontend/src/layouts/DefaultLayout.vue new file mode 100644 index 00000000..94b51013 --- /dev/null +++ b/frontend/src/layouts/DefaultLayout.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/frontend/src/layouts/SimpleLayout.vue b/frontend/src/layouts/SimpleLayout.vue new file mode 100644 index 00000000..ba4672f5 --- /dev/null +++ b/frontend/src/layouts/SimpleLayout.vue @@ -0,0 +1,3 @@ + diff --git a/frontend/src/main.js b/frontend/src/main.js index 786af441..a090886d 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -1,12 +1,13 @@ import { createApp } from "vue"; import { createPinia } from "pinia"; +import router from "@/router"; import App from "./App.vue"; -import router from "./router"; const app = createApp(App); app.use(createPinia()); + app.use(router); app.mount("#app"); diff --git a/frontend/src/modules/constructor/DiameterSelector.vue b/frontend/src/modules/constructor/DiameterSelector.vue new file mode 100644 index 00000000..a6451230 --- /dev/null +++ b/frontend/src/modules/constructor/DiameterSelector.vue @@ -0,0 +1,113 @@ + + + + + + \ No newline at end of file diff --git a/frontend/src/modules/constructor/DoughSelector.vue b/frontend/src/modules/constructor/DoughSelector.vue new file mode 100644 index 00000000..5281e6f9 --- /dev/null +++ b/frontend/src/modules/constructor/DoughSelector.vue @@ -0,0 +1,95 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/modules/constructor/IngredientsSelector.vue b/frontend/src/modules/constructor/IngredientsSelector.vue new file mode 100644 index 00000000..6e0d1ae9 --- /dev/null +++ b/frontend/src/modules/constructor/IngredientsSelector.vue @@ -0,0 +1,270 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/modules/constructor/PizzaConstructor.vue b/frontend/src/modules/constructor/PizzaConstructor.vue new file mode 100644 index 00000000..5193a99f --- /dev/null +++ b/frontend/src/modules/constructor/PizzaConstructor.vue @@ -0,0 +1,235 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/modules/constructor/SauceSelector.vue b/frontend/src/modules/constructor/SauceSelector.vue new file mode 100644 index 00000000..c4d32f2d --- /dev/null +++ b/frontend/src/modules/constructor/SauceSelector.vue @@ -0,0 +1,61 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index 6c13dc55..26c56f0b 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -1,8 +1,9 @@ import { createRouter, createWebHistory } from "vue-router"; +import {routes} from './routes'; const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), - routes: [], + routes, }); export default router; diff --git a/frontend/src/router/routes.js b/frontend/src/router/routes.js new file mode 100644 index 00000000..b57c4236 --- /dev/null +++ b/frontend/src/router/routes.js @@ -0,0 +1,38 @@ +export const routes = [ + { + path: "/", + name: "home", + component: () => import("@/views/HomeView.vue"), + meta: { layout: "DefaultLayout" }, + }, + { + path: "/login", + name: "login", + component: () => import("@/views/LoginView.vue"), + meta: { layout: "SimpleLayout" }, + }, + { + path: "/cart", + name: "cart", + component: () => import("@/views/CartView.vue"), + meta: { layout: "DefaultLayout" }, + }, + { + path: "/user", + name: "user", + component: () => import("@/views/UserView.vue"), + meta: { layout: "DefaultLayout" }, + children: [ + { + path: "orders", + name: "orders", + component: () => import("@/views/OrdersView.vue"), + }, + { + path: "profile", + name: "profile", + component: () => import("@/views/ProfileView.vue"), + }, + ], + }, +]; diff --git a/frontend/src/views/CartView.vue b/frontend/src/views/CartView.vue new file mode 100644 index 00000000..e69de29b diff --git a/frontend/src/views/HomeView.vue b/frontend/src/views/HomeView.vue new file mode 100644 index 00000000..d5ca267e --- /dev/null +++ b/frontend/src/views/HomeView.vue @@ -0,0 +1,156 @@ + + + + + diff --git a/frontend/src/views/LoginView.vue b/frontend/src/views/LoginView.vue new file mode 100644 index 00000000..e69de29b diff --git a/frontend/src/views/OrdersView.vue b/frontend/src/views/OrdersView.vue new file mode 100644 index 00000000..e69de29b diff --git a/frontend/src/views/ProfileView.vue b/frontend/src/views/ProfileView.vue new file mode 100644 index 00000000..e69de29b diff --git a/frontend/src/views/UserView.vue b/frontend/src/views/UserView.vue new file mode 100644 index 00000000..e69de29b