upload path
Gitea Actions Requirements / Explore-Gitea-Actions (push) Waiting to run Details

This commit is contained in:
Kseninia Mikhaylova 2024-04-27 11:09:26 +03:00
parent 66aaf30fdd
commit bf520ccef8
8 changed files with 104 additions and 26 deletions

View File

@ -6,16 +6,16 @@ class Product(models.Model):
title = models.CharField(max_length=100) title = models.CharField(max_length=100)
description = models.TextField(default=None, null=True) description = models.TextField(default=None, null=True)
model3d = models.FileField( model3d = models.FileField(
default=None, blank=True, null=True, upload_to="back/files" default=None, blank=True, null=True, upload_to="files"
) )
image1 = models.ImageField( image1 = models.ImageField(
default=None, blank=True, null=True, upload_to="back/files" default=None, blank=True, null=True, upload_to="files"
) )
image2 = models.ImageField( image2 = models.ImageField(
default=None, blank=True, null=True, upload_to="back/files" default=None, blank=True, null=True, upload_to="files"
) )
image3 = models.ImageField( image3 = models.ImageField(
default=None, blank=True, null=True, upload_to="back/files" default=None, blank=True, null=True, upload_to="files"
) )
def __str__(self): def __str__(self):

View File

@ -1 +1,2 @@
VITE_SERVER_URL='http://localhost:8000' VITE_SERVER_URL='http://localhost:8000'
VITE_IMAGE_URL='https://demo.kustarshina.ru'

View File

@ -3,7 +3,8 @@ import { onMounted, reactive } from 'vue';
import { ModelFbx } from 'vue-3d-model'; import { ModelFbx } from 'vue-3d-model';
import { useProductStore } from './stores/product'; import { useProductStore } from './stores/product';
import type { ProductInfo } from './stores/product'; import type { ProductInfo } from './stores/product';
import { SERVER_URL } from './constants'
const IMAGE_URL = import.meta.env.VITE_IMAGE_URL ?? ''
type StateType = { type StateType = {
active_product?: ProductInfo active_product?: ProductInfo
@ -27,7 +28,7 @@ onMounted(async () => {
<template> <template>
<div class="container"> <div class="container">
<div class="sidebar"> <div class="sidebar">
<ul> <ul class="menu">
<li v-for="item in products.list"> <li v-for="item in products.list">
<a @click.stop.prevent="setActive(item.id)" :href="item.id.toString()"> <a @click.stop.prevent="setActive(item.id)" :href="item.id.toString()">
{{ item.title }} {{ item.title }}
@ -35,18 +36,19 @@ onMounted(async () => {
</li> </li>
</ul> </ul>
</div> </div>
<div class="header">Проекты Кустарщины</div> <div class="header"><span class="logo-header">Проекты Кустарщины</span></div>
<div class="product"> <div class="main product" v-if="state.active_product">
<div v-if="state.active_product">
<model-fbx v-if="state.active_product.model3d" class="product-model" <model-fbx v-if="state.active_product.model3d" class="product-model"
:src="`${SERVER_URL}/${state.active_product.model3d.replace('/back', '')}`"></model-fbx> :src="`${IMAGE_URL}/${state.active_product.model3d.replace('/back', '')}`"></model-fbx>
<div class="model-image" v-if="state.active_product.image1"> <div class="product-image" v-if="state.active_product.image1">
<img :src="state.active_product.image1" /> <img :src="`${IMAGE_URL}${state.active_product.image1}`" />
</div> </div>
<div class="product-description"> <div class="product-description">
{{ state.active_product.description }} {{ state.active_product.description }}
</div> </div>
</div> </div>
<div class="main" v-else>
<img class="logo-img" src="./assets/logo.png" />
</div> </div>
</div> </div>
</template> </template>

BIN
front/src/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

View File

@ -1,28 +1,103 @@
@import '../../node_modules/reset-css/sass/reset'; @import '../../node_modules/reset-css/sass/reset';
$accentColor: #ef570c;
body { body {
// background-color: red; font-family: 'main';
}
@font-face {
font-family: 'logo';
src: url('../fonts/logo.ttf');
}
@font-face {
font-family: 'main';
src: url('../fonts/main.otf');
} }
.container { .container {
display: grid; display: grid;
grid-template-columns: repeat(5, 1fr); grid-template-columns: 16rem 1fr;
grid-template-rows: repeat(5, 1fr); grid-template-rows: 4rem 1fr;
grid-column-gap: 0px; gap: 0px 0px;
grid-row-gap: 0px; grid-template-areas:
"header header"
"sidebar content";
min-height: 100vh;
padding: 0 2rem;
} }
.sidebar { .sidebar {
grid-area: 1 / 1 / 6 / 2; grid-area: sidebar;
} }
.header { .header {
grid-area: 1 / 2 / 2 / 6; grid-area: header;
justify-content: center;
} }
.main { .main {
grid-area: 2 / 2 / 6 / 6; grid-area: content;
}
.main,
.header,
.sidebar {
display: flex;
align-items: center;
}
.menu {
padding: 1rem;
display: flex;
flex-direction: column;
gap: 1rem;
li {
padding: 0.5rem 0;
a {
text-decoration: none;
&,
&:hover,
&:active,
&:visited {
color: $accentColor;
}
}
}
} }
.model { .model {
max-width: 33vw; max-width: 33vw;
} }
.product {
gap: 1rem;
&-image {
flex-basis: 50%;
flex-shrink: 0;
}
}
.logo {
&-header {
font-family: 'logo';
font-size: 3rem;
}
&-img {
width: 54%;
display: block;
margin: auto;
}
}
img {
max-width: 100%;
}

BIN
front/src/fonts/logo.ttf Normal file

Binary file not shown.

BIN
front/src/fonts/main.otf Normal file

Binary file not shown.