-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from ktvtk/module7-task1
- Loading branch information
Showing
19 changed files
with
264 additions
and
391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* Ключевые кадры для анимации вращения */ | ||
@keyframes react-spinners-rotate { | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
|
||
/* Ключевые кадры для анимации отскока */ | ||
@keyframes react-spinners-bounce { | ||
0%, 100% { | ||
transform: scale(0); | ||
} | ||
50% { | ||
transform: scale(1.0); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import './loading.css'; | ||
import React, {JSX} from 'react'; | ||
|
||
export function Loading() : JSX.Element { | ||
// Жестко заданные параметры | ||
const color : string = '#3069a6'; | ||
const size: number = 80; | ||
const speedMultiplier : number = 1; | ||
|
||
const wrapperStyle : React.CSSProperties = { | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
position: 'relative', | ||
width: '100vw', | ||
height: '100vh', | ||
animation: `react-spinners-rotate ${2 / speedMultiplier}s 0s infinite linear`, | ||
}; | ||
|
||
const dotStyle = (i: number) : React.CSSProperties => ({ | ||
position: 'relative', | ||
top: i % 2 ? '0' : 'auto', | ||
bottom: i % 2 ? 'auto' : '0', | ||
height: `${size / 2}px`, | ||
width: `${size / 2}px`, | ||
backgroundColor: color, | ||
borderRadius: '100%', | ||
animation: `react-spinners-bounce ${2 / speedMultiplier}s ${i === 2 ? '1s' : '0s'} infinite linear`, | ||
}); | ||
|
||
return ( | ||
<span style={wrapperStyle}> | ||
<span style={dotStyle(1)} /> | ||
<span style={dotStyle(2)} /> | ||
</span> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
import { App } from './components/app/app.tsx'; | ||
import {offers} from './mocks/offers.ts'; | ||
import {detailOffers} from './mocks/detail-offers.ts'; | ||
import {reviews} from './mocks/reviews.ts'; | ||
import {Provider} from 'react-redux'; | ||
import {store} from './store'; | ||
import {fetchOffers} from './store/api-actions.ts'; | ||
|
||
const root = ReactDOM.createRoot( | ||
document.getElementById('root') as HTMLElement | ||
); | ||
|
||
store.dispatch(fetchOffers()); | ||
|
||
root.render( | ||
<React.StrictMode> | ||
<Provider store={store}> | ||
<App offers={offers} detailOffers={detailOffers} reviews={reviews}/> | ||
<App /> | ||
</Provider> | ||
</React.StrictMode> | ||
); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.