Skip to content

Commit

Permalink
Added editor page in slide
Browse files Browse the repository at this point in the history
  • Loading branch information
Arpita-Jaiswal committed Nov 27, 2023
1 parent 15a48b9 commit a7db536
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 0 deletions.
50 changes: 50 additions & 0 deletions slides/editor.ftd
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
-- import: fifthtry.github.io/ui/slides/ui/login
-- import: fifthtry.github.io/ui/slides/ui/common



-- slide-ds.page:

-- slide-ds.project-slide: Slide Project
slide-list: $common.slide-lists
all-comments: $common.all-comments
$current-slide if { current-slide.preview_url != NULL }: $current-slide
$thumbnails: $thumbnails
id: 1
order: 1

-- end: slide-ds.page






-- slide-ds.slide $current-slide:
code: *$sample-initial-code
preview_url: https://fastn.com


-- string list $thumbnails:

-- string: *$assets.files.slides.ui.assets.template-1.png.light
-- string: *$assets.files.slides.ui.assets.template-2.png.light

-- end: $thumbnails



-- string $sample-initial-code:

\-- import: fastn-slide/settings
exposing: slide

\-- slide: This is sample title
subtitle: This is subtitle

\;; ---------- << ADD your slide content here >> --------------

\-- ftd.text: This is sample text
color: white

\-- end: slide
1 change: 1 addition & 0 deletions slides/index.ftd
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
- [Login](slides/login/)
- [Present](slides/present/)
- [All Templates](slides/all-templates/)
- [Editor](slides/editor/)

-- end: ds.page
112 changes: 112 additions & 0 deletions slides/ui/editor.ftd
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
-- import: slides.fifthtry.com/assets
-- import: fastn/processors as pr

-- integer order:
$processor$: pr.request-data

-- integer id:
$processor$: pr.request-data

-- boolean $is-loaded: false

-- string list $thumbnails:

-- string slide-url: $construct-slide-url(id = $id, order = $order)

;; Todo: We can't make this optional because it makes this of mutable type
;; instead of RecordInstance
-- ds.slide $current-slide:
code: *$sample-initial-code
preview_url: https://fastn.com



-- ds.page:

-- loader-component:
url: $slide-url

-- ftd.text: Loading ...
if: { !is-loaded }
color: $inherited.colors.text-strong
role: $inherited.types.heading-medium
align-self: center
margin-top.percent: 20

-- ds.project-slide: Slide Project
if: { is-loaded }
slide-list: $common.slide-lists
all-comments: $common.all-comments
$current-slide if { current-slide.preview_url != NULL }: $current-slide
$thumbnails: $thumbnails
id: $id
order: $order

-- end: ds.page















;; --------------------- FUNCTIONS + WEB COMPONENTS ---------------------------
-- string construct-slide-url(id,order):
integer id:
integer order:

"slide/" + id + "/" + order + "/"





-- web-component loader-component:
string url:
js: $assets.files.slides.ui.loader-component.js








;; Todo: If we pass mutable to a function then the function get converted into
;; fastn.formula and it add function as the closure to that mutable, so when
;; this formula is called, it calls mutable.set which again call the formula and
;; which calls the mutable.set and it goes on and on
;;
;; -- string value: $func($a = $s, v = hello)
;; -- string func(a,v):
;; string $a:
;; string v:
;;
;; a = a + "world";
;; v + "r"
;; ;; a.set -> func -> a.set -> func

;; ---------------------- SAMPLE CODE --------------------------------

-- string $sample-initial-code:

\-- import: fastn-slide/settings
exposing: slide

\-- slide: This is sample title
subtitle: This is subtitle

\;; ---------- << ADD your slide content here >> --------------

\-- ftd.text: This is sample text
color: white

\-- end: slide

0 comments on commit a7db536

Please sign in to comment.