Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 042d24df4d |
@@ -0,0 +1,173 @@
|
|||||||
|
@import url('./../variables.css');
|
||||||
|
|
||||||
|
#preloader_container {
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
background: rgba(0, 0, 0, 0.3);
|
||||||
|
z-index: 900;
|
||||||
|
backdrop-filter: blur(5px);
|
||||||
|
|
||||||
|
&.hide {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&>#preloader{
|
||||||
|
width: 200px;
|
||||||
|
height: 200px;
|
||||||
|
background: none;
|
||||||
|
position: relative;
|
||||||
|
top: 30%;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
|
||||||
|
&>.circle {
|
||||||
|
position: absolute;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border: 10px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
&>#circle_one {
|
||||||
|
width: 80%;
|
||||||
|
height: 80%;
|
||||||
|
border-top-width: 10px;
|
||||||
|
left: 5%;
|
||||||
|
top: 5%;
|
||||||
|
animation: roll_one 4.5s;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
animation-timing-function: linear;
|
||||||
|
|
||||||
|
&.preloader-emerald-circle{
|
||||||
|
border-top-color: var(--color_emerald_light);
|
||||||
|
}
|
||||||
|
&.preloader-ruby-circle{
|
||||||
|
border-top-color: var(--color_ruby_main);
|
||||||
|
}
|
||||||
|
&.preloader-graphite-circle{
|
||||||
|
border-top-color: var(--color_graphite_main);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&>#circle_two {
|
||||||
|
width: 70%;
|
||||||
|
height: 70%;
|
||||||
|
left: 10%;
|
||||||
|
top: 10%;
|
||||||
|
border-right-width: 10px;
|
||||||
|
animation: roll_two 2.5s;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
animation-timing-function: linear;
|
||||||
|
|
||||||
|
&.preloader-emerald-circle{
|
||||||
|
border-right-color: var(--color_emerald_light);
|
||||||
|
}
|
||||||
|
&.preloader-ruby-circle{
|
||||||
|
border-right-color: var(--color_ruby_main);
|
||||||
|
}
|
||||||
|
&.preloader-graphite-circle{
|
||||||
|
border-right-color: var(--color_graphite_main);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&>#circle_three {
|
||||||
|
width: 60%;
|
||||||
|
height: 60%;
|
||||||
|
left: 15%;
|
||||||
|
top: 15%;
|
||||||
|
border-bottom-width: 10px;
|
||||||
|
animation: roll_three 3s;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
animation-timing-function: linear;
|
||||||
|
|
||||||
|
&.preloader-emerald-circle{
|
||||||
|
border-bottom-color: var(--color_emerald_light);
|
||||||
|
}
|
||||||
|
&.preloader-ruby-circle{
|
||||||
|
border-bottom-color: var(--color_ruby_main);
|
||||||
|
}
|
||||||
|
&.preloader-graphite-circle{
|
||||||
|
border-bottom-color: var(--color_graphite_main);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
&>#preloader_text {
|
||||||
|
width: 150%;
|
||||||
|
left: -25%;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
position: absolute;
|
||||||
|
bottom: -50px;
|
||||||
|
text-align: center;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
&>#logo {
|
||||||
|
position: absolute;
|
||||||
|
background: none;
|
||||||
|
width: 40%;
|
||||||
|
height: 40%;
|
||||||
|
top: 25%;
|
||||||
|
left: 25%;
|
||||||
|
|
||||||
|
&>.logo_square {
|
||||||
|
position: absolute;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
&>#left-top {
|
||||||
|
width: 60%;
|
||||||
|
height: 70%;
|
||||||
|
top: 15%;
|
||||||
|
left: 20%;
|
||||||
|
border-left: 7px solid white;
|
||||||
|
border-top: 7px solid white;
|
||||||
|
border-top-left-radius: 45%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&>#right-bottom {
|
||||||
|
width: 40%;
|
||||||
|
height: 50%;
|
||||||
|
top: 15%;
|
||||||
|
left: 40%;
|
||||||
|
border-right: 7px solid white;
|
||||||
|
border-bottom: 7px solid white;
|
||||||
|
border-bottom-right-radius: 45%;
|
||||||
|
border-bottom-left-radius: 10%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes roll_one {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes roll_two {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: rotate(-360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes roll_three {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: rotate(720deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
/* ГАВРИЛОВ. ВЫЯСНИТЬ, ГДЕ ИСПОЛЬЗУЮТСЯ */
|
|
||||||
|
|
||||||
#root{
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-container{
|
|
||||||
|
|
||||||
&.form-container--small-size{
|
|
||||||
width: 30%;
|
|
||||||
}
|
|
||||||
&.form-container--medium-size{
|
|
||||||
width: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.form-container--left-pos{
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
&.form-container--mid-pos{
|
|
||||||
margin: 25px auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.form__field-block{
|
|
||||||
margin: 15px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-block{
|
|
||||||
margin: 15px 0;
|
|
||||||
padding: 15px 0;
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-start;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* OVERWRITE */
|
|
||||||
.renButton{
|
|
||||||
|
|
||||||
&.renButton--tertiary{
|
|
||||||
background: #dfdfdf;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
#page__content-block{
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#page__header-block{
|
|
||||||
position: sticky;
|
|
||||||
top: 0;
|
|
||||||
z-index: 99;
|
|
||||||
box-shadow: 0px 2px 9px 3px #8f8d8d;
|
|
||||||
|
|
||||||
& .header-block__header-container{
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 10px;
|
|
||||||
background: var(--color_graphite_main);
|
|
||||||
|
|
||||||
& .header-container__block{
|
|
||||||
display: flex;
|
|
||||||
gap: 10px;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
& .header-container__block__app-name{
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
:root{
|
|
||||||
--color_graphite_main: #323e48;
|
|
||||||
--color_emerald_main: #77cb10;
|
|
||||||
--color_emerald_light: #95fa77;
|
|
||||||
--color_ruby_main: #ff0078;
|
|
||||||
--color_purple_main: #7864eb;
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import "./../../../css/components/preloader.css";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
export default function Preloader ( props: {visible: boolean, text?: string | null}) {
|
||||||
|
const {text = 'загрузка'} = props;
|
||||||
|
let preloaderColorArray: string[] = ['preloader-ruby-circle', 'preloader-emerald-circle', 'preloader-graphite-circle'],
|
||||||
|
//Код ниже реализует возможность присваивать каждую перезагрузку разные классы с цветом полос
|
||||||
|
//Рандомное число, по которому получим первый класс
|
||||||
|
firstColorIndex: number = Math.floor(Math.random() * 3),
|
||||||
|
firstCircleClass: typeof preloaderColorArray[number] = preloaderColorArray[firstColorIndex],
|
||||||
|
secondCircleClass: typeof preloaderColorArray[number],
|
||||||
|
thirdCircleClass: typeof preloaderColorArray[number];
|
||||||
|
//Удалим уже используемый класс цвета из массива
|
||||||
|
preloaderColorArray.splice(firstColorIndex, 1);
|
||||||
|
//Оставшиеся 2 класса распределеяем в зависимости от проостой проверки четности/нечетности
|
||||||
|
if (Math.floor(Math.random() * 2) % 2 === 0) {
|
||||||
|
secondCircleClass = preloaderColorArray[0];
|
||||||
|
thirdCircleClass = preloaderColorArray[1];
|
||||||
|
} else {
|
||||||
|
secondCircleClass = preloaderColorArray[1];
|
||||||
|
thirdCircleClass = preloaderColorArray[0];
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
props.visible ?
|
||||||
|
<div id='preloader_container'>
|
||||||
|
<div id='preloader'>
|
||||||
|
<div className={'circle ' + firstCircleClass} id='circle_one'></div>
|
||||||
|
<div className={'circle ' + secondCircleClass} id='circle_two'></div>
|
||||||
|
<div className={'circle ' + thirdCircleClass} id='circle_three'></div>
|
||||||
|
<div id='logo'>
|
||||||
|
<div className='logo_square' id='right-bottom'></div>
|
||||||
|
<div className='logo_square' id='left-top'></div>
|
||||||
|
</div>
|
||||||
|
<div id='preloader_text'>{ text }</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
: null
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import React, { createContext, useState } from "react";
|
||||||
|
import Preloader from "../components/preloader/Preloader";
|
||||||
|
|
||||||
|
interface PreloaderProps{
|
||||||
|
setPreloaderVisible: (preloaderVisible: boolean) => void;
|
||||||
|
setPreloaderText: (preloaderText: string) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const PreloaderContext = createContext<PreloaderProps>({
|
||||||
|
setPreloaderVisible: () => {},
|
||||||
|
setPreloaderText: () => {},
|
||||||
|
});
|
||||||
|
|
||||||
|
export function PreloaderProvider({ children }){
|
||||||
|
const [visible, setVisible] = useState<boolean>(true);
|
||||||
|
const [text, setText] = useState<string>('Страница загружается');
|
||||||
|
|
||||||
|
function setPreloaderVisible(preloaderVisible: boolean){
|
||||||
|
setVisible(preloaderVisible);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setPreloaderText(preloaderText: string){
|
||||||
|
setText(preloaderText);
|
||||||
|
}
|
||||||
|
|
||||||
|
let value = {
|
||||||
|
setPreloaderVisible: setPreloaderVisible,
|
||||||
|
setPreloaderText: setPreloaderText
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PreloaderContext.Provider value={value}>
|
||||||
|
<Preloader
|
||||||
|
visible={visible}
|
||||||
|
text={text}
|
||||||
|
/>
|
||||||
|
{children}
|
||||||
|
</PreloaderContext.Provider>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
import { createRoot } from 'react-dom/client';
|
|
||||||
import { UIKitThemeProvider } from '@SharePoint/rencredit_uikit';
|
|
||||||
import Header from "./components/header/Header.tsx";
|
|
||||||
|
|
||||||
const headerBlock:HTMLElement = document.getElementById('page__header-block')!;
|
|
||||||
const headerRoot = createRoot(headerBlock);
|
|
||||||
|
|
||||||
console.log('da')
|
|
||||||
|
|
||||||
headerRoot.render(
|
|
||||||
<UIKitThemeProvider>
|
|
||||||
<Header />
|
|
||||||
</UIKitThemeProvider>
|
|
||||||
);
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import React, { ReactNode } from "react";
|
|
||||||
import { UIKitThemeProvider } from '@SharePoint/rencredit_uikit';
|
|
||||||
import { PopupProvider } from "../contexts/PopupContext.tsx";
|
|
||||||
import { PreloaderProvider } from "../contexts/PreloaderContext.tsx";
|
|
||||||
|
|
||||||
interface AppProviderProps{
|
|
||||||
children: ReactNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function AppProvider({children}: AppProviderProps){
|
|
||||||
|
|
||||||
return (
|
|
||||||
<UIKitThemeProvider>
|
|
||||||
<PopupProvider>
|
|
||||||
<PreloaderProvider>
|
|
||||||
{children}
|
|
||||||
</PreloaderProvider>
|
|
||||||
</PopupProvider>
|
|
||||||
</UIKitThemeProvider>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
/**
|
|
||||||
* Сервис для полуения csrt токена для размещения в формах
|
|
||||||
* @date 24.07.2025
|
|
||||||
* @author dgavrilov
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const getCsrfToken = ():string => {
|
|
||||||
const METATAG:HTMLElement|null = document.querySelector('meta[name="csrf-token"]');
|
|
||||||
|
|
||||||
if (!METATAG) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
const CSRFTOKEN:string|null = METATAG.getAttribute('content');
|
|
||||||
if (!CSRFTOKEN) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
return CSRFTOKEN;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user