Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I created an Angular app that does this, in a more flexible way.</p> <p><strong>FIDDLE: <a href="http://jsfiddle.net/Pha4V/3/" rel="noreferrer">http://jsfiddle.net/Pha4V/3/</a></strong></p> <p>You can easily add shapes, types and colors just by creating new elements in an array. Also, by having the structure defined this way, the code can be easily integrated with a database.</p> <p><strong>Example:</strong></p> <pre><code>var tops = [ new Shape("Triangle", "http://i.stack.imgur.com/wkRaA.png", "Blue"), new Shape("Triangle", "http://i.stack.imgur.com/lHk5X.png", "Green"), new Shape("Triangle", "http://i.stack.imgur.com/LT6Nn.png", "Red"), new Shape("Octagonal", "http://i.stack.imgur.com/FjF7S.png", "Red"), new Shape("Octagonal", "http://i.stack.imgur.com/0FWGv.png", "Blue"), new Shape("Octagonal", "http://i.stack.imgur.com/92kyY.png", "Green") ]; </code></pre> <p>For the future, fonts can be added by adding a fourth parameter and new colors can be added just by adding an element with that color.</p> <p><strong>New color example:</strong></p> <pre><code>... new Shape("Octagonal", "http://...", "Cyan") ... </code></pre> <p><strong>New shape type example:</strong></p> <pre><code>... new Shape("Square", "http://...", "Blue") ... </code></pre> <p><strong>The current form of the 'house':</strong></p> <p>It could be easily saved, as there are variables that define all the selections:</p> <pre><code>$scope.topColor, $scope.topType $scope.bottomColor, $scope.bottomType ... </code></pre> <p><strong>Different methods of input:</strong></p> <p>The select method can be changed easily, as the code does not depend on it's type.</p> <p><strong>Future fonts:</strong></p> <p>You can easily add new shapes as fonts, and copy the logic from 'tops' and you won't have to generate that many images. You'll have just to generate images with different fonts:</p> <pre><code>var fontBottom = [ new Shape("Font", "http://...", "Arial"), new Shape("Font", "http://...", "Arial Black") ]; //Then add the methods and the input. </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload