Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabrielagodek/vox-recruitment-task
Recruitment task for VOX
https://github.com/gabrielagodek/vox-recruitment-task
Last synced: about 6 hours ago
JSON representation
Recruitment task for VOX
- Host: GitHub
- URL: https://github.com/gabrielagodek/vox-recruitment-task
- Owner: GabrielaGodek
- Created: 2024-01-11T18:29:22.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-01-12T22:09:35.000Z (10 months ago)
- Last Synced: 2024-01-13T14:22:50.267Z (10 months ago)
- Language: Vue
- Size: 52.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# VOX Recruitment task
## Installation
1. Clone this repo: `https://github.com/GabrielaGodek/vox-recruitment-task`.
2. Install dependencies `npm install`.
3. Run the application `npm run dev`, it will open `http://localhost:5173/`.
4. Use button at the bottom left to add first tile.## Dependencies
- Vite `^5.0.8`
- Sass `^1.69.7`
- Vitest `^1.2.0`## Tests
src/
\_\_tests\_\_There are two tests: one for checking configuration (`sanity.test.ts`) and another for verifying if the Tile renders correctly at the front (`TileItem.test.ts`).
### Run test
In the console at the root directory, type `npm run test`.## Color validation
```ts
const isValid = (code: string): boolean => {
code = code.toLowerCase()
if(code.startsWith('rgb')){
// rgbPattern matches rgb(X, X, X) or rgba(X, X, X, Y), where X is a number from 0 to 255, and Y is a number from 0 to 1 (optional).
const rgbPattern: RegExp = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/
return rgbPattern.test(code)
}
if (code.startsWith('#') && (code.length === 7 || code.length === 4)) {
const hexPattern: RegExp = /^#[a-f0-9]{6}$|^#[a-f0-9]{3}$/;
return hexPattern.test(code)
}
return false
}
```