-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathrun-anywhere.js
More file actions
46 lines (40 loc) · 1.52 KB
/
run-anywhere.js
File metadata and controls
46 lines (40 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import platforms from "./platforms.json" with { type: "json" };
import awsLogo from "../../assets/aws.svg?type=raw";
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 = {
aws: awsLogo,
github: githubLogo,
netlify: netlifyLogo,
nodejs: nodejsLogo,
vercel: vercelLogo,
};
export default class RunAnywhere extends HTMLElement {
connectedCallback() {
this.innerHTML = `
<div class="${styles.container}">
<h3 class="${styles.heading}">Run anywhere the web can run</h3>
<p class="${styles.subHeading}">Greenwood helps you take your application <a href="/guides/hosting/">to production</a> by embracing platforms that embrace web standards.</p>
<div class="${styles.platformsContainer}">
${platforms
.map((platform) => {
const { label, icon, link } = platform;
return `
<div class="${styles.platformBox}">
<div class="${styles.iconBox}">
${platformImageMapper[icon]}
</div>
<a class="${styles.iconLink}" href="${link}">${label}</a>
</div>
`;
})
.join("")}
</div>
</div>
`;
}
}
customElements.define("app-run-anywhere", RunAnywhere);