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

Overview

RoughDraft.js v0.1.5

Quickly mockup / prototype HTML pages with auto-generated content, without additional JavaScript or server side code.

<section>
  <div data-draft-repeat="30">
    <img data-draft-image="300/300" />
    <div>
      <p data-draft-text="1/s"></p>
      <span data-draft-user="first"></span>
      <span data-draft-user="state"></span>
      <i data-draft-date="F-r"></i>
      <button class="btn" data-draft-number="$/2-3"></button>
    </div>
  </div>
</section>

LIVE DEMO OF THE ABOVE

See API below for more details.

Installation

Important: Depends on jQuery. Must be loaded after.

######Steps:

  1. Download RoughDraft.js or install via Bower

    bower install --save-dev roughdraft.js
  2. Create a new mockup

    <head>
      <script src="/bower_components/jquery/jquery.min.js"></script>
      <script src="/bower_components/roughdraft/roughdraft.min.js"></script>
    </head>
    <body>
    
      <!-- Your HTML Goes Here! -->
    
      <script>
        $(function(){
          $(window).roughDraft();
        });
      </script>
    </body>

Recommendation: This is meant to be used as a living frontend styleguide and should not be loaded in Production.

API

  • data-draft-repeat
  • data-draft-text
  • data-draft-image
  • data-draft-date
  • data-draft-number
  • data-draft-user

Please see Full Usage Wiki for more information

LIBRARIES

Lorem Ipsum remote APIs ("library")

Lorem Ipsum (local only) ("bookstore") NOTE —— all with author permission. If you want to commit a new library, please make sure you have the author permission.

  • "lorem"
  • "lebowskiipsum.com" -- courtesy of lebowskiipsum.com
  • "tunaipsum.com" -- courtesy of tunaipsum.com
  • "robotipsum.com" -- courtesy of robotipsum.com
  • "lorizzle.nl" -- courtesy of lorizzle.nl
  • add your favorite ipsum generator with JSON converter/add to repository library

######Note: To save load time you can specify a thesaurus that will be used instead of making an HTTP call for lorem ipsum text.

$(window).roughDraft({
    author: 'lorem',
    customIpsum: true,
    customIpsumPath: '/bower_components/roughdraft.js/roughdraft.thesaurus.json'
});

Image generators

User generator

Class name sequencer Style patterns with expectable class name sequence of your choice.

To use the feature, simply add a class name containing *alfa* and that node's siblings will have similar class name following NATO phonetic alphabet.

Want to Contribute?

Ideas, information, contributor list, etc.

