Self-hosted, federated location sharing app and server that prioritizes user privacy and security
end-to-end-encryption location-sharing privacy self-hosted federated

Added a settings page with Signout and Back to home

kishka.cc fc7030f4 3e39672b

verified
Changed files
+21 -24
app
src
home-page
settings-page
utils
-5
app/src/home-page/home.css
··· 6 6 justify-content: center; 7 7 } 8 8 9 - .dark-theme { 10 - background: #000; 11 - color: #fff; 12 - } 13 - 14 9 .app { 15 10 width: 100%; 16 11 background: #f9fafb;
-2
app/src/home-page/home.html
··· 91 91 > 92 92 <p>New signup key: <a x-text="newSignupKey"></a></p> 93 93 </div> 94 - <br /> 95 - <button @click="toggleDarkMode()">Toggle Dark Mode</button> 96 94 </div> 97 95 </div> 98 96 </div>
-16
app/src/home-page/home.ts
··· 1 1 import Alpine from "alpinejs"; 2 2 import { Store } from "../utils/store.ts"; 3 3 import { post } from "../utils/api.ts"; 4 - import { toggleStyle } from "../utils/tools.ts"; 5 4 6 5 Alpine.data("homePageState", () => ({ 7 6 friends: [ ··· 44 43 goto(newLocation: string) { 45 44 window.location.href = 46 45 "/src/" + newLocation + "-page/" + newLocation + ".html"; 47 - }, 48 - 49 - toggleDarkMode() { 50 - /* 51 - This toggles darkmode for 'body' in the css file | use for only document types 52 - document.body.classList.toggle("dark-theme"); 53 - 54 - this toggles darkmode for '.app' in the css file | use if it isn't a document type 55 - toggleStyle("app", "dark-theme"); 56 - 57 - */ 58 - 59 - document.body.classList.toggle("dark-theme"); 60 - toggleStyle("header", "dark-theme"); 61 - toggleStyle([".app", ".friend-card", ".content"], "dark-theme"); 62 46 }, 63 47 })); 64 48
+1 -1
app/src/settings-page/settings.html
··· 18 18 </button> 19 19 20 20 <button class="btn-secondary" @click="resetStore()"> 21 - Reset Store & go to Sign Up 21 + Signout 22 22 </button> 23 23 </div> 24 24 </div>
+20
app/src/utils/tools.ts
··· 3 3 "/src/" + newLocation + "-page/" + newLocation + ".html"; 4 4 } 5 5 6 + /* 7 + 8 + Use this type of function to toggle dark mode. It CAN be modified to your needs. copy the function, and fix the end comment(be sure to put this in the alpine section) 9 + 10 + toggleDarkMode() { 11 + /* 12 + This toggles darkmode for 'body' in the css file | use for only document types 13 + document.body.classList.toggle("dark-theme"); 14 + 15 + this toggles darkmode for '.app' in the css file | use if it isn't a document type 16 + toggleStyle("app", "dark-theme"); 17 + 18 + * / 19 + 20 + document.body.classList.toggle("dark-theme"); 21 + toggleStyle("header", "dark-theme"); 22 + toggleStyle([".app", ".friend-card", ".content"], "dark-theme"); 23 + }, 24 + */ 25 + 6 26 export function toggleStyle(classNames: string | string[], newClass: string) { 7 27 if (typeof classNames === "string") { 8 28 for (