Skip to content

Commit

Permalink
working
Browse files Browse the repository at this point in the history
  • Loading branch information
bpd01001 committed Sep 24, 2024
1 parent dce9382 commit d1cc9ed
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 182 deletions.
62 changes: 2 additions & 60 deletions css/styles.css
Original file line number Diff line number Diff line change
@@ -1,62 +1,4 @@
body {
margin: 0;
background-color: lightblue;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
ion-toolbar {
--ion-background-color: aliceblue;
}

.home-page {
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}

.about-page {
min-height: 100vh;
display: grid;
grid-template-columns: auto auto;
align-items: center;
justify-items: center;
gap: 1em;
}

.about-page img {
max-width: 50%;
display: inline-block;
text-align: center;
transform: scale(1);
transition: transform 0.5s;
}

.about-page img:hover {
transform: scale(1.5);
}

.home-page ul {
margin: 0;
padding: 0;
width: 75%;
background-color: white;
list-style-type: none;
text-align: center;
}

.home-page li {
border-bottom: 1px solid lightblue;
}

li a {
display: block;
padding: 1em 0;
font-size: 2em;
background-color: darkslateblue;
color: white;
text-decoration: none;
}

li a:hover {
color: darkslateblue;
background-color: white;
transition: all 0.5s;
}
23 changes: 0 additions & 23 deletions gallery.html

This file was deleted.

204 changes: 105 additions & 99 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,109 +1,115 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Home | Offline First Demo</title>

<link rel="stylesheet" type="text/css" href="https://cdn.skypack.dev/@ionic/core@next/css/core.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.skypack.dev/@ionic/core@next/css/ionic.bundle.css" />
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.esm.js"></script>
<script nomodule src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.js"></script>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js');
}
</script>
<link rel="stylesheet" href="css/styles.css" />
</head>
<body class="home-page">

<ion-app>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="gallery.html">Photo Gallery</a></li>
</ul>
<ion-tabs>
<ion-tab tab="home">
<div id="home-page">
<ion-header>
<ion-toolbar>
<ion-title>Listen now</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<div class="example-content">Listen now content</div>
</ion-content>
</div>
</ion-tab>
<ion-tab tab="radio">
<div id="radio-page">
<ion-header>
<ion-toolbar>
<ion-title>Radio</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<div class="example-content">Radio content</div>
</ion-content>
</div>
</ion-tab>
<ion-tab tab="library">
<div id="library-page">
<ion-header>
<ion-toolbar>
<ion-title>Library</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<div class="example-content">Library content</div>
</ion-content>
</div>
</ion-tab>
<ion-tab tab="search">
<div id="search-page">

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Home | Offline First Demo</title>

<link rel="stylesheet" type="text/css" href="https://cdn.skypack.dev/@ionic/core@next/css/core.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.skypack.dev/@ionic/core@next/css/ionic.bundle.css" />
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.esm.js"></script>
<script nomodule src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.js"></script>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('sw.js');
}
</script>
<link rel="stylesheet" href="css/styles.css" />
</head>

<body class="home-page">

<ion-app>

<div class="ion-page" id="main-content">
<ion-header>
<ion-toolbar>
<ion-title>Search</ion-title>
<ion-buttons slot="start">
<ion-menu-button></ion-menu-button>
</ion-buttons>
<ion-title>Photo Gallery</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<div class="example-content">Search content</div>

<ion-card class="ion-margin">
<img alt="Antelope" src="images/antelope.jpg" />
<ion-card-content>
Antelope
</ion-card-content>
</ion-card>

<ion-card class="ion-margin">
<img alt="Bobcat" src="images/bobcat.jpg" />
<ion-card-content>
Bobcat
</ion-card-content>


</ion-card>

<ion-card class="ion-margin">
<img alt="Caracal" src="images/caracal.jpg" />
<ion-card-content>
Caracal
</ion-card-content>
</ion-card>

<ion-card class="ion-margin">
<img alt="Caribou" src="images/caribou-bulls.jpg" />
<ion-card-content>
Caribou Bulls
</ion-card-content>
</ion-card>

<ion-card class="ion-margin">
<img alt="Caribou" src="images/caribou.jpg" />
<ion-card-content>
Caribou
</ion-card-content>
</ion-card>

<ion-card class="ion-margin">
<img alt="Cheetah" src="images/cheetah.jpg" />
<ion-card-content>
Cheetah
</ion-card-content>
</ion-card>

<ion-card class="ion-margin">
<img alt="Coyote" src="images/coyote.jpg" />
<ion-card-content>
Coyote
</ion-card-content>
</ion-card>

<ion-card class="ion-margin">
<img alt="Ferrets" src="images/ferrets.jpg" />
<ion-card-content>
Ferrets
</ion-card-content>
</ion-card>

<ion-card class="ion-margin">
<img alt="Ox" src="images/ox.jpg" />
<ion-card-content>
Ox
</ion-card-content>
</ion-card>

<ion-card class="ion-margin">
<img alt="Coyote" src="images/tiger.jpg" />
<ion-card-content>
Tiger
</ion-card-content>
</ion-card>

</ion-content>
</div>
</ion-tab>

<ion-tab-bar slot="bottom">
<ion-tab-button tab="home">
<ion-icon name="play-circle"></ion-icon>
Listen Now
</ion-tab-button>
<ion-tab-button tab="radio">
<ion-icon name="radio"></ion-icon>
Radio
</ion-tab-button>
<ion-tab-button tab="library">
<ion-icon name="library"></ion-icon>
Library
</ion-tab-button>
<ion-tab-button tab="search">
<ion-icon name="search"></ion-icon>
Search
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>

<style>
/* This style is for demonstration purposes only. */
/* It's not required for the tabs to function. */
.example-content {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
</style>
</ion-app>
</body>

</ion-app>
</body>

</html>
28 changes: 28 additions & 0 deletions sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Name of our cache
const cacheName = 'offline-pwa-gallery-v1';

const urlsToCache = [

];

// Cache files on service worker registration
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(cacheName).then((cache) => {
return cache.addAll(urlsToCache);
})
);
});

// Intercept fetch requests to serve cached assets
self.addEventListener('fetch', (event) => {
if(event.request.url.match(/^https:\/\//)){
console.log('Browser is requesting', event.request.url);
}
event.respondWith(
caches.match(event.request).then((cachedResponse) => {
// It can update the cache to serve updated content on the next request
return cachedResponse || fetch(event.request);
})
);
});

0 comments on commit d1cc9ed

Please sign in to comment.