ReactJS JSX Transformer

Link to code (github)

  • This is a basic JSX Transformer application that transforms our code on the left to ES5 on the right
  • Based on Babel’s own example page http://babeljs.io/repl/
  • The bottom bar shows errors presented in the code in red text
  • Some basic styling has been applied to the application
  • It also uses Webpack and has all the dependencies listed already so just use npm install to get them
  • npm start will load the server and use localhost to launch the application
  • Trying putting in some code on the left and see the magic happen. E.g. [1, 2, 3].map(n => n+1 )

This slideshow requires JavaScript.

Advertisements

ReactJS states and reusability potential

Link to code (github)

  • The sample code shows a simple way to use states in React
  • CDNs have been used for convenience
  • Different buttons are used to increment the value of a single state counter
  • The code has been made more reusable in the subsequent branches keeping the same functionality
  • You can check the changes in the branches or pull requests in this repository
  • The first branch makes the increment function reusable by binding values to the same function at runtime
  • The second one makes the Button component reusable by making it stateless and passes values as props. This reusability is evident in the alert button added. Also, this time values are defined in default props and overridden in RenderDOM.render method
  • And the final one shows the same functionality in ES6 syntax

react_reusability_01

Hangman – A simple AngularJS game

Link to code (github)

Hangman is a simple game created using AngularJS. The goal of this game is to guess a word within 6 chances one letter at a time. Every wrong guess decreases the counter by 1 while every correct guess reveals the position of that letter in the word (even if it appears multiple times). Submitting the same letter again will not affect the game. Some key points:

  • Developed in AngularJS 1.x (using CDN)
  • Simple layout with some basic styling
  • Words are currently hard feeded and selected at random
  • Words are only 3-letter long for the sake of demo
  • The correct word is printed in console

This slideshow requires JavaScript.

One-page responsive website converted from PSD

Link to code (github)

This site was created using Adobe CC 2017 versions of Dreamweaver and Photoshop and has the following features:

  • Onepage format with smooth scrolling
  • Fully responsive
  • Tabs change into accordion on mobiles
  • Responsive Carousel
  • Includes a reset.css file
  • Used both downloaded as well as online fonts
  • Sticky nav-bar after some scrolling

How the site looks on desktops:

This slideshow requires JavaScript.

The number of images in the carousel changes when viewed on tablets:

psdtohtml_onepage_responsive_06

The number of images in the carousel changes when viewed on mobile phones and the tabs also change into accordion:

Demo sites for clients (responsive)

I also created a number of responsive sites for demo purposes and to keep track of the many modules under development for the same client. These sites were standardized by me giving the ability to make minor changes and re-use them for multiple projects and clients. The data was stored in an XML file so only that single file was updated to add/remove/modify content.

This slideshow requires JavaScript.