A simple and user-friendly Svelte app designed to prevent your device from sleeping. The NoSleep app uses the Wake Lock API to keep the screen awake, with notifications to alert users if the wake lock is released due to system constraints. Built with Svelte and TailwindCSS, it offers a smooth, responsive experience with dark mode support.
Check out the live demo here: NoSleep Svelte App Demo
Clone the Repository:
git clone https://github.com/CodeskStudio/nosleep-svelte-app.git
cd nosleep-svelte-app
Install Dependencies:
npm install
Run the App:
npm run dev
Open http://localhost:5173 to view the app in your browser.
Follow these steps to build and deploy this Svelte + Vite application.
Configure the Base Path (if needed)
If your app will be hosted on a subpath (e.g., https://example.com/myapp/
), update the base
property in vite.config.js
:
// vite.config.js
import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
export default defineConfig({
plugins: [svelte()],
base: '/myapp/' // Replace '/myapp/' with your subpath or '/' if hosting at root
});
If hosting at the root (e.g., https://example.com/
), you can skip this step.
Build the Project
Run the following command to build the app:
npm run build
This will generate an optimized, production-ready version of your app in a folder called dist
.
nosleep-svelte-app/
βββ public/
β βββ favicon.ico
β βββ site.webmanifest
βββ src/
β βββ components/
β β βββ Footer.svelte
β β βββ NotificationButton.svelte
β β βββ Popup.svelte
β β βββ WakeLockButton.svelte
β βββ App.svelte
β βββ index.css
β βββ main.js
βββ .gitignore
βββ index.html
βββ package.json
βββ svelte.config.js
βββ tailwind.config.js
βββ vite.config.js
git checkout -b feature-branch-name
.git commit -m 'Add some feature'
.git push origin feature-branch-name
.This project is licensed under the MIT License.
Special thanks to all contributors aka. ChatGPT and to Svelte & TailwindCSS for making development straightforward and enjoyable!