Comments
  • Maintenance, dependencies, and improvements

    Maintenance, dependencies, and improvements

    Maintenance

    • Renamed deprecated component.json for an updated bower.json
    • Tested with latest jQuery, removed version blocker
    • Some documentation improvements
    • Removed trailing spaces

    Improvements

    • Fake user doesn’t rely on web service anymore, but through localUserThesaurus
    • Added localUsers in roughdraft.thesaurus.json for localUserThesaurus
    • Refactored test/ examples, removed checked-in jQuery requirement, called more recent jQuery from CDN

    TODO

    • Create tag to upstream ndreckshage to 0.1.5 as bower.json is declaring it
    • Minify jquery.roughdraft.js into jquery.roughdraft.min.js

    Soon

    Next objective: Propose default configuration that doesn’t require ANY HTTP calls for images, users, text.

    Also:

    opened by renoirb 9
  • Alpha sequence classname replacer utility

    Alpha sequence classname replacer utility

    Replace occurences of *alfa in classNames following the NATO phonetic alphabet sequence

    Sometimes we need to use a sequence of class names to customize styling

    A recommendation is to abstract class names from their color or objective and use them in a sequential order, this helper does just that.

    What is the phonetic alphabet?: http://en.wikipedia.org/wiki/NATO_phonetic_alphabet

    for example:

     <div data-draft-repeat="3" class="myclass-alfa">
     <h1>Example node</h1>
     </div>
    

    would give:

     <div class="myclass-alfa">
       <h1>Example node</h1>
     </div>
     <div class="myclass-bravo">
       <h1>Example node</h1>
     </div>
     <div class="myclass-charlie">
       <h1>Example node</h1>
     </div>
    
    opened by renoirb 4
  • Random Number Generator

    Random Number Generator

    Here's a demo. Add data-draft-number with the following format to add a random number:

    • optional. if first char is '$', dollar sign will be appended
    • required. include either a range of total digits or a single digit length: "2-3" will return a number of either 2 or 3 digits in length. "4" will return a 4-digit number.
    • optional. include the number of decimal places to include. single number: "2-3/4" will return a 2 or 3 digit number with 4 decimal places

    for example: data-draft-number="$/3-4/2" would return a number like $325.63 or $6423.62

    opened by ultimatedelman 4
  • Added option, cached thesaurus, some cleanup

    Added option, cached thesaurus, some cleanup

    I added a few options, namely the option to change the ajax call method. This was one problem I had getting this to work initially, as my backend does not allow POSTs on .json files, so I had to override my $.ajaxSetup() to get this working. Now it defaults to 'GET' with the option to override (although I can't see anyone overriding a GET).

    I also noticed that the thesaurus was being called every time in a loop for getting sentences. This was resulting in an AJAX call every time the loop was run, which was slowing down page load a lot for a large number of blocks. I simply cached the thesaurus and removed the methods that spliced out paragraphs. I felt that the integrity of the randomness of the sentences/paragraphs/etc was less important for prototyping than the performance of this plugin, as it is, after all, just for prototyping.

    I tried to conform to your coding conventions as much as I could and only touched things that I played with for my own need, so I didn't get through the whole codebase. I hope you like my changes!

    opened by ultimatedelman 4
  • Improving sequencer, adding SVG image generator

    Improving sequencer, adding SVG image generator

    Here is the promised patch.

    What’s new:

    1. Refactored sequencer so it change classnames during draft-repeat.

      Problem with original classname sequencer is that it’s searching the whole DOM and create sequences. This operation can become intensive; this is why it’s disabled by default.

      Instead, how about we only support the class name sequencer to be changed for loops that are already managed in data-draft-repeat="n". Since we are already looping to clone nodes, we could check if it has the alfa trigger in a class attribute and, if enabled, replace the cloned node alfa className the next name it’s at.

      In other words, my suggestion is to support class="whatever-alfa" to be sequenced ONLY when that member ALSO has data-draft-repeat="n" and make the feature enabled by default.

    2. Added SVG image generator

      Added a new "photoAlbum", to give auto-generated SVG image through data-uri. It’s also suggested to become the default.

    opened by renoirb 3
  • Basic lorempixel support

    Basic lorempixel support

    Hey there,

    I've tried implementing some basic lorempixel support to your library.

    Use:

    $(window).roughDraft({
      illustrator: 'lorempixel',
      categories: ['buisness', 'cats'] // optional category selection (all by default)
    });
    
    opened by johngeorgewright 2
  • Nested repeats don't work

    Nested repeats don't work

    If I have a repeater within a repeater, the inner repeater doesn't work

    <div data-draft-repeat="5">
        <ul>
              <li data-draft-repeat="3" data-draft-text="1/s"></li>
        </ul>
    </div>
    

    only results in one <li>

    bug 
    opened by ultimatedelman 2
  • Maintenance and improvements

    Maintenance and improvements

    Maintenance

    • Tested with latest jQuery, removed version blocker
    • Some documentation improvements
    • Removed trailing spaces

    Improvements

    • Fake user doesn’t rely on web service anymore, but through localUserThesaurus
    • Added localUsers in roughdraft.thesaurus.json for localUserThesaurus
    • Refactored test/ examples

    Soon

    Next objective: Propose default configuration that doesn’t require ANY HTTP calls for images, users, text.

    Also:

    • Build process, linting
    • Way to generate inline images automatically w/ SVG
    opened by renoirb 1
  • demo page problems

    demo page problems

    demo page http://ndreckshage.github.io/roughdraft.js/ has problems, it relies on doing AJAX to http://www.roughdraftjs.com/api/?number=25. http://www.roughdraftjs.com is a parked domain.

    opened by rickdog 0
  • Bumping up version number, pushing to bower with name consistency

    Bumping up version number, pushing to bower with name consistency

    Hi!

    I just pushed on bower a package "roughdraft" that should match with the name it was in the bower.json file.

    Do you want help in maintaining the project?

    opened by renoirb 0
  • When I install roughdraft 1.0.5 it doesn’t really install 0.1.5 :(

    When I install roughdraft 1.0.5 it doesn’t really install 0.1.5 :(

    When I install a version using bower, it installs 207ffbe, instead of installing 3c0504b. The current master, that actually has our previous merges and enables the new features.

    Two ways to fix:

    1. Commit new bower.json with version +1, then, make a tag
    2. Delete old tag, create new one, then push. Maybe like this.

    Either case, I cannot do it myself

    See what bower doesn’t install :(

    opened by renoirb 0
  • Localize currency sign

    Localize currency sign

    Not all money is in dollars so when you format as money you should be able to add for example a euro sign instead of always a dollar sign. Or I could just change a single line, maybe this is too nitpicky

    https://github.com/ndreckshage/roughdraft.js/blob/master/jquery.roughdraft.0.1.3.js#L496

    opened by MilanJa 1
Fast and minimal JS server-side writer and client-side manager.

unihead Fast and minimal JS <head> server-side writer and client-side manager. Nearly every SSR framework out there relies on server-side components t

Jonas Galvez 24 Sep 4, 2022
Em pleno 2022, ano da tecnologia, ano de copa do mundo, você ainda tem preconceito com o Toguro Ipsum?

toguroipsum.com Em pleno 2022, ano da tecnologia, ano de copa do mundo, você ainda tem preconceito com o Toguro Ipsum? Toguro Ipsum é um gerador de te

Lucas F. da Costa 29 Oct 25, 2022
Straightforward interactive HTTP requests from within your Alpine.JS markup

Alpine Fetch Straightforward interactive HTTP requests from within your Alpine.JS markup. View the live demo here What does this do? Alpine.JS is a ru

null 29 Dec 21, 2022
Easy server-side and client-side validation for FormData, URLSearchParams and JSON data in your Fresh app 🍋

Fresh Validation ??     Easily validate FormData, URLSearchParams and JSON data in your Fresh app server-side or client-side! Validation Fresh Validat

Steven Yung 20 Dec 23, 2022
Tax-finder - A web application sourcing and sharing tax data on Fortune 500 corporations.

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Bennett Huffman 1 Jan 1, 2022
🦫 A simple way to implement event sourcing in TypeScript

✨ Better DevX for Event Sourcing in TypeScript Castore provides a unified interface for implementing Event Sourcing in TypeScript. Define your events

Theodo.FR 17 Nov 18, 2022
Better DevX for Event Sourcing in TypeScript 🧑‍💻

Castore ?? Better DevX for Event Sourcing in TypeScript Castore provides a unified interface for implementing Event Sourcing in TypeScript ??‍♂️ . ??

castore 65 Dec 22, 2022
Linely is inspired by LocalStack. Goal of this tool is to create a mock service for LINE.

Linely Linely is inspired by LocalStack. Goal of this tool is to create a mock service for LINE. Setup Docker docker run -d -p 3000:3000 dyoshikawa/li

null 4 Jan 24, 2022
NiseLine is inspired by LocalStack. Goal of this tool is to create a mock service for LINE.

NiseLine NiseLine is inspired by LocalStack. Goal of this tool is to create a mock service for LINE. Getting Started Launch NiseLine server. docker ru

null 4 Jan 24, 2022
NiseLine is inspired by LocalStack. Goal of this tool is to create a mock service for LINE.

NiseLine NiseLine is inspired by LocalStack. Goal of this tool is to create a mock service for LINE. Getting Started Launch NiseLine server by Docker

クラスメソッド株式会社 5 Jul 29, 2022
Quickly bootstrap your next TypeScript REST API project. Node 16+, auto OpenAPI, Prettier+ESLint, Jest

REST API template with autogenerated OpenAPI Quickly bootstrap your next TypeScript REST API project with the most up to date template. Included a sam

null 6 Oct 1, 2022
Minificator allows you to quickly minify your files (Images, HTML, CSS, Javascript)

ᗰIᑎIᖴIᑕᗩTOᖇ ~ Demo ~ ?? Description Minification is the process of removing unnecessary elements and rewriting code to reduce file size. These are usu

Raja Rakotonirina 8 Nov 14, 2022
A util for getting data and metadata for all markdown files in a given dir. Useful for building static site generators

extract-md-data A util for getting data and metadata for all markdown files in a given dir. Useful for building static site generators. Usage Given th

Claire Froelich 2 Jan 6, 2022
Create a 3D interactive object using images and one simple JS call

#Interactive 3D by Pete R. Create a 3D interactive object using images and one simple JS call Created by Pete R., Founder of BucketListly Demo View de

Pete R. 377 Nov 17, 2022
A set of scripts to test markdown processing speeds in various site generators/frameworks

bench-framework-markdown A set of scripts to test markdown processing speeds in various site generators/frameworks. Read the blog post: Which Generato

Zach Leatherman 24 Nov 3, 2022
A Git-based CMS for Static Site Generators

staticjscms.github.io/static-cms A CMS for static site generators. Give users a simple way to edit and add content to any site built with a static sit

StaticJs CMS 147 Jan 2, 2023
MidJourney is an AI text-to-image service that generates images based on textual prompts. It is often used to create artistic or imaginative images, and is available on Discord and through a web interface here.

Midjourney MidJourney is an AI text-to-image service that generates images based on textual prompts. It is often used to create artistic or imaginativ

Andrew Tsegaye 8 May 1, 2023