Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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: 1 addition & 1 deletion src/assets/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/netlify.png
Binary file not shown.
5 changes: 5 additions & 0 deletions src/assets/netlify.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/node.png
Binary file not shown.
32 changes: 32 additions & 0 deletions src/assets/nodejs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 10 additions & 8 deletions src/assets/vercel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/components/run-anywhere/platforms.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[
{
"name": "Vercel",
"icon": "/assets/vercel.svg",
"icon": "vercel",
"link": "/guide/deploy/vercel/"
},
{
"name": "Netlify",
"icon": "/assets/netlify.png",
"icon": "netlify",
"link": "/guide/deploy/netlify/"
},
{
"name": "NodeJS",
"icon": "/assets/node.png",
"icon": "nodejs",
"link": "/guide/deploy/nodejs/"
},
{
"name": "GitHub",
"icon": "/assets/github.svg",
"icon": "github",
"link": "/guide/deploy/github-pages/"
}
]
13 changes: 12 additions & 1 deletion src/components/run-anywhere/run-anywhere.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
import platforms from "./platforms.json" with { type: "json" };
import githubLogo from "../../assets/github.svg?type=raw";
import netlifyLogo from "../../assets/netlify.svg?type=raw";
import nodejsLogo from "../../assets/nodejs.svg?type=raw";
import vercelLogo from "../../assets/vercel.svg?type=raw";
import styles from "./run-anywhere.module.css";

const platformImageMapper = {
github: githubLogo,
netlify: netlifyLogo,
nodejs: nodejsLogo,
vercel: vercelLogo,
};

export default class RunAnywhere extends HTMLElement {
connectedCallback() {
this.innerHTML = `
Expand All @@ -16,7 +27,7 @@ export default class RunAnywhere extends HTMLElement {
return `
<div class="${styles.platformBox}">
<div class="${styles.iconBox}">
<img class="${styles.icon}" src="${icon}" alt="${name} logo"/>
${platformImageMapper[icon]}
</div>

<a class="${styles.iconLink}" href="${link}">${name}</a>
Expand Down
5 changes: 3 additions & 2 deletions src/components/run-anywhere/run-anywhere.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@
padding: var(--size-fluid-2);
}

.icon {
width: 100px;
.iconBox svg {
width: 100%;
height: 100%;
}

.iconLink {
Expand Down
Loading