Giter VIP home page Giter VIP logo

okokphone_custom_app's Introduction

okokPhone Custom App Development

Welcome, here you can find templates that you can use to build your Custom Apps for okokPhone.

At this moment, it doesn't contain all the functions, this is a work in progress, so it's a good idea to keep an eye on it ๐Ÿค“

Todo List

  • React Template
  • Add Remaining Functions

Workflow

Developing custom apps can be a smooth process.

These templates are built in a way that allows you to hot reload your app without needing to restart the okokPhone.

The Document Variable will be injected with a few properties.

console.log(document.okokPhone); // See all the injected properties

document.okokPhone.appId; // Your app's id, defined in init.lua
document.okokPhone.resourceName; // An alternative to window.GetParentResourceName() since it doesn't exist inside the app container

// Used in utils.js
// Calling these functions directly is not recommended
// Use the wrapped functions inside utils.js
document.okokPhone.notifyIsland(data);

New Events

// Handle Dark Mode Toggle
document.addEventListener("darkMode", (e) => {
  const isDark = e.detail;
  if (isDark) {
    console.log("Dark Mode is enabled");
  } else {
    console.log("Dark Mode is disabled");
  }
});

document.addEventListener("loadedPhoneFunctions", () => {
  console.log("props", document.okokPhone);
});

Customizing your app information

Open init.lua and change the app info

local appInfo      = {
      id = "customapp", -- Your app id (keep it short, the user won't see it)
      label = "Custom App Name", -- Your app display name
      description = "Your app store description",
      custom = true, --โŒ Don't touch this
      icon = logoPath, --โŒ You Don't need to touch this
      previewImagesCount = 3, -- Depends on the number of images present on web/app-store
      notifications = true, --โŒ Don't touch this
      resourceName = resourceName, --โŒ Don't touch this
      webUrl = webUrl, -- โŒ Don't touch this
}

Changing the app logo

  • Open web folder
  • Replace icon.png

Templates

Vanilla JS

This is a very basic template for those of you that don't use any framework.

You can copy the functions and use it however you like, I added JSDoc types so you can enjoy type safety.

It contains tailwind cdn and a list of functions found on web/assets/utils.js.

You can just open app.html in your browser and start developing your app inside the development container like any other project.

Please don't delete the style.css if you don't know what you are doing. Read the comments.

okokphone_custom_app's People

Contributors

luxu-gg avatar

Stargazers

 avatar

Watchers

 avatar

okokphone_custom_app's Issues

Custom app doesn't work.

So the issue all comes down to the fact in the original okokPhone script the cfx url is hardcoded (or atleast seems to be hardcoded) to be "https://cfx-nui-custom_app/web/app.html" No matter what I change in the resource. It does work if the resource is called custom_app obviously

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.