From e0aa6b5d9c7a6b791947e7e665a0ba1cd9c763f0 Mon Sep 17 00:00:00 2001 From: NewHappyRabbit <31893343+NewHappyRabbit@users.noreply.github.com> Date: Wed, 12 Feb 2025 21:30:43 +0200 Subject: [PATCH] Ran prettier --- src/client/components/FlagInput.ts | 136 +++++++++++------------ src/client/graphics/layers/NameLayer.ts | 4 +- webpack.config.js | 140 +++++++++++++----------- 3 files changed, 138 insertions(+), 142 deletions(-) diff --git a/src/client/components/FlagInput.ts b/src/client/components/FlagInput.ts index ae524d9ff..4731e9bf1 100644 --- a/src/client/components/FlagInput.ts +++ b/src/client/components/FlagInput.ts @@ -152,80 +152,66 @@ export class FlagInput extends LitElement { } render() { - return html` -
- ${this.flag === "" - ? html` ` + : html` (this.showModal = true)} + />`} + ${this.showModal + ? html` +
+ +
+ + + ${Countries.filter( + (country) => + country.name + .toLowerCase() + .includes(this.search.toLowerCase()) || + country.code + .toLowerCase() + .includes(this.search.toLowerCase()), + ).map( + (country) => html` + ` - : html` (this.showModal = true)} - />`} - ${this.showModal - ? html` -
- -
- - - ${Countries.filter( - (country) => - country.name - .toLowerCase() - .includes( - this.search.toLowerCase() - ) || - country.code - .toLowerCase() - .includes( - this.search.toLowerCase() - ) - ).map( - (country) => html` - - ` - )} -
-
- ` - : ""} -
- `; - } + + ${country.name} + + `, + )} +
+
+ ` + : ""} + + `; + } } diff --git a/src/client/graphics/layers/NameLayer.ts b/src/client/graphics/layers/NameLayer.ts index 47836fb26..566af94d0 100644 --- a/src/client/graphics/layers/NameLayer.ts +++ b/src/client/graphics/layers/NameLayer.ts @@ -153,8 +153,8 @@ export class NameLayer implements Layer { const flagImg = document.createElement("img"); flagImg.classList.add("player-flag"); flagImg.style.marginBottom = "-5%"; - flagImg.style.opacity = '0.8'; - flagImg.src = '/flags/' + sanitize(player.flag()) + '.svg'; + flagImg.style.opacity = "0.8"; + flagImg.src = "/flags/" + sanitize(player.flag()) + ".svg"; flagImg.style.zIndex = "1"; flagImg.style.width = "40%"; flagImg.style.aspectRatio = "3/4"; diff --git a/webpack.config.js b/webpack.config.js index 26c379005..c6e879fae 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -11,129 +11,139 @@ export default (env, argv) => { const isProduction = argv.mode === "production"; return { - entry: './src/client/Main.ts', + entry: "./src/client/Main.ts", output: { publicPath: "/", - filename: 'bundle.js', - path: path.resolve(__dirname, 'out'), - clean: true + filename: "bundle.js", + path: path.resolve(__dirname, "out"), + clean: true, }, module: { rules: [ { test: /\.bin$/, - use: 'raw-loader' + use: "raw-loader", }, { test: /\.txt$/, - use: 'raw-loader' + use: "raw-loader", }, { test: /\.ts$/, - use: 'ts-loader', + use: "ts-loader", exclude: /node_modules/, }, { test: /\.css$/, use: [ - 'style-loader', + "style-loader", { - loader: 'css-loader', + loader: "css-loader", options: { - importLoaders: 1 - } + importLoaders: 1, + }, }, { - loader: 'postcss-loader', + loader: "postcss-loader", options: { postcssOptions: { - plugins: [ - 'tailwindcss', - 'autoprefixer', - ], - } - } - } - ] + plugins: ["tailwindcss", "autoprefixer"], + }, + }, + }, + ], }, { test: /\.(png|jpe?g|gif)$/i, - type: 'asset/resource', + type: "asset/resource", generator: { - filename: 'images/[hash][ext][query]' - } + filename: "images/[hash][ext][query]", + }, }, { test: /\.html$/, - use: ['html-loader'] + use: ["html-loader"], }, { test: /\.svg$/, - type: 'asset/inline', + type: "asset/inline", }, { test: /\.(woff|woff2|eot|ttf|otf)$/, use: [ { - loader: 'file-loader', + loader: "file-loader", options: { - name: '[name].[ext]', - outputPath: 'fonts/', - publicPath: '../fonts/', // This is important - } - } - ] - } + name: "[name].[ext]", + outputPath: "fonts/", + publicPath: "../fonts/", // This is important + }, + }, + ], + }, ], }, resolve: { - extensions: ['.tsx', '.ts', '.js'], + extensions: [".tsx", ".ts", ".js"], alias: { - 'protobufjs/minimal': path.resolve(__dirname, 'node_modules/protobufjs/minimal.js') - } + "protobufjs/minimal": path.resolve( + __dirname, + "node_modules/protobufjs/minimal.js", + ), + }, }, plugins: [ new HtmlWebpackPlugin({ - template: './src/client/index.html', - filename: 'index.html' + template: "./src/client/index.html", + filename: "index.html", }), new webpack.DefinePlugin({ - 'process.env.WEBSOCKET_URL': JSON.stringify(isProduction ? '' : 'localhost:3000') + "process.env.WEBSOCKET_URL": JSON.stringify( + isProduction ? "" : "localhost:3000", + ), }), new webpack.DefinePlugin({ - 'process.env.GAME_ENV': JSON.stringify(isProduction ? 'prod' : 'dev') + "process.env.GAME_ENV": JSON.stringify(isProduction ? "prod" : "dev"), }), new CopyPlugin({ - patterns: [ - { from: "resources", to: path.resolve(__dirname, 'out') }, - ], + patterns: [{ from: "resources", to: path.resolve(__dirname, "out") }], options: { concurrency: 100, }, }), ], - devServer: isProduction ? {} : { - devMiddleware: { writeToDisk: true }, - static: { - directory: path.join(__dirname, 'out'), - }, - historyApiFallback: true, - compress: true, - port: 9000, - proxy: [ - { - context: ['/socket'], - target: 'ws://localhost:3000', - ws: true, + devServer: isProduction + ? {} + : { + devMiddleware: { writeToDisk: true }, + static: { + directory: path.join(__dirname, "out"), + }, + historyApiFallback: true, + compress: true, + port: 9000, + proxy: [ + { + context: ["/socket"], + target: "ws://localhost:3000", + ws: true, + }, + { + context: [ + "/lobbies", + "/join_game", + "/join_lobby", + "/private_lobby", + "/start_private_lobby", + "/lobby", + "/archive_singleplayer_game", + "/validate-username", + ], + target: "http://localhost:3000", + secure: false, + changeOrigin: true, + }, + ], }, - { - context: ['/lobbies', '/join_game', '/join_lobby', '/private_lobby', '/start_private_lobby', - '/lobby', '/archive_singleplayer_game', '/validate-username'], - target: 'http://localhost:3000', - secure: false, - changeOrigin: true, - } - ], - }, }; };