Browse Source

Add numeric avatars

pull/58/head
Matt Baer 3 years ago
parent
commit
c2a7f19ef0
  1. 4
      collections.go
  2. BIN
      static/img/avatars/0.png
  3. BIN
      static/img/avatars/1.png
  4. BIN
      static/img/avatars/2.png
  5. BIN
      static/img/avatars/3.png
  6. BIN
      static/img/avatars/4.png
  7. BIN
      static/img/avatars/5.png
  8. BIN
      static/img/avatars/6.png
  9. BIN
      static/img/avatars/7.png
  10. BIN
      static/img/avatars/8.png
  11. BIN
      static/img/avatars/9.png

4
collections.go

@ -262,7 +262,7 @@ func (c *Collection) ForPublic() {
c.URL = c.CanonicalURL()
}
var isLowerLetter = regexp.MustCompile("[a-z]").MatchString
var isAvatarChar = regexp.MustCompile("[a-z0-9]").MatchString
func (c *Collection) PersonObject(ids ...int64) *activitystreams.Person {
accountRoot := c.FederatedAccount()
@ -297,7 +297,7 @@ func (c *Collection) PersonObject(ids ...int64) *activitystreams.Person {
func (c *Collection) AvatarURL() string {
fl := string(unicode.ToLower([]rune(c.DisplayTitle())[0]))
if !isLowerLetter(fl) {
if !isAvatarChar(fl) {
return ""
}
return hostName + "/img/avatars/" + fl + ".png"

BIN
static/img/avatars/0.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
static/img/avatars/1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
static/img/avatars/2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
static/img/avatars/3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
static/img/avatars/4.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
static/img/avatars/5.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
static/img/avatars/6.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
static/img/avatars/7.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

BIN
static/img/avatars/8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
static/img/avatars/9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Loading…
Cancel
Save