diff --git a/frontend/src/assets/fonts/Comfortaa-VariableFont_wght.ttf b/frontend/src/assets/fonts/Comfortaa-VariableFont_wght.ttf new file mode 100644 index 0000000..9acab52 Binary files /dev/null and b/frontend/src/assets/fonts/Comfortaa-VariableFont_wght.ttf differ diff --git a/frontend/src/assets/fonts/Nunito-VariableFont_wght.ttf b/frontend/src/assets/fonts/Nunito-VariableFont_wght.ttf new file mode 100644 index 0000000..10387be Binary files /dev/null and b/frontend/src/assets/fonts/Nunito-VariableFont_wght.ttf differ diff --git a/frontend/src/assets/fonts/OFL.Comfortaa.txt b/frontend/src/assets/fonts/OFL.Comfortaa.txt new file mode 100644 index 0000000..5c7930b --- /dev/null +++ b/frontend/src/assets/fonts/OFL.Comfortaa.txt @@ -0,0 +1,93 @@ +Copyright 2011 The Comfortaa Project Authors (https://github.com/alexeiva/comfortaa), with Reserved Font Name "Comfortaa". + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/frontend/src/assets/fonts/OFL.Nunito.txt b/frontend/src/assets/fonts/OFL.Nunito.txt new file mode 100644 index 0000000..8f5b7e2 --- /dev/null +++ b/frontend/src/assets/fonts/OFL.Nunito.txt @@ -0,0 +1,93 @@ +Copyright 2014 The Nunito Project Authors (https://github.com/googlefonts/nunito) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/frontend/src/styles.css b/frontend/src/styles.css index c624a44..6b71638 100644 --- a/frontend/src/styles.css +++ b/frontend/src/styles.css @@ -3,12 +3,28 @@ --bg-accent: #e3eff8; --primary: #2f80ed; --primary-dark: #1d6bd8; + --primary-darker: #134c9c; --primary-soft: #dbeafe; + --primary-light: #82b3f4; --text: #1e3a5f; --text-soft: #5b7a9d; --danger: #e0483e; + --ship: #1d3a5f; + --fire-fg: #f0564a; + --fire-bg: #ffbba8; --radius: 14px; - font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; + font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif; + font-size: 16pt; +} + +@font-face { + font-family: 'Comfortaa'; + src: url('./assets/fonts/Comfortaa-VariableFont_wght.ttf'); +} + +@font-face { + font-family: 'Nunito'; + src: url('./assets/fonts/Nunito-VariableFont_wght.ttf'); } * { @@ -25,6 +41,10 @@ body { min-height: 100vh; } +h1, h2, h3, h4, h5, h6 { + font-family: 'Comfortaa'; +} + .page { min-height: 100vh; display: flex; @@ -58,14 +78,19 @@ body { } .btn { + font-family: 'Comfortaa'; border: none; border-radius: var(--radius); cursor: pointer; - font-family: inherit; font-weight: 700; transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease; } +.btn:disabled { + cursor: default; + background: var(--primary-light); +} + .btn-big { padding: 18px 28px; font-size: 22px; @@ -74,12 +99,12 @@ body { box-shadow: 0 6px 0 rgba(29, 107, 216, 0.35), 0 10px 20px rgba(47, 128, 237, 0.25); } -.btn-big:hover { +.btn-big:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 0 rgba(29, 107, 216, 0.35), 0 14px 24px rgba(47, 128, 237, 0.3); } -.btn-big:active { +.btn-big:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 3px 0 rgba(29, 107, 216, 0.35); } @@ -91,13 +116,12 @@ body { background: var(--primary); } -.btn-primary:hover { +.btn-primary:hover:not(:disabled) { background: var(--primary-dark); } -.btn-primary:disabled { - opacity: 0.6; - cursor: default; +.btn-primary:active:not(:disabled) { + background: var(--primary-darker); } .join-section { @@ -125,6 +149,18 @@ body { gap: 10px; } +input { + font-size: 32px; + font-weight: 700; + color: var(--text); + background: #fff; + border: 2px solid #c9dcee; + border-radius: 12px; + outline: none; + transition: border-color 0.12s ease, box-shadow 0.12s ease; + caret-color: var(--primary); +} + .code-cell { width: 58px; height: 68px; @@ -331,6 +367,58 @@ body { font-size: 14px; } +.sea-grid { + padding: 3px; + display: inline-grid; + grid-template-columns: repeat(10, 1fr); + grid-template-rows: repeat(10, 1fr); + gap: 3px; + background-color: var(--primary-soft); +} + +.sea-cell { + width: 30px; + height: 30px; + background: var(--bg); + display: table-cell; + vertical-align: center; + text-align: center; +} + +.miss-cell { + position: relative; +} + +.miss-cell::before { + display: block; + content: ' '; + width: 8px; + height: 8px; + position: relative; + left: calc(50% - 4px); + top: calc(50% - 4px); + border-radius: 50%; + background-color: var(--primary-light); +} + +.ship-cell, .damaged-ship-cell { + background-color: var(--ship); +} + +.damaged-ship-cell { + color: var(--fire-fg); +} + +.damaged-ship-cell::before, .destroyed-ship-cell::before { + display: block; + content: 'X'; +} + +.destroyed-ship-cell { + background-color: var(--fire-bg); + color: var(--fire-fg); +} + @media (max-width: 480px) { .code-cell { width: 48px; diff --git a/frontend/src/uikit.css b/frontend/src/uikit.css new file mode 100644 index 0000000..7ecbdc2 --- /dev/null +++ b/frontend/src/uikit.css @@ -0,0 +1,104 @@ +body { + display: grid; + grid-template-rows: 0.5fr 1fr 1.5fr 2fr; + grid-template-columns: 2fr 1fr 1fr; + gap: 20px; + margin: 20px; +} + +#primary-heading { + grid-area: 1 / 1 / 1 / 4; +} + +#color-palette { + grid-area: 2 / 1 / 2 / 4; + display: flex; + gap: 30px; +} + +#font-column { + grid-area: 3 / 1 / 3 / 1; +} + +#icon-column { + grid-area: 3 / 3 / 4 / 3; +} + +#button-column { + grid-area: 3 / 2 / 4 / 2; + display: flex; + flex-direction: column; + gap: 15px; +} + +.color-series { + overflow: hidden; + min-width: 200px; + border-radius: 20px; + font-size: medium; + display: flex; + flex-direction: column; + color: white; + box-shadow: #0003 0 5px 20px; +} + +.color-sample { + font-family: monospace; + text-align: left; + vertical-align: bottom; + padding: 20px 10px 7.5px 10px; + display: flex; +} + +.color-sample span { + align-self: flex-end; +} + +.color-sample:first-child { + flex: auto; +} + +#color-sample-primary { + background-color: var(--primary); +} +#color-sample-primary-dark { + background-color: var(--primary-dark); +} +#color-sample-primary-darker { + background-color: var(--primary-darker); +} +#color-sample-primary-light { + background-color: var(--primary-light); +} + +#color-sample-ship { + background-color: var(--ship); +} + +#color-sample-fire-fg { + background-color: var(--fire-fg); +} +#color-sample-fire-bg { + background-color: var(--fire-bg); + color: var(--fire-fg); +} + +.uikit-icon { + display: inline-block; + border: #d4e2f0 4px solid; + border-radius: 20px; + box-shadow: #001 0 0 20px -15px; + width: 66px; + height: 66px; + padding: 5px; + background: white; +} + +#cells-demo { + grid-area: 4 / 1 / 4 / 1; +} + +.demo-sea-grid { + grid-template-columns: repeat(3, 1fr); + grid-template-rows: repeat(3, 1fr); +} diff --git a/frontend/src/uikit.js b/frontend/src/uikit.js new file mode 100644 index 0000000..2a4a149 --- /dev/null +++ b/frontend/src/uikit.js @@ -0,0 +1,2 @@ +import './styles.css'; +import './uikit.css'; diff --git a/frontend/uikit.html b/frontend/uikit.html index 6a7b58e..b86e9c2 100644 --- a/frontend/uikit.html +++ b/frontend/uikit.html @@ -4,9 +4,139 @@ UI Kit - + - ui kit. +
+

Ruby Sea Battle (Морской бой) - UI Kit

+
+
+
+
primary - #2F80ED
+
dark primary - #1D6BD8
+
darker primary - #134C9C
+
light primary - #82B3F4
+
+
+
ship - #1D3A5F
+
+
+
fire fg - #F0564A
+
fire bg - #FDEEEA
+
+
+
+

Основной шрифт - Comfortaa

+

Дополнительный шрифт - Nunito

+
+
+ + + + + +
+
+

Значки

+
+ +
+
+ +
+
+ +
+
+ +
+
+
+

Клетки игрового поля

+
+
+
+
+
+
+
+
+
+
+
+