]> git.neb.cc Git - xyz.git/commitdiff
Fullscreen projects (#3)
authorBen Larson <[email protected]>
Mon, 2 Dec 2019 01:14:24 +0000 (19:14 -0600)
committerGitHub <[email protected]>
Mon, 2 Dec 2019 01:14:24 +0000 (19:14 -0600)
src/index.html
src/main.css
src/main.js

index c36459e0b5387049e96bf41c5b89c9a242a5c5a3..e8cfd3c56dc78b02c7e01852174fd11e7f159a3b 100644 (file)
@@ -12,9 +12,9 @@
     </style>
   </head>
   <body>
-    <h1>Ben Larson</h1>
-    <h2>Projects</h2>
-    <div class="shelf"></div>
+    <section>
+      <h1>Ben Larson</h1>
+    </section>
   </body>
   <script src="main.js"></script>
 </html>
index 469a4c7a080519b94713fbfc7095bfc9e6f4fdbd..3eb369f4da93e2b7fb515eec354ce7c2d3682913 100644 (file)
@@ -17,58 +17,32 @@ h1 {
   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-container {
-  width: 50%;
-  max-width: 30em;
-  margin: 2em 2em 3em 2em;
-  display: inline-block;
+section {
+  background: linear-gradient(transparent, rgba(0, 0, 0, 0.1));
 }
 
-.card {
-  width: 100%;
-  padding-top: 70%;
-  position: relative;
-  height: 0;
-  display: block;
+.sizer {
+  overflow: auto;
+  max-width: 30em;
+  margin: 0 auto;
+  padding: 3em;
 }
 
-.card iframe {
-  box-sizing: border-box;
-  pointer-events: none;
-  position: absolute;
-  top: 0;
+iframe {
+  float: right;
   box-shadow: 0 0 1em -0.5em rgba(0, 0, 0, 0.5);
-  border-radius: 1em;
-  width: 100%;
-  height: 100%;
+  border-radius: 1.2em;
+  width: 2.81in;
+  height: 5.67in;
   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;
 }
index 74965208113f881cd61ef25d1d1366dc01d922db..2eb80236b2b7c47474d87a073b27b96fd86ce11d 100644 (file)
@@ -10,7 +10,6 @@ const element = (tagName, attrs = {}, ...children) => {
   return result;
 };
 
-const shelves = document.querySelectorAll('.shelf');
 repos.forEach(title => {
   const name = title.toLowerCase().replace(' ', '-');
   const url = `https://benlarson.xyz/${name}/`;
@@ -21,7 +20,7 @@ repos.forEach(title => {
     { href: `https://github.com/ben-larson/${name}/`, class: 'github' },
     'View on GitHub &#8599;'
   );
-  const card = element('a', { href: url, class: 'card' }, iframe, githubLink);
-  const cardContainer = element('div', { class: 'card-container' }, card);
-  shelves[0].appendChild(cardContainer);
+  const content = element('div', { class: 'sizer' }, githubLink, iframe);
+  const section = element('section', {}, content);
+  document.body.appendChild(section);
 });