Coding Challange
Word Flipper is a dynamic web page programmed with JavaScript that takes a word or phrase and displays it on the page reversed.
Tech Stack
JavaScript
I used JavaScript to create interactive elements, validate user input, and enhance user experience through dynamic content, and functionality.
Bootstrap
I used Bootstrap to create responsive and mobile-friendly design. Bootstrap provided a framework for creating consistent layouts, typography, and UI components.
HTML
I used HTML to organize text, images, and other media into a logical and accessible format for users.
CSS
I used CSS to control the color, typography, and other design elements of HTML content to create visually appealing and consistent user interface.
The App
Your Message has been reversed!
The Code
Seperation of concerns
The solution to this coding challange is split into three sections, each of which will addreress a seperate concern.
- Controller, Logic, View
-
The Controller function is the entry point for the page, it's responsible for getting and validating the inputs as well as handling the logic and view functions.
The Logic function is in charge of all the calculations.
The View function formats and displays data to the page.
Functions
- getValues
-
Is called when the user clicks reverse.
Calls it's borther functions to reverse string and display string on the page.
- reverseString
-
Takes message.
Reverses message.
Returns reversed message.
- displayString
-
Takes reverseMessage.
Formats and displaysreverseMessage to the page as an alert.