подвязала шрифты

This commit is contained in:
Tatyana 2025-08-18 15:45:16 +03:00
parent 8133a97fc7
commit ed2f6d6278
13 changed files with 105 additions and 24 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,36 @@
@import "tailwindcss"; @import "tailwindcss";
@font-face {
font-family: 'Poppins';
src: url('../src/assets/fonts/Poppins-Regular.woff2') format('woff2');
font-weight: 400; /* обычный */
font-style: normal;
}
@font-face {
font-family: 'Poppins';
src: url('../src/assets/fonts/Poppins-Medium.woff2') format('woff2');
font-weight: 500; /* Medium */
font-style: normal;
}
@font-face {
font-family: 'Poppins';
src: url('../src/assets/fonts/Poppins-Semibold.woff2') format('woff2');
font-weight: 600; /* Semibold */
font-style: normal;
}
@font-face {
font-family: 'Poppins';
src: url('../src/assets/fonts/Poppins-Bold.woff2') format('woff2');
font-weight: 700; /* Bold */
font-style: normal;
}
@custom-variant dark (&:is(.dark *)); @custom-variant dark (&:is(.dark *));
:root { :root {
@ -116,19 +146,31 @@
} }
@layer base { @layer base {
* { * {
@apply border-border outline-ring/50; @apply border-border outline-ring/50;
@apply font-poppins;
box-sizing: border-box;
} }
html, body { html, body {
height: 100%; height: 100%;
font-family: 'Poppins', sans-serif;
} }
p, h1, h2, h3, h4, h5, h6 {
} }
/* Custom glass-morphism effect */ .glass-morphism {
.glass-morphism { background-color: rgba(255, 255, 255, 0.1); /* Белый с прозрачностью */
background-color: rgba(255, 255, 255, 0.1); /* White with transparency */ backdrop-filter: blur(10px); /* Эффект размытия */
backdrop-filter: blur(10px); /* Blur effect */ -webkit-backdrop-filter: blur(10px); /* Для Safari */
-webkit-backdrop-filter: blur(10px); /* For Safari */ border: 1px solid rgba(255, 255, 255, 0.2); /* Тонкая белая рамка */
border: 1px solid rgba(255, 255, 255, 0.2); /* Subtle white border */ box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37); /* Тень */
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37); /* Shadow */
} }
}

View File

