Skip to content

Commit

Permalink
Revert "Revert "Migrate Postwoman to Nuxt.js (full Vue and SCSS suppo…
Browse files Browse the repository at this point in the history
…rt)""
  • Loading branch information
liyasthomas authored Aug 24, 2019
1 parent dbcd744 commit b027eeb
Show file tree
Hide file tree
Showing 39 changed files with 12,054 additions and 816 deletions.
92 changes: 91 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,91 @@
node_modules
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# Nuxt generate
dist

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# IDE / Editor
.idea
.editorconfig

# Service worker
sw.*

# Mac OSX
.DS_Store

# Vim swap files
*.swp
31 changes: 25 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,28 @@

language: node_js
node_js:
- "node"
notifications:
webhooks: https://www.travisbuddy.com
env:
- MY_VAR=EverythignIsAwesome
- NODE_ENV=TEST
- "8"

cache:
directories:
- "node_modules"

branches:
only:
- master

install:
- npm install
- npm run generate

script:
- echo "Skipping tests"

deploy:
provider: pages
skip-cleanup: true
github-token: $GITHUB_ACCESS_TOKEN # Set in travis-ci.org dashboard, marked secure https://docs.travis-ci.com/user/deployment/pages/#Setting-the-GitHub-token
target-branch: gh-pages
local-dir: dist
on:
branch: master
88 changes: 0 additions & 88 deletions 404.html

This file was deleted.

