-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…-support Issue/#139 multiple projects support
- Loading branch information
Showing
26 changed files
with
468 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './htmlEncode'; | ||
export * from './textToColors'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export const textToColors = (input: string): string[] => { | ||
// Utility function to convert a character to a base hue value | ||
const charToHue = (char: string): number => { | ||
const code = char.toLowerCase().charCodeAt(0); | ||
return (code - 97) * 20 % 360; // Map 'a' to 'z' to a hue value between 0 and 360 | ||
}; | ||
|
||
// Function to generate an HSL color based on a base hue | ||
const getHslColor = (hue: number) => `hsl(${hue}, 70%, 50%)`; | ||
|
||
// Extract up to three characters from the input string | ||
const chars = input.length >= 3 ? input.slice(0, 3).split('') : input.padEnd(3, input[0]).slice(0, 3).split(''); | ||
|
||
// Calculate the hue for each character | ||
// Generate the HSL colors list | ||
return chars.map(charToHue).map(getHslColor); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { defineStore } from "pinia"; | ||
import {ConnectionStatus} from "./types"; | ||
|
||
|
||
export const useConnectionStore = defineStore("connectionStore", { | ||
state: () => ({ | ||
wsConnectionStatus: ConnectionStatus.DISCONNECTED, | ||
}), | ||
getters: { | ||
isConnectedWS({ wsConnectionStatus }) { | ||
return wsConnectionStatus === ConnectionStatus.CONNECTED; | ||
} | ||
}, | ||
actions: { | ||
setStatus(newStatus: ConnectionStatus) { | ||
this.wsConnectionStatus = newStatus; | ||
}, | ||
removeWSConnection() { | ||
this.setStatus(ConnectionStatus.DISCONNECTED) | ||
}, | ||
addWSConnection() { | ||
this.setStatus(ConnectionStatus.CONNECTED) | ||
} | ||
|
||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { useConnectionStore } from './connections-store' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export enum ConnectionStatus { | ||
CONNECTED = "connected", | ||
DISCONNECTED = "disconnected", | ||
} |
Oops, something went wrong.