@ -3,8 +3,12 @@
import React, { useState } from "react" import React, { useState } from "react"
import { useHistory } from "react-router-dom" import { useHistory } from "react-router-dom"
import manImage from "../assets/man.svg" // Reverted to original import import manImage from "../assets/man.svg" // Reverted to original import
import { connect } from '../confconnect';
import axios from 'axios'; import axios from 'axios';
export default function LoginPage() { export default function LoginPage() {
const history = useHistory() const history = useHistory()
// Стейты для формы входа // Стейты для формы входа
@ -28,7 +32,7 @@ export default function LoginPage() {
const handleLogin = async (e: React.FormEvent) => { const handleLogin = async (e: React.FormEvent) => {
e.preventDefault(); e.preventDefault();
try { try {
const response = await axios.post('http://localhost:8093/auth/api/login', { const response = await connect.post('/auth/api/login', {
email, email,
password, password,
rememberMe, rememberMe,
@ -68,7 +72,7 @@ const handleRegisterSubmit = async (e: React.FormEvent) => {
return return
} }
try { try {
const response = await axios.post('http://localhost:8093/auth/api/register', { const response = await connect.post('/auth/api/register', {
email: registerFormData.email, email: registerFormData.email,
name: registerFormData.email, name: registerFormData.email,
password: registerFormData.password, password: registerFormData.password,
@ -84,6 +88,7 @@ const handleRegisterSubmit = async (e: React.FormEvent) => {
localStorage.setItem('userName', data.user_name) localStorage.setItem('userName', data.user_name)
console.log('Данные сохранены в localStorage') console.log('Данные сохранены в localStorage')
alert('Вы успешно зерегистрировались!')
// После этого можно перейти или показать сообщение // После этого можно перейти или показать сообщение
history.push("/home") history.push("/home")
@ -100,7 +105,6 @@ const handleRegisterInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
}) })
} }

View File

@ -10,7 +10,6 @@ const Settings: React.FC = () => {
const handleLogout = () => { const handleLogout = () => {
// Simulate logout // Simulate logout
history.push("/login") history.push("/login")
} }
return ( return (

View File

@ -0,0 +1,2 @@
export const USER_KEY = 'user';
export const AUTH_TOKEN = 'token';

View File

@ -0,0 +1,20 @@
export const getRouteLogin = () => `/auth/login`;
export const getRouteRegister = () => `/auth/register`;
export const getRouteResetPassword = () => `/auth/reset-password`;
export const getRouteLkHome = () => `/lk`;
export const getRouteUsersList = () => `/lk/admin/users`;
export const getRouteUserEdit = (id: number | string) => `/lk/admin/users/${id}`;
export const getRouteUserCreate = () => `/lk/admin/users/create`;
export const getRouteUserRolesList = () => `/lk/admin/user-roles`;
export const getRouteUserRoleEdit = (id: number | string) => `/lk/admin/user-roles/${id}`;
export const getRouteUserRoleCreate = () => `/lk/admin/user-roles/create`;
export const getRouterExercisesList = () =>`/lk/admin/exercises`;
export const getRouterExercisesEdit = (id: number | string) =>`/lk/admin/exercises/${id}`;
export const getRouterExercisesCreate = () =>`/lk/admin/exercises/create`;
export const getRouterCoursesList = () => `/lk/admin/courses`;
export const getRouterCoursesEdit = (id: number | string) => `/lk/admin/courses/${id}`;
export const getRouterCoursesCreate = () => `/lk/admin/courses/create`;

View File

@ -1,14 +1,21 @@
/** @type {import('tailwindcss').Config} */ /** @type {import('tailwindcss').Config} */
const defaultConfig = require("shadcn/ui/tailwind.config") const defaultConfig = require("shadcn/ui/tailwind.config");
module.exports = { module.exports = {
...defaultConfig, ...defaultConfig,
content: [ content: [
...defaultConfig.content, ...defaultConfig.content,
"./pages/**/*.{js,ts,jsx,tsx,mdx}", "./pages/**/*.{js,ts,jsx,tsx,mdx}",
"./components/**/*.{js,ts,jsx,tsx,mdx}", "./components/**/*.{js,ts,jsx,tsx,mdx}",
"./app/**/*.{js,ts,jsx,tsx,mdx}", "./app/**/*.{js,ts,jsx,tsx,mdx}",
"*.{js,ts,jsx,tsx,mdx}", "*.{js,ts,jsx,tsx,mdx}",
], ],
// theme: {
// extend: {
// fontFamily: {
// poppins: ['Poppins', 'sans-serif'],
// },
// },
// },
plugins: [...defaultConfig.plugins, require("tailwindcss-animate")], plugins: [...defaultConfig.plugins, require("tailwindcss-animate")],
} };

View File

@ -6,6 +6,7 @@
"lib": ["ES2022", "DOM", "DOM.Iterable"], "lib": ["ES2022", "DOM", "DOM.Iterable"],
"module": "ESNext", "module": "ESNext",
"skipLibCheck": true, "skipLibCheck": true,
"allowJs": true,
/* Bundler mode */ /* Bundler mode */
"moduleResolution": "bundler", "moduleResolution": "bundler",
@ -23,5 +24,5 @@
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true "noUncheckedSideEffectImports": true
}, },
"include": ["src"] "include": ["src", "src/confconnect.js"]
} }

View File

@ -1,8 +1,14 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react' import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite' import tailwindcss from '@tailwindcss/vite'
import path from 'path' // <-- добавьте этот импорт
// https://vite.dev/config/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [react(), tailwindcss ()], plugins: [react(), tailwindcss()],
}) resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
})