diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 362d54e..d02bd71 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -5,6 +5,7 @@ FROM node:16 as builder # ENV API_URL=http://api:80 ENV API_URL=https://mawoka.eu ENV REDIS_URL=$REDIS +ENV VITE_HCAPTCHA=ee81b2a1-acf3-4d20-b2a4-a7ea94c7eba5 ENV VITE_SENTRY=https://4981de1f72f24fd7b5e21b8913b93a02@o661934.ingest.sentry.io/6254641 # change working directory WORKDIR /usr/src/app diff --git a/frontend/package.json b/frontend/package.json index 629ee5e..f989ee3 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -31,6 +31,7 @@ "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.1", "felte": "^1.0.1", + "highlight.js": "^11.4.0", "ioredis": "^4.28.5", "js-cookie": "^3.0.1", "luxon": "^2.3.1", diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 36a7c54..6df065d 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -19,6 +19,7 @@ specifiers: eslint-config-prettier: ^8.3.0 eslint-plugin-svelte3: ^3.2.1 felte: ^1.0.1 + highlight.js: ^11.4.0 ioredis: ^4.28.5 js-cookie: ^3.0.1 luxon: ^2.3.1 @@ -57,6 +58,7 @@ devDependencies: eslint-config-prettier: 8.4.0_eslint@7.32.0 eslint-plugin-svelte3: 3.4.1_eslint@7.32.0+svelte@3.46.4 felte: 1.0.1_svelte@3.46.4 + highlight.js: 11.4.0 ioredis: 4.28.5 js-cookie: 3.0.1 luxon: 2.3.1 @@ -1450,6 +1452,11 @@ packages: function-bind: 1.1.1 dev: true + /highlight.js/11.4.0: + resolution: {integrity: sha512-nawlpCBCSASs7EdvZOYOYVkJpGmAOKMYZgZtUqSRqodZE0GRVcFKwo1RcpeOemqh9hyttTdd5wDBwHkuSyUfnA==} + engines: {node: '>=12.0.0'} + dev: true + /ignore/4.0.6: resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==} engines: {node: '>= 4'} diff --git a/frontend/src/lib/hljs.css b/frontend/src/lib/hljs.css new file mode 100644 index 0000000..05efc04 --- /dev/null +++ b/frontend/src/lib/hljs.css @@ -0,0 +1,86 @@ +pre code.hljs { + display: block; + overflow-x: auto; + padding: 1em; +} +code.hljs { + padding: 3px 5px; +} /*! + Theme: a11y-dark + Author: @ericwbailey + Maintainer: @ericwbailey + + Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css +*/ +.hljs { + background: transparent; + color: #f8f8f2; +} +.hljs-comment, +.hljs-quote { + color: #d4d0ab; +} +.hljs-deletion, +.hljs-name, +.hljs-regexp, +.hljs-selector-class, +.hljs-selector-id, +.hljs-tag, +.hljs-template-variable, +.hljs-variable { + color: #ffa07a; +} +.hljs-built_in, +.hljs-link, +.hljs-literal, +.hljs-meta, +.hljs-number, +.hljs-params, +.hljs-type { + color: #f5ab35; +} +.hljs-attribute { + color: gold; +} +.hljs-addition, +.hljs-bullet, +.hljs-string, +.hljs-symbol { + color: #abe338; +} +.hljs-section, +.hljs-title { + color: #00e0e0; +} +.hljs-keyword, +.hljs-selector-tag { + color: #dcc6e0; +} +.hljs-emphasis { + font-style: italic; +} +.hljs-strong { + font-weight: 700; +} +@media screen and (-ms-high-contrast: active) { + .hljs-addition, + .hljs-attribute, + .hljs-built_in, + .hljs-bullet, + .hljs-comment, + .hljs-link, + .hljs-literal, + .hljs-meta, + .hljs-number, + .hljs-params, + .hljs-quote, + .hljs-string, + .hljs-symbol, + .hljs-type { + color: highlight; + } + .hljs-keyword, + .hljs-selector-tag { + font-weight: 700; + } +} diff --git a/frontend/src/lib/play/join.svelte b/frontend/src/lib/play/join.svelte index 94f5ebb..d299ded 100644 --- a/frontend/src/lib/play/join.svelte +++ b/frontend/src/lib/play/join.svelte @@ -1,16 +1,18 @@ - - + {#if game_pin === '' || game_pin.length <= 7} -
+
{}} - class="flex-col flex justify-center align-center mx-auto" + class='flex-col flex justify-center align-center mx-auto' > -

Game Pin

+

Game Pin


{:else} -
+
-

Username

- +

Username

+
{/if}
diff --git a/frontend/src/routes/__layout.svelte b/frontend/src/routes/__layout.svelte index d07b704..ab30ed2 100644 --- a/frontend/src/routes/__layout.svelte +++ b/frontend/src/routes/__layout.svelte @@ -30,16 +30,17 @@