refactor: start grouping brick attributes info

This commit is contained in:
efim
2023-11-23 14:07:36 +00:00
parent 2e68b8d8e7
commit 82a96ea9d7
7 changed files with 81 additions and 41 deletions

View File

@@ -1,6 +1,7 @@
package rooms
import (
"html/template"
"log"
"maps"
"slices"
@@ -242,3 +243,42 @@ func GestureFromInt(num int) (HandGesture, bool) {
func (g HandGesture) String() string {
return [...]string{"Change Topic", "Probing Quesion", "Expand", "Clarifying Quesion", "Meta"}[g]
}
type GestureInfo struct {
Name string
Color, BgColor template.CSS
IconUrl template.URL
}
func (g HandGesture) GetGestureInfo() GestureInfo {
result := GestureInfo{}
switch g {
case ChangeTopic:
result = GestureInfo{
Color: "--change-topic-color",
BgColor: "--change-topic-dark",
}
case ProbingQ:
result = GestureInfo{
Color: "--probing-q-color",
BgColor: "--probing-q-dark",
}
case Expand:
result = GestureInfo{
Color: "--expand-color",
BgColor: "--expand-dark",
}
case ClarifyingQ:
result = GestureInfo{
Color: "--clarifying-q-color",
BgColor: "--clarifying-q-dark",
}
case Meta:
result = GestureInfo{
Color: "--meta-color",
BgColor: "--meta-dark",
}
}
result.Name = g.String()
return result
}