-
Notifications
You must be signed in to change notification settings - Fork 3
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
9 changed files
with
247 additions
and
45 deletions.
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
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,15 @@ | ||
# Build | ||
build/ | ||
*.apk | ||
*.exe | ||
|
||
# Android | ||
.gradle/ | ||
.idea/ | ||
|
||
# Logs | ||
*.log | ||
*.lg | ||
|
||
# Db | ||
*.db |
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,10 @@ | ||
# test | ||
### made with HappyX Native with ❤ | ||
|
||
## Get Started 👨🔬 | ||
|
||
Main frontend file is `/assets/main.nim`. It compiles into JS. | ||
This files includes into `/assets/index.html`. | ||
|
||
Main file is `app.nim`. It compiles into C/C++. | ||
|
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,11 @@ | ||
# Main native file | ||
import happyx_native | ||
|
||
|
||
callback: | ||
# HappyX Native helloWorld callback | ||
proc helloWorld() = | ||
echo "Hello from Nim" | ||
|
||
|
||
nativeApp("/assets", resizeable = false, title = "test") |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,10 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>test</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script src="main.js"></script> | ||
</body> | ||
</html> |
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,62 @@ | ||
import | ||
happyx, | ||
jsffi | ||
|
||
|
||
# Object for working with HappyX Native | ||
var hpxNative {.importc, nodecl.}: JsObject | ||
|
||
var x = remember 0 | ||
|
||
|
||
appRoutes "app": | ||
"/": | ||
tDiv(class = "container"): | ||
tH1: | ||
"test" | ||
tDiv(class = "content"): | ||
"x is {x}" | ||
tButton: | ||
"increase" | ||
@click: | ||
# Call HappyX Native callback named helloWorld without arguments | ||
hpxNative.callNim("helloWorld") | ||
x->inc() | ||
tStyle: """ | ||
body { | ||
padding: 0; | ||
margin: 0; | ||
} | ||
.container { | ||
color: #efefef; | ||
width: 100vw; | ||
height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
background-color: #0A0A0A; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
.content { | ||
gap: .2rem; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
button { | ||
padding: .4rem 1.2rem; | ||
font-weight: bold; | ||
transition: all; | ||
border: none; | ||
border-radius: 8px; | ||
transition-duration: .3s; | ||
background-color: #ecf; | ||
} | ||
button:hover { | ||
background-color: #cbe; | ||
} | ||
button:active { | ||
background-color: #bad; | ||
} | ||
""" |
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,9 @@ | ||
# HappyX Native config file | ||
[Main] | ||
name = r"test" | ||
kind = r"SPA" | ||
androidSdk = r"C:\Users\79833\AppData\Local\Android\Sdk" | ||
androidPackage = r"com.hapticx.tmpl" | ||
appDirectory = r"/assets" | ||
version = 1.0.0 | ||
port = 5123 # uses in android build |