Teleprompter update

While back I have made a cheap teleprompter, but you had to use the internet to take advantage of it. This software would probably work great with a touchpad as it is basically a web page that does not take up nuch room. you can find more information at: http://www.instructables.com/id/Linux-ghetto-Tele-prompter/


Screenshot from 2013-12-28 21:03:41



-----------------------------------------------------------------------------------
Example code:

Teleprompter.html

<html>
<head>
<style>
body {
     font-family: Helvetica,Arial,sans-serif;
     font-size: 2.4em;
     line-height: 1.4;
     background: #000;
     color: #fff;
     overflow: hidden;
}

#speech {
     position: absolute;
}

p {
     margin: .5em;
}

.slide {
     text-align: center;
     margin: 0;
}
</style>
<script type="text/javascript" src="teleprompter.js"></script>
</head>
<body>
<div id="speech">
<p>

<strong>From Basic Forms to Shopping Carts</strong><br><br>
An electronic shopping cart is a critical aspect of an e-commerce business. The shopping cart is the software (or series of scripts) that allows users to select products from your Web site, save them and check out when they are done shopping. In the early stages of electronic shopping, the shopping cart was usually a basic HTML form from which a customer selected the products he  wanted to purchase. Long before using a credit card over the Internet was widely accepted, it was common to find that you would need to print the form and mail it along with a money order or credit card information to the company. Over time, as e-commerce grew and online stores began to offer hundreds, if not hundreds of thousands of products, obviously a better method for storing a customer's purchases and placing an order was needed.</p>
<p>
        The shopping cart acts as the user-interface for the customer to shop. It allows users to place items in a "shopping basket". The cart remembers these items for a predetermined length of time, usually 15 to 30 days unless the shopper removes the items from the cart. Today's shopping carts are really designed for the ease-of-use of the shopper. Extra features such as different color or size options, quantity of order, and matching item links can be integrated into the shopping cart. Once a shopper enters her shipping address, taxes and shipping costs can also be tallied from within the shopping cart. For the merchant, the shopping cart also provides important information, which is often transparent to the shopper, including a cart number to track the order, and even a cookie to provide you with some limited tracking details about your customer.</p>

</body>
</html>

teleprompter.js

/*global document, window, event */

var scroll = function(element) {
     var scrolling = null;
     var inc = 1;
     var wait = 50;
     var getYpos = function() {
          var ypos = element.offsetTop;
          var thisNode = element;
          while (thisNode.offsetParent &&  (thisNode.offsetParent != document.body)) {
               thisNode = thisNode.offsetParent;
              ypos += thisNode.offsetTop;
         }
         return ypos;
     };

     var doScroll = function() {
          var y = parseInt(getYpos(),10);
          y=y-inc;
          y=y+"px";
          element.style.top = y;
          scrolling = window.setTimeout(doScroll,wait);
     };

     var toggleScrolling = function() {
          if (scrolling) {
               window.clearTimeout(scrolling);
               scrolling = null;
          } else {
               doScroll();
          }
     };

     element.onclick = toggleScrolling;

// 'keys' code adapted S5 (http://www.meyerweb.com/eric/tools/s5/)
//    which was in turn adapted from MozPoint (http://mozpoint.mozdev.org/)

     var keys = function(key) {
          if (!key) {
               key = event;
               key.which = key.keyCode;
          }
        switch (key.which) {
             case 221:    // ]
                  if (scrolling) {
                       inc++;
                  }
             break;
             case 219:    // [
               if (scrolling && inc>1) {
                       inc--;
                  }
             break;
             case 10:    // return
             case 13:    // enter
                  toggleScrolling();
             break;
        }
          return false;
     };
     document.onkeyup = keys;
};

var init = function() {
     if (document.getElementById && document.getElementById("speech")) {
          scroll(document.getElementById("speech"));
     }
};

window.onload = init;


Comments

Popular posts from this blog

Guiless?

MSOffice vs Libreoffice

Raspberry pi zero.