36 changes: 23 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
When I wrote this, only God and I understood what I was doing. Now, only God knows.
```
<div align="center">
<a href="https://liyas-thomas.firebaseapp.com"><img src="https://raw.githubusercontent.com/liyasthomas/templates/master/assets/logo.gif" alt="Liyas Thomas" width="200"></a>
<br>
<h1>Liyas Thomas</h1>
<sub>Built with ❤︎ by
<a href="https://github.com/liyasthomas">liyasthomas</a> and
<a href="https://github.com/liyasthomas/postwoman/graphs/contributors">contributors</a>
</sub>
<a href="https://liyas-thomas.firebaseapp.com"><img src="https://raw.githubusercontent.com/liyasthomas/templates/master/assets/logo.gif" alt="Liyas Thomas" width="200"></a>
<br>
<h1>Liyas Thomas</h1>
<sub>Built with ❤︎ by
<a href="https://github.com/liyasthomas">liyasthomas</a> and
<a href="https://github.com/liyasthomas/postwoman/graphs/contributors">contributors</a>
</sub>
</div>

---

[![Build Status](https://travis-ci.org/liyasthomas/postwoman.svg?branch=master)](https://travis-ci.org/liyasthomas/postwoman) [![GitHub release](https://img.shields.io/github/release/liyasthomas/postwoman/all.svg)](https://github.com/liyasthomas/postwoman/releases/latest) [![repo size](https://img.shields.io/github/repo-size/liyasthomas/postwoman.svg)](https://github.com/liyasthomas/postwoman/archive/master.zip) [![license](https://img.shields.io/github/license/liyasthomas/postwoman.svg)](https://github.com/liyasthomas/postwoman/blob/master/LICENSE) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/liyasthomas/postwoman/issues) [![Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=website)](https://liyas-thomas.firebaseapp.com) [![Donate](https://img.shields.io/badge/$-donate-ff69b4.svg)](https://www.paypal.me/liyascthomas) [![Buy me a coffee](https://img.shields.io/badge/$-BuyMeACoffee-orange.svg)](https://www.buymeacoffee.com/liyasthomas)

# <img src="icons/icon-48x48.png" alt="postwoman" width="32"> Postwoman
# <img src="static/icon.png" alt="postwoman" width="32"> Postwoman

### 👽 API request builder by [Liyas Thomas](https://github.com/liyasthomas)

<div align="center">
<br>
<img src="icons/screely.png" alt="postwoman" width="100%">
<img src="icons/screely2.png" alt="postwoman" width="100%">
<img src="static/screely.png" alt="postwoman" width="100%">
<img src="static/screely2.png" alt="postwoman" width="100%">
<br>
</div>

Expand Down Expand Up @@ -58,15 +58,25 @@ You're done!
* HTML - For the web framework
* CSS - For styling components
* JavaScript - For magic!
* [Vue](https://vuejs.org/) - To add to the JavaScript magic!
* [Nuxt](https://nuxtjs.org/) - To add to the Vue magic! <!-- (Nuxt helps create the PWA and single page application.) -->

---

## Developing

1. [Clone this repo](https://help.github.com/en/articles/cloning-a-repository) with git.
1. Install dependencies by running `npm install` within the `postwoman` directory.
1. Start the development server with `npm start`.
1. Open development site by going to [http://localhost:8080](http://localhost:8080) in your browser.
1. Install dependencies by running `npm install` within the directory that you cloned (probably `postwoman`).
1. Start the development server with `npm run dev`.
1. Open development site by going to [http://localhost:3000](http://localhost:3000) in your browser.

---

## Releasing
1. [Clone this repo](https://help.github.com/en/articles/cloning-a-repository) with git.
1. Install dependencies by running `npm install` within the directory that you cloned (probably `postwoman`).
1. Build the release files with `npm run build`.
1. Find the built project in `./dist`.

---

Expand Down
7 changes: 7 additions & 0 deletions assets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ASSETS

**This directory is not required, you can delete it if you don't want to use it.**

This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked).
2 changes: 2 additions & 0 deletions assets/css/fonts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Poppins (Google Fonts)
@import url("https://fonts.googleapis.com/css?family=Poppins:500,700&display=swap");
16 changes: 11 additions & 5 deletions style.css → assets/css/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ footer {
justify-content: space-between;
}

.logo {
color: var(--ac-color);
body.sticky-footer footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
}

main {
margin: 0 auto;
max-width: 1200px;
.logo {
color: var(--ac-color);
}

button {
Expand Down Expand Up @@ -213,3 +215,7 @@ ol li {
display: flex;
}
}

#installPWA {
display: none;
}
54 changes: 54 additions & 0 deletions assets/js/pwa.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
export default () => {
//*** Determine whether or not the PWA has been installed. ***//

// Step 1: Check local storage
let pwaInstalled = localStorage.getItem('pwaInstalled') === 'yes';

// Step 2: Check if the display-mode is standalone. (Only permitted for PWAs.)
if (!pwaInstalled && window.matchMedia('(display-mode: standalone)').matches) {
localStorage.setItem('pwaInstalled', 'yes');
pwaInstalled = true;
}

// Step 3: Check if the navigator is in standalone mode. (Again, only permitted for PWAs.)
if (!pwaInstalled && window.navigator.standalone === true) {
localStorage.setItem('pwaInstalled', 'yes');
pwaInstalled = true;
}

//*** If the PWA has not been installed, show the install PWA prompt.. ***//
let deferredPrompt = null;
window.addEventListener('beforeinstallprompt', (event) => {
deferredPrompt = event;

// Show the install button if the prompt appeared.
if (!pwaInstalled) {
document.querySelector('#installPWA').style.display = 'block';
}
});

// When the app is installed, remove install prompts.
window.addEventListener('appinstalled', (event) => {
localStorage.setItem('pwaInstalled', 'yes');
pwaInstalled = true;
document.getElementById('installPWA').style.display = 'none';
});

// When the app is uninstalled, add the prompts back


return async () => {
if (deferredPrompt) {
deferredPrompt.prompt();
let outcome = await deferredPrompt.userChoice;

if (outcome === 'accepted') {
console.log('Postwoman was installed successfully.')
} else {
console.log('Postwoman could not be installed. (Installation rejected by user.)')
}
deferredPrompt = null;
}
};

};
7 changes: 7 additions & 0 deletions components/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# COMPONENTS

**This directory is not required, you can delete it if you don't want to use it.**

The components directory contains your Vue.js Components.

_Nuxt.js doesn't supercharge these components._
Loading

0 comments on commit b027eeb

Please sign in to comment.