An interactive story framework.

Overview

Tale-js

Tale-js is an interactive story maker, that allows you to write a story using JavaScript logic controls.

There are a few requirements:

// For formatting purposes
<script src="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/12.3.0/markdown-it.min.js" integrity="sha512-q1tclxbgrDhFhGp/i9mnxITl2FQ3TCfwNj0mZ1r2USwj9WNXBpQ1au4HOBdAq8LXXWFIcsW+5dsdFHyVdk10AQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/styles/default.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/highlight.min.js"></script>

//include Tale
<script src = "tale.js"></script>

//Load your book file
load_book("book.json")

Documentation

Tale-js interacts with 2 page elements, an element which displays your text (markdown formatted) called #page, and the body background image (to set chapter themes).

Formatting

Tale-js books are in JSON, with a key for each chapter/location. JSON does not allow multi-lined strings. Your JavaScript will have to be minified into a single string.

The start of the book is called index. That's where Tale-js will begin when first opening your book file.

functions

Tale-js uses several short functions to for ease of use.

Printing

Printing to the #page element is quite simple. All you do is use the .out() method on your string. Your string is processed for markdown, before being shown to the user.

Input

Ask the user questions with input(value, placeholder). Answers provided by your users are stored in localStorage under the value you've provided.

Background

Tale-js lets you set the mood for a certain chapter by changing the body background of the page you're on via background(url).

Clear

clear() clears all text in the #page element.

Goto

You may change pages at any time with the goto(page) function. Just make sure your book actually contains the page.

Storage

Tale-js offers direct access to storage with short functions: get and set

Set

set(key, value) sets a key in localstorage to the given value.

Get

get(key) returns said value.

You might also like...

curtains.js is a lightweight vanilla WebGL javascript library that turns HTML DOM elements into interactive textured planes.

curtains.js is a lightweight vanilla WebGL javascript library that turns HTML DOM elements into interactive textured planes.

What is it ? Shaders are the new front-end web developpment big thing, with the ability to create very powerful 3D interactions and animations. A lot

Jan 1, 2023

Interactive, accessible toggle switches for the web.

On-Off Toggle Switch Interactive, accessible toggle switches for the web Transform checkboxes into toggle switches. Toggle switches made for the web a

Sep 9, 2022

Interactive 3D plotting with a simple function call using Three.js

Interactive 3D plotting with a simple function call using Three.js

About Generate interactive 3d plots with a simple function call. Function returns a Three.js scene which can be customized as needed. Basic function c

Oct 20, 2022

Look up a city and get back weather forecast for searched city and top News headline related to that city and an interactive map which shows the location of that city.

Look up a city and get back weather forecast for searched city and top News headline related to that city and an interactive map which shows the location of that city.

WeatheredVibes Description As a user I want to look up a city to get the current weather and suggested current news articles based on the location sea

Mar 12, 2022

An interactive encyclopedia of Pokémon.

An interactive encyclopedia of Pokémon.

Pokédex An interactive encyclopedia encompassing data on the various mythical creatures found throughout the world of the universally-loved, multimedi

Dec 9, 2022

Non-interactive publicly verifiable distributed key generation and resharing algorithm over BLS12-381

NPVDKG-RS This repository contains a mathematical presentation and some code to demonstrate our developed non-interactive publicly verifiable distribu

May 19, 2022

An interactive app that allows adding, editing and removing tasks of a to-do list. Drag-and-drop featured added. Webpack was used to bundle all the Js modules in to one main Js file.

An interactive app that allows adding, editing and removing tasks of a to-do list. Drag-and-drop featured added. Webpack was used to bundle all the Js modules in to one main Js file.

To-do List A to-do list app This app let you to set your own to-do list. Built With HTML CSS JavaScript WebPack Jest Live Page Page Link Getting Start

May 5, 2022

Interactive visualiser 🌠 for a 3D raymarching engine written in GLSL and computed in a fragment shader on the 2D Plane.

Getting Started Node version used : 16.13.1 First install dependencies with: npm install # or yarn install Then, run the development server: npm run d

Nov 12, 2022

A CLI tool to embed interactive PUML diagrams to your github markdown files.

puml-for-markdown Simple CLI Usage Just run puml-for-markdown in any directory where you have markdown files and it will render links to PlantUML file

Jan 3, 2023
Owner
Jesse
Jesse
Story Show Gallery - JS & React - minimalist, vertical photo gallery, mobile friendly

Vertical photo gallery optimized for smartphones (notch area included). SSG will support your brand and marketing. Optimally placed captions, full screen lightbox, no ugly arrows

Roman Flössler 21 Oct 4, 2022
Storybook Addon Root Attributes to switch html, body or some element attributes (multiple) at runtime for you story

Storybook Addon Root Attributes What is this This project was inspired by le0pard/storybook-addon-root-attribute The existing library received only on

정현수 5 Sep 6, 2022
:fireworks:Interactive Online Platform that Visualizes Algorithms from Code

Algorithm Visualizer Algorithm Visualizer is an interactive online platform that visualizes algorithms from code. Learning an algorithm gets much easi

Algorithm Visualizer 42k Jan 4, 2023
An interactive git visualization and tutorial. Aspiring students of git can use this app to educate and challenge themselves towards mastery of git!

LearnGitBranching LearnGitBranching is a git repository visualizer, sandbox, and a series of educational tutorials and challenges. Its primary purpose

Peter Cottle 26.4k Jan 3, 2023
A pretty cool org-mode -> interactive blog post tool

Radish A kinda-cool org-mode -> interactive blog post tool written with and for Clojure(script). Here are two example posts created with this tool: Ra

adam-james 46 Dec 28, 2021
A simple interactive web page for your Gantt Chart (build with Vue.js)

Web Gantt A simple interactive web page for your Gantt Chart (build with Vue.js) No dependency required, no command line, just download the repo and l

Julie Blanc 4 Mar 22, 2022
Jaxit is an easy-to-use library that makes an interactive terminal for your programs.

Jaxit Jaxit is an easy-to-use library that makes an interactive terminal for your programs. Jaxit was made by Codeverse, so check on Codeverse's Profi

null 3 Dec 11, 2022
Diagram-maker - A library to display an interactive editor for any graph-like data.

Diagram Maker Diagram Maker is a library to display an interactive editor for any graph-like data. Following is a screenshot from one of the consumers

Amazon Web Services - Labs 2.3k Dec 27, 2022
a lightweight, dependency-free JavaScript plugin which makes a HTML table interactive

JSTable The JSTable is a lightweight, dependency-free JavaScript plugin which makes a HTML table interactive. The plugin is similar to the jQuery data

null 63 Oct 20, 2022
Quickly create an interactive HTML mock-up by auto sourcing lorem ipsum/images generators, with minimal html markup, and no server side code

RoughDraft.js v0.1.5 Quickly mockup / prototype HTML pages with auto-generated content, without additional JavaScript or server side code. <section>

Nick Dreckshage 464 Dec 21, 2022