Forum avatar and similar round into hexagon shapes

To make my avatar look like it belongs on this forum I made a custom image of a hexagon with Y and uploaded it. Lot of work for an avatar and then thought today how can we make all avatars into hexagons. And while tweaking, I changed lots of other round (and 1 square) shapes as well. (-:

Used Stylus (client side css extension for browser) for the tweaking to see the immediate result on the live forum.

Screenshots of the result:

How avatars and category bullet look in list:

How avatars, category bullet, badges, counts look in topic, summary & name card:


Peeps can still have custom avatars with transparant background as above regular user shows.

Hope @Sara & others don’t mind being in the screenshots :crossed_fingers:

CSS code changes:

img.avatar, 
.avatar-flair.rounded, 
.badge-category-parent-bg, .badge-category-bg, 
span.post-count, 
.badge-notification.clicks {
    border-radius: 0%;
    clip-path:polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
}

Only the categories with multiple colours look a bit weird:
image

2 Likes

love it - you have my upvote :smiley:
@Sara it’s the little things that show you care :smiley: can we get this to be the default?

1 Like

I think we’d need a bit more upvotes for that, as per democratic order, but I checked with our web developer and it is possible technically :slight_smile:

I am on board with anything the people of the forum decides on :sunglasses:

1 Like

Sure, why not. :grinning_face_with_smiling_eyes: Looks cool and is a neat little addition. :+1:

2 Likes

So, how is it looking? :slight_smile:

Thank you, @Yggy !
This is a really cool suggestion :slight_smile:

6 Likes

At first I didn’t see the change, since I still had my local adjustment with Stylus on … :stuck_out_tongue_closed_eyes:

Turned it off and the hexagons remained.

Cool, that it got implemented!
:sunglasses:

1 Like

very nice ^^ thanks Sara and @Yggy

1 Like

Holiday Hex Bonus :gift:
There is preloading splash animation with svg before the forum completely loads.
image

Which is achieved with following code:

<section id="d-splash">
  <template class="splash-svg-template">
    <svg
      xmlns="http://www.w3.org/2000/svg"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      version="1.1"
    >
      <style>
        :root {
          --animation-state: paused;
        }

        /* user picked a theme where the "regular" scheme is dark */
        :root {
          --primary: #dddddd;
          --secondary: #222222;
          --tertiary: #15d1a0;
          --quaternary: #c14924;
          --highlight: #a87137;
          --success: #66ffcc;
        }

        /* these styles need to live here because the SVG has a different scope */
        .dots {
          animation-name: loader;
          animation-timing-function: ease-in-out;
          animation-duration: 3s;
          animation-iteration-count: infinite;
          animation-play-state: var(--animation-state);
          stroke: #fff;
          stroke-width: 0.5px;
          transform-origin: center;
          opacity: 0;
          r: max(1vw, 11px);
          cy: 50%;
          filter: saturate(2) opacity(0.85);
        }

        .dots:first-child {
          fill: var(--quaternary);
        }

        .dots:nth-child(2) {
          fill: var(--quaternary);
          animation-delay: 0.15s;
        }

        .dots:nth-child(3) {
          fill: var(--highlight);
          animation-delay: 0.3s;
        }

        .dots:nth-child(4) {
          fill: var(--tertiary);
          animation-delay: 0.45s;
        }

        .dots:nth-child(5) {
          fill: var(--tertiary);
          animation-delay: 0.6s;
        }

        @keyframes loader {
          0% {
            opacity: 0;
            transform: scale(1);
          }
          45% {
            opacity: 1;
            transform: scale(0.7);
          }
          65% {
            opacity: 1;
            transform: scale(0.7);
          }
          100% {
            opacity: 0;
            transform: scale(1);
          }
        }
      </style>

      <g class="container">
        <circle class="dots" cx="30vw" />
        <circle class="dots" cx="40vw" />
        <circle class="dots" cx="50vw" />
        <circle class="dots" cx="60vw" />
        <circle class="dots" cx="70vw" />
      </g>
    </svg>
  </template>

  <style>
    html {
      overflow-y: hidden !important;
    }

    /* user picked a theme where the "regular" scheme is dark */
    html {
      background-color: #222222;
    }

    #d-splash .preloader-text-wrapper {
      color: #dddddd;
    }

    #d-splash {
      display: grid;
      place-items: center;
      backface-visibility: hidden;
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      z-index: 1001;
      --animation-state: paused;
    }

    #d-splash .preloader-image {
      max-width: 100%;
      height: 100vh;
    }

    #d-splash .preloader-text-wrapper {
      position: absolute;
      opacity: 0;
      animation: fade-in 0.5s ease-in-out;
      animation-delay: 1s;
      animation-fill-mode: forwards;
      animation-play-state: var(--animation-state);
      margin-bottom: -4em;
    }

    #d-splash .preloader-text:after {
      animation: loading-text 3s infinite;
      content: "";
      position: absolute;
      margin: 0 0.1em;
      left: 100%;
    }

    .rtl #d-splash .preloader-text:after {
      left: 0;
      right: 100%;
    }

    @keyframes fade-in {
      0% {
        opacity: 0;
      }
      100% {
        opacity: 1;
      }
    }

    @keyframes loading-text {
      0% {
        content: "";
      }
      25% {
        content: ".";
      }
      50% {
        content: "..";
      }
      75% {
        content: "...";
      }
    }
  </style>

  <img
    class="preloader-image"
    src="data:image/svg;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
    alt="Checkmk Community"
  />

  <div class="preloader-text-wrapper">
    <div class="preloader-text">Loading</div>
  </div>

  <noscript>
    <style>
      html {
        overflow-y: revert !important;
      }

      #d-splash {
        display: none;
      }
    </style>
  </noscript>

  <script>const DELAY_TARGET=2e3,POLLING_INTERVAL=50,splashSvgTemplate=document.querySelector(".splash-svg-template"),splashTemplateClone=splashSvgTemplate.content.cloneNode(!0),svgElement=splashTemplateClone.querySelector("svg"),svgString=(new XMLSerializer).serializeToString(svgElement),encodedSvg=btoa(svgString),splashWrapper=document.querySelector("#d-splash"),splashImage=splashWrapper&&splashWrapper.querySelector(".preloader-image")
