Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline support with service worker #978

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules
.DS_Store
npm-debug.log
_includes/readmes/*.md
.idea

# testing
coverage
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ default_js:
- "https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.5.13/clipboard.min.js"
- "https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"
- "/scripts/search.js"
- "/scripts/service-worker.init.js"
- "/scripts/clipboard.js"
- "/scripts/open-in-repl.js"

Expand Down
5 changes: 5 additions & 0 deletions _includes/header.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<input type="checkbox" id="babel-toggle-search" class="babel-toggle-search-checkbox" />
<header class="navbar navbar-default navbar-fixed-top babel-nav" id="top" role="banner">

<div id="offline-indicator" class="hidden">
You are offline
</div>

<div class="container">
<a href="/" class="navbar-brand logo">Babel</a>
<div class="babel-navbar-toggles">
Expand Down
3 changes: 2 additions & 1 deletion _sass/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ body {
@import "components/_tick-list.scss";
@import "components/_type.scss";
@import "components/_user.scss";
@import "components/_offline-indicator.scss";
@import "components/_video.scss";

@import "components/_offline.scss";
@import "pages/_404.scss";
@import "pages/_blog.scss";
@import "pages/_docs.scss";
Expand Down
6 changes: 6 additions & 0 deletions _sass/components/_offline-indicator.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#offline-indicator {
text-align: center;
color: white;
padding: 5px;
background: #323330;
}
6 changes: 6 additions & 0 deletions _sass/components/_offline.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.offline_hero {
height: calc(100vh - 50px);
.hero__content {
margin-top: 5%;
}
}
10 changes: 10 additions & 0 deletions offline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: default
---

<div class="hero offline_hero">
<div class="hero__content">
<h1>You are offline!</h1>
<p>Try again later</p>
</div>
</div>
Loading