├── .gitignore
├── semantic
├── site
│ ├── modules
│ │ ├── embed.variables
│ │ ├── nag.overrides
│ │ ├── popup.overrides
│ │ ├── shape.overrides
│ │ ├── tab.overrides
│ │ ├── accordion.overrides
│ │ ├── chatroom.overrides
│ │ ├── checkbox.overrides
│ │ ├── dimmer.overrides
│ │ ├── dropdown.overrides
│ │ ├── embed.overrides
│ │ ├── modal.overrides
│ │ ├── modal.variables
│ │ ├── nag.variables
│ │ ├── popup.variables
│ │ ├── progress.overrides
│ │ ├── rating.overrides
│ │ ├── rating.variables
│ │ ├── search.overrides
│ │ ├── search.variables
│ │ ├── shape.variables
│ │ ├── sidebar.overrides
│ │ ├── sidebar.variables
│ │ ├── sticky.overrides
│ │ ├── sticky.variables
│ │ ├── tab.variables
│ │ ├── accordion.variables
│ │ ├── chatroom.variables
│ │ ├── checkbox.variables
│ │ ├── dimmer.variables
│ │ ├── dropdown.variables
│ │ ├── progress.variables
│ │ ├── transition.overrides
│ │ └── transition.variables
│ ├── elements
│ │ ├── flag.variables
│ │ ├── button.overrides
│ │ ├── divider.overrides
│ │ ├── flag.overrides
│ │ ├── header.overrides
│ │ ├── icon.overrides
│ │ ├── icon.variables
│ │ ├── image.overrides
│ │ ├── input.overrides
│ │ ├── label.overrides
│ │ ├── list.overrides
│ │ ├── list.variables
│ │ ├── loader.overrides
│ │ ├── rail.overrides
│ │ ├── rail.variables
│ │ ├── reveal.overrides
│ │ ├── segment.overrides
│ │ ├── step.overrides
│ │ ├── step.variables
│ │ ├── button.variables
│ │ ├── container.overrides
│ │ ├── container.variables
│ │ ├── divider.variables
│ │ ├── header.variables
│ │ ├── image.variables
│ │ ├── input.variables
│ │ ├── label.variables
│ │ ├── loader.variables
│ │ ├── reveal.variables
│ │ └── segment.variables
│ ├── collections
│ │ ├── menu.overrides
│ │ ├── form.overrides
│ │ ├── grid.overrides
│ │ ├── table.overrides
│ │ ├── breadcrumb.overrides
│ │ ├── breadcrumb.variables
│ │ ├── form.variables
│ │ ├── grid.variables
│ │ ├── menu.variables
│ │ ├── message.overrides
│ │ ├── table.variables
│ │ └── message.variables
│ ├── globals
│ │ ├── site.overrides
│ │ ├── reset.overrides
│ │ ├── reset.variables
│ │ └── site.variables
│ └── views
│ │ ├── ad.overrides
│ │ ├── ad.variables
│ │ ├── card.overrides
│ │ ├── card.variables
│ │ ├── comment.overrides
│ │ ├── comment.variables
│ │ ├── feed.overrides
│ │ ├── feed.variables
│ │ ├── item.overrides
│ │ ├── item.variables
│ │ ├── statistic.overrides
│ │ └── statistic.variables
├── themes
│ └── default
│ │ ├── collections
│ │ ├── table.overrides
│ │ ├── form.overrides
│ │ ├── menu.overrides
│ │ ├── grid.overrides
│ │ ├── message.overrides
│ │ ├── breadcrumb.overrides
│ │ ├── breadcrumb.variables
│ │ └── grid.variables
│ │ ├── globals
│ │ ├── reset.variables
│ │ └── site.overrides
│ │ ├── modules
│ │ ├── chatroom.variables
│ │ ├── nag.overrides
│ │ ├── tab.overrides
│ │ ├── calendar.overrides
│ │ ├── chatroom.overrides
│ │ ├── dimmer.overrides
│ │ ├── embed.overrides
│ │ ├── modal.overrides
│ │ ├── popup.overrides
│ │ ├── progress.overrides
│ │ ├── rating.overrides
│ │ ├── search.overrides
│ │ ├── shape.overrides
│ │ ├── sidebar.overrides
│ │ ├── slider.overrides
│ │ ├── sticky.overrides
│ │ ├── toast.overrides
│ │ ├── sticky.variables
│ │ ├── tab.variables
│ │ ├── transition.variables
│ │ ├── calendar.variables
│ │ ├── shape.variables
│ │ ├── sidebar.variables
│ │ ├── rating.variables
│ │ ├── embed.variables
│ │ ├── nag.variables
│ │ ├── dimmer.variables
│ │ ├── checkbox.overrides
│ │ ├── slider.variables
│ │ ├── toast.variables
│ │ ├── accordion.variables
│ │ ├── accordion.overrides
│ │ └── progress.variables
│ │ ├── views
│ │ ├── ad.overrides
│ │ ├── card.overrides
│ │ ├── feed.overrides
│ │ ├── item.overrides
│ │ ├── comment.overrides
│ │ ├── statistic.overrides
│ │ ├── ad.variables
│ │ ├── comment.variables
│ │ ├── statistic.variables
│ │ └── feed.variables
│ │ ├── assets
│ │ ├── fonts
│ │ │ ├── icons.eot
│ │ │ ├── icons.ttf
│ │ │ ├── icons.woff
│ │ │ ├── icons.woff2
│ │ │ ├── brand-icons.eot
│ │ │ ├── brand-icons.ttf
│ │ │ ├── brand-icons.woff
│ │ │ ├── brand-icons.woff2
│ │ │ ├── outline-icons.eot
│ │ │ ├── outline-icons.ttf
│ │ │ ├── outline-icons.woff
│ │ │ └── outline-icons.woff2
│ │ └── images
│ │ │ └── flags.png
│ │ └── elements
│ │ ├── button.overrides
│ │ ├── image.overrides
│ │ ├── input.overrides
│ │ ├── label.overrides
│ │ ├── list.overrides
│ │ ├── loader.overrides
│ │ ├── rail.overrides
│ │ ├── reveal.overrides
│ │ ├── segment.overrides
│ │ ├── text.overrides
│ │ ├── container.overrides
│ │ ├── header.overrides
│ │ ├── placeholder.overrides
│ │ ├── flag.variables
│ │ ├── text.variables
│ │ ├── emoji.variables
│ │ ├── reveal.variables
│ │ ├── rail.variables
│ │ ├── image.variables
│ │ ├── divider.variables
│ │ ├── placeholder.variables
│ │ ├── loader.variables
│ │ ├── container.variables
│ │ ├── input.variables
│ │ ├── divider.overrides
│ │ ├── icon.variables
│ │ └── step.variables
├── package.json
├── README.md
├── definitions
│ ├── globals
│ │ └── reset.less
│ ├── elements
│ │ ├── flag.less
│ │ ├── emoji.less
│ │ ├── text.less
│ │ └── rail.less
│ ├── modules
│ │ ├── sticky.less
│ │ ├── transition.less
│ │ ├── tab.less
│ │ ├── shape.less
│ │ └── embed.less
│ └── collections
│ │ └── breadcrumb.less
├── theme.less
├── theme.config
└── semantic.less
├── screenshots
├── game.png
└── results.png
├── .idea
├── .gitignore
├── codeStyles
│ ├── codeStyleConfig.xml
│ └── Project.xml
├── vcs.xml
├── jsLinters
│ └── eslint.xml
├── modules.xml
├── runConfigurations
│ ├── lint.xml
│ └── start.xml
├── guess-the-eval.iml
└── inspectionProfiles
│ └── Project_Default.xml
├── evaluator
├── .idea
│ ├── vcs.xml
│ ├── .gitignore
│ ├── modules.xml
│ ├── evaluator.iml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ └── runConfigurations
│ │ ├── Lint.xml
│ │ └── Run_evaluator.xml
├── README.md
├── .gitignore
├── Cargo.toml
└── src
│ ├── visitor.rs
│ └── question.rs
├── src
├── index.html
├── index.tsx
├── components
│ ├── .eslintrc.js
│ ├── ErrorBoundary.tsx
│ ├── Chessground.tsx
│ ├── LastResult.tsx
│ ├── EvalSliderMobile.tsx
│ └── EvalSliderDesktop.tsx
├── questions.ts
└── PointsSolver.ts
├── tsconfig.json
├── .github
└── workflows
│ ├── deploy.yml
│ └── test.yml
├── README.md
├── webpack
├── webpack.prod.js
├── webpack.dev.js
└── webpack.common.js
├── .eslintrc.js
├── about.md
├── package.json
└── assets
└── pieces
├── bP.svg
├── wR.svg
├── wP.svg
├── wK.svg
├── bK.svg
├── wB.svg
├── bB.svg
├── bR.svg
├── wN.svg
├── bN.svg
├── wQ.svg
└── bQ.svg
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules/
2 |
--------------------------------------------------------------------------------
/semantic/site/modules/embed.variables:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/semantic/themes/default/collections/table.overrides:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/screenshots/game.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MakotoE/guess-the-eval/HEAD/screenshots/game.png
--------------------------------------------------------------------------------
/screenshots/results.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MakotoE/guess-the-eval/HEAD/screenshots/results.png
--------------------------------------------------------------------------------
/semantic/site/elements/flag.variables:
--------------------------------------------------------------------------------
1 | /*-------------------
2 | Flag Variables
3 | --------------------*/
4 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 |
--------------------------------------------------------------------------------
/semantic/site/collections/menu.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
--------------------------------------------------------------------------------
/semantic/site/globals/site.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/nag.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/popup.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/shape.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/tab.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/views/ad.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/views/ad.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/collections/form.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/collections/grid.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/collections/table.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/button.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/divider.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/flag.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/header.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/icon.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/icon.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/image.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/input.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/label.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/list.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/list.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/loader.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/rail.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/rail.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/reveal.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/segment.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/step.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/step.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/globals/reset.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/globals/reset.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Global Variables
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/accordion.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/chatroom.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/checkbox.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/dimmer.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/dropdown.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/embed.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/modal.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/modal.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/nag.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/popup.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/progress.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/rating.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/rating.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/search.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/search.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/shape.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/sidebar.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/sidebar.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/sticky.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/sticky.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/tab.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/views/card.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/views/card.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/views/comment.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/views/comment.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/views/feed.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/views/feed.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/views/item.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/views/item.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/globals/reset.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Reset
3 | *******************************/
--------------------------------------------------------------------------------
/semantic/site/collections/breadcrumb.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/collections/breadcrumb.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/collections/form.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/collections/grid.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/collections/menu.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/collections/message.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/collections/table.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/button.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/container.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/container.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/divider.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/header.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/image.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/input.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/label.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/loader.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/reveal.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/elements/segment.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/accordion.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/chatroom.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/checkbox.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/dimmer.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/dropdown.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/progress.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/transition.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Site Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/modules/transition.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/views/statistic.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/views/statistic.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/chatroom.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Chatroom
3 | *******************************/
--------------------------------------------------------------------------------
/semantic/themes/default/modules/nag.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/tab.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Tab Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/views/ad.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/views/card.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/views/feed.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/views/item.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/site/collections/message.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | User Variable Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/assets/fonts/icons.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MakotoE/guess-the-eval/HEAD/semantic/themes/default/assets/fonts/icons.eot
--------------------------------------------------------------------------------
/semantic/themes/default/assets/fonts/icons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MakotoE/guess-the-eval/HEAD/semantic/themes/default/assets/fonts/icons.ttf
--------------------------------------------------------------------------------
/semantic/themes/default/assets/fonts/icons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MakotoE/guess-the-eval/HEAD/semantic/themes/default/assets/fonts/icons.woff
--------------------------------------------------------------------------------
/semantic/themes/default/assets/images/flags.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MakotoE/guess-the-eval/HEAD/semantic/themes/default/assets/images/flags.png
--------------------------------------------------------------------------------
/semantic/themes/default/collections/form.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/collections/menu.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/button.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/image.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/input.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/label.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/list.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/loader.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/rail.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/reveal.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/segment.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/text.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/globals/site.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Global Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/calendar.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/chatroom.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/dimmer.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/embed.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Video Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/modal.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/popup.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/progress.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Progress
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/rating.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/search.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/shape.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/sidebar.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/slider.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Slider Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/sticky.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/toast.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/views/comment.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/views/statistic.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/assets/fonts/icons.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MakotoE/guess-the-eval/HEAD/semantic/themes/default/assets/fonts/icons.woff2
--------------------------------------------------------------------------------
/semantic/themes/default/collections/grid.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
5 |
--------------------------------------------------------------------------------
/semantic/themes/default/collections/message.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/container.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/header.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
5 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/placeholder.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/assets/fonts/brand-icons.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MakotoE/guess-the-eval/HEAD/semantic/themes/default/assets/fonts/brand-icons.eot
--------------------------------------------------------------------------------
/semantic/themes/default/assets/fonts/brand-icons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MakotoE/guess-the-eval/HEAD/semantic/themes/default/assets/fonts/brand-icons.ttf
--------------------------------------------------------------------------------
/semantic/themes/default/collections/breadcrumb.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
--------------------------------------------------------------------------------
/semantic/themes/default/assets/fonts/brand-icons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MakotoE/guess-the-eval/HEAD/semantic/themes/default/assets/fonts/brand-icons.woff
--------------------------------------------------------------------------------
/semantic/themes/default/assets/fonts/brand-icons.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MakotoE/guess-the-eval/HEAD/semantic/themes/default/assets/fonts/brand-icons.woff2
--------------------------------------------------------------------------------
/semantic/themes/default/assets/fonts/outline-icons.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MakotoE/guess-the-eval/HEAD/semantic/themes/default/assets/fonts/outline-icons.eot
--------------------------------------------------------------------------------
/semantic/themes/default/assets/fonts/outline-icons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MakotoE/guess-the-eval/HEAD/semantic/themes/default/assets/fonts/outline-icons.ttf
--------------------------------------------------------------------------------
/semantic/themes/default/assets/fonts/outline-icons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MakotoE/guess-the-eval/HEAD/semantic/themes/default/assets/fonts/outline-icons.woff
--------------------------------------------------------------------------------
/semantic/themes/default/assets/fonts/outline-icons.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MakotoE/guess-the-eval/HEAD/semantic/themes/default/assets/fonts/outline-icons.woff2
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/semantic/site/globals/site.variables:
--------------------------------------------------------------------------------
1 | @fontName: 'Roboto';
2 | @h1: 8em;
3 |
4 | @white: #F9F9F9;
5 | @black: #161616;
6 | @inputColor: @black;
7 | @pageBackground: @black;
8 | @textColor: @white;
9 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/jsLinters/eslint.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/evaluator/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/sticky.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Sticky
3 | *******************************/
4 |
5 | @transitionDuration: @defaultDuration;
6 | @transition: none;
7 | @zIndex: 800;
--------------------------------------------------------------------------------
/evaluator/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 | # Datasource local storage ignored files
7 | /dataSources/
8 | /dataSources.local.xml
9 |
--------------------------------------------------------------------------------
/evaluator/README.md:
--------------------------------------------------------------------------------
1 | `evaluator` selects positions from the given PGN file and calculates evaluations. It outputs positions in JSON format which should be piped to the `questions.json` file.
2 |
3 | Run with `RUST_BACKTRACE=1;RUST_LOG=evaluator cargo run -- --stockfish-path [stockfish path] [pgn path] > questions.json`
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/evaluator/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/tab.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Tab
3 | *******************************/
4 |
5 | /* Loading */
6 | @loadingMinHeight: 250px;
7 | @loadingContentPosition: relative;
8 | @loadingContentOffset: -10000px;
9 |
10 | @loaderDistanceFromTop: 50%;
11 | @loaderSize: 2.5em;
12 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/transition.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Transition
3 | *******************************/
4 |
5 | @transitionDefaultEasing: @defaultEasing;
6 | @transitionDefaultFill: both;
7 | @transitionDefaultDuration: 300ms;
8 |
9 | @use3DAcceleration: translateZ(0);
10 | @backfaceVisibility: hidden;
--------------------------------------------------------------------------------
/semantic/themes/default/elements/flag.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Flag
3 | *******************************/
4 |
5 | /*-------------------
6 | Element
7 | --------------------*/
8 |
9 | @spritePath: "@{imagePath}/flags.png";
10 | @width: 16px;
11 | @height: 11px;
12 | @verticalAlign: baseline;
13 | @margin: 0.5em;
--------------------------------------------------------------------------------
/semantic/themes/default/views/ad.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Advertisement
3 | *******************************/
4 |
5 | @margin: 1em 0;
6 | @overflow: hidden;
7 |
8 | @testBackground: @lightBlack;
9 | @testColor: @white;
10 | @testFontWeight: @bold;
11 | @testText: 'Ad';
12 | @testFontSize: @relativeMedium;
13 | @testMobileFontSize: @relativeTiny;
14 |
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Guess the Eval
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/text.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Text
3 | *******************************/
4 |
5 | /*-------------------
6 | Element
7 | --------------------*/
8 | @lineHeight: 1;
9 |
10 | @mini: 0.4em;
11 | @tiny: 0.5em;
12 | @small: 0.75em;
13 | @medium: 1em;
14 | @large: 1.5em;
15 | @big: 2em;
16 | @huge: 4em;
17 | @massive: 8em;
18 |
19 |
--------------------------------------------------------------------------------
/src/index.tsx:
--------------------------------------------------------------------------------
1 | import ReactDOM from 'react-dom';
2 | import React from 'react';
3 | import App from './components/App';
4 | import ErrorBoundary from './components/ErrorBoundary';
5 | // eslint-disable-next-line import/no-relative-packages
6 | import '../semantic/semantic.less';
7 |
8 | ReactDOM.render(
9 |
10 |
11 | ,
12 | document.getElementById('root'),
13 | );
14 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext",
4 | "target": "es2021",
5 | "sourceMap": true,
6 | "lib": [
7 | "dom",
8 | "es2020"
9 | ],
10 | "jsx": "react-jsx",
11 | "moduleResolution": "node",
12 | "allowSyntheticDefaultImports": true,
13 | "strict": true,
14 | "resolveJsonModule": true
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/.idea/runConfigurations/lint.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/runConfigurations/start.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/emoji.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Emoji
3 | *******************************/
4 |
5 | /*--------------
6 | Path
7 | ---------------*/
8 | @emojiPath: "https://twemoji.maxcdn.com/v/latest/svg/";
9 | @emojiFileType: "svg";
10 |
11 | /*--------------
12 | Definition
13 | ---------------*/
14 |
15 | /* Emoji Variables */
16 | @opacity: 1;
17 | @loadingDuration: 2s;
18 | @emojiLineHeight: @headerLineHeight;
19 |
--------------------------------------------------------------------------------
/evaluator/.idea/evaluator.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | name: Deploy
2 | on:
3 | push:
4 | tags:
5 | - '*'
6 |
7 | jobs:
8 | deploy:
9 | runs-on: ubuntu-20.04
10 | steps:
11 | - uses: actions/checkout@v2
12 | - uses: actions/setup-node@v1
13 | with:
14 | node-version: '17.1'
15 | - run: npm ci
16 | - run: npm run build
17 | - uses: JamesIves/github-pages-deploy-action@4.1.4
18 | with:
19 | BRANCH: gh-pages
20 | FOLDER: dist
21 |
--------------------------------------------------------------------------------
/evaluator/.gitignore:
--------------------------------------------------------------------------------
1 | # Generated by Cargo
2 | # will have compiled files and executables
3 | debug/
4 | target/
5 |
6 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
7 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
8 | Cargo.lock
9 |
10 | # These are backup files generated by rustfmt
11 | **/*.rs.bk
12 |
13 | # MSVC Windows builds of rustc generate these, which store debugging information
14 | *.pdb
15 |
16 | /stockfish*
--------------------------------------------------------------------------------
/.idea/guess-the-eval.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/evaluator/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/components/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | rules: {
3 | 'react/function-component-definition': 'off',
4 | '@typescript-eslint/no-unsafe-call': 'off', // Causes false positives
5 | '@typescript-eslint/no-unsafe-member-access': 'off',
6 | '@typescript-eslint/restrict-template-expressions': 'off',
7 | '@typescript-eslint/no-misused-promises': [
8 | 'error',
9 | {
10 | 'checksVoidReturn': false,
11 | },
12 | ],
13 | },
14 | }
15 |
--------------------------------------------------------------------------------
/semantic/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fomantic-ui-less",
3 | "version": "2.8.8",
4 | "title": "Fomantic UI",
5 | "description": "LESS only distribution of Fomantic UI",
6 | "homepage": "https://fomantic-ui.com",
7 | "author": "hammy2899",
8 | "license": "MIT",
9 | "repository": {
10 | "type": "git",
11 | "url": "git://github.com/fomantic/Fomantic-UI-LESS.git"
12 | },
13 | "bugs": {
14 | "url": "https://github.com/fomantic/Fomantic-UI/issues"
15 | },
16 | "dependencies": {
17 | "jquery": "^3.4.0"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/semantic/README.md:
--------------------------------------------------------------------------------
1 | # LESS Distribution
2 |
3 | This repository is a distribution of [Fomantic-UI](https://fomantic-ui.com) as LESS only to provide a lightweight themeable version of Fomantic UI.
4 |
5 | You can view more on Fomantic UI at [fomantic-ui.com](https://fomantic-ui.com).
6 |
7 | If you have any issues please use the main [Fomantic-UI repositroy](https://github.com/fomantic/Fomantic-UI).
8 |
9 | ## Installation
10 |
11 | ```bash
12 | $ npm install --save fomantic-ui-less
13 | ```
14 | or
15 | ```bash
16 | $ git clone https://github.com/fomantic/Fomantic-UI-LESS
17 | ```
18 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Guess the Eval
2 |
3 | [Guess the Eval](https://makotoe.github.io/guess-the-eval/) presents a series of chess positions, and you have to guess what evaluation Stockfish gives to those positions. If you guess one of the top three moves from the position, you may get a multiplier applied to your score.
4 |
5 | 
6 | 
7 |
8 | The TypeScript project for the web app is located at the root of this repo. The Rust-based `evaluator` which is responsible for selecting positions and calculating evals is located under [`evaluator`](evaluator).
9 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/reveal.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Reveal
3 | *******************************/
4 |
5 | @transitionDelay: 0.1s;
6 | @transitionDuration: 0.5s;
7 | @transitionEasing: cubic-bezier(0.175, 0.885, 0.320, 1);
8 | @transition: all @transitionDuration @defaultEasing @transitionDelay;
9 |
10 | @bottomZIndex: 2;
11 | @topZIndex: 3;
12 | @activeZIndex: 4;
13 | @overlayZIndex: 5;
14 |
15 | /* Types */
16 | @rotateDegrees: 110deg;
17 | @moveTransition: transform @transitionDuration @transitionEasing @transitionDelay;
18 | @slideTransition: transform @transitionDuration @defaultEasing @transitionDelay;
19 |
--------------------------------------------------------------------------------
/evaluator/Cargo.toml:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "evaluator"
3 | version = "0.1.0"
4 | edition = "2021"
5 | license = "GPL"
6 |
7 | [profile.release]
8 | lto = "fat"
9 | codegen-units = 1
10 |
11 | [dependencies]
12 | tokio = { version = "1.19", features = ["rt-multi-thread", "macros", "process", "io-util", "time", "sync"] }
13 | anyhow = { version = "1.0", features = ["backtrace"]}
14 | vampirc-uci = "0.11"
15 | serde_json = "1.0"
16 | serde = { version = "1.0", features = ["derive"]}
17 | shakmaty = "0.21"
18 | clap = { version = "3.2", features = ["derive"] }
19 | pgn-reader = "0.20"
20 | rand = { version = "0.8", features = ["small_rng"] }
21 | log = "0.4"
22 | env_logger = "0.9"
--------------------------------------------------------------------------------
/src/components/ErrorBoundary.tsx:
--------------------------------------------------------------------------------
1 | import React, { ReactNode } from 'react';
2 |
3 | interface Props {
4 | children: ReactNode;
5 | }
6 |
7 | export default class extends React.Component {
8 | constructor(props: Props) {
9 | super(props);
10 | this.state = { error: '' };
11 | }
12 |
13 | static getDerivedStateFromError(error: Error) {
14 | return { error: `${error.toString()}\n${error.stack ? error.stack : ''}` };
15 | }
16 |
17 | render() {
18 | const { error } = this.state;
19 | const { children } = this.props;
20 | if (error.length > 0) {
21 | return {error};
22 | }
23 |
24 | return children;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/webpack/webpack.prod.js:
--------------------------------------------------------------------------------
1 | const {merge} = require('webpack-merge');
2 | const common = require('./webpack.common.js');
3 |
4 | module.exports = merge(common, {
5 | mode: 'production',
6 | output: {
7 | publicPath: '/guess-the-eval/',
8 | },
9 | module: {
10 | rules: [
11 | {
12 | test: /.tsx?$/,
13 | use: {
14 | loader: 'babel-loader',
15 | options: {
16 | presets: [
17 | '@babel/react',
18 | '@babel/preset-typescript',
19 | [
20 | '@babel/preset-env',
21 | {targets: '> 2%'},
22 | ],
23 | ],
24 | },
25 | },
26 | },
27 | ],
28 | },
29 | });
30 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/calendar.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Calendar
3 | *******************************/
4 |
5 | @focusBoxShadow: inset 0 0 0 1px @focusedFormBorderColor;
6 | @focusInvertedBoxShadow: inset 0 0 0 1px @focusedFormBorderColor;
7 |
8 | @todayFontWeight: bold;
9 |
10 | @rangeBackground: @transparentBlack;
11 | @rangeTextColor: @selectedTextColor;
12 | @rangeBoxShadow: none;
13 | @rangeInvertedBackground: @transparentWhite;
14 | @rangeInvertedTextColor: @invertedSelectedTextColor;
15 | @rangeInvertedBoxShadow: none;
16 |
17 | @adjacentTextColor: @mutedTextColor;
18 | @adjacentBackground: @subtleTransparentBlack;
19 | @adjacentInvertedTextColor: @invertedMutedTextColor;
20 | @adjacentInvertedBackground: @subtleTransparentWhite;
21 |
--------------------------------------------------------------------------------
/webpack/webpack.dev.js:
--------------------------------------------------------------------------------
1 | const {merge} = require('webpack-merge');
2 | const common = require('./webpack.common.js');
3 |
4 | module.exports = merge(common, {
5 | mode: 'development',
6 | output: {
7 | publicPath: '/',
8 | },
9 | module: {
10 | rules: [
11 | {
12 | test: /\.tsx?$/,
13 | use: ['ts-loader'],
14 | },
15 | ],
16 | },
17 | devServer: {
18 | compress: true,
19 | port: 3010,
20 | historyApiFallback: true,
21 | headers: {
22 | 'Cross-Origin-Opener-Policy': 'same-origin',
23 | 'Cross-Origin-Embedder-Policy': 'require-corp',
24 | },
25 | },
26 | cache: {
27 | type: 'filesystem',
28 | buildDependencies: {
29 | config: [__filename, __dirname + '/webpack.common.js'],
30 | },
31 | },
32 | });
33 |
--------------------------------------------------------------------------------
/src/components/Chessground.tsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useRef, useState } from 'react';
2 | import { Chessground as ChessgroundApi } from 'chessground';
3 | import { Api } from 'chessground/api';
4 | import { Config } from 'chessground/config';
5 |
6 | interface Props {
7 | config: Config;
8 | style: React.CSSProperties,
9 | }
10 |
11 | export default ({ config, style }: Props): React.ReactElement => {
12 | const [api, setApi] = useState(null as Api | null);
13 |
14 | const ref = useRef(null as HTMLDivElement | null);
15 |
16 | useEffect(() => {
17 | if (ref && ref.current) {
18 | if (api) {
19 | api.set(config);
20 | } else {
21 | setApi(ChessgroundApi(ref.current, config));
22 | }
23 | }
24 | }, [api, ref, config]);
25 |
26 | return ;
27 | };
28 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | parser: '@typescript-eslint/parser',
4 | plugins: [
5 | '@typescript-eslint',
6 | 'react',
7 | ],
8 | extends: [
9 | 'eslint:recommended',
10 | 'plugin:@typescript-eslint/recommended',
11 | 'plugin:@typescript-eslint/recommended-requiring-type-checking',
12 | 'plugin:react/recommended',
13 | 'plugin:react-hooks/recommended',
14 | 'airbnb',
15 | 'airbnb/hooks',
16 | 'airbnb-typescript',
17 | ],
18 | env: {
19 | browser: true,
20 | node: true,
21 | },
22 | parserOptions: {
23 | tsconfigRootDir: __dirname,
24 | project: ['./tsconfig.json'],
25 | },
26 | settings: {
27 | react: {
28 | version: 'detect',
29 | },
30 | },
31 | ignorePatterns: ['*.js'],
32 | };
33 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/shape.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Shape
3 | *******************************/
4 |
5 | @display: inline-block;
6 |
7 | /* Animating */
8 | @perspective: 2000px;
9 |
10 | @duration: 0.6s;
11 | @easing: ease-in-out;
12 |
13 | @hiddenSideOpacity: 0.6;
14 | @animatingZIndex: 100;
15 |
16 | @transition:
17 | transform @duration @easing,
18 | left @duration @easing,
19 | width @duration @easing,
20 | height @duration @easing
21 | ;
22 | @sideTransition: opacity @duration @easing;
23 | @backfaceVisibility: hidden;
24 |
25 | /* Side */
26 | @sideMargin: 0;
27 |
28 | /*--------------
29 | Types
30 | ---------------*/
31 |
32 | /* Cube */
33 | @cubeSize: 15em;
34 | @cubeBackground: #E6E6E6;
35 | @cubePadding: 2em;
36 | @cubeTextColor: @textColor;
37 | @cubeBoxShadow: 0 0 2px rgba(0, 0, 0, 0.3);
38 |
39 | @cubeTextAlign: center;
40 | @cubeFontSize: 2em;
41 |
--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | name: Test
2 | on:
3 | push:
4 | branches:
5 | - '*'
6 | pull_request:
7 | branches:
8 | - main
9 |
10 | jobs:
11 | app:
12 | runs-on: ubuntu-20.04
13 | steps:
14 | - uses: actions/checkout@v2
15 | - uses: actions/setup-node@v1
16 | with:
17 | node-version: '17.1'
18 | - run: npm i
19 | - run: npm run build
20 | - run: npm run lint
21 | evaluator:
22 | runs-on: ubuntu-20.04
23 | defaults:
24 | run:
25 | working-directory: evaluator
26 | steps:
27 | - uses: actions/checkout@v2
28 | - run: rustup component add clippy
29 | working-directory: evaluator
30 | - run: rustup component add rustfmt
31 | - run: RUST_BACKTRACE=1 cargo test --all-features -- --nocapture
32 | - run: cargo clippy --all-targets --all-features -- -D warnings
33 | - run: cargo fmt -- --check
34 |
--------------------------------------------------------------------------------
/evaluator/.idea/runConfigurations/Lint.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/semantic/definitions/globals/reset.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * # Fomantic-UI - Reset
3 | * http://github.com/fomantic/Fomantic-UI/
4 | *
5 | *
6 | * Released under the MIT license
7 | * http://opensource.org/licenses/MIT
8 | *
9 | */
10 |
11 | /*******************************
12 | Theme
13 | *******************************/
14 |
15 | @type : 'global';
16 | @element : 'reset';
17 |
18 | @import (multiple) '../../theme.config';
19 |
20 | /*******************************
21 | Reset
22 | *******************************/
23 |
24 | /* Border-Box */
25 | *,
26 | *:before,
27 | *:after {
28 | box-sizing: inherit;
29 | }
30 | html {
31 | box-sizing: border-box;
32 | }
33 |
34 | /* iPad Input Shadows */
35 | input[type="text"], input[type="email"], input[type="search"], input[type="password"] {
36 | -webkit-appearance: none;
37 | -moz-appearance: none; /* mobile firefox too! */
38 | }
39 |
40 | .loadUIOverrides();
41 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/rail.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Rail
3 | *******************************/
4 |
5 | /*-------------------
6 | Element
7 | --------------------*/
8 |
9 | @width: 300px;
10 | @height: 100%;
11 |
12 | @distance: 4rem;
13 | @splitDistance: (@distance / 2);
14 |
15 | /*-------------------
16 | Variations
17 | --------------------*/
18 |
19 | /* Close */
20 | @closeDistance: 2em;
21 | @veryCloseDistance: 1em;
22 |
23 | @splitCloseDistance: (@closeDistance / 2);
24 | @splitVeryCloseDistance: (@veryCloseDistance / 2);
25 |
26 | @closeWidth: e(%("calc(%d + %d)", @width, @splitCloseDistance));
27 | @veryCloseWidth: e(%("calc(%d + %d)", @width, @splitVeryCloseDistance));
28 |
29 | /* Dividing */
30 | @dividingBorder: 1px solid @borderColor;
31 | @dividingDistance: 5rem;
32 | @splitDividingDistance: (@dividingDistance / 2);
33 | @dividingWidth: @width + @splitDividingDistance;
34 |
35 |
--------------------------------------------------------------------------------
/semantic/themes/default/collections/breadcrumb.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Breadcrumb
3 | *******************************/
4 |
5 | /*-------------------
6 | Breadcrumb
7 | --------------------*/
8 |
9 | @verticalMargin: 0;
10 | @display: inline-block;
11 | @verticalAlign: middle;
12 |
13 | @dividerSpacing: @3px;
14 | @dividerOpacity: 0.7;
15 | @dividerColor: @lightTextColor;
16 |
17 | @dividerSize: @relativeSmall;
18 | @dividerVerticalAlign: baseline;
19 |
20 | @iconDividerSize: @relativeTiny;
21 | @iconDividerVerticalAlign: baseline;
22 |
23 | @sectionMargin: 0;
24 | @sectionPadding: 0;
25 |
26 | /* Coupling */
27 | @segmentPadding: @relativeMini @relativeMedium;
28 |
29 | /* Inverted */
30 | @invertedColor: @midWhite;
31 | @invertedActiveColor: @white;
32 | @invertedDividerColor: @invertedLightTextColor;
33 |
34 | /*-------------------
35 | States
36 | --------------------*/
37 |
38 | @activeFontWeight: @bold;
39 |
--------------------------------------------------------------------------------
/src/questions.ts:
--------------------------------------------------------------------------------
1 | import * as questionsData from '../evaluator/questions.json';
2 |
3 | export interface Question {
4 | fen: string,
5 | players: { white: string, black: string },
6 | moves: Moves,
7 | pgn: string,
8 | turn_number: number,
9 | }
10 |
11 | export interface Move {
12 | move: San,
13 | evaluation: number,
14 | }
15 |
16 | // San is a lowercase SAN.
17 | export type San = string;
18 |
19 | // Contains up to 3 top moves. The first move gives the current evaluation.
20 | export interface Moves {
21 | one: Move,
22 | two: Move | null,
23 | three: Move | null,
24 | }
25 |
26 | // Returns number of non-null variations.
27 | export function numberOfVariations(variations: Moves): number {
28 | if (variations.three !== null) {
29 | return 3;
30 | }
31 |
32 | if (variations.two !== null) {
33 | return 2;
34 | }
35 |
36 | return 1;
37 | }
38 |
39 | export const questionsDatabase = questionsData as unknown as Question[];
40 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/image.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Image
3 | *******************************/
4 |
5 | /*-------------------
6 | Element
7 | --------------------*/
8 |
9 | @placeholderColor: transparent;
10 | @roundedBorderRadius: 0.3125em;
11 |
12 | @imageHorizontalMargin: 0.25rem;
13 | @imageVerticalMargin: 0.5rem;
14 | @imageBorder: 1px solid rgba(0, 0, 0, 0.1);
15 |
16 | /*-------------------
17 | Types
18 | --------------------*/
19 |
20 | /* Avatar */
21 | @avatarSize: 2em;
22 | @avatarMargin: 0.25em;
23 |
24 |
25 | /*-------------------
26 | Variations
27 | --------------------*/
28 |
29 | /* Spaced */
30 | @spacedDistance: 0.5em;
31 |
32 | /* Floated */
33 | @floatedHorizontalMargin: 1em;
34 | @floatedVerticalMargin: 1em;
35 |
36 | /* Size */
37 | @miniWidth: 35px;
38 | @tinyWidth: 80px;
39 | @smallWidth: 150px;
40 | @mediumWidth: 300px;
41 | @largeWidth: 450px;
42 | @bigWidth: 600px;
43 | @hugeWidth: 800px;
44 | @massiveWidth: 960px;
45 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/sidebar.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Sidebar
3 | *******************************/
4 |
5 | /*-------------------
6 | Content
7 | --------------------*/
8 |
9 | /* Animation */
10 | @perspective: 1500px;
11 | @duration: 500ms;
12 | @easing: @defaultEasing;
13 |
14 | /* Dimmer */
15 | @dimmerColor: rgba(0, 0, 0, 0.4);
16 | @dimmerTransition: opacity @duration;
17 |
18 | /* Color below page */
19 | @canvasBackground: @lightBlack;
20 |
21 | /* Shadow */
22 | @boxShadow: 0 0 20px @borderColor;
23 | @horizontalBoxShadow: @boxShadow;
24 | @verticalBoxShadow: @boxShadow;
25 |
26 | /* Layering */
27 | @bottomLayer: 1;
28 | @middleLayer: 2;
29 | @fixedLayer: 101;
30 | @topLayer: 102;
31 | @dimmerLayer: 1000;
32 |
33 | /*-------------------
34 | Variations
35 | --------------------*/
36 |
37 | /* Width */
38 | @veryThinWidth: 60px;
39 | @thinWidth: 150px;
40 | @width: 260px;
41 | @wideWidth: 350px;
42 | @veryWideWidth: 475px;
43 |
44 | /* Height */
45 | @height: 36px;
46 |
--------------------------------------------------------------------------------
/about.md:
--------------------------------------------------------------------------------
1 | # About Guess the Eval
2 |
3 | Guess the Eval is designed and developed by Makoto Emura. It is licensed under the GNU General Public License. See [LICENSE](LICENSE) for details. Guess the Eval uses third party libraries which are listed [here](thirdPartyLicenses.md).
4 |
5 | You're currently in the GitHub repo containing the source code for [Guess the Eval](https://github.com/MakotoE/guess-the-eval). If you have feedback or suggestions for this project, please make an issue on this repo. Thanks!
6 |
7 | ## Positions database
8 |
9 | Thanks to [The Week in Chess](https://theweekinchess.com/) for the PGNs. From the 56 games of Candidates Tournament 2022, I choose up to two random positions of each.
10 |
11 | All evaluations were calculated with Stockfish 15, to a depth of 30 with NNUE.
12 |
13 | Selecting positions for the positions database is difficult. There may be very one-sided positions. Also, the points scoring algorithm may need tweaking. If you know of a possible way to improve the scoring algorithm, please leave create an issue with your idea.
14 |
--------------------------------------------------------------------------------
/semantic/definitions/elements/flag.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * # Fomantic-UI - Flag
3 | * http://github.com/fomantic/Fomantic-UI/
4 | *
5 | *
6 | * Released under the MIT license
7 | * http://opensource.org/licenses/MIT
8 | *
9 | */
10 |
11 |
12 | /*******************************
13 | Theme
14 | *******************************/
15 |
16 | @type : 'element';
17 | @element : 'flag';
18 |
19 | @import (multiple) '../../theme.config';
20 |
21 |
22 | /*******************************
23 | Flag
24 | *******************************/
25 |
26 | i.flag:not(.icon) {
27 | display: inline-block;
28 |
29 | width: @width;
30 | height: @height;
31 |
32 | line-height: @height;
33 | vertical-align: @verticalAlign;
34 | margin: 0 @margin 0 0;
35 |
36 | text-decoration: inherit;
37 |
38 | speak: none;
39 | -webkit-font-smoothing: antialiased;
40 | backface-visibility: hidden;
41 | }
42 |
43 | /* Sprite */
44 | i.flag:not(.icon):before {
45 | display: inline-block;
46 | content: '';
47 | background: url(@spritePath) no-repeat -108px -1976px;
48 | width: @width;
49 | height: @height;
50 | }
51 |
52 | .loadUIOverrides();
53 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/rating.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Rating
3 | *******************************/
4 |
5 | @margin: 0 @relativeMini;
6 | @whiteSpace: nowrap;
7 | @verticalAlign: baseline;
8 |
9 | @iconCursor: pointer;
10 | @iconWidth: 1.25em;
11 | @iconHeight: auto;
12 | @iconTransition:
13 | opacity @defaultDuration @defaultEasing,
14 | background @defaultDuration @defaultEasing,
15 | text-shadow @defaultDuration @defaultEasing,
16 | color @defaultDuration @defaultEasing
17 | ;
18 |
19 |
20 | /*-------------------
21 | Types
22 | --------------------*/
23 |
24 | /* Standard */
25 | @inactiveBackground: transparent;
26 | @inactiveColor: rgba(0, 0, 0, 0.15);
27 |
28 | @selectedBackground: @inactiveBackground;
29 | @selectedColor: @textColor;
30 |
31 | @activeBackground: @inactiveBackground;
32 | @activeColor: @darkTextColor;
33 |
34 | @shadowWidth: 1px;
35 |
36 | /*-------------------
37 | States
38 | --------------------*/
39 |
40 | @interactiveActiveIconOpacity: 1;
41 | @interactiveSelectedIconOpacity: 1;
42 |
43 | /*-------------------
44 | Variations
45 | --------------------*/
46 |
47 | @massive: 2rem;
48 |
--------------------------------------------------------------------------------
/evaluator/.idea/runConfigurations/Run_evaluator.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/webpack/webpack.common.js:
--------------------------------------------------------------------------------
1 | const HtmlWebpackPlugin = require('html-webpack-plugin');
2 | const CopyPlugin = require('copy-webpack-plugin');
3 |
4 | module.exports = {
5 | entry: './src/index.tsx',
6 | module: {
7 | rules: [
8 | {
9 | test: /\.css$/,
10 | use: [
11 | 'style-loader',
12 | {
13 | loader: 'css-loader',
14 | options: {
15 | modules: true,
16 | },
17 | },
18 | ],
19 | },
20 | {
21 | test: /\.less$/,
22 | use: [
23 | 'style-loader',
24 | 'css-loader',
25 | 'less-loader',
26 | ],
27 | },
28 | {
29 | test: /\.m?js$/,
30 | resolve: {
31 | fullySpecified: false
32 | }
33 | },
34 | ],
35 | },
36 | resolve: {
37 | extensions: ['.js', '.ts', '.tsx', '.css'],
38 | },
39 | target: 'web',
40 | output: {
41 | filename: '[name].[contenthash].js',
42 | },
43 | devtool: 'inline-source-map',
44 | plugins: [
45 | new HtmlWebpackPlugin({template: './src/index.html'}),
46 | new CopyPlugin({
47 | patterns: [
48 | {from: 'src/chessground.css'},
49 | {from: 'assets', to: 'assets'},
50 | ],
51 | }),
52 | ],
53 | };
54 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/divider.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Divider
3 | *******************************/
4 |
5 | /*-------------------
6 | Element
7 | --------------------*/
8 |
9 | @margin: 1rem 0;
10 | @borderStyle: solid;
11 |
12 | @highlightWidth: 1px;
13 | @highlightColor: @whiteBorderColor;
14 |
15 | @shadowWidth: 1px;
16 | @shadowColor: @borderColor;
17 |
18 | /* Text */
19 | @letterSpacing: 0.05em;
20 | @fontWeight: @bold;
21 | @color: @darkTextColor;
22 | @textTransform: uppercase;
23 |
24 | /*-------------------
25 | Coupling
26 | --------------------*/
27 |
28 | /* Icon */
29 | @dividerIconSize: 1rem;
30 | @dividerIconMargin: 0;
31 |
32 |
33 | /*******************************
34 | Variations
35 | *******************************/
36 |
37 | /* Horizontal / Vertical */
38 | @horizontalMargin: '';
39 | @horizontalDividerMargin: 1em;
40 | @horizontalRulerOffset: e(%("calc(-50%% - %d)", @horizontalDividerMargin));
41 |
42 | @verticalDividerMargin: 1rem;
43 | @verticalDividerHeight: e(%("calc(100%% - %d)", @verticalDividerMargin));
44 |
45 | /* Inverted */
46 | @invertedTextColor: @white;
47 | @invertedHighlightColor: rgba(255, 255, 255, 0.15);
48 | @invertedShadowColor: @borderColor;
49 |
50 | /* Section */
51 | @sectionMargin: 2rem;
52 |
53 | /* Sizes */
54 | @medium: 1rem;
55 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/embed.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Video
3 | *******************************/
4 |
5 | /*-------------------
6 | Element
7 | --------------------*/
8 |
9 | /* Simple */
10 | @background: @lightGrey;
11 | @transitionDuration: 0.5s;
12 | @transitionEasing: @defaultEasing;
13 |
14 | /* Placeholder */
15 | @placeholderUnderlay: @background;
16 |
17 | /* Placeholder Overlayed Background */
18 | @placeholderBackground: radial-gradient(transparent 45%, rgba(0, 0, 0, 0.3));
19 | @placeholderBackgroundOpacity: 0.5;
20 | @placeholderBackgroundTransition: opacity @transitionDuration @transitionEasing;
21 |
22 | /* Icon */
23 | @iconBackground: @veryStrongTransparentBlack;
24 | @iconSize: 6rem;
25 | @iconTransition:
26 | opacity @transitionDuration @transitionEasing,
27 | color @transitionDuration @transitionEasing
28 | ;
29 | @iconColor: @white;
30 | @iconShadow:
31 | 0 2px 10px rgba(34, 36, 38, 0.2)
32 | ;
33 | @iconZIndex: 10;
34 |
35 | /*-------------------
36 | States
37 | --------------------*/
38 |
39 | /* Hover */
40 | @hoverPlaceholderBackground: @placeholderBackground;
41 | @hoverPlaceholderBackgroundOpacity: 1;
42 | @hoverIconColor: @white;
43 |
44 |
45 | /*-------------------
46 | Variations
47 | --------------------*/
48 |
49 | /* Aspect Ratios */
50 | @squareRatio: (1/1) * 100%;
51 | @widescreenRatio: (9/16) * 100%;
52 | @ultraWidescreenRatio: (9/21) * 100%;
53 | @standardRatio: (3/4) * 100%;
54 |
--------------------------------------------------------------------------------
/semantic/definitions/modules/sticky.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * # Fomantic-UI - Sticky
3 | * http://github.com/fomantic/Fomantic-UI/
4 | *
5 | *
6 | * Released under the MIT license
7 | * http://opensource.org/licenses/MIT
8 | *
9 | */
10 |
11 |
12 | /*******************************
13 | Theme
14 | *******************************/
15 |
16 | @type : 'module';
17 | @element : 'sticky';
18 |
19 | @import (multiple) '../../theme.config';
20 |
21 | /*******************************
22 | Sticky
23 | *******************************/
24 |
25 | .ui.sticky {
26 | position: static;
27 | transition: @transition;
28 | z-index: @zIndex;
29 | }
30 |
31 | /*******************************
32 | States
33 | *******************************/
34 |
35 | /* Bound */
36 | .ui.sticky.bound {
37 | position: absolute;
38 | left: auto;
39 | right: auto;
40 | }
41 |
42 | /* Fixed */
43 | .ui.sticky.fixed {
44 | position: fixed;
45 | left: auto;
46 | right: auto;
47 | }
48 |
49 | /* Bound/Fixed Position */
50 | .ui.sticky.bound.top,
51 | .ui.sticky.fixed.top {
52 | top: 0;
53 | bottom: auto;
54 | }
55 | .ui.sticky.bound.bottom,
56 | .ui.sticky.fixed.bottom {
57 | top: auto;
58 | bottom: 0;
59 | }
60 |
61 |
62 | /*******************************
63 | Types
64 | *******************************/
65 |
66 | .ui.native.sticky {
67 | position: -webkit-sticky;
68 | position: -moz-sticky;
69 | position: -ms-sticky;
70 | position: -o-sticky;
71 | position: sticky;
72 | }
73 |
74 | .loadUIOverrides();
75 |
--------------------------------------------------------------------------------
/semantic/definitions/elements/emoji.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * # Fomantic UI - Emoji
3 | * https://github.com/fomantic/Fomantic-UI/
4 | *
5 | *
6 | * Released under the MIT license
7 | * https://github.com/fomantic/Fomantic-UI/blob/master/LICENSE.md
8 | *
9 | */
10 |
11 |
12 | /*******************************
13 | Theme
14 | *******************************/
15 |
16 | @type : 'element';
17 | @element : 'emoji';
18 |
19 | @import (multiple) '../../theme.config';
20 |
21 |
22 | /*******************************
23 | Emoji
24 | *******************************/
25 |
26 |
27 | em[data-emoji] {
28 | opacity: @opacity;
29 |
30 | speak: none;
31 | backface-visibility: hidden;
32 | }
33 |
34 | em[data-emoji]:before {
35 | content:'\00A0\00A0\00A0\00A0\00A0\00A0\00A0';
36 | display: inline-block;
37 | line-height: @emojiLineHeight;
38 | background-repeat: no-repeat;
39 | background-position: center center;
40 | & when not (@emojiFileType = 'svg') {
41 | background-size: contain;
42 | }
43 | }
44 |
45 |
46 | /*******************************
47 | States
48 | *******************************/
49 |
50 | em[data-emoji].disabled {
51 | opacity: @disabledOpacity;
52 | }
53 |
54 |
55 | /*******************************
56 | Variations
57 | *******************************/
58 |
59 | em[data-emoji].loading:before {
60 | animation: loader @loadingDuration linear infinite;
61 | }
62 |
63 |
64 | /*-------------------
65 | Link
66 | --------------------*/
67 |
68 | em[data-emoji].link:not(.disabled) {
69 | cursor: pointer;
70 | }
71 |
72 | .loadUIOverrides();
73 |
--------------------------------------------------------------------------------
/semantic/definitions/elements/text.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * # Fomantic-UI - Text
3 | * http://github.com/fomantic/Fomantic-UI/
4 | *
5 | *
6 | * Released under the MIT license
7 | * https://github.com/fomantic/Fomantic-UI/blob/master/LICENSE.md
8 | *
9 | */
10 |
11 |
12 | /*******************************
13 | Theme
14 | *******************************/
15 |
16 | @type : 'element';
17 | @element : 'text';
18 |
19 | @import (multiple) '../../theme.config';
20 |
21 |
22 | /*******************************
23 | Text
24 | *******************************/
25 | span.ui.text {
26 | line-height: @lineHeight;
27 | }
28 |
29 | each(@colors, {
30 | @color: replace(@key, '@', '');
31 | @c: @colors[@@color][color];
32 | @l: @colors[@@color][light];
33 |
34 | span.ui.@{color}.text {
35 | color: @c;
36 | }
37 | & when (@variationTextInverted) {
38 | span.ui.inverted.@{color}.text {
39 | color: @l;
40 | }
41 | }
42 | })
43 |
44 | & when (@variationTextStates) {
45 | each(@textStates, {
46 | @state: replace(@key, '@', '');
47 | @c: @textStates[@@state][color];
48 |
49 | span.ui.@{state}.text {
50 | color: @c;
51 | }
52 | })
53 | }
54 |
55 | & when (@variationTextDisabled) {
56 | span.ui.disabled.text {
57 | opacity: @disabledOpacity;
58 | }
59 | }
60 |
61 | /* Sizes */
62 | span.ui.medium.text {
63 | font-size: @medium;
64 | }
65 | & when not (@variationTextSizes = false) {
66 | each(@variationTextSizes, {
67 | @s: @@value;
68 | span.ui.@{value}.text {
69 | font-size: @s;
70 | }
71 | })
72 | }
73 |
74 | .loadUIOverrides();
75 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/nag.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Nag
3 | *******************************/
4 |
5 | /*--------------
6 | Collection
7 | ---------------*/
8 |
9 | @position: relative;
10 | @width: 100%;
11 | @zIndex: 999;
12 | @margin: 0;
13 |
14 | @background: #777777;
15 | @opacity: 0.95;
16 | @minHeight: 0;
17 | @padding: 0.75em 1em;
18 | @lineHeight: 1em;
19 | @boxShadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
20 |
21 | @fontSize: 1rem;
22 | @textAlign: center;
23 | @color: @textColor;
24 |
25 | @transition: 0.2s background ease;
26 |
27 |
28 | /*--------------
29 | Elements
30 | ---------------*/
31 |
32 | /* Title */
33 | @titleColor: @white;
34 | @titleMargin: 0 0.5em;
35 |
36 | @closeSize: 1em;
37 | @closeMargin: (-@closeSize / 2) 0 0;
38 | @closeTop: 50%;
39 | @closeRight: 1em;
40 | @closeColor: @white;
41 | @closeTransition: opacity 0.2s ease;
42 | @closeOpacity: 0.4;
43 |
44 |
45 | /*--------------
46 | States
47 | ---------------*/
48 |
49 | /* Hover */
50 | @nagHoverBackground: @background;
51 | @nagHoverOpacity: 1;
52 |
53 | @closeHoverOpacity: 1;
54 |
55 | /*--------------
56 | Variations
57 | ---------------*/
58 |
59 | /* Top / Bottom */
60 | @top: 0;
61 | @bottom: 0;
62 | @borderRadius: @defaultBorderRadius;
63 | @topBorderRadius: 0 0 @borderRadius @borderRadius;
64 | @bottomBorderRadius: @borderRadius @borderRadius 0 0;
65 |
66 | /* Inverted */
67 | @invertedBackground: @darkWhite;
68 | @invertedTitleColor: @mutedTextColor;
69 | @invertedCloseColor: @mutedTextColor;
70 |
71 | /*--------------
72 | Plural
73 | ---------------*/
74 |
75 | @groupedBorderRadius: 0;
76 |
77 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "guess-the-eval",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "start": "webpack serve --config webpack/webpack.dev.js",
7 | "build": "webpack --config webpack/webpack.prod.js",
8 | "lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix"
9 | },
10 | "dependencies": {
11 | "@babel/core": "^7.18.5",
12 | "@babel/preset-env": "^7.18.2",
13 | "@babel/preset-react": "^7.17.12",
14 | "@babel/preset-typescript": "^7.17.12",
15 | "@types/react": "^18.0.14",
16 | "@types/react-dom": "^18.0.5",
17 | "@types/semantic-ui": "^2.2.7",
18 | "@typescript-eslint/eslint-plugin": "^5.29.0",
19 | "@typescript-eslint/parser": "^5.29.0",
20 | "babel-loader": "^8.2.5",
21 | "chess.ts": "^0.16.2",
22 | "chessground": "^8.2.1",
23 | "copy-webpack-plugin": "^11.0.0",
24 | "css-loader": "^6.7.1",
25 | "eslint": "^8.18.0",
26 | "eslint-config-airbnb": "^19.0.4",
27 | "eslint-config-airbnb-typescript": "^17.0.0",
28 | "eslint-plugin-import": "^2.26.0",
29 | "eslint-plugin-jsx-a11y": "^6.5.1",
30 | "eslint-plugin-react": "^7.30.0",
31 | "eslint-plugin-react-hooks": "^4.6.0",
32 | "html-webpack-plugin": "^5.5.0",
33 | "less": "^4.1.3",
34 | "less-loader": "^11.0.0",
35 | "nlf": "^2.1.1",
36 | "react": "^18.2.0",
37 | "react-dom": "^18.2.0",
38 | "react-draggable": "^4.4.5",
39 | "semantic-ui-react": "^2.1.3",
40 | "style-loader": "^3.3.1",
41 | "ts-loader": "^9.3.0",
42 | "typescript": "^4.7.4",
43 | "webpack": "^5.73.0",
44 | "webpack-cli": "^4.10.0",
45 | "webpack-dev-server": "^4.9.2",
46 | "webpack-merge": "^5.8.0"
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/placeholder.variables:
--------------------------------------------------------------------------------
1 | @placeholderMaxWidth: 30rem;
2 |
3 | /* Key Content Sizing */
4 | @placeholderLineMargin: @relative12px;
5 | @placeholderHeaderLineHeight: @relative9px;
6 | @placeholderLineHeight: @relative7px;
7 | @placeholderParagraphLineHeight: @placeholderLineHeight;
8 |
9 | @placeholderSpacing: @relative20px;
10 |
11 | /* Interval between consecutive placeholders */
12 | @placeholderAnimationInterval: 0.15s;
13 |
14 | /* Repeated Placeholder */
15 | @consecutivePlaceholderSpacing: 2rem;
16 |
17 | /* Image */
18 | @placeholderImageHeight: 100px;
19 |
20 | /* Header Image */
21 | @placeholderImageWidth: 3em;
22 | @placeholderImageTextIndent: @10px;
23 |
24 | /* Paragraph */
25 | @placeholderHeaderLineOneOutdent: 20%;
26 | @placeholderHeaderLineTwoOutdent: 60%;
27 |
28 | @placeholderLineOneOutdent: @placeholderFullLineOutdent;
29 | @placeholderLineTwoOutdent: @placeholderMediumLineOutdent;
30 | @placeholderLineThreeOutdent: @placeholderVeryLongLineOutdent;
31 | @placeholderLineFourOutdent: @placeholderLongLineOutdent;
32 | @placeholderLineFiveOutdent: @placeholderShortLineOutdent;
33 |
34 |
35 | /* Glow Gradient */
36 | @placeholderLoadingAnimationDuration: 2s;
37 | @placeholderLoadingGradientWidth: 1200px;
38 | @placeholderLoadingGradient: linear-gradient(to right,
39 | rgba(0, 0, 0, 0.08) 0,
40 | rgba(0, 0, 0, 0.15) 15%,
41 | rgba(0, 0, 0, 0.08) 30%
42 | );
43 | @placeholderInvertedLoadingGradient: linear-gradient(to right,
44 | rgba(255, 255, 255, 0.08) 0,
45 | rgba(255, 255, 255, 0.14) 15%,
46 | rgba(255, 255, 255, 0.08) 30%
47 | );
48 |
49 | /* Variations */
50 | @placeholderFullLineOutdent: 0;
51 | @placeholderVeryLongLineOutdent: 10%;
52 | @placeholderLongLineOutdent: 35%;
53 | @placeholderMediumLineOutdent: 50%;
54 | @placeholderShortLineOutdent: 65%;
55 | @placeholderVeryShortLineOutdent: 80%;
56 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/dimmer.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Dimmer
3 | *******************************/
4 |
5 | @dimmablePosition: relative;
6 | @dimmerPosition: absolute;
7 |
8 | @backgroundColor: rgba(0, 0, 0 , 0.85);
9 | @lineHeight: 1;
10 | @perspective: 2000px;
11 | @padding: 1em;
12 |
13 | @duration: 0.5s;
14 | @transition:
15 | background-color @duration linear
16 | ;
17 | @zIndex: 1000;
18 | @textAlign: center;
19 | @verticalAlign: middle;
20 | @textColor: @white;
21 | @overflow: hidden;
22 |
23 | @blurredStartFilter: initial;
24 | @blurredEndFilter: e("blur(5px) grayscale(0.7)");
25 | @blurredTransition: 800ms filter @defaultEasing;
26 |
27 | @blurredBackgroundColor: rgba(0, 0, 0, 0.6);
28 | @blurredInvertedBackgroundColor: rgba(255, 255, 255, 0.6);
29 |
30 | /* Hidden (Default) */
31 | @hiddenOpacity: 0;
32 |
33 | /* Visible */
34 | @visibleOpacity: 1;
35 |
36 | /*-------------------
37 | Types
38 | --------------------*/
39 |
40 | /* Page Dimmer*/
41 | @transformStyle: '';
42 | @pageDimmerPosition: fixed;
43 |
44 |
45 | /*-------------------
46 | Variations
47 | --------------------*/
48 |
49 | /* Inverted */
50 | @invertedBackgroundColor: rgba(255, 255, 255, 0.85);
51 | @invertedTextColor: @fullBlack;
52 |
53 | /* Simple */
54 | @simpleZIndex: 1;
55 | @simpleStartBackgroundColor: rgba(0, 0, 0, 0);
56 | @simpleEndBackgroundColor: @backgroundColor;
57 | @simpleInvertedStartBackgroundColor: rgba(255, 255, 255, 0);
58 | @simpleInvertedEndBackgroundColor: @invertedBackgroundColor;
59 |
60 | /* Intensity */
61 | @veryLightBackgroundColor: rgba(0,0,0,.25);
62 | @lightBackgroundColor: rgba(0,0,0,.45);
63 | @mediumBackgroundColor: rgba(0,0,0,.65);
64 | @veryLightInvertedBackgroundColor: rgba(255,255,255,.25);
65 | @lightInvertedBackgroundColor: rgba(255,255,255,.45);
66 | @mediumInvertedBackgroundColor: rgba(255,255,255,.65);
--------------------------------------------------------------------------------
/semantic/themes/default/elements/loader.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Loader
3 | *******************************/
4 |
5 | /* Some global loader styles defined in site.variables */
6 | // @loaderSpeed
7 | // @loaderLineWidth
8 | // @loaderFillColor
9 | // @loaderLineColor
10 | // @invertedLoaderFillColor
11 | // @invertedLoaderLineColor
12 |
13 | /*-------------------
14 | Standard
15 | --------------------*/
16 |
17 | @loaderTopOffset: 50%;
18 | @loaderLeftOffset: 50%;
19 |
20 | @shapeBorderColor: @loaderLineColor;
21 | @invertedShapeBorderColor: @invertedLoaderLineColor;
22 |
23 | /*-------------------
24 | Types
25 | --------------------*/
26 |
27 | /* Text */
28 | @textDistance: @relativeMini;
29 | @loaderTextColor: @textColor;
30 | @invertedLoaderTextColor: @invertedTextColor;
31 |
32 |
33 | /*-------------------
34 | States
35 | --------------------*/
36 |
37 | @indeterminateDirection: reverse;
38 | @indeterminateSpeed: (2 * @loaderSpeed);
39 |
40 | /*-------------------
41 | Variations
42 | --------------------*/
43 |
44 | @inlineVerticalAlign: middle;
45 | @inlineMargin: 0;
46 |
47 | /* Exact Sizes (Avoids Rounding Errors) */
48 | @mini : @14px;
49 | @tiny : @16px;
50 | @small : @24px;
51 | @medium : @32px;
52 | @large : @48px;
53 | @big : @52px;
54 | @huge : @58px;
55 | @massive : @64px;
56 |
57 | @miniOffset: 0 0 0 -(@mini / 2);
58 | @tinyOffset: 0 0 0 -(@tiny / 2);
59 | @smallOffset: 0 0 0 -(@small / 2);
60 | @mediumOffset: 0 0 0 -(@medium / 2);
61 | @largeOffset: 0 0 0 -(@large / 2);
62 | @bigOffset: 0 0 0 -(@big / 2);
63 | @hugeOffset: 0 0 0 -(@huge / 2);
64 | @massiveOffset: 0 0 0 -(@massive / 2);
65 |
66 | @tinyFontSize: @relativeTiny;
67 | @miniFontSize: @relativeMini;
68 | @smallFontSize: @relativeSmall;
69 | @mediumFontSize: @relativeMedium;
70 | @largeFontSize: @relativeLarge;
71 | @bigFontSize: @relativeBig;
72 | @hugeFontSize: @relativeHuge;
73 | @massiveFontSize: @relativeMassive;
74 |
--------------------------------------------------------------------------------
/semantic/definitions/modules/transition.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * # Fomantic-UI - Transition
3 | * http://github.com/fomantic/Fomantic-UI/
4 | *
5 | *
6 | * Released under the MIT license
7 | * http://opensource.org/licenses/MIT
8 | *
9 | */
10 |
11 |
12 | /*******************************
13 | Theme
14 | *******************************/
15 |
16 | @type : 'module';
17 | @element : 'transition';
18 |
19 | @import (multiple) '../../theme.config';
20 |
21 | /*******************************
22 | Transitions
23 | *******************************/
24 |
25 | .transition {
26 | animation-iteration-count: 1;
27 | animation-duration: @transitionDefaultDuration;
28 | animation-timing-function: @transitionDefaultEasing;
29 | animation-fill-mode: @transitionDefaultFill;
30 | }
31 |
32 | /*******************************
33 | States
34 | *******************************/
35 |
36 |
37 | /* Animating */
38 | .animating.transition {
39 | backface-visibility: @backfaceVisibility;
40 | visibility: visible !important;
41 | }
42 |
43 | & when (@variationTransitionLoading) {
44 | /* Loading */
45 | .loading.transition {
46 | position: absolute;
47 | top: -99999px;
48 | left: -99999px;
49 | }
50 | }
51 |
52 | /* Hidden */
53 | .hidden.transition {
54 | display: none;
55 | visibility: hidden;
56 | }
57 |
58 | /* Visible */
59 | .visible.transition {
60 | display: block !important;
61 | visibility: visible !important;
62 | /* backface-visibility: @backfaceVisibility;
63 | transform: @use3DAcceleration;*/
64 | }
65 |
66 | & when (@variationTransitionDisabled) {
67 | /* Disabled */
68 | .disabled.transition {
69 | animation-play-state: paused;
70 | }
71 | }
72 |
73 | /*******************************
74 | Variations
75 | *******************************/
76 | & when (@variationTransitionLoading) {
77 | .looping.transition {
78 | animation-iteration-count: infinite;
79 | }
80 | }
81 |
82 | .loadUIOverrides();
83 |
--------------------------------------------------------------------------------
/evaluator/src/visitor.rs:
--------------------------------------------------------------------------------
1 | use super::*;
2 | use pgn_reader::{RawHeader, Visitor};
3 | use shakmaty::san::SanPlus;
4 | use shakmaty::Chess;
5 |
6 | #[derive(Debug)]
7 | pub struct PositionsVisitor {
8 | positions: Vec,
9 | players: Players,
10 | error: Option,
11 | }
12 |
13 | impl PositionsVisitor {
14 | pub fn new() -> Self {
15 | Self {
16 | positions: vec![Chess::default()],
17 | players: Players::default(),
18 | error: None,
19 | }
20 | }
21 | }
22 |
23 | impl Visitor for PositionsVisitor {
24 | type Result = Result<(Vec, Players)>;
25 |
26 | fn header(&mut self, key: &[u8], value: RawHeader<'_>) {
27 | match key {
28 | b"White" => self.players.white = value.decode_utf8_lossy().to_string(),
29 | b"Black" => self.players.black = value.decode_utf8_lossy().to_string(),
30 | _ => {}
31 | }
32 | }
33 |
34 | fn san(&mut self, san: SanPlus) {
35 | if self.error.is_some() {
36 | return;
37 | }
38 |
39 | let last_position = self.positions.last().unwrap().clone();
40 | let m = match san.san.to_move(&last_position) {
41 | Ok(m) => m,
42 | Err(e) => {
43 | let fen = Fen::from_position(last_position, EnPassantMode::Legal);
44 | self.error =
45 | Some(Error::from(e).context(format!("position: {}, san: {}", fen, san,)));
46 | return;
47 | }
48 | };
49 |
50 | match last_position.play(&m) {
51 | Ok(new_pos) => self.positions.push(new_pos),
52 | Err(e) => self.error = Some(e.into()),
53 | }
54 | }
55 |
56 | fn end_game(&mut self) -> Self::Result {
57 | match self.error.take() {
58 | Some(e) => Err(e),
59 | None => Ok((
60 | std::mem::take(&mut self.positions),
61 | std::mem::take(&mut self.players),
62 | )),
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/assets/pieces/bP.svg:
--------------------------------------------------------------------------------
1 |
2 |
27 |
--------------------------------------------------------------------------------
/semantic/definitions/modules/tab.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * # Fomantic-UI - Tab
3 | * http://github.com/fomantic/Fomantic-UI/
4 | *
5 | *
6 | * Released under the MIT license
7 | * http://opensource.org/licenses/MIT
8 | *
9 | */
10 |
11 |
12 | /*******************************
13 | Theme
14 | *******************************/
15 |
16 | @type : 'module';
17 | @element : 'tab';
18 |
19 | @import (multiple) '../../theme.config';
20 |
21 | /*******************************
22 | UI Tabs
23 | *******************************/
24 |
25 | .ui.tab {
26 | display: none;
27 | }
28 |
29 | /*******************************
30 | States
31 | *******************************/
32 |
33 | /*--------------------
34 | Active
35 | ---------------------*/
36 |
37 | .ui.tab.active,
38 | .ui.tab.open {
39 | display: block;
40 | }
41 |
42 | & when (@variationTabLoading) {
43 | /*--------------------
44 | Loading
45 | ---------------------*/
46 |
47 | .ui.tab.loading {
48 | position: relative;
49 | overflow: hidden;
50 | display: block;
51 | min-height: @loadingMinHeight;
52 | }
53 | .ui.tab.loading * {
54 | position: @loadingContentPosition !important;
55 | left: @loadingContentOffset !important;
56 | }
57 |
58 | .ui.tab.loading:before,
59 | .ui.tab.loading.segment:before {
60 | position: absolute;
61 | content: '';
62 | top: @loaderDistanceFromTop;
63 | left: 50%;
64 |
65 | margin: @loaderMargin;
66 | width: @loaderSize;
67 | height: @loaderSize;
68 |
69 | border-radius: @circularRadius;
70 | border: @loaderLineWidth solid @loaderFillColor;
71 | }
72 | .ui.tab.loading:after,
73 | .ui.tab.loading.segment:after {
74 | position: absolute;
75 | content: '';
76 | top: @loaderDistanceFromTop;
77 | left: 50%;
78 |
79 | margin: @loaderMargin;
80 | width: @loaderSize;
81 | height: @loaderSize;
82 |
83 | animation: loader @loaderSpeed infinite linear;
84 | border: @loaderLineWidth solid @loaderLineColor;
85 | border-radius: @circularRadius;
86 |
87 | box-shadow: 0 0 0 1px transparent;
88 | }
89 | }
90 |
91 | .loadUIOverrides();
92 |
--------------------------------------------------------------------------------
/semantic/theme.less:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Import Directives
3 | *******************************/
4 |
5 | /*------------------
6 | Theme
7 | -------------------*/
8 |
9 | @theme: @@element;
10 |
11 | /*--------------------
12 | Site Variables
13 | ---------------------*/
14 |
15 | /* Default site.variables */
16 | @import "@{themesFolder}/default/globals/site.variables";
17 |
18 | /* Packaged site.variables */
19 | @import (optional) "@{themesFolder}/@{site}/globals/site.variables";
20 |
21 | /* Component's site.variables */
22 | & when not (@theme = 'default') {
23 | @import (optional) "@{themesFolder}/@{theme}/globals/site.variables";
24 | }
25 |
26 | /* Site theme site.variables */
27 | @import (optional) "@{siteFolder}/globals/site.variables";
28 |
29 |
30 | /*-------------------
31 | Component Variables
32 | ---------------------*/
33 |
34 | /* Default */
35 | @import "@{themesFolder}/default/@{type}s/@{element}.variables";
36 |
37 | /* Packaged Theme */
38 | @import (optional) "@{themesFolder}/@{theme}/@{type}s/@{element}.variables";
39 |
40 | /* Site Theme */
41 | @import (optional) "@{siteFolder}/@{type}s/@{element}.variables";
42 |
43 |
44 | /*-------------------------
45 | Central Color Map
46 | -------------------------*/
47 |
48 | /* Default */
49 | @import "@{themesFolder}/default/globals/colors.less";
50 |
51 | /* Site Theme */
52 | @import (optional) "@{themesFolder}/@{site}/globals/colors.less";
53 |
54 |
55 | /*******************************
56 | Mix-ins
57 | *******************************/
58 |
59 | /*------------------
60 | Fonts
61 | -------------------*/
62 |
63 | .loadFonts() when (@importGoogleFonts) {
64 | @import (css) url('@{googleProtocol}fonts.googleapis.com/css2?family=@{googleFontRequest}');
65 | }
66 |
67 | /*------------------
68 | Overrides
69 | -------------------*/
70 |
71 | .loadUIOverrides() {
72 | & when not (@theme = 'default') {
73 | @import (optional) "@{themesFolder}/default/@{type}s/@{element}.overrides";
74 | }
75 | @import (optional) "@{themesFolder}/@{theme}/@{type}s/@{element}.overrides";
76 | @import (optional) "@{siteFolder}/@{type}s/@{element}.overrides";
77 | }
78 |
--------------------------------------------------------------------------------
/assets/pieces/wR.svg:
--------------------------------------------------------------------------------
1 |
2 |
33 |
--------------------------------------------------------------------------------
/assets/pieces/wP.svg:
--------------------------------------------------------------------------------
1 |
2 |
29 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/container.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Container
3 | *******************************/
4 |
5 | /*-------------------
6 | Element
7 | --------------------*/
8 |
9 | /* Minimum Gutter is used to determine the maximum container width for a given device */
10 |
11 | @maxWidth: 100%;
12 |
13 | /* Devices */
14 | @mobileMinimumGutter: 0;
15 | @mobileWidth: auto;
16 | @mobileGutter: 1em;
17 |
18 | @tabletMinimumGutter: (@emSize * 1);
19 | @tabletWidth: @tabletBreakpoint - (@tabletMinimumGutter * 2) - @scrollbarWidth;
20 | @tabletGutter: auto;
21 |
22 | @computerMinimumGutter: (@emSize * 1.5);
23 | @computerWidth: @computerBreakpoint - (@computerMinimumGutter * 2) - @scrollbarWidth;
24 | @computerGutter: auto;
25 |
26 | @largeMonitorMinimumGutter: (@emSize * 2);
27 | @largeMonitorWidth: @largeMonitorBreakpoint - (@largeMonitorMinimumGutter * 2) - @scrollbarWidth;
28 | @largeMonitorGutter: auto;
29 |
30 | /* Coupling (Add Negative Margin to container size) */
31 | @gridGutterWidth: 2rem;
32 | @relaxedGridGutterWidth: 3rem;
33 | @veryRelaxedGridGutterWidth: 5rem;
34 |
35 | @mobileGridWidth: @mobileWidth;
36 | @tabletGridWidth: e(%("calc(%d + %d)", @tabletWidth, @gridGutterWidth));
37 | @computerGridWidth: e(%("calc(%d + %d)", @computerWidth, @gridGutterWidth));
38 | @largeMonitorGridWidth: e(%("calc(%d + %d)", @largeMonitorWidth, @gridGutterWidth));
39 |
40 | @mobileRelaxedGridWidth: @mobileWidth;
41 | @tabletRelaxedGridWidth: e(%("calc(%d + %d)", @tabletWidth, @relaxedGridGutterWidth));
42 | @computerRelaxedGridWidth: e(%("calc(%d + %d)", @computerWidth, @relaxedGridGutterWidth));
43 | @largeMonitorRelaxedGridWidth: e(%("calc(%d + %d)", @largeMonitorWidth, @relaxedGridGutterWidth));
44 |
45 | @mobileVeryRelaxedGridWidth: @mobileWidth;
46 | @tabletVeryRelaxedGridWidth: e(%("calc(%d + %d)", @tabletWidth, @veryRelaxedGridGutterWidth));
47 | @computerVeryRelaxedGridWidth: e(%("calc(%d + %d)", @computerWidth, @veryRelaxedGridGutterWidth));
48 | @largeMonitorVeryRelaxedGridWidth: e(%("calc(%d + %d)", @largeMonitorWidth, @veryRelaxedGridGutterWidth));
49 |
50 | /*-------------------
51 | Types
52 | --------------------*/
53 |
54 | /* Text */
55 | @textWidth: 700px;
56 | @textFontFamily: @pageFont;
57 | @textLineHeight: 1.5;
58 | @textSize: @large;
59 |
--------------------------------------------------------------------------------
/assets/pieces/wK.svg:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/assets/pieces/bK.svg:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/semantic/themes/default/views/comment.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Comments
3 | *******************************/
4 |
5 |
6 | /*-------------------
7 | View
8 | --------------------*/
9 |
10 | @maxWidth: 650px;
11 | @margin: 1.5em 0;
12 |
13 | /*-------------------
14 | Elements
15 | --------------------*/
16 |
17 | /* Comment */
18 | @commentBackground: none;
19 | @commentMargin: 0.5em 0 0;
20 | @commentPadding: 0.5em 0 0;
21 | @commentDivider: none;
22 | @commentBorder: none;
23 | @commentLineHeight: 1.2;
24 | @firstCommentMargin: 0;
25 | @firstCommentPadding: 0;
26 |
27 | /* Nested Comment */
28 | @nestedCommentsMargin: 0 0 0.5em 0.5em;
29 | @nestedCommentsPadding: 1em 0 1em 1em;
30 |
31 | @nestedCommentDivider: none;
32 | @nestedCommentBorder: none;
33 | @nestedCommentBackground: none;
34 |
35 | /* Avatar */
36 | @avatarDisplay: block;
37 | @avatarFloat: left;
38 | @avatarWidth: 2.5em;
39 | @avatarHeight: auto;
40 | @avatarSpacing: 1em;
41 | @avatarMargin: (@commentLineHeight - 1em) 0 0;
42 | @avatarBorderRadius: 0.25rem;
43 |
44 | /* Content */
45 | @contentMargin: @avatarWidth + @avatarSpacing;
46 |
47 | /* Author */
48 | @authorFontSize: 1em;
49 | @authorColor: @textColor;
50 | @authorHoverColor: @linkHoverColor;
51 | @authorFontWeight: @bold;
52 |
53 | /* Metadata */
54 | @metadataDisplay: inline-block;
55 | @metadataFontSize: 0.875em;
56 | @metadataSpacing: 0.5em;
57 | @metadataContentSpacing: 0.5em;
58 | @metadataColor: @lightTextColor;
59 |
60 | /* Text */
61 | @textFontSize: 1em;
62 | @textMargin: 0.25em 0 0.5em;
63 | @textWordWrap: break-word;
64 | @textLineHeight: 1.3;
65 |
66 | /* Actions */
67 | @actionFontSize: 0.875em;
68 | @actionContentDistance: 0.75em;
69 | @actionLinkColor: @unselectedTextColor;
70 | @actionLinkHoverColor: @hoveredTextColor;
71 |
72 | /* Reply */
73 | @replyDistance: 1em;
74 | @replyHeight: 12em;
75 | @replyFontSize: 1em;
76 |
77 | @commentReplyDistance: @replyDistance;
78 |
79 | /*-------------------
80 | Variations
81 | --------------------*/
82 |
83 | /* Threaded */
84 | @threadedCommentMargin: -1.5em 0 -1em (@avatarWidth / 2);
85 | @threadedCommentPadding: 3em 0 2em 2.25em;
86 | @threadedCommentBoxShadow: -1px 0 0 @borderColor;
87 |
88 |
89 | /* Minimal */
90 | @minimalActionPosition: absolute;
91 | @minimalActionTop: 0;
92 | @minimalActionRight: 0;
93 | @minimalActionLeft: auto;
94 |
95 | @minimalTransitionDelay: 0.1s;
96 | @minimalEasing: @defaultEasing;
97 | @minimalDuration: 0.2s;
98 | @minimalTransition: opacity @minimalDuration @minimalEasing;
99 |
--------------------------------------------------------------------------------
/semantic/theme.config:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | ████████╗██╗ ██╗███████╗███╗ ███╗███████╗███████╗
4 | ╚══██╔══╝██║ ██║██╔════╝████╗ ████║██╔════╝██╔════╝
5 | ██║ ███████║█████╗ ██╔████╔██║█████╗ ███████╗
6 | ██║ ██╔══██║██╔══╝ ██║╚██╔╝██║██╔══╝ ╚════██║
7 | ██║ ██║ ██║███████╗██║ ╚═╝ ██║███████╗███████║
8 | ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝
9 |
10 | */
11 |
12 | /*******************************
13 | Theme Selection
14 | *******************************/
15 |
16 | /* To override a theme for an individual element
17 | specify theme name below
18 | */
19 |
20 | /* Global */
21 | @site : 'default';
22 | @reset : 'default';
23 |
24 | /* Elements */
25 | @button : 'default';
26 | @container : 'default';
27 | @divider : 'default';
28 | @emoji : 'default';
29 | @flag : 'default';
30 | @header : 'default';
31 | @icon : 'default';
32 | @image : 'default';
33 | @input : 'default';
34 | @label : 'default';
35 | @list : 'default';
36 | @loader : 'default';
37 | @placeholder: 'default';
38 | @rail : 'default';
39 | @reveal : 'default';
40 | @segment : 'default';
41 | @step : 'default';
42 | @text : 'default';
43 |
44 | /* Collections */
45 | @breadcrumb : 'default';
46 | @form : 'default';
47 | @grid : 'default';
48 | @menu : 'default';
49 | @message : 'default';
50 | @table : 'default';
51 |
52 | /* Modules */
53 | @accordion : 'default';
54 | @calendar : 'default';
55 | @checkbox : 'default';
56 | @dimmer : 'default';
57 | @dropdown : 'default';
58 | @embed : 'default';
59 | @modal : 'default';
60 | @nag : 'default';
61 | @popup : 'default';
62 | @progress : 'default';
63 | @slider : 'default';
64 | @rating : 'default';
65 | @search : 'default';
66 | @shape : 'default';
67 | @sidebar : 'default';
68 | @sticky : 'default';
69 | @tab : 'default';
70 | @toast : 'default';
71 | @transition : 'default';
72 |
73 | /* Views */
74 | @ad : 'default';
75 | @card : 'default';
76 | @comment : 'default';
77 | @feed : 'default';
78 | @item : 'default';
79 | @statistic : 'default';
80 |
81 | /*******************************
82 | Folders
83 | *******************************/
84 |
85 | /* Path to theme packages */
86 | @themesFolder : 'themes';
87 |
88 | /* Path to site override folder */
89 | @siteFolder : 'site';
90 |
91 |
92 | /*******************************
93 | Import Theme
94 | *******************************/
95 |
96 | @import (multiple) "theme.less";
97 |
98 | /* End Config */
99 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/checkbox.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
5 | @font-face {
6 | font-family: 'Checkbox';
7 | src:
8 | url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBD8AAAC8AAAAYGNtYXAYVtCJAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5Zn4huwUAAAF4AAABYGhlYWQGPe1ZAAAC2AAAADZoaGVhB30DyAAAAxAAAAAkaG10eBBKAEUAAAM0AAAAHGxvY2EAmgESAAADUAAAABBtYXhwAAkALwAAA2AAAAAgbmFtZSC8IugAAAOAAAABknBvc3QAAwAAAAAFFAAAACAAAwMTAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADoAgPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6AL//f//AAAAAAAg6AD//f//AAH/4xgEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAEUAUQO7AvgAGgAAARQHAQYjIicBJjU0PwE2MzIfAQE2MzIfARYVA7sQ/hQQFhcQ/uMQEE4QFxcQqAF2EBcXEE4QAnMWEP4UEBABHRAXFhBOEBCoAXcQEE4QFwAAAAABAAABbgMlAkkAFAAAARUUBwYjISInJj0BNDc2MyEyFxYVAyUQEBf9SRcQEBAQFwK3FxAQAhJtFxAQEBAXbRcQEBAQFwAAAAABAAAASQMlA24ALAAAARUUBwYrARUUBwYrASInJj0BIyInJj0BNDc2OwE1NDc2OwEyFxYdATMyFxYVAyUQEBfuEBAXbhYQEO4XEBAQEBfuEBAWbhcQEO4XEBACEm0XEBDuFxAQEBAX7hAQF20XEBDuFxAQEBAX7hAQFwAAAQAAAAIAAHRSzT9fDzz1AAsEAAAAAADRsdR3AAAAANGx1HcAAAAAA7sDbgAAAAgAAgAAAAAAAAABAAADwP/AAAAEAAAAAAADuwABAAAAAAAAAAAAAAAAAAAABwQAAAAAAAAAAAAAAAIAAAAEAABFAyUAAAMlAAAAAAAAAAoAFAAeAE4AcgCwAAEAAAAHAC0AAQAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAOAK4AAQAAAAAAAQAIAAAAAQAAAAAAAgAHAGkAAQAAAAAAAwAIADkAAQAAAAAABAAIAH4AAQAAAAAABQALABgAAQAAAAAABgAIAFEAAQAAAAAACgAaAJYAAwABBAkAAQAQAAgAAwABBAkAAgAOAHAAAwABBAkAAwAQAEEAAwABBAkABAAQAIYAAwABBAkABQAWACMAAwABBAkABgAQAFkAAwABBAkACgA0ALBDaGVja2JveABDAGgAZQBjAGsAYgBvAHhWZXJzaW9uIDIuMABWAGUAcgBzAGkAbwBuACAAMgAuADBDaGVja2JveABDAGgAZQBjAGsAYgBvAHhDaGVja2JveABDAGgAZQBjAGsAYgBvAHhSZWd1bGFyAFIAZQBnAHUAbABhAHJDaGVja2JveABDAGgAZQBjAGsAYgBvAHhGb250IGdlbmVyYXRlZCBieSBJY29Nb29uLgBGAG8AbgB0ACAAZwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABJAGMAbwBNAG8AbwBuAC4AAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('truetype')
9 | ;
10 | }
11 |
12 | /* Checkmark */
13 | .ui.checkbox label:after,
14 | .ui.checkbox .box:after {
15 | font-family: 'Checkbox';
16 | }
17 |
18 | /* Checked */
19 | .ui.checkbox input:checked ~ .box:after,
20 | .ui.checkbox input:checked ~ label:after {
21 | content: '\e800';
22 | }
23 |
24 | /* Indeterminate */
25 | .ui.checkbox input:indeterminate ~ .box:after,
26 | .ui.checkbox input:indeterminate ~ label:after {
27 | font-size: 12px;
28 | content: '\e801';
29 | }
30 |
31 |
32 | /* UTF Reference
33 | .check:before { content: '\e800'; }
34 | .dash:before { content: '\e801'; }
35 | .plus:before { content: '\e802'; }
36 | */
37 |
--------------------------------------------------------------------------------
/assets/pieces/wB.svg:
--------------------------------------------------------------------------------
1 |
27 |
--------------------------------------------------------------------------------
/assets/pieces/bB.svg:
--------------------------------------------------------------------------------
1 |
27 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/slider.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Slider Variables
3 | *******************************/
4 |
5 | /*-------------------
6 | Element
7 | --------------------*/
8 |
9 | @height : 1.5em;
10 | @hoverPointer : auto;
11 | @padding : 1em .5em;
12 |
13 | /* Track */
14 | @trackHeight : .4em;
15 | @trackPositionTop : (@height / 2) - (@trackHeight / 2);
16 | @background : #ccc;
17 | @trackBorderRadius : 4px;
18 | @trackColor : @transparentBlack;
19 |
20 | /* Track Fill */
21 | @trackFillHeight : @trackHeight;
22 | @trackFillColor : @black;
23 | @trackFillColorFocus : @blackHover;
24 | @invertedTrackFillColor : @lightBlack;
25 | @invertedTrackFillColorFocus : @lightBlackHover;
26 | @trackFillBorderRadius : @trackBorderRadius;
27 |
28 | /* Thumb */
29 | @thumbHeight : @height;
30 | @thumbBorderRadius : 100%;
31 | @thumbBackground : @white @subtleGradient;
32 | @thumbShadow : @subtleShadow, 0 0 0 1px @borderColor inset;
33 | @thumbTransitionDuration : 0.3s;
34 | @thumbTransition : background @thumbTransitionDuration @defaultEasing;
35 | @thumbVerticalSliderOffset: 0.03em;
36 |
37 | /* Thumb Hover */
38 | @thumbHoverPointer : pointer;
39 | @thumbHoverBackground : @whiteHover @subtleGradient;
40 |
41 | /*-------------------
42 | States
43 | --------------------*/
44 |
45 | /* Disabled */
46 | @disabledOpactiy : .5;
47 | @disabledTrackFillColor : @background;
48 |
49 | /*-------------------
50 | Variations
51 | --------------------*/
52 |
53 | /* Vertical */
54 | @verticalPadding : .5em 1em;
55 |
56 | /* Labeled */
57 | @labelHeight : @height;
58 | @labelWidth : 1px;
59 | @labelColor : @background;
60 | @labelPadding : 0.2em 0;
61 |
62 | /* Hover */
63 | @hoverVarOpacity : 0;
64 | @hoverVarHoverOpacity : 1;
65 | @hoverOpacityTransitionDuration : 0.2s;
66 | @hoverOpacityTransition : opacity @hoverOpacityTransitionDuration linear;
67 |
68 | /* Sizing */
69 | @smallHeight : 1em;
70 | @smallLabelHeight : @smallHeight;
71 | @smallTrackHeight : 0.3em;
72 | @smallTrackPositionTop : (@smallHeight / 2) - (@smallTrackHeight / 2);
73 |
74 | @largeHeight : 2em;
75 | @largeLabelHeight : @largeHeight;
76 | @largeTrackHeight : 0.5em;
77 | @largeTrackPositionTop : (@largeHeight / 2) - (@largeTrackHeight / 2);
78 |
79 | @bigHeight : 2.5em;
80 | @bigLabelHeight : @bigHeight;
81 | @bigTrackHeight : 0.6em;
82 | @bigTrackPositionTop : (@bigHeight / 2) - (@bigTrackHeight / 2);
83 |
84 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/toast.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Toast
3 | *******************************/
4 |
5 | /* Container */
6 | @toastContainerDistance: @relative12px;
7 |
8 | /* Toast */
9 | @toastWidth: 350px;
10 | @toastBorderRadius: @defaultBorderRadius;
11 | @toastPadding: @inputPadding;
12 | @toastMarginBottom: -0.01em;
13 | @toastLeftRightMargin: 1px;
14 | @toastBoxMarginBottom: 0.5em;
15 | @toastBoxMarginRight: @toastBoxMarginBottom;
16 | @toastMarginProgress: -0.2em;
17 | @toastMargin: 0 -@toastLeftRightMargin @toastMarginBottom;
18 | @toastTextColor: @invertedTextColor;
19 | @toastInvertedTextColor: @textColor;
20 | @toastNeutralTextColor: @textColor;
21 |
22 | /* Mobile */
23 | @mobileToastBreakpoint: 420px;
24 | @mobileWidth: 280px;
25 |
26 | /* on Hover */
27 | @toastOpacityOnHover: 1;
28 | @toastCursorOnHover: pointer;
29 |
30 | /* Color variations */
31 | @toastInfoColor: @infoColor;
32 | @toastWarningColor: @warningColor;
33 | @toastErrorColor: @errorColor;
34 | @toastSuccessColor: @successColor;
35 | @toastNeutralColor: @white;
36 | @toastInvertedColor: @black;
37 |
38 | @toastBoxBorder: 1px solid rgba(34, 36, 38, 0.12);
39 |
40 | /* Icon */
41 | @toastIconContentPadding: 3em;
42 | @toastIconFontSize: 1.5em;
43 | @toastIconMessageContentPadding: 5rem;
44 | @toastIconMessageWidth: 4rem;
45 |
46 | /* Image */
47 | @toastImageContentPadding: 1em;
48 | @toastAvatarImageContentPadding: 3em;
49 | @toastMiniImageContentPadding: 3.4em;
50 | @toastTinyImageContentPadding: 7em;
51 | @toastSmallImageContentPadding: 12em;
52 |
53 | @toastAvatarImageHeight: 2em;
54 | @toastMiniImageHeight: 35px;
55 | @toastTinyImageHeight: 80px;
56 | @toastSmallImageHeight: 150px;
57 |
58 | @toastIconCenteredAdjustment: 1.2em;
59 | @toastImageCenteredAdjustment: 2em;
60 |
61 | /* Progressbar Colors */
62 | @toastInfoProgressColor: darken(@toastInfoColor,15);
63 | @toastWarningProgressColor: darken(@toastWarningColor,15);
64 | @toastErrorProgressColor: darken(@toastErrorColor,15);
65 | @toastSuccessProgressColor: darken(@toastSuccessColor,15);
66 | @toastNeutralProgressColor: darken(@toastNeutralColor,15);
67 |
68 | /* Close Icon */
69 | @toastCloseTopDistance: 0.3em;
70 | @toastCloseRightDistance: 0.3em;
71 | @toastCloseOpacity: 0.7;
72 | @toastCloseTransition: opacity @defaultDuration @defaultEasing;
73 | @toastCloseDistance: 1.5em;
74 | @toastCloseDistanceVertical: 1em;
75 |
76 | /* Actions */
77 | @toastActionBackground: rgba(255, 255, 255, .25);
78 | @toastActionBorder: 1px solid rgba(0, 0, 0, .2);
79 | @toastActionMargin: -1em;
80 | @toastActionMarginTop: 0.5em;
81 | @toastActionMarginLeft: 1em;
82 | @toastActionMarginBottom: 0.3em;
83 | @toastActionPadding: 0.5em;
84 | @toastActionPaddingBottom: 0.75em;
85 | @toastActionCenteredMargin: 0.25em;
--------------------------------------------------------------------------------
/semantic/themes/default/modules/accordion.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Accordion
3 | *******************************/
4 |
5 | @boxShadow: none;
6 |
7 | /* Title */
8 | @titleFont: @headerFont;
9 | @titlePadding: 0.5em 0;
10 | @titleFontSize: 1em;
11 | @titleColor: @textColor;
12 |
13 | /* Icon */
14 | @iconOpacity: 1;
15 | @iconFontSize: 1em;
16 | @iconFloat: none;
17 | @iconWidth: 1.25em;
18 | @iconHeight: 1em;
19 | @iconDisplay: inline-block;
20 | @iconMargin: 0 0.25rem 0 0;
21 | @iconPadding: 0;
22 | @iconTransition:
23 | transform @defaultDuration @defaultEasing,
24 | opacity @defaultDuration @defaultEasing
25 | ;
26 | @iconVerticalAlign: baseline;
27 | @iconTransform: none;
28 |
29 | /* Child Accordion */
30 | @childAccordionMargin: 1em 0 0;
31 | @childAccordionPadding: 0;
32 |
33 | /* Content */
34 | @contentMargin: '';
35 | @contentPadding: 0.5em 0 1em;
36 |
37 | /*-------------------
38 | Coupling
39 | --------------------*/
40 |
41 | @menuTitlePadding: 0;
42 | @menuIconFloat: right;
43 | @menuIconMargin: @lineHeightOffset 0 0 1em;
44 | @menuIconTransform: rotate(180deg);
45 |
46 |
47 | /*-------------------
48 | States
49 | --------------------*/
50 |
51 | @activeIconTransform: rotate(90deg);
52 |
53 | /*-------------------
54 | Variations
55 | --------------------*/
56 |
57 | /* Styled */
58 | @styledWidth: 600px;
59 | @styledBackground: @white;
60 | @styledBorderRadius: @defaultBorderRadius;
61 | @styledBoxShadow:
62 | @subtleShadow,
63 | 0 0 0 1px @borderColor
64 | ;
65 |
66 | /* Content */
67 | @styledContentMargin: 0;
68 | @styledContentPadding: 0.5em 1em 1.5em;
69 |
70 | /* Child Content */
71 | @styledChildContentMargin: 0;
72 | @styledChildContentPadding: @styledContentPadding;
73 |
74 | /* Styled Title */
75 | @styledTitleMargin: 0;
76 | @styledTitlePadding: 0.75em 1em;
77 | @styledTitleFontWeight: @bold;
78 | @styledTitleColor: @unselectedTextColor;
79 | @styledTitleTransition: background-color @defaultDuration @defaultEasing;
80 | @styledTitleBorder: 1px solid @borderColor;
81 | @styledTitleTransition:
82 | background @defaultDuration @defaultEasing,
83 | color @defaultDuration @defaultEasing
84 | ;
85 |
86 | /* Styled Title States */
87 | @styledTitleHoverBackground: transparent;
88 | @styledTitleHoverColor: @textColor;
89 | @styledActiveTitleBackground: transparent;
90 | @styledActiveTitleColor: @selectedTextColor;
91 |
92 | /* Styled Child Title States */
93 | @styledHoverChildTitleBackground: @styledTitleHoverBackground;
94 | @styledHoverChildTitleColor: @styledTitleHoverColor;
95 | @styledActiveChildTitleBackground: @styledActiveTitleBackground;
96 | @styledActiveChildTitleColor: @styledActiveTitleColor;
97 |
98 | /* Inverted */
99 | @invertedTitleColor: @invertedTextColor;
100 |
101 |
--------------------------------------------------------------------------------
/assets/pieces/bR.svg:
--------------------------------------------------------------------------------
1 |
2 |
43 |
--------------------------------------------------------------------------------
/semantic/themes/default/views/statistic.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Statistic
3 | *******************************/
4 |
5 | /*-------------------
6 | View
7 | --------------------*/
8 |
9 | @verticalMargin: 1em;
10 | @margin: @verticalMargin 0;
11 | @textAlign: center;
12 | @maxWidth: none;
13 |
14 | /* Group */
15 | @horizontalSpacing: 1.5em;
16 | @rowSpacing: 1em;
17 | @groupMargin: @verticalMargin -@horizontalSpacing -@rowSpacing;
18 |
19 | /* Group Element */
20 | @elementMargin: 0 @horizontalSpacing @rowSpacing;
21 | @elementMaxWidth: @maxWidth;
22 |
23 | /*-------------------
24 | Content
25 | --------------------*/
26 |
27 | /* Value */
28 | @valueFont: @pageFont;
29 | @valueFontWeight: @normal;
30 | @valueLineHeight: 1em;
31 | @valueColor: @black;
32 | @valueTextTransform: uppercase;
33 |
34 | /* Label */
35 | @labelSize: @relativeMedium;
36 | @topLabelDistance: 0;
37 | @bottomLabelDistance: 0;
38 | @labelFont: @headerFont;
39 | @labelFontWeight: @bold;
40 | @labelColor: @textColor;
41 | @labelLineHeight: @relativeLarge;
42 | @labelTextTransform: uppercase;
43 |
44 | /* Text */
45 | @textValueLineHeight: 1em;
46 | @textValueMinHeight: 2em;
47 | @textValueFontWeight: @bold;
48 |
49 | /* Label Image */
50 | @imageHeight: 3rem;
51 | @imageVerticalAlign: baseline;
52 |
53 | /*-------------------
54 | Types
55 | --------------------*/
56 |
57 | @horizontalGroupElementMargin: 1em 0;
58 | @horizontalLabelDistance: 0.75em;
59 |
60 | /*-------------------
61 | Variations
62 | --------------------*/
63 |
64 | /* Floated */
65 | @leftFloatedMargin: 0 2em 1em 0;
66 | @rightFloatedMargin: 0 0 1em 2em;
67 |
68 | /* Inverted */
69 | @invertedValueColor: @white;
70 | @invertedLabelColor: @invertedTextColor;
71 |
72 | /* Item Width */
73 | @itemGroupMargin: 0 0 -@rowSpacing;
74 | @itemMargin: 0 0 @rowSpacing;
75 |
76 | /* Stackable */
77 | @stackableRowSpacing: 2rem;
78 | @stackableGutter: 2rem;
79 |
80 | /* Size */
81 | @miniTextValueSize: 1rem;
82 | @miniValueSize: 1.5rem;
83 | @miniHorizontalValueSize: 1.5rem;
84 |
85 | @tinyTextValueSize: 1rem;
86 | @tinyValueSize: 2rem;
87 | @tinyHorizontalValueSize: 2rem;
88 |
89 | @smallTextValueSize: 1rem;
90 | @smallValueSize: 3rem;
91 | @smallHorizontalValueSize: 2rem;
92 |
93 | @textValueSize: 2rem;
94 | @valueSize: 4rem;
95 | @horizontalValueSize: 3rem;
96 |
97 | @largeTextValueSize: 2.5rem;
98 | @largeValueSize: 5rem;
99 | @largeHorizontalValueSize: 4rem;
100 |
101 | @bigTextValueSize: 2.5rem;
102 | @bigValueSize: 5.5rem;
103 | @bigHorizontalValueSize: 4.5rem;
104 |
105 | @hugeTextValueSize: 2.5rem;
106 | @hugeValueSize: 6rem;
107 | @hugeHorizontalValueSize: 5rem;
108 |
109 | @massiveTextValueSize: 3rem;
110 | @massiveValueSize: 7rem;
111 | @massiveHorizontalValueSize: 6rem;
112 |
--------------------------------------------------------------------------------
/semantic/definitions/collections/breadcrumb.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * # Fomantic-UI - Breadcrumb
3 | * http://github.com/fomantic/Fomantic-UI/
4 | *
5 | *
6 | * Released under the MIT license
7 | * http://opensource.org/licenses/MIT
8 | *
9 | */
10 |
11 | /*******************************
12 | Theme
13 | *******************************/
14 |
15 | @type : 'collection';
16 | @element : 'breadcrumb';
17 |
18 | @import (multiple) '../../theme.config';
19 |
20 |
21 | /*******************************
22 | Breadcrumb
23 | *******************************/
24 |
25 | .ui.breadcrumb {
26 | line-height: @lineHeight;
27 | display: @display;
28 | margin: @verticalMargin 0;
29 | vertical-align: @verticalAlign;
30 | }
31 | .ui.breadcrumb:first-child {
32 | margin-top: 0;
33 | }
34 | .ui.breadcrumb:last-child {
35 | margin-bottom: 0;
36 | }
37 |
38 | /*******************************
39 | Content
40 | *******************************/
41 |
42 | /* Divider */
43 | .ui.breadcrumb .divider {
44 | display: inline-block;
45 | opacity: @dividerOpacity;
46 | margin: 0 @dividerSpacing 0;
47 |
48 | font-size: @dividerSize;
49 | color: @dividerColor;
50 | vertical-align: @dividerVerticalAlign;
51 | }
52 |
53 | /* Link */
54 | .ui.breadcrumb a {
55 | color: @linkColor;
56 | }
57 | .ui.breadcrumb a:hover {
58 | color: @linkHoverColor;
59 | }
60 |
61 |
62 | /* Icon Divider */
63 | .ui.breadcrumb .icon.divider {
64 | font-size: @iconDividerSize;
65 | vertical-align: @iconDividerVerticalAlign;
66 | }
67 |
68 | /* Section */
69 | .ui.breadcrumb a.section {
70 | cursor: pointer;
71 | }
72 | .ui.breadcrumb .section {
73 | display: inline-block;
74 | margin: @sectionMargin;
75 | padding: @sectionPadding;
76 | }
77 |
78 | /* Loose Coupling */
79 | .ui.breadcrumb.segment {
80 | display: inline-block;
81 | padding: @segmentPadding;
82 | }
83 |
84 | & when (@variationBreadcrumbInverted) {
85 | /* Inverted */
86 | .ui.inverted.breadcrumb {
87 | color: @invertedColor;
88 | }
89 | .ui.inverted.breadcrumb > .active.section {
90 | color: @invertedActiveColor;
91 | }
92 | .ui.inverted.breadcrumb > .divider {
93 | color: @invertedDividerColor;
94 | }
95 | }
96 |
97 | /*******************************
98 | States
99 | *******************************/
100 |
101 | .ui.breadcrumb .active.section {
102 | font-weight: @activeFontWeight;
103 | }
104 |
105 |
106 | /*******************************
107 | Variations
108 | *******************************/
109 |
110 | .ui.breadcrumb {
111 | font-size: @medium;
112 | }
113 | & when not (@variationBreadcrumbSizes = false) {
114 | each(@variationBreadcrumbSizes, {
115 | @s: @@value;
116 | .ui.@{value}.breadcrumb {
117 | font-size: @s;
118 | }
119 | })
120 | }
121 |
122 | .loadUIOverrides();
123 |
--------------------------------------------------------------------------------
/assets/pieces/wN.svg:
--------------------------------------------------------------------------------
1 |
2 |
35 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/input.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Input
3 | *******************************/
4 |
5 | /*-------------------
6 | Element
7 | --------------------*/
8 |
9 | @inputFont: @pageFont;
10 | @verticalPadding: @inputVerticalPadding;
11 | @horizontalPadding: @inputHorizontalPadding;
12 |
13 | @lineHeight: @inputLineHeight;
14 | @lineHeightOffset: ((@lineHeight - 1em) / 2);
15 |
16 | @padding: (@verticalPadding - @lineHeightOffset) @horizontalPadding;
17 |
18 | @textAlign: left;
19 | @background: @inputBackground;
20 | @borderWidth: 1px;
21 | @border: @borderWidth solid @borderColor;
22 | @boxShadow: none;
23 |
24 | @borderRadius: @defaultBorderRadius;
25 | @transition:
26 | box-shadow @defaultDuration @defaultEasing,
27 | border-color @defaultDuration @defaultEasing
28 | ;
29 |
30 | /*-------------------
31 | Types
32 | --------------------*/
33 |
34 | /* Icon Input */
35 | @iconWidth: (@verticalPadding * 2) + @glyphWidth;
36 | @iconOpacity: 0.5;
37 | @iconFocusOpacity: 1;
38 | @iconOffset: -0.5em;
39 |
40 | @iconDistance: 0;
41 | @iconMargin: @iconWidth + @iconDistance;
42 | @iconTransition: opacity 0.3s @defaultEasing;
43 |
44 | @transparentIconWidth: @glyphWidth;
45 | @transparentIconMargin: 2em;
46 |
47 | @textareaIconHeight: 3em;
48 | @transparentTextareaIconHeight: 1.3em;
49 |
50 | /* Circular Icon Input */
51 | @circularIconVerticalOffset: 0.35em;
52 | @circularIconHorizontalOffset: 0.5em;
53 |
54 | /* Labeled Input */
55 | @labelCornerTop: @borderWidth;
56 | @labelCornerRight: @borderWidth;
57 | @labelCornerSize: @relative9px;
58 | @labelSize: 1em;
59 | @labelVerticalPadding: (@verticalPadding - @lineHeightOffset);
60 |
61 | @labeledMargin: 2.5em;
62 | @labeledIconInputMargin: 3.25em;
63 | @labeledIconMargin: 1.25em;
64 |
65 | /*-------------------
66 | States
67 | --------------------*/
68 |
69 | /* Placeholder */
70 | @placeholderColor: @inputPlaceholderColor;
71 | @placeholderFocusColor: @inputPlaceholderFocusColor;
72 |
73 | /* Down */
74 | @downBorderColor: rgba(0, 0, 0, 0.3);
75 | @downBackground: #FAFAFA;
76 | @downColor: @textColor;
77 | @downBoxShadow: none;
78 |
79 | /* Focus */
80 | @focusBorderColor: @focusedFormBorderColor;
81 | @focusBackground: @background;
82 | @focusColor: @hoveredTextColor;
83 | @focusBoxShadow: none;
84 |
85 | /* Loader */
86 | @invertedLoaderFillColor: rgba(0, 0, 0, 0.15);
87 |
88 | /*-------------------
89 | Variations
90 | --------------------*/
91 |
92 | /* Inverted */
93 | @transparentInvertedPlaceholderColor: @invertedUnselectedTextColor;
94 | @transparentInvertedColor: @white;
95 |
96 | @miniInputSize: @relativeMini;
97 | @tinyInputSize: @relativeTiny;
98 | @smallInputSize: @relativeSmall;
99 | @largeInputSize: @relativeLarge;
100 | @bigInputSize: @relativeBig;
101 | @hugeInputSize: @relativeHuge;
102 | @massiveInputSize: @relativeMassive;
103 |
--------------------------------------------------------------------------------
/assets/pieces/bN.svg:
--------------------------------------------------------------------------------
1 |
2 |
35 |
--------------------------------------------------------------------------------
/assets/pieces/wQ.svg:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/evaluator/src/question.rs:
--------------------------------------------------------------------------------
1 | use super::*;
2 | use serde::{Serialize, Serializer};
3 | use shakmaty::fen::Fen;
4 | use shakmaty::san::San;
5 | use shakmaty::{CastlingMode, Chess, Color, FromSetup};
6 |
7 | #[derive(Debug, Clone, Serialize)]
8 | pub struct Question {
9 | pub fen: SerializableFen,
10 | pub players: Players,
11 | pub moves: Moves,
12 | pub pgn: String,
13 | pub turn_number: usize,
14 | }
15 |
16 | #[derive(Debug, Clone, Serialize)]
17 | pub struct Moves {
18 | pub one: Move,
19 | pub two: Option,
20 | pub three: Option,
21 | }
22 |
23 | #[derive(Debug, Default, PartialEq, Eq, Clone, Serialize)]
24 | pub struct Players {
25 | pub white: String,
26 | pub black: String,
27 | }
28 |
29 | #[derive(Debug, Clone, Serialize)]
30 | pub struct Move {
31 | #[serde(rename = "move")]
32 | pub move_: SerializableSan,
33 | pub evaluation: f32,
34 | }
35 |
36 | impl Move {
37 | pub fn from_variation(eval_and_move: &EvalAndMove, fen: &Fen) -> Result {
38 | let position = Chess::from_setup(fen.as_setup().clone(), CastlingMode::Standard)?;
39 | let san = San::from_move(&position, &eval_and_move.uci_move.to_move(&position)?);
40 |
41 | let evaluation = eval_and_move.cp as f32
42 | * match position.turn() {
43 | Color::White => 1.0,
44 | Color::Black => -1.0,
45 | }
46 | / 100.0;
47 |
48 | Ok(Move {
49 | move_: SerializableSan(san),
50 | evaluation,
51 | })
52 | }
53 | }
54 |
55 | #[derive(Debug, Clone)]
56 | pub struct SerializableFen(pub Fen);
57 |
58 | impl Serialize for SerializableFen {
59 | fn serialize(&self, serializer: S) -> Result
60 | where
61 | S: Serializer,
62 | {
63 | serializer.collect_str(&self.0)
64 | }
65 | }
66 |
67 | #[derive(Debug, Clone)]
68 | pub struct SerializableSan(pub San);
69 |
70 | impl Serialize for SerializableSan {
71 | fn serialize(&self, serializer: S) -> Result
72 | where
73 | S: Serializer,
74 | {
75 | serializer.collect_str(&self.0)
76 | }
77 | }
78 |
79 | #[cfg(test)]
80 | mod tests {
81 | use super::*;
82 | use shakmaty::fen::Fen;
83 | use shakmaty::{CastlingMode, Chess, Move, Role, Square};
84 |
85 | #[test]
86 | fn test_serializable_san() {
87 | let position: Chess =
88 | Fen::from_ascii(b"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1")
89 | .unwrap()
90 | .into_position(CastlingMode::Standard)
91 | .unwrap();
92 | let m = Move::Normal {
93 | role: Role::Knight,
94 | from: Square::B1,
95 | to: Square::C3,
96 | capture: None,
97 | promotion: None,
98 | };
99 |
100 | let san = SerializableSan(San::from_move(&position, &m));
101 | assert_eq!(serde_json::to_string(&san).unwrap(), r#""Nc3""#);
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/assets/pieces/bQ.svg:
--------------------------------------------------------------------------------
1 |
22 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/divider.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 |
5 |
6 | .ui.horizontal.divider:before,
7 | .ui.horizontal.divider:after {
8 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABaAAAAACCAYAAACuTHuKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo1OThBRDY4OUNDMTYxMUU0OUE3NUVGOEJDMzMzMjE2NyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo1OThBRDY4QUNDMTYxMUU0OUE3NUVGOEJDMzMzMjE2NyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjU5OEFENjg3Q0MxNjExRTQ5QTc1RUY4QkMzMzMyMTY3IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjU5OEFENjg4Q0MxNjExRTQ5QTc1RUY4QkMzMzMyMTY3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+VU513gAAADVJREFUeNrs0DENACAQBDBIWLGBJQby/mUcJn5sJXQmOQMAAAAAAJqt+2prAAAAAACg2xdgANk6BEVuJgyMAAAAAElFTkSuQmCC');
9 | }
10 |
11 | @media only screen and (max-width : (@tabletBreakpoint - 1px)) {
12 | .ui.stackable.grid .ui.vertical.divider:before,
13 | .ui.grid .stackable.row .ui.vertical.divider:before,
14 | .ui.stackable.grid .ui.vertical.divider:after,
15 | .ui.grid .stackable.row .ui.vertical.divider:after {
16 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABaAAAAACCAYAAACuTHuKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo1OThBRDY4OUNDMTYxMUU0OUE3NUVGOEJDMzMzMjE2NyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo1OThBRDY4QUNDMTYxMUU0OUE3NUVGOEJDMzMzMjE2NyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjU5OEFENjg3Q0MxNjExRTQ5QTc1RUY4QkMzMzMyMTY3IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjU5OEFENjg4Q0MxNjExRTQ5QTc1RUY4QkMzMzMyMTY3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+VU513gAAADVJREFUeNrs0DENACAQBDBIWLGBJQby/mUcJn5sJXQmOQMAAAAAAJqt+2prAAAAAACg2xdgANk6BEVuJgyMAAAAAElFTkSuQmCC');
17 | }
18 | }
--------------------------------------------------------------------------------
/semantic/semantic.less:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | ███████╗███████╗███╗ ███╗ █████╗ ███╗ ██╗████████╗██╗ ██████╗ ██╗ ██╗██╗
4 | ██╔════╝██╔════╝████╗ ████║██╔══██╗████╗ ██║╚══██╔══╝██║██╔════╝ ██║ ██║██║
5 | ███████╗█████╗ ██╔████╔██║███████║██╔██╗ ██║ ██║ ██║██║ ██║ ██║██║
6 | ╚════██║██╔══╝ ██║╚██╔╝██║██╔══██║██║╚██╗██║ ██║ ██║██║ ██║ ██║██║
7 | ███████║███████╗██║ ╚═╝ ██║██║ ██║██║ ╚████║ ██║ ██║╚██████╗ ╚██████╔╝██║
8 | ╚══════╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝
9 |
10 | Import this file into your LESS project to use Fomantic-UI without build tools
11 | */
12 |
13 | /* Global */
14 | & { @import "definitions/globals/reset"; }
15 | & { @import "definitions/globals/site"; }
16 |
17 | /* Elements */
18 | & { @import "definitions/elements/button"; }
19 | & { @import "definitions/elements/container"; }
20 | & { @import "definitions/elements/divider"; }
21 | & { @import "definitions/elements/emoji"; }
22 | & { @import "definitions/elements/flag"; }
23 | & { @import "definitions/elements/header"; }
24 | & { @import "definitions/elements/icon"; }
25 | & { @import "definitions/elements/image"; }
26 | & { @import "definitions/elements/input"; }
27 | & { @import "definitions/elements/label"; }
28 | & { @import "definitions/elements/list"; }
29 | & { @import "definitions/elements/loader"; }
30 | & { @import "definitions/elements/placeholder"; }
31 | & { @import "definitions/elements/rail"; }
32 | & { @import "definitions/elements/reveal"; }
33 | & { @import "definitions/elements/segment"; }
34 | & { @import "definitions/elements/step"; }
35 | & { @import "definitions/elements/text"; }
36 |
37 | /* Collections */
38 | & { @import "definitions/collections/breadcrumb"; }
39 | & { @import "definitions/collections/form"; }
40 | & { @import "definitions/collections/grid"; }
41 | & { @import "definitions/collections/menu"; }
42 | & { @import "definitions/collections/message"; }
43 | & { @import "definitions/collections/table"; }
44 |
45 | /* Views */
46 | & { @import "definitions/views/ad"; }
47 | & { @import "definitions/views/card"; }
48 | & { @import "definitions/views/comment"; }
49 | & { @import "definitions/views/feed"; }
50 | & { @import "definitions/views/item"; }
51 | & { @import "definitions/views/statistic"; }
52 |
53 | /* Modules */
54 | & { @import "definitions/modules/accordion"; }
55 | & { @import "definitions/modules/calendar"; }
56 | & { @import "definitions/modules/checkbox"; }
57 | & { @import "definitions/modules/dimmer"; }
58 | & { @import "definitions/modules/dropdown"; }
59 | & { @import "definitions/modules/embed"; }
60 | & { @import "definitions/modules/modal"; }
61 | & { @import "definitions/modules/nag"; }
62 | & { @import "definitions/modules/popup"; }
63 | & { @import "definitions/modules/progress"; }
64 | & { @import "definitions/modules/slider"; }
65 | & { @import "definitions/modules/rating"; }
66 | & { @import "definitions/modules/search"; }
67 | & { @import "definitions/modules/shape"; }
68 | & { @import "definitions/modules/sidebar"; }
69 | & { @import "definitions/modules/sticky"; }
70 | & { @import "definitions/modules/tab"; }
71 | & { @import "definitions/modules/toast"; }
72 | & { @import "definitions/modules/transition"; }
73 |
--------------------------------------------------------------------------------
/src/components/LastResult.tsx:
--------------------------------------------------------------------------------
1 | import React, { useState } from 'react';
2 | import { Button, Container } from 'semantic-ui-react';
3 | import { Chess } from 'chess.ts';
4 | import { Answer, PointsSolver } from '../PointsSolver';
5 | import {
6 | numberOfVariations, Question, Move, Moves,
7 | } from '../questions';
8 |
9 | function formatEval(evaluation: number): string {
10 | const sign = evaluation > 0 ? '+' : '';
11 | return sign + evaluation.toFixed(2);
12 | }
13 |
14 | interface Props {
15 | question: Question;
16 | answer: Answer;
17 | }
18 |
19 | function variationString(variation: Move): string {
20 | return `${variation.move} (${formatEval(variation.evaluation)})`;
21 | }
22 |
23 | function variationsString(variations: Moves): string {
24 | let result = variationString(variations.one);
25 | if (variations.two !== null) {
26 | result += `, ${variationString(variations.two)}`;
27 | }
28 |
29 | if (variations.three !== null) {
30 | result += `, ${variationString(variations.three)}`;
31 | }
32 |
33 | return result;
34 | }
35 |
36 | interface ImportResponse {
37 | url: string,
38 | }
39 |
40 | export default ({ question, answer }: Props): React.ReactElement => {
41 | const [lichessLoading, setLichessLoading] = useState(false);
42 |
43 | const onPGNUpload = async () => {
44 | setLichessLoading(true);
45 | const response = await fetch(
46 | 'https://lichess.org/api/import',
47 | {
48 | method: 'POST',
49 | // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
50 | body: new URLSearchParams({ pgn: question.pgn }),
51 | },
52 | );
53 | const body = await response.json() as ImportResponse;
54 |
55 | const turn = new Chess(question.fen).turn();
56 | window.open(`${body.url}${turn === 'b' ? '/black' : ''}#${question.turn_number}`, '_blank')?.focus();
57 | setLichessLoading(false);
58 | };
59 |
60 | const points = new PointsSolver({ question, answer });
61 | return (
62 |
63 | {
64 | points.foundWinningSide()
65 | ? 'You guessed the winning side. +20 points'
66 | : 'You did not guess the winning side.'
67 | }
68 |
69 | {`Your eval guess was off by ${Math.abs(answer.evaluation - question.moves.one.evaluation).toFixed(2)}. Actual eval was ${formatEval(question.moves.one.evaluation)}.`}
70 |
71 | {`${points.evalPoints().toFixed(1)} points for the evaluation.`}
72 |
73 | {
74 | points.foundBestMove()
75 | ? `You found one of the top 3 moves. Multiplier of x${points.bestMoveMultiplier().toFixed(1)}`
76 | : 'You did not find a best move.'
77 | }
78 |
79 | {`These are the top ${numberOfVariations(question.moves)} moves according to Stockfish: ${variationsString(question.moves)}.`}
80 |
81 |
89 |
90 |
91 | {`You earned ${points.totalPoints().toFixed(1)} points.`}
92 |
93 | );
94 | };
95 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/icon.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Icon
3 | *******************************/
4 |
5 | /*--------------
6 | Font Files
7 | ---------------*/
8 |
9 | /* Solid Icons */
10 | @fontName: 'icons';
11 | @src:
12 | url("@{fontPath}/@{fontName}.eot?#iefix") format('embedded-opentype'),
13 | url("@{fontPath}/@{fontName}.woff2") format('woff2'),
14 | url("@{fontPath}/@{fontName}.woff") format('woff'),
15 | url("@{fontPath}/@{fontName}.ttf") format('truetype'),
16 | url("@{fontPath}/@{fontName}.svg#icons") format('svg')
17 | ;
18 | @fallbackSRC: url("@{fontPath}/@{fontName}.eot");
19 |
20 | /* Outline Icons */
21 | @importOutlineIcons: true;
22 | @outlineFontName: 'outline-icons';
23 | @outlineSrc:
24 | url("@{fontPath}/@{outlineFontName}.eot?#iefix") format('embedded-opentype'),
25 | url("@{fontPath}/@{outlineFontName}.woff2") format('woff2'),
26 | url("@{fontPath}/@{outlineFontName}.woff") format('woff'),
27 | url("@{fontPath}/@{outlineFontName}.ttf") format('truetype'),
28 | url("@{fontPath}/@{outlineFontName}.svg#icons") format('svg')
29 | ;
30 | @outlineFallbackSRC: url("@{fontPath}/@{outlineFontName}.eot");
31 |
32 |
33 |
34 | /* Brand Icons */
35 | @importBrandIcons: true;
36 | @brandFontName: 'brand-icons';
37 | @brandSrc:
38 | url("@{fontPath}/@{brandFontName}.eot?#iefix") format('embedded-opentype'),
39 | url("@{fontPath}/@{brandFontName}.woff2") format('woff2'),
40 | url("@{fontPath}/@{brandFontName}.woff") format('woff'),
41 | url("@{fontPath}/@{brandFontName}.ttf") format('truetype'),
42 | url("@{fontPath}/@{brandFontName}.svg#icons") format('svg')
43 | ;
44 | @brandFallbackSRC: url("@{fontPath}/@{brandFontName}.eot");
45 |
46 |
47 | /*--------------
48 | Definition
49 | ---------------*/
50 |
51 | /* Icon Variables */
52 | @opacity: 1;
53 | @width: @iconWidth;
54 | @height: 1em;
55 | @distanceFromText: 0.25rem;
56 | @lineHeight: 1;
57 |
58 |
59 | /* Variations */
60 | @linkOpacity: 0.8;
61 | @linkDuration: 0.3s;
62 | @loadingDuration: 2s;
63 |
64 | @circularSize: 2em;
65 | @circularPadding: 0.5em 0;
66 | @circularShadow: 0 0 0 0.1em rgba(0, 0, 0, 0.1) inset;
67 |
68 | @borderedSize: 2em;
69 | @borderedVerticalPadding: ((@borderedSize - @height) / 2);
70 | @borderedHorizontalPadding: 0;
71 | @borderedShadow: 0 0 0 0.1em rgba(0, 0, 0, 0.1) inset;
72 |
73 | @coloredBoxShadow: 0 0 0 0.1em currentColor inset;
74 |
75 | @cornerIconSize: 0.45em;
76 | @cornerIconStroke: 1px;
77 | @cornerIconShadow:
78 | -@cornerIconStroke -@cornerIconStroke 0 @white,
79 | @cornerIconStroke -@cornerIconStroke 0 @white,
80 | -@cornerIconStroke @cornerIconStroke 0 @white,
81 | @cornerIconStroke @cornerIconStroke 0 @white
82 | ;
83 | @cornerIconInvertedShadow:
84 | -@cornerIconStroke -@cornerIconStroke 0 @black,
85 | @cornerIconStroke -@cornerIconStroke 0 @black,
86 | -@cornerIconStroke @cornerIconStroke 0 @black,
87 | @cornerIconStroke @cornerIconStroke 0 @black
88 | ;
89 |
90 | @cornerOffset: 0;
91 | @borderedGroupCornerOffset: 1.15em;
92 |
93 | @mini: 0.4em;
94 | @tiny: 0.5em;
95 | @small: 0.75em;
96 | @medium: 1em;
97 | @large: 1.5em;
98 | @big: 2em;
99 | @huge: 4em;
100 | @massive: 8em;
101 |
--------------------------------------------------------------------------------
/semantic/themes/default/collections/grid.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Grid
3 | *******************************/
4 |
5 | /* Inherited From Site */
6 |
7 | // @mobileBreakpoint
8 | // @tabletBreakpoint
9 | // @computerBreakpoint
10 | // @largeMonitorBreakpoint
11 | // @widescreenMonitorBreakpoint
12 |
13 | /*******************************
14 | Grid
15 | *******************************/
16 |
17 | @minWidth: 320px;
18 |
19 | @gutterWidth: 2rem;
20 | @rowSpacing: 2rem;
21 |
22 | @tableWidth: e(%("calc(100%% + %d)", @gutterWidth));
23 | @columnMaxImageWidth: 100%;
24 |
25 | @consecutiveGridDistance: (@rowSpacing / 2);
26 |
27 | /*******************************
28 | Variations
29 | *******************************/
30 |
31 | /*--------------
32 | Relaxed
33 | ---------------*/
34 |
35 | @relaxedGutterWidth: 3rem;
36 | @veryRelaxedGutterWidth: 5rem;
37 |
38 | /*--------------
39 | Divided
40 | ---------------*/
41 |
42 | @dividedBorder: -1px 0 0 0 @borderColor;
43 | @verticallyDividedBorder: 0 -1px 0 0 @borderColor;
44 |
45 | @dividedInvertedBorder: -1px 0 0 0 @whiteBorderColor;
46 | @verticallyDividedInvertedBorder: 0 -1px 0 0 @whiteBorderColor;
47 |
48 | /*--------------
49 | Celled
50 | ---------------*/
51 |
52 | @celledMargin: 1em 0;
53 | @celledWidth: 1px;
54 | @celledBorderColor: @solidBorderColor;
55 |
56 | @celledPadding: 1em;
57 | @celledRelaxedPadding: 1.5em;
58 | @celledVeryRelaxedPadding: 2em;
59 |
60 | @celledGridDivider: 0 0 0 @celledWidth @celledBorderColor;
61 | @celledRowDivider: 0 (-@celledWidth) 0 0 @celledBorderColor;
62 | @celledColumnDivider: (-@celledWidth) 0 0 0 @celledBorderColor;
63 |
64 |
65 | /*--------------
66 | Stackable
67 | ---------------*/
68 |
69 | @stackableRowSpacing: @rowSpacing;
70 | @stackableGutter: @gutterWidth;
71 | @stackableMobileBorder: 1px solid @borderColor;
72 | @stackableInvertedMobileBorder: 1px solid @whiteBorderColor;
73 |
74 | /*--------------
75 | Compact
76 | ---------------*/
77 | @compactGutterWidth: (@gutterWidth / 2);
78 | @compactRowSpacing: (@rowSpacing / 2);
79 | @compactCelledRelaxedPadding: (@celledRelaxedPadding / 2);
80 | @compactCelledVeryRelaxedPadding: (@celledVeryRelaxedPadding / 2);
81 |
82 | /*------------------
83 | Very Compact
84 | ------------------*/
85 | @veryCompactGutterWidth: (@compactGutterWidth / 2);
86 | @veryCompactRowSpacing: (@compactRowSpacing / 2);
87 | @veryCompactCelledRelaxedPadding: (@compactCelledRelaxedPadding / 2);
88 | @veryCompactCelledVeryRelaxedPadding: (@compactCelledVeryRelaxedPadding / 2);
89 |
90 |
91 | /*******************************
92 | Legacy
93 | *******************************/
94 |
95 | /*--------------
96 | Page
97 | ---------------*/
98 |
99 | /* Legacy (DO NOT USE)
100 | */
101 | @mobileWidth: auto;
102 | @mobileMargin: 0;
103 | @mobileGutter: 0;
104 |
105 | @tabletWidth: auto;
106 | @tabletMargin: 0;
107 | @tabletGutter: 2em;
108 |
109 | @computerWidth: auto;
110 | @computerMargin: 0;
111 | @computerGutter: 3%;
112 |
113 | @largeMonitorWidth: auto;
114 | @largeMonitorMargin: 0;
115 | @largeMonitorGutter: 15%;
116 |
117 | @widescreenMonitorWidth: auto;
118 | @widescreenMargin: 0;
119 | @widescreenMonitorGutter: 23%;
120 |
--------------------------------------------------------------------------------
/semantic/definitions/modules/shape.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * # Fomantic-UI - Shape
3 | * http://github.com/fomantic/Fomantic-UI/
4 | *
5 | *
6 | * Released under the MIT license
7 | * http://opensource.org/licenses/MIT
8 | *
9 | */
10 |
11 |
12 |
13 | /*******************************
14 | Theme
15 | *******************************/
16 |
17 | @type : 'module';
18 | @element : 'shape';
19 |
20 | @import (multiple) '../../theme.config';
21 |
22 | /*******************************
23 | Shape
24 | *******************************/
25 |
26 | .ui.shape {
27 | position: relative;
28 | vertical-align: top;
29 | display: @display;
30 | perspective: @perspective;
31 | transition: @transition;
32 | }
33 |
34 | .ui.shape .side,
35 | .ui.shape .sides {
36 | transform-style: preserve-3d;
37 | }
38 |
39 | .ui.shape .side {
40 | display: none;
41 | opacity: 1;
42 | width: 100%;
43 |
44 | margin: @sideMargin !important;
45 | backface-visibility: @backfaceVisibility;
46 | }
47 |
48 | .ui.shape .side * {
49 | backface-visibility: visible !important;
50 | }
51 |
52 | /*******************************
53 | Types
54 | *******************************/
55 |
56 | & when (@variationShapeCube) {
57 | .ui.cube.shape .side {
58 | min-width: @cubeSize;
59 | height: @cubeSize;
60 |
61 | padding: @cubePadding;
62 |
63 | background-color: @cubeBackground;
64 | color: @cubeTextColor;
65 | box-shadow: @cubeBoxShadow;
66 | }
67 | .ui.cube.shape .side > .content {
68 | width: 100%;
69 | height: 100%;
70 | display: table;
71 |
72 | text-align: @cubeTextAlign;
73 | user-select: text;
74 | }
75 | .ui.cube.shape .side > .content > div {
76 | display: table-cell;
77 | vertical-align: middle;
78 | font-size: @cubeFontSize;
79 | }
80 | }
81 |
82 | /*******************************
83 | Variations
84 | *******************************/
85 | & when (@variationShapeText) {
86 | .ui.text.shape.animating .sides {
87 | position: static;
88 | }
89 | .ui.text.shape .side {
90 | white-space: nowrap;
91 | }
92 | .ui.text.shape .side > * {
93 | white-space: normal;
94 | }
95 | }
96 |
97 |
98 | /*******************************
99 | States
100 | *******************************/
101 |
102 | & when (@variationShapeLoading) {
103 | /*--------------
104 | Loading
105 | ---------------*/
106 |
107 | .ui.loading.shape {
108 | position: absolute;
109 | top: -9999px;
110 | left: -9999px;
111 | }
112 | }
113 |
114 |
115 | /*--------------
116 | Animating
117 | ---------------*/
118 |
119 | .ui.shape .animating.side {
120 | position: absolute;
121 | top: 0;
122 | left: 0;
123 | display: block;
124 | z-index: @animatingZIndex;
125 | }
126 | .ui.shape .hidden.side {
127 | opacity: @hiddenSideOpacity;
128 | }
129 |
130 |
131 | /*--------------
132 | CSS
133 | ---------------*/
134 |
135 | .ui.shape.animating .sides {
136 | position: absolute;
137 | transition: @transition;
138 | }
139 | .ui.shape.animating .side {
140 | transition: @sideTransition;
141 | }
142 | .ui.shape .animating.side *,
143 | .ui.shape.animating .side * {
144 | transition: none;
145 | }
146 |
147 | /*--------------
148 | Active
149 | ---------------*/
150 |
151 | .ui.shape .active.side {
152 | display: block;
153 | }
154 |
155 | .loadUIOverrides();
156 |
--------------------------------------------------------------------------------
/semantic/definitions/elements/rail.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * # Fomantic-UI - Rail
3 | * http://github.com/fomantic/Fomantic-UI/
4 | *
5 | *
6 | * Released under the MIT license
7 | * http://opensource.org/licenses/MIT
8 | *
9 | */
10 |
11 | /*******************************
12 | Theme
13 | *******************************/
14 |
15 | @type : 'element';
16 | @element : 'rail';
17 |
18 | @import (multiple) '../../theme.config';
19 |
20 | /*******************************
21 | Rails
22 | *******************************/
23 |
24 | .ui.rail {
25 | position: absolute;
26 | top: 0;
27 | width: @width;
28 | height: @height;
29 | }
30 |
31 | .ui.left.rail {
32 | left: auto;
33 | right: 100%;
34 | padding: 0 @splitDistance 0 0;
35 | margin: 0 @splitDistance 0 0;
36 | }
37 |
38 | .ui.right.rail {
39 | left: 100%;
40 | right: auto;
41 | padding: 0 0 0 @splitDistance;
42 | margin: 0 0 0 @splitDistance;
43 | }
44 |
45 | /*******************************
46 | Variations
47 | *******************************/
48 |
49 | & when (@variationRailInternal) {
50 | /*--------------
51 | Internal
52 | ---------------*/
53 |
54 | .ui.left.internal.rail {
55 | left: 0;
56 | right: auto;
57 | padding: 0 0 0 @splitDistance;
58 | margin: 0 0 0 @splitDistance;
59 | }
60 |
61 | .ui.right.internal.rail {
62 | left: auto;
63 | right: 0;
64 | padding: 0 @splitDistance 0 0;
65 | margin: 0 @splitDistance 0 0;
66 | }
67 | }
68 |
69 | & when (@variationRailDividing) {
70 | /*--------------
71 | Dividing
72 | ---------------*/
73 |
74 | .ui.dividing.rail {
75 | width: @dividingWidth;
76 | }
77 | .ui.left.dividing.rail {
78 | padding: 0 @splitDividingDistance 0 0;
79 | margin: 0 @splitDividingDistance 0 0;
80 | border-right: @dividingBorder;
81 | }
82 | .ui.right.dividing.rail {
83 | border-left: @dividingBorder;
84 | padding: 0 0 0 @splitDividingDistance;
85 | margin: 0 0 0 @splitDividingDistance;
86 | }
87 | }
88 |
89 | & when (@variationRailDistance) {
90 | /*--------------
91 | Distance
92 | ---------------*/
93 |
94 | .ui.close.rail {
95 | width: @closeWidth;
96 | }
97 | .ui.close.left.rail {
98 | padding: 0 @splitCloseDistance 0 0;
99 | margin: 0 @splitCloseDistance 0 0;
100 | }
101 | .ui.close.right.rail {
102 | padding: 0 0 0 @splitCloseDistance;
103 | margin: 0 0 0 @splitCloseDistance;
104 | }
105 |
106 | .ui.very.close.rail {
107 | width: @veryCloseWidth;
108 | }
109 | .ui.very.close.left.rail {
110 | padding: 0 @splitVeryCloseDistance 0 0;
111 | margin: 0 @splitVeryCloseDistance 0 0;
112 | }
113 | .ui.very.close.right.rail {
114 | padding: 0 0 0 @splitVeryCloseDistance;
115 | margin: 0 0 0 @splitVeryCloseDistance;
116 | }
117 | }
118 |
119 | & when (@variationRailAttached) {
120 | /*--------------
121 | Attached
122 | ---------------*/
123 |
124 | .ui.attached.left.rail,
125 | .ui.attached.right.rail {
126 | padding: 0;
127 | margin: 0;
128 | }
129 | }
130 |
131 | /*--------------
132 | Sizing
133 | ---------------*/
134 |
135 | .ui.rail {
136 | font-size: @medium;
137 | }
138 | & when not (@variationRailSizes = false) {
139 | each(@variationRailSizes, {
140 | @s: @@value;
141 | .ui.@{value}.rail {
142 | font-size: @s;
143 | }
144 | })
145 | }
146 |
147 | .loadUIOverrides();
148 |
--------------------------------------------------------------------------------
/semantic/definitions/modules/embed.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * # Fomantic-UI - Video
3 | * http://github.com/fomantic/Fomantic-UI/
4 | *
5 | *
6 | * Released under the MIT license
7 | * http://opensource.org/licenses/MIT
8 | *
9 | */
10 |
11 |
12 | /*******************************
13 | Theme
14 | *******************************/
15 |
16 | @type : 'module';
17 | @element : 'embed';
18 |
19 | @import (multiple) '../../theme.config';
20 |
21 | /*******************************
22 | Types
23 | *******************************/
24 |
25 | .ui.embed {
26 | position: relative;
27 | max-width: 100%;
28 | height: 0;
29 | overflow: hidden;
30 | background: @background;
31 | padding-bottom: @widescreenRatio;
32 | }
33 |
34 | /*-----------------
35 | Embedded Content
36 | ------------------*/
37 |
38 | .ui.embed iframe,
39 | .ui.embed embed,
40 | .ui.embed object {
41 | position: absolute;
42 | border: none;
43 | width: 100%;
44 | height: 100%;
45 | top: 0;
46 | left: 0;
47 | margin: 0;
48 | padding: 0;
49 | overflow: hidden;
50 | }
51 |
52 | /*-----------------
53 | Embed
54 | ------------------*/
55 |
56 | .ui.embed > .embed {
57 | display: none;
58 | }
59 |
60 | /*--------------
61 | Placeholder
62 | ---------------*/
63 |
64 | .ui.embed > .placeholder {
65 | position: absolute;
66 | cursor: pointer;
67 | top: 0;
68 | left: 0;
69 | display: block;
70 | width: 100%;
71 | height: 100%;
72 | background-color: @placeholderBackground;
73 | }
74 |
75 | /*--------------
76 | Icon
77 | ---------------*/
78 |
79 | .ui.embed > i.icon {
80 | cursor: pointer;
81 | position: absolute;
82 | top: 0;
83 | left: 0;
84 | width: 100%;
85 | height: 100%;
86 | z-index: 2;
87 | }
88 | .ui.embed > i.icon:after {
89 | position: absolute;
90 | top: 0;
91 | left: 0;
92 | width: 100%;
93 | height: 100%;
94 | z-index: 3;
95 | content: '';
96 | background: @placeholderBackground;
97 | opacity: @placeholderBackgroundOpacity;
98 | transition: @placeholderBackgroundTransition;
99 | }
100 | .ui.embed > i.icon:before {
101 | position: absolute;
102 | top: 50%;
103 | left: 50%;
104 | transform: translateX(-50%) translateY(-50%);
105 |
106 | color: @iconColor;
107 | font-size: @iconSize;
108 | text-shadow: @iconShadow;
109 | transition: @iconTransition;
110 | z-index: @iconZIndex;
111 | }
112 |
113 | /*******************************
114 | States
115 | *******************************/
116 |
117 | /*--------------
118 | Hover
119 | ---------------*/
120 |
121 | .ui.embed i.icon:hover:after {
122 | background: @hoverPlaceholderBackground;
123 | opacity: @hoverPlaceholderBackgroundOpacity;
124 | }
125 | .ui.embed i.icon:hover:before {
126 | color: @hoverIconColor;
127 | }
128 |
129 | /*--------------
130 | Active
131 | ---------------*/
132 |
133 | .ui.active.embed > i.icon,
134 | .ui.active.embed > .placeholder {
135 | display: none;
136 | }
137 | .ui.active.embed > .embed {
138 | display: block;
139 | }
140 |
141 | /*******************************
142 | Variations
143 | *******************************/
144 |
145 | & when (@variationEmbedRatio) {
146 | .ui.square.embed {
147 | padding-bottom: @squareRatio;
148 | }
149 | .ui[class*="4:3"].embed {
150 | padding-bottom: @standardRatio;
151 | }
152 | .ui[class*="16:9"].embed {
153 | padding-bottom: @widescreenRatio;
154 | }
155 | .ui[class*="21:9"].embed {
156 | padding-bottom: @ultraWidescreenRatio;
157 | }
158 | }
159 |
160 | .loadUIOverrides();
161 |
--------------------------------------------------------------------------------
/src/components/EvalSliderMobile.tsx:
--------------------------------------------------------------------------------
1 | import { Color } from 'chess.ts';
2 | import React from 'react';
3 | import Draggable from 'react-draggable';
4 | import { BLACK_COLOR, evalOutput, WHITE_COLOR } from './EvalSliderDesktop';
5 |
6 | interface Props {
7 | // From -1.0 to 1.0
8 | value: number;
9 | onDrag: (value: number) => void;
10 | orientation: Color;
11 | disabled: boolean;
12 | width: number;
13 | }
14 |
15 | export default ({
16 | value, onDrag, orientation, disabled, width,
17 | }: Props): React.ReactElement => {
18 | const sliderWidth = 20;
19 | const sliderHeight = 28;
20 | const barHeight = 10;
21 | const valueCoefficient = orientation === 'w' ? -1 : 1;
22 |
23 | return (
24 |
32 |
56 |
{
64 | onDrag((data.x / (width / 2 - sliderWidth / 2)) * valueCoefficient);
65 | }}
66 | disabled={disabled}
67 | >
68 |
74 |
86 |
97 |
98 | {evalOutput(value)}
99 |
100 |
101 |
102 |
103 |
104 | );
105 | };
106 |
--------------------------------------------------------------------------------
/semantic/themes/default/elements/step.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Step
3 | *******************************/
4 |
5 | /*-------------------
6 | Group
7 | --------------------*/
8 |
9 | @stepMargin: 1em 0;
10 | @stepsBorderRadius: @defaultBorderRadius;
11 | @stepsBackground: '';
12 | @stepsBoxShadow: none;
13 | @stepsBorder: 1px solid @borderColor;
14 |
15 | /*-------------------
16 | Element
17 | --------------------*/
18 |
19 | @verticalMargin: 0;
20 | @horizontalMargin: 0;
21 |
22 | @arrowSize: @relativeLarge;
23 | @verticalPadding: @relativeLarge;
24 | @horizontalPadding: 2em;
25 |
26 | @transition:
27 | background-color @defaultDuration @defaultEasing,
28 | opacity @defaultDuration @defaultEasing,
29 | color @defaultDuration @defaultEasing,
30 | box-shadow @defaultDuration @defaultEasing
31 | ;
32 | @lineHeight: @relativeLarge;
33 | @alignItems: center;
34 | @justifyContent: center;
35 | @backgroundColor: @white;
36 | @background: @backgroundColor;
37 | @borderRadius: 0;
38 | @borderWidth: 1px;
39 | @boxShadow: none;
40 | @border: none;
41 | @divider: @borderWidth solid @borderColor;
42 |
43 | /* Icon */
44 | @iconDistance: 1rem;
45 | @iconSize: 2.5em;
46 | @iconAlign: middle;
47 |
48 | /* Title */
49 | @titleFontFamily: @headerFont;
50 | @titleFontWeight: @bold;
51 | @titleFontSize: @relativeLarge;
52 | @titleColor: @darkTextColor;
53 |
54 | /* Description */
55 | @descriptionDistance: 0.25em;
56 | @descriptionFontSize: @relativeSmall;
57 | @descriptionFontWeight: @normal;
58 | @descriptionColor: @textColor;
59 |
60 |
61 | /* Arrow */
62 | @arrowBackgroundColor: @backgroundColor;
63 | @arrowTopOffset: 50%;
64 | @arrowRightOffset: 0;
65 | @arrowBorderWidth: 0 @borderWidth @borderWidth 0;
66 |
67 | @arrowDisplay: block;
68 | @lastArrowDisplay: none;
69 |
70 | @activeArrowDisplay: block;
71 | @activeLastArrowDisplay: none;
72 |
73 | /* Mobile */
74 | @mobileIconDistance: @iconDistance;
75 |
76 | /*-------------------
77 | Types
78 | --------------------*/
79 |
80 | /* Vertical */
81 | @verticalDivider: @divider;
82 | @verticalArrowTopOffset: 50%;
83 | @verticalArrowRightOffset: 0;
84 | @verticalLeftArrowLeftOffset: 0;
85 | @verticalLeftArrowRightOffset: 100%;
86 | @verticalLeftArrowBorderWidth: @borderWidth 0 0 @borderWidth;
87 | @verticalArrowBorderWidth: 0 @borderWidth @borderWidth 0;
88 |
89 | @verticalArrowDisplay: none;
90 | @verticalLastArrowDisplay: @verticalArrowDisplay;
91 |
92 | @verticalActiveArrowDisplay: block;
93 | @verticalActiveLastArrowDisplay: block;
94 |
95 | /*-------------------
96 | Variations
97 | --------------------*/
98 |
99 | @attachedHorizontalOffset: -@borderWidth;
100 | @attachedVerticalOffset: 0;
101 | @attachedWidth: e(%("calc(100%% + %d)", -@attachedHorizontalOffset * 2));
102 |
103 | @orderedFontFamily: inherit;
104 | @orderedFontWeight: @bold;
105 |
106 | /*-------------------
107 | States
108 | --------------------*/
109 |
110 | /* Completed */
111 | @completedColor: @positiveColor;
112 |
113 | /* Hover */
114 | @hoverBackground: @offWhite;
115 | @hoverColor: @hoveredTextColor;
116 |
117 | /* Down */
118 | @downBackground: @darkWhite;
119 | @downColor: @pressedTextColor;
120 |
121 | /* Active */
122 | @activeBackground: @darkWhite;
123 | @activeColor: @linkColor;
124 | @activeIconColor: @darkTextColor;
125 |
126 | /* Active + Hover */
127 | @activeHoverBackground: @lightGrey;
128 | @activeHoverColor: @textColor;
129 |
130 |
131 | /* Disabled */
132 | @disabledBackground: @background;
133 | @disabledColor: @disabledTextColor;
134 |
135 | /* Inverted */
136 | @invertedActiveBackground: #333333;
137 | @invertedActiveHoverBackground: #444444;
138 | @invertedHoverBackground: #3F3F3F;
139 | @invertedDisabledBackground: #222222;
140 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/accordion.overrides:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Theme Overrides
3 | *******************************/
4 | @font-face {
5 | font-family: 'Accordion';
6 | src:
7 | url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMggjB5AAAAC8AAAAYGNtYXAPfOIKAAABHAAAAExnYXNwAAAAEAAAAWgAAAAIZ2x5Zryj6HgAAAFwAAAAyGhlYWT/0IhHAAACOAAAADZoaGVhApkB5wAAAnAAAAAkaG10eAJuABIAAAKUAAAAGGxvY2EAjABWAAACrAAAAA5tYXhwAAgAFgAAArwAAAAgbmFtZfC1n04AAALcAAABPHBvc3QAAwAAAAAEGAAAACAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADw2gHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADgAAAAKAAgAAgACAAEAIPDa//3//wAAAAAAIPDZ//3//wAB/+MPKwADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQASAEkAtwFuABMAADc0PwE2FzYXFh0BFAcGJwYvASY1EgaABQgHBQYGBQcIBYAG2wcGfwcBAQcECf8IBAcBAQd/BgYAAAAAAQAAAEkApQFuABMAADcRNDc2MzIfARYVFA8BBiMiJyY1AAUGBwgFgAYGgAUIBwYFWwEACAUGBoAFCAcFgAYGBQcAAAABAAAAAQAAqWYls18PPPUACwIAAAAAAM/9o+4AAAAAz/2j7gAAAAAAtwFuAAAACAACAAAAAAAAAAEAAAHg/+AAAAIAAAAAAAC3AAEAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAQAAAAC3ABIAtwAAAAAAAAAKABQAHgBCAGQAAAABAAAABgAUAAEAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEADAAAAAEAAAAAAAIADgBAAAEAAAAAAAMADAAiAAEAAAAAAAQADABOAAEAAAAAAAUAFgAMAAEAAAAAAAYABgAuAAEAAAAAAAoANABaAAMAAQQJAAEADAAAAAMAAQQJAAIADgBAAAMAAQQJAAMADAAiAAMAAQQJAAQADABOAAMAAQQJAAUAFgAMAAMAAQQJAAYADAA0AAMAAQQJAAoANABaAHIAYQB0AGkAbgBnAFYAZQByAHMAaQBvAG4AIAAxAC4AMAByAGEAdABpAG4AZ3JhdGluZwByAGEAdABpAG4AZwBSAGUAZwB1AGwAYQByAHIAYQB0AGkAbgBnAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('truetype'),
8 | url(data:application/font-woff;charset=utf-8;base64,d09GRk9UVE8AAASwAAoAAAAABGgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAAA9AAAAS0AAAEtFpovuE9TLzIAAAIkAAAAYAAAAGAIIweQY21hcAAAAoQAAABMAAAATA984gpnYXNwAAAC0AAAAAgAAAAIAAAAEGhlYWQAAALYAAAANgAAADb/0IhHaGhlYQAAAxAAAAAkAAAAJAKZAedobXR4AAADNAAAABgAAAAYAm4AEm1heHAAAANMAAAABgAAAAYABlAAbmFtZQAAA1QAAAE8AAABPPC1n05wb3N0AAAEkAAAACAAAAAgAAMAAAEABAQAAQEBB3JhdGluZwABAgABADr4HAL4GwP4GAQeCgAZU/+Lix4KABlT/4uLDAeLa/iU+HQFHQAAAHkPHQAAAH4RHQAAAAkdAAABJBIABwEBBw0PERQZHnJhdGluZ3JhdGluZ3UwdTF1MjB1RjBEOXVGMERBAAACAYkABAAGAQEEBwoNVp38lA78lA78lA77lA773Z33bxWLkI2Qj44I9xT3FAWOj5CNkIuQi4+JjoePiI2Gi4YIi/uUBYuGiYeHiIiHh4mGi4aLho2Ijwj7FPcUBYeOiY+LkAgO+92L5hWL95QFi5CNkI6Oj4+PjZCLkIuQiY6HCPcU+xQFj4iNhouGi4aJh4eICPsU+xQFiIeGiYaLhouHjYePiI6Jj4uQCA74lBT4lBWLDAoAAAAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADw2gHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADgAAAAKAAgAAgACAAEAIPDa//3//wAAAAAAIPDZ//3//wAB/+MPKwADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAEAADfYOJZfDzz1AAsCAAAAAADP/aPuAAAAAM/9o+4AAAAAALcBbgAAAAgAAgAAAAAAAAABAAAB4P/gAAACAAAAAAAAtwABAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAAEAAAAAtwASALcAAAAAUAAABgAAAAAADgCuAAEAAAAAAAEADAAAAAEAAAAAAAIADgBAAAEAAAAAAAMADAAiAAEAAAAAAAQADABOAAEAAAAAAAUAFgAMAAEAAAAAAAYABgAuAAEAAAAAAAoANABaAAMAAQQJAAEADAAAAAMAAQQJAAIADgBAAAMAAQQJAAMADAAiAAMAAQQJAAQADABOAAMAAQQJAAUAFgAMAAMAAQQJAAYADAA0AAMAAQQJAAoANABaAHIAYQB0AGkAbgBnAFYAZQByAHMAaQBvAG4AIAAxAC4AMAByAGEAdABpAG4AZ3JhdGluZwByAGEAdABpAG4AZwBSAGUAZwB1AGwAYQByAHIAYQB0AGkAbgBnAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('woff')
9 | ;
10 | font-weight: normal;
11 | font-style: normal;
12 | }
13 |
14 | /* Dropdown Icon */
15 | .ui.accordion .title .dropdown.icon,
16 | .ui.accordion .accordion .title .dropdown.icon {
17 | font-family: Accordion;
18 | line-height: 1;
19 | backface-visibility: hidden;
20 | font-weight: normal;
21 | font-style: normal;
22 | text-align: center;
23 | }
24 |
25 | .ui.accordion .title .dropdown.icon:before,
26 | .ui.accordion .accordion .title .dropdown.icon:before {
27 | content: '\f0da'/*rtl:'\f0d9'*/;
28 | }
29 |
--------------------------------------------------------------------------------
/src/PointsSolver.ts:
--------------------------------------------------------------------------------
1 | import { Question, Move, Moves } from './questions';
2 |
3 | /**
4 | * Calculates points awarded for position.
5 | *
6 | * 1. 20 points for correctly guessing the winning side or that the position is a draw
7 | *
8 | * 2. The number of points for the eval guess is given by:
9 | * points = -8(1/abs(0.5c + 1))d^1.5 + 50
10 | * if points < 0: points = points / 4
11 | * where c = correct eval, d = abs(guessed eval - c)
12 | *
13 | * 3. Guessing a best move multiplies your eval points by:
14 | * multiplier = max(-0.75 * abs(guessed eval - c) + 3, 1)
15 | * if points > 0:
16 | * 1 / multiplier
17 | *
18 | * 4. Guessing a player awards 10 points
19 | */
20 | export class PointsSolver {
21 | public readonly result: QuestionAnswer;
22 |
23 | constructor(result: QuestionAnswer) {
24 | this.result = result;
25 | }
26 |
27 | /**
28 | * @returns true if the winning side was found or correctly answering a draw
29 | */
30 | foundWinningSide(): boolean {
31 | if (
32 | this.result.answer.evaluation === 0
33 | && this.result.question.moves.one.evaluation === 0
34 | ) {
35 | return true;
36 | }
37 |
38 | return this.result.answer.evaluation * this.result.question.moves.one.evaluation >= 0;
39 | }
40 |
41 | /**
42 | * @returns Points awarded for eval
43 | */
44 | evalPoints(): number {
45 | const correctEval = this.result.question.moves.one.evaluation;
46 | const guessEval = this.result.answer.evaluation;
47 | const unadjusted = -8 * (1 / Math.abs(0.5 * correctEval + 1))
48 | * Math.abs(guessEval - correctEval) ** 1.5
49 | + 50;
50 | if (unadjusted < 0) {
51 | return unadjusted / 2;
52 | }
53 | return unadjusted;
54 | }
55 |
56 | /**
57 | * @returns true if guessed move was in the top 3
58 | */
59 | foundBestMove(): boolean {
60 | const variation = PointsSolver.getMatchingVariation(
61 | this.result.question.moves,
62 | this.result.answer.bestMove,
63 | );
64 | return variation !== null;
65 | }
66 |
67 | /**
68 | * @returns Eval points multiplier
69 | */
70 | bestMoveMultiplier(): number {
71 | const variation = PointsSolver.getMatchingVariation(
72 | this.result.question.moves,
73 | this.result.answer.bestMove,
74 | );
75 | if (variation === null) {
76 | return 1;
77 | }
78 |
79 | const multiplier = Math.max(
80 | -0.75 * Math.abs(variation.evaluation - this.result.question.moves.one.evaluation) + 3,
81 | 1,
82 | );
83 |
84 | if (this.evalPoints() < 0) {
85 | return 1 / multiplier;
86 | }
87 |
88 | return multiplier;
89 | }
90 |
91 | /**
92 | * @returns Points awarded for question
93 | */
94 | totalPoints(): number {
95 | return (this.foundWinningSide() ? 20 : 0)
96 | + this.evalPoints() * this.bestMoveMultiplier();
97 | }
98 |
99 | // Returns first variation with matching move, or null if not found.
100 | static getMatchingVariation(variations: Moves, move: string) : Move | null {
101 | const lowercaseMove = move.toLowerCase().replace('+', '');
102 |
103 | if (variations.one.move.toLowerCase() === lowercaseMove) {
104 | return variations.one;
105 | }
106 |
107 | if (variations.two && variations.two.move.toLowerCase() === lowercaseMove) {
108 | return variations.two;
109 | }
110 |
111 | if (variations.three && variations.three.move.toLowerCase() === lowercaseMove) {
112 | return variations.three;
113 | }
114 |
115 | return null;
116 | }
117 | }
118 |
119 | export interface QuestionAnswer {
120 | question: Question;
121 | answer: Answer;
122 | }
123 |
124 | export interface Answer {
125 | evaluation: number,
126 | bestMove: string,
127 | }
128 |
--------------------------------------------------------------------------------
/semantic/themes/default/views/feed.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Feed
3 | *******************************/
4 |
5 | /*-------------------
6 | Feed
7 | --------------------*/
8 |
9 | @margin: 1em 0;
10 |
11 | /*-------------------
12 | Elements
13 | --------------------*/
14 |
15 | /* Event */
16 | @eventWidth: 100%;
17 | @eventPadding: @3px 0;
18 | @eventMargin: 0;
19 | @eventBackground: none;
20 | @eventDivider: none;
21 |
22 | /* Event Label */
23 | @labelWidth: 2.5em;
24 | @labelHeight: auto;
25 | @labelAlignSelf: stretch;
26 | @labelTextAlign: left;
27 |
28 | /* Icon Label */
29 | @iconLabelOpacity: 1;
30 | @iconLabelWidth: 100%;
31 | @iconLabelSize: 1.5em;
32 | @iconLabelPadding: 0.25em;
33 | @iconLabelBackground: none;
34 | @iconLabelBorderRadius: none;
35 | @iconLabelBorder: none;
36 | @iconLabelColor: rgba(0, 0, 0, 0.6);
37 |
38 | /* Image Label */
39 | @imageLabelWidth: 100%;
40 | @imageLabelHeight: auto;
41 | @imageLabelBorderRadius: @circularRadius;
42 |
43 | /* Content w/ Label */
44 | @labeledContentMargin: 0.5em 0 @relative5px @relativeLarge;
45 | @lastLabeledContentPadding: 0;
46 |
47 | /* Content */
48 | @contentAlignSelf: stretch;
49 | @contentTextAlign: left;
50 | @contentWordWrap: break-word;
51 |
52 | /* Date */
53 | @dateMargin: -0.5rem 0 0;
54 | @datePadding: 0;
55 | @dateColor: @lightTextColor;
56 | @dateFontSize: @relativeMedium;
57 | @dateFontWeight: @normal;
58 | @dateFontStyle: @normal;
59 |
60 | /* Summary */
61 | @summaryMargin: 0;
62 | @summaryFontSize: @relativeMedium;
63 | @summaryFontWeight: @bold;
64 | @summaryColor: @textColor;
65 |
66 | /* Summary Image */
67 | @summaryImageWidth: auto;
68 | @summaryImageHeight: 10em;
69 | @summaryImageMargin: -0.25em 0.25em 0 0;
70 | @summaryImageVerticalAlign: middle;
71 | @summaryImageBorderRadius: 0.25em;
72 |
73 | /* Summary Date */
74 | @summaryDateDisplay: inline-block;
75 | @summaryDateFloat: none;
76 | @summaryDateMargin: 0 0 0 0.5em;
77 | @summaryDatePadding: 0;
78 | @summaryDateFontSize: @relativeTiny;
79 | @summaryDateFontWeight: @dateFontWeight;
80 | @summaryDateFontStyle: @dateFontStyle;
81 | @summaryDateColor: @dateColor;
82 |
83 | /* User */
84 | @userFontWeight: @bold;
85 | @userDistance: 0;
86 | @userImageWidth: @summaryImageWidth;
87 | @userImageHeight: @summaryImageHeight;
88 | @userImageMargin: @summaryImageMargin;
89 | @userImageVerticalAlign: @summaryImageVerticalAlign;
90 |
91 | /* Extra Summary Data */
92 | @extraMargin: 0.5em 0 0;
93 | @extraBackground: none;
94 | @extraPadding: 0;
95 | @extraColor: @textColor;
96 |
97 | /* Extra Images */
98 | @extraImageMargin: 0 0.25em 0 0;
99 | @extraImageWidth: 6em;
100 |
101 | /* Extra Text */
102 | @extraTextPadding: 0;
103 | @extraTextPointer: none;
104 | @extraTextFontSize: @relativeMedium;
105 | @extraTextLineHeight: @lineHeight;
106 | @extraTextMaxWidth: 500px;
107 |
108 | /* Metadata Group */
109 | @metadataDisplay: inline-block;
110 | @metadataFontSize: @relativeTiny;
111 | @metadataMargin: 0.5em 0 0;
112 | @metadataBackground: none;
113 | @metadataBorder: none;
114 | @metadataBorderRadius: 0;
115 | @metadataBoxShadow: none;
116 | @metadataPadding: 0;
117 | @metadataColor: rgba(0, 0, 0, 0.6);
118 |
119 | @metadataElementSpacing: 0.75em;
120 |
121 | /* Like */
122 | @likeColor: '';
123 | @likeHoverColor: #FF2733;
124 | @likeActiveColor: #EF404A;
125 | @likeTransition: 0.2s color ease;
126 |
127 | /* Metadata Divider */
128 | @metadataDivider: '';
129 | @metadataDividerColor: rgba(0, 0, 0, 0.2);
130 | @metadataDividerOffset: -1em;
131 |
132 | @metadataActionCursor: pointer;
133 | @metadataActionOpacity: 1;
134 | @metadataActionColor: rgba(0, 0, 0, 0.5);
135 | @metadataActionTransition: color @defaultDuration @defaultEasing;
136 |
137 | @metadataActionHoverColor: @selectedTextColor;
138 |
139 | /*-------------------
140 | Variations
141 | --------------------*/
142 |
--------------------------------------------------------------------------------
/src/components/EvalSliderDesktop.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import Draggable from 'react-draggable';
3 | import { Color } from 'chess.ts';
4 |
5 | export function sliderValueToEval(value: number): number {
6 | return 20 * value ** 3;
7 | }
8 |
9 | export function evalOutput(value: number): string {
10 | const evaluation = sliderValueToEval(value);
11 | if (evaluation >= 0) {
12 | return `+${evaluation.toFixed(2)}`;
13 | }
14 |
15 | return evaluation.toFixed(2);
16 | }
17 |
18 | export const WHITE_COLOR = '#e3e3e3';
19 | export const BLACK_COLOR = '#161616';
20 |
21 | interface Props {
22 | // From -1.0 to 1.0
23 | value: number;
24 | onDrag: (value: number) => void;
25 | orientation: Color;
26 | disabled: boolean;
27 | height: number;
28 | }
29 |
30 | export default ({
31 | value, onDrag, orientation, disabled, height,
32 | }: Props): React.ReactElement => {
33 | const sliderWidth = 24;
34 | const sliderHeight = 12;
35 | const barWidth = 10;
36 | const valueCoefficient = orientation === 'w' ? -1 : 1;
37 |
38 | return (
39 |
46 |
70 |
{
78 | onDrag((data.y / (height / 2 - sliderHeight / 2)) * valueCoefficient);
79 | }}
80 | disabled={disabled}
81 | >
82 |
88 |
100 |
111 |
112 | {evalOutput(value)}
113 |
114 |
115 |
116 |
117 |
118 | );
119 | };
120 |
--------------------------------------------------------------------------------
/semantic/themes/default/modules/progress.variables:
--------------------------------------------------------------------------------
1 | /*******************************
2 | Progress
3 | *******************************/
4 |
5 | /*-------------------
6 | Element
7 | --------------------*/
8 |
9 | @verticalSpacing: 1em;
10 | @margin: @verticalSpacing 0 (@labelHeight + @verticalSpacing);
11 | @firstMargin: 0 0 (@labelHeight + @verticalSpacing);
12 | @lastMargin: 0 0 (@labelHeight);
13 |
14 | @background: @strongTransparentBlack;
15 | @border: none;
16 | @boxShadow: none;
17 | @padding: 0;
18 | @borderRadius: @defaultBorderRadius;
19 |
20 | /* Bar */
21 | @barPosition: relative;
22 | @barHeight: 1.75em;
23 | @barBackground: #888888;
24 | @barBorderRadius: @borderRadius;
25 | @barTransitionEasing: @defaultEasing;
26 | @barTransitionDuration: @defaultDuration;
27 | @barTransition:
28 | width @barTransitionDuration @barTransitionEasing,
29 | background-color @barTransitionDuration @barTransitionEasing
30 | ;
31 | @barInitialWidth: 0;
32 | @barMinWidth: 2em;
33 |
34 | /* Progress Bar Label */
35 | @progressWidth: auto;
36 | @progressSize: @relativeSmall;
37 | @progressPosition: absolute;
38 | @progressTop: 50%;
39 | @progressRight: 0.5em;
40 | @progressLeft: auto;
41 | @progressBottom: auto;
42 | @progressOffset: -0.5em;
43 | @progressColor: @invertedLightTextColor;
44 | @progressTextShadow: none;
45 | @progressFontWeight: @bold;
46 | @progressTextAlign: left;
47 | @progressRightAlignedRight: @progressLeft;
48 | @progressRightAlignedLeft: @progressRight;
49 |
50 | /* Label */
51 | @labelWidth: 100%;
52 | @labelHeight: 1.5em;
53 | @labelSize: 1em;
54 | @labelPosition: absolute;
55 | @labelTop: 100%;
56 | @labelLeft: 0;
57 | @labelRight: auto;
58 | @labelBottom: auto;
59 | @labelOffset: (@labelHeight - 1.3em);
60 | @labelColor: @textColor;
61 | @labelTextShadow: none;
62 | @labelFontWeight: @bold;
63 | @labelTextAlign: center;
64 | @labelTransition: color 0.4s @defaultEasing;
65 |
66 | /*-------------------
67 | Types
68 | --------------------*/
69 |
70 | @indicatingFirstColor: #D95C5C;
71 | @indicatingSecondColor: #EFBC72;
72 | @indicatingThirdColor: #E6BB48;
73 | @indicatingFourthColor: #DDC928;
74 | @indicatingFifthColor: #B4D95C;
75 | @indicatingSixthColor: #66DA81;
76 |
77 | @indicatingFirstLabelColor: @textColor;
78 | @indicatingSecondLabelColor: @textColor;
79 | @indicatingThirdLabelColor: @textColor;
80 | @indicatingFourthLabelColor: @textColor;
81 | @indicatingFifthLabelColor: @textColor;
82 | @indicatingSixthLabelColor: @textColor;
83 |
84 | @invertedIndicatingFirstLabelColor: @invertedTextColor;
85 | @invertedIndicatingSecondLabelColor: @invertedTextColor;
86 | @invertedIndicatingThirdLabelColor: @invertedTextColor;
87 | @invertedIndicatingFourthLabelColor: @invertedTextColor;
88 | @invertedIndicatingFifthLabelColor: @invertedTextColor;
89 | @invertedIndicatingSixthLabelColor: @invertedTextColor;
90 |
91 | /*-------------------
92 | States
93 | --------------------*/
94 |
95 | /* Active */
96 | @activePulseColor: @white;
97 | @activePulseMaxOpacity: 0.3;
98 | @activePulseDuration: 2s;
99 | @activeMinWidth: @barMinWidth;
100 |
101 |
102 | /*-------------------
103 | Variations
104 | --------------------*/
105 |
106 | /* Attached */
107 | @attachedBackground: transparent;
108 | @attachedHeight: 0.2rem;
109 | @attachedBorderRadius: @borderRadius;
110 |
111 | /* Inverted */
112 | @invertedBackground: @transparentWhite;
113 | @invertedBorder: none;
114 | @invertedBarBackground: @barBackground;
115 | @invertedProgressColor: @black;
116 | @invertedLabelColor: @white;
117 |
118 | /* Sizing */
119 | @miniBarHeight: 0.3em;
120 | @tinyBarHeight: 0.5em;
121 | @smallBarHeight: 1em;
122 | @largeBarHeight: 2.5em;
123 | @bigBarHeight: 3.5em;
124 | @hugeBarHeight: 4em;
125 | @massiveBarHeight: 5em;
126 |
127 | /* Indeterminate */
128 | @indeterminatePulseColor: @white;
129 | @indeterminatePulseDuration: @activePulseDuration;
130 | @indeterminatePulseDurationSlow: 4s;
131 | @indeterminatePulseDurationFast: 1s;
132 |
--------------------------------------------------------------------------------