GithubHelp home page GithubHelp logo

adrianhajdin / project_weather_pwa Goto Github PK

View Code? Open in Web Editor NEW
745.0 7.0 197.0 2 MB

This is a code repository for the corresponding YouTube video. In this tutorial we are going to build, deploy and publish a Weather Progressive Web App. Covered topics: React.js, Service Workers, PWA, Lighthouse...

Home Page: https://inspiring-bhaskara-d21f88.netlify.app

HTML 31.49% JavaScript 44.32% CSS 24.19%

project_weather_pwa's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

project_weather_pwa's Issues

Light house not 100% passed

image

just test and follow the tutorial and I'm confused why the start_url test didn't pass. it tells that the start_url did respond, but not via a service worker.

External CSS isn't working from another sources

At offline.html I want to add External CSS style instead of Internal CSS. I do link with it but although it shows status code of 200 at offline mode but doesn't work.

  • serviceWorker.js
const CACHE_NAME = 'pwa-version-1';
const urlsToCache = ['index.html', 'offline.html', 'style.offline.css', '../src/style/style.offline.css'];
const self = this;

// Installation service worker
self.addEventListener('install', (e) => {
    e.waitUntil(
        caches.open(CACHE_NAME)
        .then(cache => {
            console.log('Cache Opened')
            return cache.addAll(urlsToCache)
        })
        .catch()
    )
})

// Listen for request
self.addEventListener('fetch', (e) => {
    e.respondWith(
        caches.match(e.request)
        .then(() => {
            return fetch(e.request)
                .catch(() => {
                    return caches.match('offline.html')
                })
        })
        .catch()
    )
})

Note: If I remove 'style.offline.css', '../src/style/style.offline.css' then it return fetch failed.

  • offline.html
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../src/style/offline.css">
    <title>Weather App</title>
</head>

<body>
    <div class="city">
        <h2 class="city-name">
            <span>Please go online to check the current weather.</span>
        </h2>
    </div>
</body>

</html>

offline.html not working

On setting the network to offine, it doesn't show the offline.html page. Rather its showing default browser not internet page.

open weather api changed

open weather api changed a bit know they provided all the data into 'data' field, now I have made some changes please consider

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.