Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New "columns" display mode #371

Merged
merged 3 commits into from
Jun 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/readme/partials/setup/action/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,6 @@ Update your README.md to embed your metrics:
![Metrics](https://github.com/my-github-user/my-github-user/blob/master/github-metrics.svg)
<!-- If you're using "main" as default branch -->
![Metrics](https://github.com/my-github-user/my-github-user/blob/main/github-metrics.svg)
<!-- If you're using the "columns" display mode -->
<img src="https://github.com/my-github-user/my-github-user/blob/master/github-metrics.svg" alt="Metrics" width="100%">
```
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,8 @@ Update your README.md to embed your metrics:
![Metrics](https://github.com/my-github-user/my-github-user/blob/master/github-metrics.svg)
<!-- If you're using "main" as default branch -->
![Metrics](https://github.com/my-github-user/my-github-user/blob/main/github-metrics.svg)
<!-- If you're using the "columns" display mode -->
<img src="https://github.com/my-github-user/my-github-user/blob/master/github-metrics.svg" alt="Metrics" width="100%">
Zenoo marked this conversation as resolved.
Show resolved Hide resolved
```
</details>

Expand Down
1 change: 1 addition & 0 deletions source/app/web/statics/app.placeholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
animated: false,
//Display size
large: set.config.display === "large",
columns: set.config.display === "columns",
//Config
config: set.config,
//Base elements
Expand Down
1 change: 1 addition & 0 deletions source/plugins/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ It may increase filesize since it replace unicode characters by SVG images.
Some templates like `classic` and `repositories` support different output display size:
- `regular` (default) will render a medium-sized image, which is suitable for both desktop and mobile displays and is preferable when using data-intensive metrics (since text may be scaled down on small devices)
- `large` will render a large-sized image, which may be more suitable for some plugins (like displaying topics icons, repository contributors, etc.)
- `columns` will render a full-width image, with two columns on desktop / one column on mobile

#### ℹ️ Examples workflows

Expand Down
1 change: 1 addition & 0 deletions source/plugins/core/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default async function({login, q}, {conf, data, rest, graphql, plugins, q

//Display
data.large = display === "large"
data.columns = display === "columns"

//Animations
data.animated = animations
Expand Down
1 change: 1 addition & 0 deletions source/plugins/core/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ inputs:
values:
- regular # 480px width
- large # 960px width (may not be supported by all templates)
- columns # Full width with two columns on desktop / One column on mobile

# Enable SVG CSS animations
config_animations:
Expand Down
4 changes: 2 additions & 2 deletions source/templates/classic/image.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions source/templates/classic/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,23 @@
width: 50%;
}

/* Columns display */
svg.columns .items-wrapper{
column-count: 2;
column-gap: 10px;
}
svg.columns .items-wrapper>*{
-webkit-column-break-inside: avoid;
page-break-inside: avoid;
break-inside: avoid-column;
}

@media (max-width: 850px){
svg.columns .items-wrapper{
column-count: 1;
}
}

/* Headers */
h1, h2, h3 {
margin: 8px 0 2px;
Expand Down