-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6eeb779
Showing
9 changed files
with
5,348 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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><img> tag</h1> | ||
</div> | ||
</story-card> | ||
|
||
<img style="object-fit: cover" src="https://i.imgur.com/ktDKGxb.jpg" draggable="false"> | ||
|
||
</story-viewer> | ||
</body> | ||
</html> |
Oops, something went wrong.