Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
straversi committed Nov 4, 2020
0 parents commit 6eeb779
Show file tree
Hide file tree
Showing 9 changed files with 5,348 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
build/*.d.ts
build/*.d.ts.map
build/*.js
build/*.js.map
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Story Viewer

A completed story-viewer component, from the [Story Viewer codelab](http://codelabs.developers.google.com/codelabs/lit-story-viewer).

To start the development environment:

```bash
npm run dev
```

---

The blank starter repo can be found at https://github.com/polymerlabs/story-viewer-starter.
33 changes: 33 additions & 0 deletions build/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
html {
height: 100%;
overflow: hidden;
}
body {
margin: 0;
background: black;
height: 100%;
overflow: hidden;
position: relative;
}

/* Center the story component */
story-viewer {
width: 400px;
max-width: 100%;
height: 80%;
top: 50%;
transform: translateY(-50%);
margin: 0 auto;
}

/* Styles for specific story cards */
.bottom {
position: absolute;
width: 100%;
bottom: 48px;
left: 0;
}
.bottom > * {
margin: 0;
text-align: center;
}
48 changes: 48 additions & 0 deletions build/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Story Viewer</title>
<link rel="stylesheet" href="./index.css">
<script type="module" src="./story-card.js"></script>
<script type="module" src="./story-viewer.js"></script>
</head>
<body>
<story-viewer>
<story-card>
<img slot="media" src="https://i.imgur.com/88RbRIc.jpg" />
<div class="bottom">
<h1 style="font-family: serif">A STORY COMPONENT</h1>
<p>swipe to navigate</p>
</div>
</story-card>

<story-card>
<video slot="media" src="https://i.imgur.com/KfpqUdC.mp4" loop playsinline></video>
<div class="bottom">
<h2>This video will</h2>
<h1 style="font-family: serif">AUTOPLAY</h1>
<h3>when it's focused</h3>
</div>
</story-card>

<story-card>
<img slot="media" src="https://i.imgur.com/1wTXrAu.jpg" />
<h1>This text</h1>
<p>uses <i>default</i> overlay styling.</p>
</story-card>

<story-card>
<video slot="media" src="https://i.imgur.com/PwTsAT3.mp4" loop playsinline></video>
<div class="bottom">
<p>The next card is just a plain</p>
<h1>&lt;img&gt; tag</h1>
</div>
</story-card>

<img style="object-fit: cover" src="https://i.imgur.com/ktDKGxb.jpg" draggable="false">

</story-viewer>
</body>
</html>
Loading

0 comments on commit 6eeb779

Please sign in to comment.