-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
63 changed files
with
20,836 additions
and
1 deletion.
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,8 @@ | ||
node_modules | ||
*.log* | ||
.nuxt | ||
.nitro | ||
.cache | ||
.output | ||
.env | ||
dist |
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,3 @@ | ||
{ | ||
"nuxt.isNuxtApp": false | ||
} |
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 |
---|---|---|
@@ -1 +1,47 @@ | ||
# Nuxt3-PWA | ||
<img src="public/images/design.jpeg" /> | ||
|
||
# Nuxt PWA | ||
|
||
[![Generic badge](https://img.shields.io/badge/Nuxt-3.0.0-<COLOR>.svg)](https://shields.io/) | ||
[![Generic badge](https://img.shields.io/badge/Tailwind-6.1.3-38bdf8.svg)](https://shields.io/) | ||
|
||
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. | ||
|
||
## Setup | ||
|
||
Make sure to install the dependencies: | ||
|
||
```bash | ||
# yarn | ||
yarn install | ||
|
||
# npm | ||
npm install | ||
|
||
# pnpm | ||
pnpm install --shamefully-hoist | ||
``` | ||
|
||
## Development Server | ||
|
||
Start the development server on http://localhost:3000 | ||
|
||
```bash | ||
npm run dev | ||
``` | ||
|
||
## Production | ||
|
||
Build the application for production: | ||
|
||
```bash | ||
npm run build | ||
``` | ||
|
||
Locally preview production build: | ||
|
||
```bash | ||
npm run preview | ||
``` | ||
|
||
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. |
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,16 @@ | ||
/* | ||
* Nuxt 3 Config File | ||
* https://nuxt.com/docs/getting-started/configuration#app-configuration | ||
*/ | ||
export default defineAppConfig({ | ||
title: 'Hello Nuxt', | ||
blog:{ | ||
enabled: true, | ||
}, | ||
theme: { | ||
dark: true, | ||
colors: { | ||
primary: '#ff0000' | ||
} | ||
} | ||
}) |
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,64 @@ | ||
<template> | ||
<div> | ||
<SplashScreen :src="'/favicon.ico'" :time="1000" width="100px" /> | ||
<NuxtLoadingIndicator /> | ||
<NuxtPage /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
mounted() { | ||
this.registerServiceWorker(); | ||
}, | ||
methods: { | ||
/** | ||
* * Register the service worker | ||
* * Load the service worker file and set the scope. | ||
* ? The scope is the path where the service worker will be active. | ||
* ? The scope is relative to the domain. | ||
* ! The scope is not the same as the path to the service worker file. | ||
* TODO: Investigate if there is any usefull function to load in this function. | ||
* TODO: Export this function to a separate file ? | ||
*/ | ||
async registerServiceWorker() { | ||
// Define file and scope from root directory | ||
const scope = '.'; | ||
const workerPath = 'worker.js'; | ||
// Check if service worker is supported and register it | ||
if ('serviceWorker' in navigator) { | ||
try { | ||
/** | ||
* * Register the service worker | ||
* .register() @returns a promise with a ServiceWorkerRegistration object | ||
*/ | ||
const registration = await navigator.serviceWorker | ||
.register(workerPath, { | ||
scope: scope, | ||
}) | ||
.then((registration) => { | ||
console.log( | ||
'Service worker registration successful with scope: ', | ||
registration.scope | ||
); | ||
return registration; | ||
}); | ||
if (registration.installing) { | ||
console.log('Service worker installing'); | ||
} else if (registration.waiting) { | ||
console.log('Service worker installed'); | ||
} else if (registration.active) { | ||
console.log('Service worker active'); | ||
} | ||
} catch (error) { | ||
console.error(`Registration failed with ${error}`); | ||
} | ||
} | ||
}, | ||
}, | ||
}; | ||
</script> |
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,20 @@ | ||
# `assets/` Directory | ||
|
||
Nuxt uses **Vite** or **webpack** to build and bundle your application. The main function of these build tools is to process JavaScript files, but they can be extended through plugins (for Vite) or loaders (for webpack) to process other kind of assets, like stylesheets, fonts or SVG. This step transforms the original file mainly for performance or caching purposes (such as stylesheets minification or browser cache invalidation). | ||
|
||
By convention, Nuxt uses the `assets/` directory to store these files but there is no auto-scan functionality for this directory, and you can use any other name for it. | ||
|
||
In your application's code, you can reference a file located in the `assets/` directory by using the `~/assets/ path`. | ||
|
||
## Example | ||
|
||
For example, referencing an image file that will be processed if a build tool is configured to handle this file extension: | ||
|
||
*app.vue* | ||
````html | ||
<template> | ||
<img src="~/assets/img/nuxt.png" alt="Discover Nuxt 3" /> | ||
</template> | ||
```` | ||
|
||
>> Nuxt won't serve files in the `assets/` directory at a static URL like `/assets/my-file.png`. If you need a static URL, use the `public/` directory. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,82 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
/* | ||
* Global styles | ||
*/ | ||
|
||
body { | ||
@apply dark:bg-gray-dark bg-gray-100 min-h-screen min-w-full; | ||
} | ||
|
||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6, | ||
span { | ||
@apply dark:text-gray-100 text-gray-900 font-sf; | ||
} | ||
|
||
p, | ||
li { | ||
@apply dark:text-gray-200 text-gray-800; | ||
} | ||
|
||
/* Transition Effect (All elements) */ | ||
* { | ||
transition: all 0.25s ease-out; | ||
} | ||
|
||
/* | ||
* Body sizes | ||
*/ | ||
|
||
body { | ||
@apply max-w-5xl mx-auto; | ||
} | ||
|
||
/* Page transition effects */ | ||
.page-enter-active, | ||
.page-leave-active { | ||
transition: all 0.3s; | ||
} | ||
.page-enter-from, | ||
.page-leave-to { | ||
opacity: 0; | ||
filter: blur(1rem); | ||
} | ||
|
||
@font-face { | ||
font-family: 'San Francisco'; | ||
src: url('./fonts/san-francisco-display/SFUIDisplay-Light.ttf') | ||
format('truetype'); | ||
} | ||
|
||
@font-face { | ||
font-family: 'San Francisco Bold'; | ||
src: url('./fonts/san-francisco-display/SFUIDisplay-Bold.ttf') | ||
format('truetype'); | ||
} | ||
|
||
::-webkit-scrollbar { | ||
width: 4px; | ||
} | ||
|
||
/* Track */ | ||
::-webkit-scrollbar-track { | ||
background: #f1f1f1; | ||
} | ||
|
||
/* Handle */ | ||
::-webkit-scrollbar-thumb { | ||
background: #888; | ||
border-radius: 5px; | ||
} | ||
|
||
/* Handle on hover */ | ||
::-webkit-scrollbar-thumb:hover { | ||
background: #555; | ||
} |
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,26 @@ | ||
<template> | ||
<footer class="w-full fixed bottom-0 border-t border-1 border-dashed p-5 dark:border-gray-600"> | ||
<div class="flex max-w-7xl mx-auto justify-between items-center"> | ||
|
||
<p>© alexrueda 2022</p> | ||
|
||
<div id="social" class="flex items-center dark:text-gray-200 text-gray-700"> | ||
<NuxtLink> | ||
<Icon name="uil:github-alt" class="w-5 h-5 m-2" /> | ||
</NuxtLink> | ||
<NuxtLink> | ||
<Icon name="uil:twitter" class="w-6 h-6 m-2" /> | ||
</NuxtLink> | ||
<NuxtLink> | ||
<Icon name="mingcute:discord-fill" class="w-6 h-6 m-2" /> | ||
</NuxtLink> | ||
<NuxtLink> | ||
<Icon name="mingcute:tiktok-fill" class="w-6 h-6 m-2" /> | ||
</NuxtLink> | ||
<NuxtLink> | ||
<Icon name="mingcute:linkedin-fill" class="w-6 h-6 m-2" /> | ||
</NuxtLink> | ||
</div> | ||
</div> | ||
</footer> | ||
</template> |
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,43 @@ | ||
<template> | ||
<header class="fixed w-full top-0 z-10 backdrop-blur-md"> | ||
<nav class="max-w-7xl mx-auto flex p-5 justify-between"> | ||
<div class="flex"> | ||
<NuxtLink to="/"> | ||
<img src="/logo.png" alt="" class="w-10 h-10"> | ||
</NuxtLink> | ||
|
||
<ul class="hidden lg:flex space-x-5 items-center pl-5 "> | ||
<li><NuxtLink class="hover:text-white" to="/about">About this app</NuxtLink></li> | ||
<!-- <li><NuxtLink to="/blog">Blog</NuxtLink></li> --> | ||
</ul> | ||
</div> | ||
<Switch class="hidden lg:flex"/> | ||
<!-- Burger icon --> | ||
<NuxtLink @click="toggleMobileMenu()" class="flex lg:hidden hover:cursor-pointer"> | ||
<Icon name="mingcute:menu-line" class="text-gray-200 w-6 h-6 m-2" /> | ||
</NuxtLink> | ||
|
||
</nav> | ||
|
||
<MobileMenu class="hidden mobile-menu" /> | ||
|
||
</header> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
methods: { | ||
toggleMobileMenu(){ | ||
// Toggle mobile menu | ||
document.querySelector('.mobile-menu').classList.toggle('hidden') | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
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,16 @@ | ||
<template> | ||
<div class="w-full h-52 bg-slate-500"> | ||
<NuxtLink to="/">Home</NuxtLink> | ||
<NuxtLink to="/about">About</NuxtLink> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
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,24 @@ | ||
# `components/` [Directory](https://nuxt.com/docs/getting-started/views#components) | ||
|
||
Most components are reusable pieces of the user interface, like buttons and menus. In Nuxt, you can create these components in the `components/` directory, and they will be automatically available across your application without having to explicitly import them. | ||
|
||
*app.vue* | ||
````html | ||
<template> | ||
<div> | ||
<h1>Welcome to the homepage</h1> | ||
<AppAlert> | ||
This is an auto-imported component. | ||
</AppAlert> | ||
</div> | ||
</template> | ||
```` | ||
|
||
*components/AppAlert.vue* | ||
````html | ||
<template> | ||
<span> | ||
<slot /> | ||
</span> | ||
</template> | ||
```` |
Oops, something went wrong.