GithubHelp home page GithubHelp logo

tristanjm / responsive-web-guestbook Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 2.63 MB

A mobile-responsive website with information and a guestbook. Built in HTML5, CSS3 and jQuery.

License: MIT License

HTML 40.42% JavaScript 45.21% CSS 14.37%

responsive-web-guestbook's Introduction

Responsive Web Guestbook

A responsive website, built from scratch, using native HTML5 and CSS3 with jQuery.

Learning objectives

  • Pure CSS responsive web design with no front-end frameworks.
  • Using Geo-location alongside the Yahoo weather and Google Maps APIs.
  • Using mobile accelerometer and gyroscope to detect and act on gestures.
  • Drawable canvas object and device-localstorage image saving.

Getting started

Simply download the project zip and load the index.html file in any browser.

View the layout & style changes when resizing the browser window.

Usage

Use the source code as reference for building a mobile responsive website. Notable snippets include:

Device geolocation:

navigator.geolocation.getCurrentPosition(function(position) {
	// 'User location: ' + position.coords.latitude + ', ' + position.coords.longitude);
}, onError, options);

Device gestures:

window.addEventListener("deviceorientation", orientationEvent);
// ...
function orientationEvent(event) {
		var direction = Math.round(event.alpha);
		var tiltFrontBack = Math.round(event.beta);
		var tiltLeftRight = Math.round(event.gamma);
}

Local Storage:

var currentData = localStorage.getItem("guestbookData");
localStorage.setItem("guestbookData", newData);

Canvas & HTML5 File Reader:

// Reads in image from camera/file and shows in canvas
function showAvatar() {
	var input = document.getElementById('form-image-input');
	var file = input.files[0];
	
	// get canvas context
	
	//use HTML5 FileReader API to read the image file as dataURL
	var reader = new FileReader();
	reader.readAsDataURL(file);
	
	// draw image on canvas
}

CSS clouds:

You'll have to hunt down the cloud/sun styles in the CSS!

CSS responsive table collapse:

/* Content Similar to 'Mobile Landscape' or 'Tablet' */
@media only screen and (min-width: 481px) and (max-width: 780px) {
	/* Events Table */
	
	/* End of Events Table */
}

Built with

Contributing

If you find a bug or have any suggestions, please make an issue on Github.

Spotted room for improvement? Interested in contributing? Don't be shy! Fork this repo and I'll be happy to merge pull requests.

License

This project is licensed under the MIT License - see the LICENSE.txt file for details.

responsive-web-guestbook's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.