Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflow updates; parameter changes #13

Merged
merged 1 commit into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ jobs:
&& git clone https://github.com/calcit-lang/memof.git
&& git clone https://github.com/Respo/respo.calcit.git
&& git clone https://github.com/Respo/respo-ui.calcit.git
&& git clone https://github.com/Quamolit/phlox.calcit.git
&& git clone https://github.com/Phlox-GL/phlox.git
&& git clone https://github.com/Quatrefoil-GL/touch-control.git

- name: "compiles to js"
run: >
Expand Down
2 changes: 2 additions & 0 deletions assets/main.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

@import url(@quamolit/touch-control/style/touch-control.css);

body {
margin: 0;
overscroll-behavior-y: none;
Expand Down
98 changes: 62 additions & 36 deletions calcit.cirru

Large diffs are not rendered by default.

35 changes: 21 additions & 14 deletions compact.cirru
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

{} (:package |app)
:configs $ {} (:init-fn |app.main/main!) (:reload-fn |app.main/reload!)
:modules $ [] |memof/ |lilac/ |respo.calcit/ |respo-ui.calcit/ |phlox.calcit/
:modules $ [] |memof/ |lilac/ |respo.calcit/ |respo-ui.calcit/ |phlox/ |touch-control/
:version nil
:entries $ {}
:files $ {}
|app.schema $ {}
:ns $ quote (ns app.schema)
Expand Down Expand Up @@ -30,9 +31,9 @@
true $ let
x $ js/Math.random
cond
and (> x 0.1) (< x 0.17)
and (> x 0.1) (< x 0.15)
not cell
(and (> x 0.3) (< x 0.39))
(and (> x 0.3) (< x 0.4))
, false
(and (> x 0.5) (< x 0.52))
, true
Expand Down Expand Up @@ -139,33 +140,33 @@
(fn (xs) (&list:concat & xs))
map-indexed $ fn (idx x) ([] idx x)
container
{} $ :position ([] 440 -260)
{} $ :position ([] -400 -360)
rect
{}
:position $ [] 0 0
:size $ [] 48 34
:fill $ hslx 40 80 80
:on $ {}
:pointerdown $ fn (e d!) (on-reset d!)
text $ {} (:text "\"Run!")
text $ {} (:text "\"!")
:position $ [] 8 4
:style $ {}
:fill $ hslx 120 80 20
:font-size 18
:font-family "\"Josefin Sans"
if (:win? store)
container
{} $ :position ([] 60 -80)
{} $ :position ([] 400 280)
rect $ {}
:position $ [] 0 0
:size $ [] 460 130
:size $ [] 230 60
:fill $ hslx 300 20 30
:alpha 0.8
text $ {} (:text "\"Take a rest.")
:position $ [] 20 0
:style $ {}
:fill $ hslx 30 90 100
:font-size 96
:font-size 48
:font-family "\"Josefin Sans"
|gap $ quote
def gap $ / 1 15
Expand All @@ -184,7 +185,7 @@
and
> xi $ - x 4
> yi $ - y 4
, true $ > (js/Math.random) 0.48
, true $ > (js/Math.random) 0.64
d! :reset $ {} (:x x) (:y y)
:grids $ assoc-in grids ([] 0 0) 1
|on-touch $ quote
Expand All @@ -210,28 +211,33 @@
|app.main $ {}
:ns $ quote
ns app.main $ :require ([] "\"pixi.js" :as PIXI)
[] phlox.core :refer $ [] render! clear-phlox-caches!
[] phlox.core :refer $ [] render! clear-phlox-caches! on-control-event
[] app.container :refer $ [] comp-container
[] app.schema :as schema
[] "\"shortid" :as shortid
[] "\"nanoid" :refer $ nanoid
[] app.updater :refer $ [] updater
[] "\"fontfaceobserver-es" :default FontFaceObserver
[] app.config :refer $ [] dev?
"\"./calcit.build-errors" :default build-errors
"\"bottom-tip" :default hud!
touch-control.core :refer $ render-control! start-control-loop! replace-control-loop!
:defs $ {}
|render-app! $ quote
defn render-app! () $ render! (comp-container @*store) dispatch! ({})
|start-undulating! $ quote
defn start-undulating! () (dispatch! :undulate nil)
js/setTimeout
fn () $ start-undulating!
* 6000 $ js/Math.pow (js/Math.random) 5
* 6000 $ js/Math.pow
+ 0.02 $ js/Math.random
, 5
|main! $ quote
defn main! () (; js/console.log PIXI)
-> global-fonts $ .then
-> global-fonts $ .!then
fn (e) (render-app!)
add-watch *store :change $ fn (s p) (render-app!)
render-control!
start-control-loop! 8 on-control-event
start-undulating!
println "\"App Started"
|*store $ quote (defatom *store schema/store)
Expand All @@ -244,7 +250,7 @@
defn dispatch! (op op-data)
when dev? $ println "\"dispatch!" op op-data
let
op-id $ shortid/generate
op-id $ nanoid
op-time $ js/Date.now
new-store $ updater @*store op op-data op-id op-time
when (not= @*store new-store) (reset! *store new-store)
Expand All @@ -253,6 +259,7 @@
do (println "\"Code updated.") (clear-phlox-caches!) (remove-watch *store :change)
add-watch *store :change $ fn (store prev) (render-app!)
render-app!
replace-control-loop! 8 on-control-event
hud! "\"ok~" "\"Ok"
hud! "\"error" build-errors
|app.page $ {}
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<head>

<title>Pixel Way</title>
<link href="https://cdn.tiye.me/logo/quamolist.png" rel="icon" type="image/png" />
<link href="https://cdn.tiye.me/logo/quamolit.png" rel="icon" type="image/png" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>

Expand All @@ -18,7 +18,7 @@
<body>

<div class="app" ></div>
<script type="module" src="./main.js" ></script>
<script type="module" src="./main.mjs" ></script>

</body>

Expand Down
10 changes: 0 additions & 10 deletions main.js

This file was deleted.

10 changes: 10 additions & 0 deletions main.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

import { main_$x_ } from "./js-out/app.main.mjs"

main_$x_()

if (import.meta.hot) {
import.meta.hot.accept('./js-out/app.main.mjs', (main) => {
main.reload_$x_()
})
}
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@
"author": "jiyinyiyong",
"license": "MIT",
"devDependencies": {
"vite": "^2.5.10"
"vite": "^2.9.4"
},
"dependencies": {
"@calcit/procs": "^0.4.36",
"@quamolit/phlox-utils": "^0.0.1",
"bottom-tip": "^0.1.2",
"@calcit/procs": "^0.5.30",
"@quamolit/phlox-utils": "^0.0.2",
"@quamolit/touch-control": "^0.0.8",
"bottom-tip": "^0.1.3",
"fontfaceobserver-es": "^3.3.3",
"pixi.js": "6.1.3",
"nanoid": "^3.3.2",
"pixi.js": "6.3.0",
"shortid": "^2.2.16"
}
}
Loading