frontend added
This commit is contained in:
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "frontend/NovelPlus-frontend"]
|
||||
path = frontend/NovelPlus-frontend
|
||||
url = https://github.com/Mikan-DS/NovelPlus-frontend.git
|
||||
4
.idea/NovelPlus.iml
generated
4
.idea/NovelPlus.iml
generated
@@ -14,6 +14,7 @@
|
||||
</component>
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/frontend/NovelPlus-frontend" isTestSource="false" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
@@ -23,7 +24,8 @@
|
||||
<option name="TEMPLATE_CONFIGURATION" value="Django" />
|
||||
<option name="TEMPLATE_FOLDERS">
|
||||
<list>
|
||||
<option value="$MODULE_DIR$/../NovelPlus\templates" />
|
||||
<option value="$MODULE_DIR$/templates" />
|
||||
<option value="$MODULE_DIR$/frontend/templates" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
1
frontend/NovelPlus-frontend
Submodule
1
frontend/NovelPlus-frontend
Submodule
Submodule frontend/NovelPlus-frontend added at 36c49097ab
15
frontend/react-to-django/template.html
Normal file
15
frontend/react-to-django/template.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{%% load static %%}
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>NovelPlus</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<script defer="defer" src="{%% static 'frontend/js/%s' %%}"></script>
|
||||
<link rel="stylesheet" href="{%% static 'frontend/css/%s' %%}">
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
51
frontend/react-to-django/update-frontend-part.py
Normal file
51
frontend/react-to-django/update-frontend-part.py
Normal file
@@ -0,0 +1,51 @@
|
||||
import glob
|
||||
import os
|
||||
import shutil
|
||||
|
||||
|
||||
|
||||
os.chdir("..")
|
||||
|
||||
for dir_name in os.listdir("."):
|
||||
if "frontend" in dir_name:
|
||||
break
|
||||
|
||||
print(dir_name)
|
||||
|
||||
os.chdir(dir_name)
|
||||
os.system('npm run build')
|
||||
|
||||
with open("../react-to-django/template.html", "r", encoding="UTF-8") as file:
|
||||
template = file.read()
|
||||
|
||||
# Получаем список файлов в директории
|
||||
js_files = glob.glob('build/static/js/*.js')
|
||||
|
||||
shutil.rmtree("../static/frontend/js/", ignore_errors=True)
|
||||
os.makedirs("../static/frontend/js/", exist_ok=True)
|
||||
# Копируем файлы в нужную директорию
|
||||
js_file = [i for i in js_files if "main" in os.path.basename(i)][0]
|
||||
shutil.copy(js_file, f'../static/frontend/js/{os.path.basename(js_file)}')
|
||||
|
||||
# Получаем список файлов в директории
|
||||
css_files = glob.glob('build/static/css/*.css')
|
||||
|
||||
shutil.rmtree("../static/frontend/css/", ignore_errors=True)
|
||||
os.makedirs("../static/frontend/css/", exist_ok=True)
|
||||
# Копируем файлы в нужную директорию
|
||||
css_file = [i for i in css_files if "main" in os.path.basename(i)][0]
|
||||
shutil.copy(css_file, f'../static/frontend/css/{os.path.basename(css_file)}')
|
||||
|
||||
shutil.rmtree("../static/media", ignore_errors=True)
|
||||
shutil.copytree("build/static/media", "../static/media", dirs_exist_ok=True)
|
||||
|
||||
|
||||
if not os.path.exists("../templates/frontend/"):
|
||||
os.makedirs("../templates/frontend", exist_ok=True)
|
||||
|
||||
with open("../templates/frontend/app.html", "w", encoding="UTF-8") as file:
|
||||
file.write(template % (os.path.basename(js_file), os.path.basename(css_file)))
|
||||
|
||||
os.chdir('../static')
|
||||
os.system('git add ./frontend/')
|
||||
os.system('git add ./media/')
|
||||
2
frontend/static/frontend/css/main.5a7bc931.css
Normal file
2
frontend/static/frontend/css/main.5a7bc931.css
Normal file
@@ -0,0 +1,2 @@
|
||||
@import url(https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700;800&display=swap);body{background-color:#ffe0ce;margin:0;padding:0}h1,h2{margin:0;text-transform:uppercase}h1{font-size:80px}h2{font-size:40px}.body-text{font-size:26px;font-weight:500}.body-text,.primary{font-family:Montserrat,sans-serif}.primary{background:#edc881;border:1px solid #7d5555;border-radius:40px;box-sizing:border-box;color:#7d5555;cursor:pointer;text-decoration:none;text-transform:uppercase;width:fit-content}.primary:hover{border-color:#000;color:#000}.primary.selected{background:#7d5555;border-color:#000;color:#edc881}.primary.large{font-size:80px;font-weight:600;padding:6px 54px}.primary.medium{font-size:40px;font-weight:500;padding:14px 54px}.primary.small{font-size:26px;font-weight:500;padding:10px 29px}.content-box{margin-left:auto;margin-right:auto;width:1880px}.fill-width{width:100%}.align-center,.align-end,.align-start,.horizontal-box,.stretched-box,.vertical-box{display:flex}.stretched-box{flex-direction:row;justify-content:space-between}.vertical-box{flex-direction:column}.horizontal-box{flex-direction:row}.align-end{align-items:flex-end}.align-center{align-items:center}.align-start{align-items:flex-start}.align-left{margin-right:auto}.section{margin:0 auto;min-height:300px;padding:30px 0}.header{background-color:#feb198;padding-bottom:40px;padding-top:40px}.header .bottom-menu,.header .upper-menu{padding-bottom:20px;padding-top:20px}.header .upper-menu{gap:60px}.header .bottom-menu{border-top:1px solid #000}.header .navigation{gap:20px}.header .avatar{height:100px;width:100px}.header .dropdown-menu{position:relative}.header .menu-button{background:none;border:none;cursor:pointer}.header .menu-content{background-color:#333;border:1px solid #fcfcfa;border-radius:5px;display:flex;flex-direction:column;padding:10px;width:max-content}.header .menu-content a{color:#fcfcfa;padding:10px 20px;text-decoration:none}.header .menu-content a:hover{background-color:#444}.header .menu-click-area{position:absolute;right:0;top:0}.header .menu-click-area>div{gap:10px}.card{color:#fff;text-decoration:none}.card,.card>div{height:350px;width:500px}.card>div{background:linear-gradient(180deg,#2d0c0c00 68.5%,#2d0c0c)}.card>div:hover{background:linear-gradient(180deg,#2d0c0c00 30.5%,#2d0c0c)}.card>div>div{color:#edc881;height:66px;margin-left:auto;margin-right:auto;text-align:center;width:450px}.store{grid-gap:39px;display:grid;gap:39px;grid-template-columns:min-content min-content min-content;width:1578px}.footer{background-color:#7d5555;padding:130px 150px}.footer a{color:#fff;font-family:Montserrat,sans-serif;font-size:40px;font-weight:500;text-decoration:none}.footer a:hover{color:#edc881}.vacancy{gap:56px}.mini-card{color:#000;gap:12px;text-decoration:none}.mini-card:hover{background-color:#feb198}.section.item .preview{gap:39px}
|
||||
/*# sourceMappingURL=main.5a7bc931.css.map*/
|
||||
3
frontend/static/frontend/js/main.d06055e6.js
Normal file
3
frontend/static/frontend/js/main.d06055e6.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 24 KiB |
@@ -0,0 +1,3 @@
|
||||
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="50" cy="50" r="50" fill="#D9D9D9"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 155 B |
@@ -0,0 +1,3 @@
|
||||
<svg width="500" height="350" viewBox="0 0 500 350" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="500" height="350" fill="#EAE4E4"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 155 B |
@@ -0,0 +1,3 @@
|
||||
<svg width="350" height="200" viewBox="0 0 350 200" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="350" height="200" fill="#D9D9D9"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 155 B |
Reference in New Issue
Block a user