if(splashImage){splashImage.src=`data:image/svg+xml;base64,${encodedSvg}`
const e=(performance.timing.connectStart||0)+2e3
let s,a
const r=()=>{splashWrapper&&splashWrapper.style.setProperty("--animation-state","running"),svgElement&&svgElement.style.setProperty("--animation-state","running")
const e=(new XMLSerializer).serializeToString(svgElement),s=btoa(e)
splashImage.src=`data:image/svg+xml;base64,${s}`,performance.mark("discourse-splash-visible"),t()},t=()=>{clearInterval(s),s=null}
s=setInterval((()=>{a&&t(),Date.now()>e&&r()}),50),document.addEventListener("discourse-ready",(()=>{a=!0,splashWrapper&&splashWrapper.remove(),performance.mark("discourse-splash-removed")}),{once:!0})}
</script>

</section>

As an alternative I made a green hex shape following a hex path:
image

<style>
html {
  background-color: #222222;
}
svg {
  border: 0px solid #eee;
  display: block;
  margin: 1em auto;
}
p {
  color: #aaa;
  text-align: center;
  margin: 2em 0;
}
</style>
<svg width="120" height="120" viewBox="0 0 120 120">
  <path id="motionPath" fill="none" stroke="none" stroke-miterlimit="10" d="M50 0 L95 25 L95 75 L50 100 L5 75 L5 25 Z"/>
  
  <polygon id="circle" points="10,0 19,5 19,15 10,20 1,15 1,5" fill="#109d77" />
   
  <animateMotion 
           href="#circle"
           dur="5s"
           begin="0s"
           fill="freeze"
           repeatCount="indefinite">
    <mpath href="#motionPath" />
  </animateMotion>
</svg>

To see it animate, save my code as html file and run it in your browser.

It’s not a complete and ready code replacement thingy, so it might need some more love and tweaking. But since I work just a few more days before my holiday till new year starts, thought I share it as it is now.

Consider it as my holiday bonus to you peeps.
:vulcan_salute:

1 Like