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
const price = (value: number) => value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ') + ' $'; | |
// 99 450 $ | |
price(99450); |
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
const wordDecl = (number:number, titles:[string, string, string]):string => { | |
const cases = [2, 0, 1, 1, 1, 2]; | |
return titles[ (number % 100 > 4 && number % 100 < 20) ? 2 : cases[(number % 10 < 5) ? number % 10 : 5] ]; | |
} | |
wordDecl(product.reviewCount, ["отзыв", "отзыва", "отзывов"]) |
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
// 2 | |
export default { | |
'cat': 'Cat', | |
'bird': 'Bird', | |
'dog': 'Dog', | |
} |
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
<body> | |
<div class="container"> | |
<div class="separator separatop-top"> | |
<svg version="1.1" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M 0 0 C 40 132 60 132 100 0 Z" style="fill: white;"></path></svg> | |
</div> | |
<div class="separator separator-bottom"> | |
<svg version="1.1" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M 0 100 C 40 -32 60 -32 100 100 Z" style="fill: rgb(255, 255, 255);"></path></svg> | |
</div> | |
<div class="content"> | |
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Mollitia voluptatem autem quod harum, necessitatibus nemo molestiae quos! Similique tempore blanditiis possimus unde tempora vitae autem voluptatum temporibus? Rerum, expedita odit?</p> |
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
.btn { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
width: 300px; | |
height: 50px; | |
text-transform: uppercase; | |
text-decoration: none; | |
padding: 10px; | |
color: #000; |