]> git.neb.cc Git - xyz.git/commitdiff
Index (#1)
authorBen Larson <[email protected]>
Tue, 12 Nov 2019 01:04:47 +0000 (19:04 -0600)
committerGitHub <[email protected]>
Tue, 12 Nov 2019 01:04:47 +0000 (19:04 -0600)
.github/CODEOWNERS [new file with mode: 0644]
.prettierrc [new file with mode: 0644]
index.html [deleted file]
src/index.html [new file with mode: 0644]
src/main.css [new file with mode: 0644]
src/main.js [new file with mode: 0644]

diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644 (file)
index 0000000..c0c655d
--- /dev/null
@@ -0,0 +1 @@
+* @ben-larson
diff --git a/.prettierrc b/.prettierrc
new file mode 100644 (file)
index 0000000..544138b
--- /dev/null
@@ -0,0 +1,3 @@
+{
+  "singleQuote": true
+}
diff --git a/index.html b/index.html
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/src/index.html b/src/index.html
new file mode 100644 (file)
index 0000000..c36459e
--- /dev/null
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>Ben Larson</title>
+    <style>
+      @import url('./main.css');
+
+      @font-face {
+        font-family: lingua-franca-bold;
+        src: url('https://benlarson.xyz/fonts/lingua-franca/bold.otf');
+      }
+    </style>
+  </head>
+  <body>
+    <h1>Ben Larson</h1>
+    <h2>Projects</h2>
+    <div class="shelf"></div>
+  </body>
+  <script src="main.js"></script>
+</html>
diff --git a/src/main.css b/src/main.css
new file mode 100644 (file)
index 0000000..79658d6
--- /dev/null
@@ -0,0 +1,72 @@
+* {
+  font: inherit;
+  margin: 0;
+  padding: 0;
+}
+
+body {
+  font-family: lingua-franca-bold;
+  font-weight: bold;
+  font-size: 1.5em;
+  background: #ddd;
+  color: #333;
+}
+
+h1 {
+  font-size: 2em;
+  padding: 1em 1em;
+}
+
+h2 {
+  font-size: 1.3em;
+  padding-left: 1.5em;
+  padding-left: calc(2em / 1.3);
+  color: #777;
+}
+
+.shelf {
+  overflow-x: scroll;
+  white-space: nowrap;
+  background: linear-gradient(transparent, rgba(0, 0, 0, 0.1));
+}
+
+a {
+  text-decoration: none;
+}
+
+.card {
+  width: 50%;
+  padding-top: 40%;
+  position: relative;
+  height: 0;
+  margin: 2em 2em 3em 2em;
+  display: inline-block;
+}
+
+.card iframe {
+  box-sizing: border-box;
+  pointer-events: none;
+  position: absolute;
+  top: 0;
+  box-shadow: 0 0 1em -0.5em rgba(0, 0, 0, 0.5);
+  border-radius: 1em;
+  width: 100%;
+  height: 100%;
+  border: 0;
+  transition: all 0.2s;
+}
+
+.card:hover iframe {
+  box-shadow: 0 0 1em -0.25em rgba(0, 0, 0, 0.5);
+}
+
+.github {
+  float: right;
+  padding: 0.5em 0;
+  color: #999;
+  transition: all 0.1s;
+}
+
+.github:hover {
+  color: #555;
+}
diff --git a/src/main.js b/src/main.js
new file mode 100644 (file)
index 0000000..f7ebd4b
--- /dev/null
@@ -0,0 +1,26 @@
+const repos = ['Event Creator', 'JS Playground'];
+
+const element = (tagName, attrs = {}, ...children) => {
+  const result = document.createElement(tagName);
+  Object.keys(attrs).forEach(key => result.setAttribute(key, attrs[key]));
+  children.forEach(child => {
+    if (typeof child === 'object') result.appendChild(child);
+    else result.innerHTML += child;
+  });
+  return result;
+};
+
+const shelves = document.querySelectorAll('.shelf');
+repos.forEach(title => {
+  const name = title.toLowerCase().replace(' ', '-');
+  const url = `https://benlarson.xyz/${name}/`;
+
+  const iframe = element('iframe', { src: url });
+  const githubLink = element(
+    'a',
+    { href: `https://github.com/ben-larson/${name}/`, class: 'github' },
+    'View on GitHub &#8599;'
+  );
+  const card = element('a', { href: url, class: 'card' }, iframe, githubLink);
+  shelves[0].appendChild(card);
+});