Code Monkey home page Code Monkey logo

optimizedhtml-5's Introduction

OptimizedHTML 5

Lightweight startup HTML5 template, based on Gulp.

Start HTML Template

Author: WebDesign Master

OptimizedHTML 5 - lightweight startup HTML5 template with Gulp 4, Sass, Browsersync, Autoprefixer, Uglify-ES, Clean-CSS, Rsync, CSS Reboot (Bootstrap reboot). It uses best practices for responsive images optimizing and contains a .htaccess file for resources caching (images, fonts, HTML, CSS, JS and other content types).

How to use OptimizedHTML 5

git clone https://github.com/agragregra/oh5
  1. Clone or Download OptimizedHTML 5 from GitHub
  2. Install Node Modules: npm i
  3. Run: gulp

Main Gulp tasks:

  • gulp: run default gulp task ('img', 'styles', 'scripts', 'browser-sync', 'watch')
  • cleanimg: Clean @*x responsive IMG's
  • rsync: project deployment via RSYNC

Basic rules

  1. All custom scripts located in app/js/_custom.js
  2. All custom styles located in app/sass/main.sass
  3. All Sass vars placed in app/sass/_vars.sass
  4. All fonts plug in app/sass/_fonts.sass
  5. All CSS styles of libraries plug in app/sass/_libs.sass
  6. All responsive images placed in app/img/_src/ folder. All source images should initially have a 2x resolution. Result image folders after resize & compression: img/@1x/ and img/@2x/ accordingly.

Included features

  1. bootstrap-reboot.scss - Bootstrap Reboot CSS collection
  2. _breakpoints.scss - Bootstrap Breakpoints mixin
  3. js/_lazy.js - Lazy loading images using Intersection Observer

Lazy loading images

Lazy loading img & background images using intersection observer. Enabled by default.

Reference: Google Developers.

1. Example of the usual <img> tag:

<img class="lazy" src="thumb.gif" data-src="img/@1x/real.jpg" data-srcset="img/@1x/real.jpg 1x, img/@2x/real.jpg 2x">

2. Background image class changer example: <div class="lazy-background"> with added class ".visible" for styling.

3. Background image style attribute lazy loading example: <div data-bg="image.jpg">.

Caching

Rename ht.access to .htaccess before place it in your web server. This file contain rules for htaccess resources caching.

optimizedhtml-5's People

Contributors

adoonq avatar agragregra avatar

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.