-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(community): new community page design (#11653)
Co-authored-by: Claas Augner <[email protected]> Co-authored-by: Florian Dieminger <[email protected]>
- Loading branch information
1 parent
b37a6e1
commit 75a3f2f
Showing
27 changed files
with
1,380 additions
and
227 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,144 @@ | ||
@use "../ui/vars" as *; | ||
|
||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
.wrap { | ||
--img-size: 3.75em; | ||
--li-size: calc(var(--img-size) * 2.5); | ||
} | ||
|
||
ul { | ||
--circle-border-size: 0.375em; | ||
align-content: start; | ||
display: grid; | ||
gap: 2rem 1rem; | ||
grid-template-columns: repeat(auto-fit, minmax(var(--li-size), 1fr)); | ||
justify-items: center; | ||
margin: 0; | ||
padding: 0; | ||
|
||
@media (max-width: $screen-md) { | ||
display: flex; | ||
margin-top: 2rem; | ||
overflow-x: auto; | ||
} | ||
} | ||
|
||
li, | ||
a { | ||
align-items: center; | ||
display: flex; | ||
flex-direction: column; | ||
flex-shrink: 0; | ||
text-align: center; | ||
} | ||
|
||
li { | ||
color: var(--community-text-primary); | ||
width: var(--li-size); | ||
} | ||
|
||
img { | ||
background: var(--community-circle-img-border); | ||
border: var(--circle-border-size) var(--community-circle-img-border) solid; | ||
border-radius: 50%; | ||
flex-shrink: 0; | ||
height: var(--img-size); | ||
width: var(--img-size); | ||
} | ||
|
||
a { | ||
color: unset; | ||
font-weight: 500; | ||
} | ||
|
||
svg { | ||
display: none; | ||
} | ||
|
||
@supports (offset-path: ellipse(100% 50% at 100% 50%)) { | ||
@media (min-width: $screen-md) { | ||
.wrap { | ||
container-type: size; | ||
height: 100%; | ||
width: 100%; | ||
} | ||
|
||
.inner { | ||
font-size: min(1rem, 3.5cqmin); | ||
padding: calc(var(--img-size) / 2) calc(var(--li-size) / 2); | ||
} | ||
|
||
ul { | ||
aspect-ratio: 1 / 2; | ||
display: block; | ||
margin-left: auto; | ||
max-height: var(--community-circle-height); | ||
min-height: 0; | ||
min-width: 0; | ||
position: relative; | ||
} | ||
|
||
svg { | ||
display: block; | ||
fill: none; | ||
height: 100%; | ||
overflow: visible; | ||
position: absolute; | ||
stroke: var(--community-circle-img-border); | ||
stroke-width: var(--circle-border-size); | ||
width: 100%; | ||
} | ||
|
||
li { | ||
$outer-elements: 5; | ||
$inner-elements: 3; | ||
|
||
// necessary because Firefox seems to have a bug where the links aren't | ||
// clickable until we force some kind of re-render which an animation does: | ||
animation: community-circle 0.1ms forwards; | ||
offset-anchor: center calc(0.5 * var(--img-size)); | ||
offset-distance: var(--offset-distance); | ||
offset-path: ellipse(100% 50% at 100% 50%); | ||
offset-rotate: 0deg; | ||
|
||
&:nth-of-type(n + #{$outer-elements + 1}) { | ||
--img-size: 5em; | ||
offset-path: ellipse(50% 25% at 100% 50%); | ||
} | ||
|
||
@keyframes community-circle { | ||
from { | ||
offset-distance: calc(var(--offset-distance) - 0.1%); | ||
} | ||
} | ||
|
||
@for $i from 1 through $outer-elements { | ||
&:nth-of-type(#{$i}) { | ||
--offset-distance: #{calc( | ||
75% - (($i - 1) * 50% / ($outer-elements - 1)) | ||
)}; | ||
} | ||
} | ||
|
||
@for $i from 1 through $inner-elements { | ||
&:nth-of-type(#{$outer-elements + $i}) { | ||
--offset-distance: #{calc( | ||
75% - (($i - 1) * 50% / ($inner-elements - 1)) | ||
)}; | ||
} | ||
} | ||
} | ||
|
||
.org { | ||
-webkit-box-orient: vertical; | ||
/* stylelint-disable-next-line value-no-vendor-prefix */ | ||
display: -webkit-box; | ||
-webkit-line-clamp: 2; | ||
line-clamp: 2; | ||
overflow: hidden; | ||
} | ||
} | ||
} |
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,109 @@ | ||
import { LitElement, html } from "lit"; | ||
import { customElement } from "lit/decorators.js"; | ||
|
||
import styles from "./contributor-list.scss?css" with { type: "css" }; | ||
|
||
interface ContributorData { | ||
name: string; | ||
github: string; | ||
org?: string; | ||
} | ||
|
||
@customElement("contributor-list") | ||
export class ContributorList extends LitElement { | ||
_contributors: ContributorData[] = []; | ||
|
||
static properties = { | ||
_contributors: { state: true }, | ||
}; | ||
|
||
static styles = styles; | ||
|
||
constructor() { | ||
super(); | ||
const contributorList = this.querySelector("ul"); | ||
const randomContributors: ContributorData[] = []; | ||
if (contributorList) { | ||
const contributors = [...contributorList.querySelectorAll("li")]; | ||
for (let index = 0; index < 8; index++) { | ||
const contributor = popRandom(contributors); | ||
if (!contributor) { | ||
break; | ||
} | ||
const [name, github, org] = [...contributor.childNodes].map( | ||
(node) => node?.textContent?.trim() || undefined | ||
); | ||
if (!name || !github) { | ||
index--; | ||
continue; | ||
} | ||
randomContributors.push({ | ||
name, | ||
github, | ||
org, | ||
}); | ||
} | ||
this._contributors = randomContributors; | ||
} | ||
} | ||
|
||
render() { | ||
return html`<div class="wrap"> | ||
<div class="inner"> | ||
<ul> | ||
<svg> | ||
<defs> | ||
<mask id="hide-half"> | ||
<rect | ||
x="0%" | ||
y="0%" | ||
width="100%" | ||
height="100%" | ||
fill="#fff" | ||
stroke="#fff" | ||
/> | ||
</mask> | ||
</defs> | ||
<ellipse | ||
rx="100%" | ||
ry="50%" | ||
cx="100%" | ||
cy="50%" | ||
mask="url(#hide-half)" | ||
/> | ||
<ellipse | ||
rx="50%" | ||
ry="25%" | ||
cx="100%" | ||
cy="50%" | ||
mask="url(#hide-half)" | ||
/> | ||
</svg> | ||
${this._contributors.map(({ name, github, org }) => { | ||
const imgSrc = `https://avatars.githubusercontent.com/${github | ||
?.split("/") | ||
.slice(-1)}`; | ||
return html`<li> | ||
<a href="${github}" target="_blank" rel="nofollow noreferrer"> | ||
<img | ||
src="${imgSrc}?size=80" | ||
srcset="${imgSrc}?size=160 2x" | ||
loading="lazy" | ||
referrerpolicy="no-referrer" | ||
/> | ||
${name} | ||
</a> | ||
<span class="org">${org}</span> | ||
</li>`; | ||
})} | ||
</ul> | ||
</div> | ||
</div>`; | ||
} | ||
} | ||
|
||
function popRandom<T>(array: Array<T>) { | ||
const i = Math.floor(Math.random() * array.length); | ||
// mutate the array: | ||
return array.splice(i, 1)[0]; | ||
} |
Oops, something went wrong.