initial commit - prva verzija
This commit is contained in:
13
.editorconfig
Normal file
13
.editorconfig
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# editorconfig.org
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
||||||
192
.gitattributes
vendored
Normal file
192
.gitattributes
vendored
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
## GITATTRIBUTES FOR WEB PROJECTS
|
||||||
|
#
|
||||||
|
# These settings are for any web project.
|
||||||
|
#
|
||||||
|
# Details per file setting:
|
||||||
|
# text These files should be normalized (i.e. convert CRLF to LF).
|
||||||
|
# binary These files are binary and should be left untouched.
|
||||||
|
#
|
||||||
|
# Note that binary is a macro for -text -diff.
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
## AUTO-DETECT
|
||||||
|
## Handle line endings automatically for files detected as
|
||||||
|
## text and leave all files detected as binary untouched.
|
||||||
|
## This will handle all files NOT defined below.
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
## SOURCE CODE
|
||||||
|
*.bat text eol=crlf
|
||||||
|
*.coffee text
|
||||||
|
*.css text
|
||||||
|
*.htm text
|
||||||
|
*.html text
|
||||||
|
*.inc text
|
||||||
|
*.ini text
|
||||||
|
*.js text
|
||||||
|
*.json text
|
||||||
|
*.jsx text
|
||||||
|
*.less text
|
||||||
|
*.od text
|
||||||
|
*.onlydata text
|
||||||
|
*.php text
|
||||||
|
*.pl text
|
||||||
|
*.py text
|
||||||
|
*.rb text
|
||||||
|
*.sass text
|
||||||
|
*.scm text
|
||||||
|
*.scss text
|
||||||
|
*.sh text eol=lf
|
||||||
|
*.sql text
|
||||||
|
*.styl text
|
||||||
|
*.tag text
|
||||||
|
*.ts text
|
||||||
|
*.tsx text
|
||||||
|
*.xml text
|
||||||
|
*.xhtml text
|
||||||
|
|
||||||
|
## DOCKER
|
||||||
|
*.dockerignore text
|
||||||
|
Dockerfile text
|
||||||
|
|
||||||
|
## DOCUMENTATION
|
||||||
|
*.markdown text
|
||||||
|
*.md text
|
||||||
|
*.mdwn text
|
||||||
|
*.mdown text
|
||||||
|
*.mkd text
|
||||||
|
*.mkdn text
|
||||||
|
*.mdtxt text
|
||||||
|
*.mdtext text
|
||||||
|
*.txt text
|
||||||
|
AUTHORS text
|
||||||
|
CHANGELOG text
|
||||||
|
CHANGES text
|
||||||
|
CONTRIBUTING text
|
||||||
|
COPYING text
|
||||||
|
copyright text
|
||||||
|
*COPYRIGHT* text
|
||||||
|
INSTALL text
|
||||||
|
license text
|
||||||
|
LICENSE text
|
||||||
|
NEWS text
|
||||||
|
readme text
|
||||||
|
*README* text
|
||||||
|
TODO text
|
||||||
|
|
||||||
|
## TEMPLATES
|
||||||
|
*.dot text
|
||||||
|
*.ejs text
|
||||||
|
*.haml text
|
||||||
|
*.handlebars text
|
||||||
|
*.hbs text
|
||||||
|
*.hbt text
|
||||||
|
*.jade text
|
||||||
|
*.latte text
|
||||||
|
*.mustache text
|
||||||
|
*.njk text
|
||||||
|
*.phtml text
|
||||||
|
*.tmpl text
|
||||||
|
*.tpl text
|
||||||
|
*.twig text
|
||||||
|
|
||||||
|
## LINTERS
|
||||||
|
.csslintrc text
|
||||||
|
.eslintrc text
|
||||||
|
.htmlhintrc text
|
||||||
|
.jscsrc text
|
||||||
|
.jshintrc text
|
||||||
|
.jshintignore text
|
||||||
|
.stylelintrc text
|
||||||
|
|
||||||
|
## CONFIGS
|
||||||
|
*.bowerrc text
|
||||||
|
*.cnf text
|
||||||
|
*.conf text
|
||||||
|
*.config text
|
||||||
|
.browserslistrc text
|
||||||
|
.editorconfig text
|
||||||
|
.gitattributes text
|
||||||
|
.gitconfig text
|
||||||
|
.gitignore text
|
||||||
|
.htaccess text
|
||||||
|
*.npmignore text
|
||||||
|
*.yaml text
|
||||||
|
*.yml text
|
||||||
|
browserslist text
|
||||||
|
Makefile text
|
||||||
|
makefile text
|
||||||
|
|
||||||
|
## HEROKU
|
||||||
|
Procfile text
|
||||||
|
.slugignore text
|
||||||
|
|
||||||
|
## GRAPHICS
|
||||||
|
*.ai binary
|
||||||
|
*.bmp binary
|
||||||
|
*.eps binary
|
||||||
|
*.gif binary
|
||||||
|
*.ico binary
|
||||||
|
*.jng binary
|
||||||
|
*.jp2 binary
|
||||||
|
*.jpg binary
|
||||||
|
*.jpeg binary
|
||||||
|
*.jpx binary
|
||||||
|
*.jxr binary
|
||||||
|
*.pdf binary
|
||||||
|
*.png binary
|
||||||
|
*.psb binary
|
||||||
|
*.psd binary
|
||||||
|
*.svg text
|
||||||
|
*.svgz binary
|
||||||
|
*.tif binary
|
||||||
|
*.tiff binary
|
||||||
|
*.wbmp binary
|
||||||
|
*.webp binary
|
||||||
|
|
||||||
|
## AUDIO
|
||||||
|
*.kar binary
|
||||||
|
*.m4a binary
|
||||||
|
*.mid binary
|
||||||
|
*.midi binary
|
||||||
|
*.mp3 binary
|
||||||
|
*.ogg binary
|
||||||
|
*.ra binary
|
||||||
|
|
||||||
|
## VIDEO
|
||||||
|
*.3gpp binary
|
||||||
|
*.3gp binary
|
||||||
|
*.as binary
|
||||||
|
*.asf binary
|
||||||
|
*.asx binary
|
||||||
|
*.fla binary
|
||||||
|
*.flv binary
|
||||||
|
*.m4v binary
|
||||||
|
*.mng binary
|
||||||
|
*.mov binary
|
||||||
|
*.mp4 binary
|
||||||
|
*.mpeg binary
|
||||||
|
*.mpg binary
|
||||||
|
*.ogv binary
|
||||||
|
*.swc binary
|
||||||
|
*.swf binary
|
||||||
|
*.webm binary
|
||||||
|
|
||||||
|
## ARCHIVES
|
||||||
|
*.7z binary
|
||||||
|
*.gz binary
|
||||||
|
*.jar binary
|
||||||
|
*.rar binary
|
||||||
|
*.tar binary
|
||||||
|
*.zip binary
|
||||||
|
|
||||||
|
## FONTS
|
||||||
|
*.ttf binary
|
||||||
|
*.eot binary
|
||||||
|
*.otf binary
|
||||||
|
*.woff binary
|
||||||
|
*.woff2 binary
|
||||||
|
|
||||||
|
## EXECUTABLES
|
||||||
|
*.exe binary
|
||||||
|
*.pyc binary
|
||||||
62
.gitignore
vendored
62
.gitignore
vendored
@@ -1,59 +1,3 @@
|
|||||||
# Logs
|
# Include your project-specific ignores in this file
|
||||||
logs
|
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
|
||||||
*.log
|
# Useful .gitignore templates: https://github.com/github/gitignore
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
|
|
||||||
# Runtime data
|
|
||||||
pids
|
|
||||||
*.pid
|
|
||||||
*.seed
|
|
||||||
*.pid.lock
|
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
||||||
lib-cov
|
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
|
||||||
coverage
|
|
||||||
|
|
||||||
# nyc test coverage
|
|
||||||
.nyc_output
|
|
||||||
|
|
||||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
|
||||||
.grunt
|
|
||||||
|
|
||||||
# Bower dependency directory (https://bower.io/)
|
|
||||||
bower_components
|
|
||||||
|
|
||||||
# node-waf configuration
|
|
||||||
.lock-wscript
|
|
||||||
|
|
||||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
|
||||||
build/Release
|
|
||||||
|
|
||||||
# Dependency directories
|
|
||||||
node_modules/
|
|
||||||
jspm_packages/
|
|
||||||
|
|
||||||
# Typescript v1 declaration files
|
|
||||||
typings/
|
|
||||||
|
|
||||||
# Optional npm cache directory
|
|
||||||
.npm
|
|
||||||
|
|
||||||
# Optional eslint cache
|
|
||||||
.eslintcache
|
|
||||||
|
|
||||||
# Optional REPL history
|
|
||||||
.node_repl_history
|
|
||||||
|
|
||||||
# Output of 'npm pack'
|
|
||||||
*.tgz
|
|
||||||
|
|
||||||
# Yarn Integrity file
|
|
||||||
.yarn-integrity
|
|
||||||
|
|
||||||
# dotenv environment variables file
|
|
||||||
.env
|
|
||||||
|
|
||||||
|
|||||||
984
.htaccess
Normal file
984
.htaccess
Normal file
@@ -0,0 +1,984 @@
|
|||||||
|
# Apache Server Configs v2.14.0 | MIT License
|
||||||
|
# https://github.com/h5bp/server-configs-apache
|
||||||
|
|
||||||
|
# (!) Using `.htaccess` files slows down Apache, therefore, if you have
|
||||||
|
# access to the main server configuration file (which is usually called
|
||||||
|
# `httpd.conf`), you should add this logic there.
|
||||||
|
#
|
||||||
|
# https://httpd.apache.org/docs/current/howto/htaccess.html.
|
||||||
|
|
||||||
|
# ######################################################################
|
||||||
|
# # CROSS-ORIGIN #
|
||||||
|
# ######################################################################
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Cross-origin requests |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Allow cross-origin requests.
|
||||||
|
#
|
||||||
|
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
|
||||||
|
# http://enable-cors.org/
|
||||||
|
# http://www.w3.org/TR/cors/
|
||||||
|
|
||||||
|
# <IfModule mod_headers.c>
|
||||||
|
# Header set Access-Control-Allow-Origin "*"
|
||||||
|
# </IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Cross-origin images |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Send the CORS header for images when browsers request it.
|
||||||
|
#
|
||||||
|
# https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image
|
||||||
|
# https://blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
|
||||||
|
|
||||||
|
<IfModule mod_setenvif.c>
|
||||||
|
<IfModule mod_headers.c>
|
||||||
|
<FilesMatch "\.(bmp|cur|gif|ico|jpe?g|png|svgz?|webp)$">
|
||||||
|
SetEnvIf Origin ":" IS_CORS
|
||||||
|
Header set Access-Control-Allow-Origin "*" env=IS_CORS
|
||||||
|
</FilesMatch>
|
||||||
|
</IfModule>
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Cross-origin web fonts |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Allow cross-origin access to web fonts.
|
||||||
|
|
||||||
|
<IfModule mod_headers.c>
|
||||||
|
<FilesMatch "\.(eot|otf|tt[cf]|woff2?)$">
|
||||||
|
Header set Access-Control-Allow-Origin "*"
|
||||||
|
</FilesMatch>
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Cross-origin resource timing |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Allow cross-origin access to the timing information for all resources.
|
||||||
|
#
|
||||||
|
# If a resource isn't served with a `Timing-Allow-Origin` header that
|
||||||
|
# would allow its timing information to be shared with the document,
|
||||||
|
# some of the attributes of the `PerformanceResourceTiming` object will
|
||||||
|
# be set to zero.
|
||||||
|
#
|
||||||
|
# http://www.w3.org/TR/resource-timing/
|
||||||
|
# http://www.stevesouders.com/blog/2014/08/21/resource-timing-practical-tips/
|
||||||
|
|
||||||
|
# <IfModule mod_headers.c>
|
||||||
|
# Header set Timing-Allow-Origin: "*"
|
||||||
|
# </IfModule>
|
||||||
|
|
||||||
|
|
||||||
|
# ######################################################################
|
||||||
|
# # ERRORS #
|
||||||
|
# ######################################################################
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Custom error messages/pages |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Customize what Apache returns to the client in case of an error.
|
||||||
|
# https://httpd.apache.org/docs/current/mod/core.html#errordocument
|
||||||
|
|
||||||
|
ErrorDocument 404 /404.html
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Error prevention |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Disable the pattern matching based on filenames.
|
||||||
|
#
|
||||||
|
# This setting prevents Apache from returning a 404 error as the result
|
||||||
|
# of a rewrite when the directory with the same name does not exist.
|
||||||
|
#
|
||||||
|
# https://httpd.apache.org/docs/current/content-negotiation.html#multiviews
|
||||||
|
|
||||||
|
Options -MultiViews
|
||||||
|
|
||||||
|
|
||||||
|
# ######################################################################
|
||||||
|
# # INTERNET EXPLORER #
|
||||||
|
# ######################################################################
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Document modes |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Force Internet Explorer 8/9/10 to render pages in the highest mode
|
||||||
|
# available in the various cases when it may not.
|
||||||
|
#
|
||||||
|
# https://hsivonen.fi/doctype/#ie8
|
||||||
|
#
|
||||||
|
# (!) Starting with Internet Explorer 11, document modes are deprecated.
|
||||||
|
# If your business still relies on older web apps and services that were
|
||||||
|
# designed for older versions of Internet Explorer, you might want to
|
||||||
|
# consider enabling `Enterprise Mode` throughout your company.
|
||||||
|
#
|
||||||
|
# https://msdn.microsoft.com/en-us/library/ie/bg182625.aspx#docmode
|
||||||
|
# http://blogs.msdn.com/b/ie/archive/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11.aspx
|
||||||
|
|
||||||
|
<IfModule mod_headers.c>
|
||||||
|
|
||||||
|
Header set X-UA-Compatible "IE=edge"
|
||||||
|
|
||||||
|
# `mod_headers` cannot match based on the content-type, however,
|
||||||
|
# the `X-UA-Compatible` response header should be send only for
|
||||||
|
# HTML documents and not for the other resources.
|
||||||
|
|
||||||
|
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
|
||||||
|
Header unset X-UA-Compatible
|
||||||
|
</FilesMatch>
|
||||||
|
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Iframes cookies |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Allow cookies to be set from iframes in Internet Explorer.
|
||||||
|
#
|
||||||
|
# https://msdn.microsoft.com/en-us/library/ms537343.aspx
|
||||||
|
# http://www.w3.org/TR/2000/CR-P3P-20001215/
|
||||||
|
|
||||||
|
# <IfModule mod_headers.c>
|
||||||
|
# Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
|
||||||
|
# </IfModule>
|
||||||
|
|
||||||
|
|
||||||
|
# ######################################################################
|
||||||
|
# # MEDIA TYPES AND CHARACTER ENCODINGS #
|
||||||
|
# ######################################################################
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Media types |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Serve resources with the proper media types (f.k.a. MIME types).
|
||||||
|
#
|
||||||
|
# https://www.iana.org/assignments/media-types/media-types.xhtml
|
||||||
|
# https://httpd.apache.org/docs/current/mod/mod_mime.html#addtype
|
||||||
|
|
||||||
|
<IfModule mod_mime.c>
|
||||||
|
|
||||||
|
# Data interchange
|
||||||
|
|
||||||
|
AddType application/atom+xml atom
|
||||||
|
AddType application/json json map topojson
|
||||||
|
AddType application/ld+json jsonld
|
||||||
|
AddType application/rss+xml rss
|
||||||
|
AddType application/vnd.geo+json geojson
|
||||||
|
AddType application/xml rdf xml
|
||||||
|
|
||||||
|
|
||||||
|
# JavaScript
|
||||||
|
|
||||||
|
# Normalize to standard type.
|
||||||
|
# https://tools.ietf.org/html/rfc4329#section-7.2
|
||||||
|
|
||||||
|
AddType application/javascript js
|
||||||
|
|
||||||
|
|
||||||
|
# Manifest files
|
||||||
|
|
||||||
|
AddType application/manifest+json webmanifest
|
||||||
|
AddType application/x-web-app-manifest+json webapp
|
||||||
|
AddType text/cache-manifest appcache
|
||||||
|
|
||||||
|
|
||||||
|
# Media files
|
||||||
|
|
||||||
|
AddType audio/mp4 f4a f4b m4a
|
||||||
|
AddType audio/ogg oga ogg opus
|
||||||
|
AddType image/bmp bmp
|
||||||
|
AddType image/svg+xml svg svgz
|
||||||
|
AddType image/webp webp
|
||||||
|
AddType video/mp4 f4v f4p m4v mp4
|
||||||
|
AddType video/ogg ogv
|
||||||
|
AddType video/webm webm
|
||||||
|
AddType video/x-flv flv
|
||||||
|
|
||||||
|
# Serving `.ico` image files with a different media type
|
||||||
|
# prevents Internet Explorer from displaying then as images:
|
||||||
|
# https://github.com/h5bp/html5-boilerplate/commit/37b5fec090d00f38de64b591bcddcb205aadf8ee
|
||||||
|
|
||||||
|
AddType image/x-icon cur ico
|
||||||
|
|
||||||
|
|
||||||
|
# Web fonts
|
||||||
|
|
||||||
|
AddType application/font-woff woff
|
||||||
|
AddType application/font-woff2 woff2
|
||||||
|
AddType application/vnd.ms-fontobject eot
|
||||||
|
|
||||||
|
# Browsers usually ignore the font media types and simply sniff
|
||||||
|
# the bytes to figure out the font type.
|
||||||
|
# https://mimesniff.spec.whatwg.org/#matching-a-font-type-pattern
|
||||||
|
#
|
||||||
|
# However, Blink and WebKit based browsers will show a warning
|
||||||
|
# in the console if the following font types are served with any
|
||||||
|
# other media types.
|
||||||
|
|
||||||
|
AddType application/x-font-ttf ttc ttf
|
||||||
|
AddType font/opentype otf
|
||||||
|
|
||||||
|
|
||||||
|
# Other
|
||||||
|
|
||||||
|
AddType application/octet-stream safariextz
|
||||||
|
AddType application/x-bb-appworld bbaw
|
||||||
|
AddType application/x-chrome-extension crx
|
||||||
|
AddType application/x-opera-extension oex
|
||||||
|
AddType application/x-xpinstall xpi
|
||||||
|
AddType text/vcard vcard vcf
|
||||||
|
AddType text/vnd.rim.location.xloc xloc
|
||||||
|
AddType text/vtt vtt
|
||||||
|
AddType text/x-component htc
|
||||||
|
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Character encodings |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Serve all resources labeled as `text/html` or `text/plain`
|
||||||
|
# with the media type `charset` parameter set to `UTF-8`.
|
||||||
|
#
|
||||||
|
# https://httpd.apache.org/docs/current/mod/core.html#adddefaultcharset
|
||||||
|
|
||||||
|
AddDefaultCharset utf-8
|
||||||
|
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
# Serve the following file types with the media type `charset`
|
||||||
|
# parameter set to `UTF-8`.
|
||||||
|
#
|
||||||
|
# https://httpd.apache.org/docs/current/mod/mod_mime.html#addcharset
|
||||||
|
|
||||||
|
<IfModule mod_mime.c>
|
||||||
|
AddCharset utf-8 .atom \
|
||||||
|
.bbaw \
|
||||||
|
.css \
|
||||||
|
.geojson \
|
||||||
|
.js \
|
||||||
|
.json \
|
||||||
|
.jsonld \
|
||||||
|
.manifest \
|
||||||
|
.rdf \
|
||||||
|
.rss \
|
||||||
|
.topojson \
|
||||||
|
.vtt \
|
||||||
|
.webapp \
|
||||||
|
.webmanifest \
|
||||||
|
.xloc \
|
||||||
|
.xml
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
|
||||||
|
# ######################################################################
|
||||||
|
# # REWRITES #
|
||||||
|
# ######################################################################
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Rewrite engine |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# (1) Turn on the rewrite engine (this is necessary in order for
|
||||||
|
# the `RewriteRule` directives to work).
|
||||||
|
#
|
||||||
|
# https://httpd.apache.org/docs/current/mod/mod_rewrite.html#RewriteEngine
|
||||||
|
#
|
||||||
|
# (2) Enable the `FollowSymLinks` option if it isn't already.
|
||||||
|
#
|
||||||
|
# https://httpd.apache.org/docs/current/mod/core.html#options
|
||||||
|
#
|
||||||
|
# (3) If your web host doesn't allow the `FollowSymlinks` option,
|
||||||
|
# you need to comment it out or remove it, and then uncomment
|
||||||
|
# the `Options +SymLinksIfOwnerMatch` line (4), but be aware
|
||||||
|
# of the performance impact.
|
||||||
|
#
|
||||||
|
# https://httpd.apache.org/docs/current/misc/perf-tuning.html#symlinks
|
||||||
|
#
|
||||||
|
# (4) Some cloud hosting services will require you set `RewriteBase`.
|
||||||
|
#
|
||||||
|
# https://www.rackspace.com/knowledge_center/frequently-asked-question/why-is-modrewrite-not-working-on-my-site
|
||||||
|
# https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
|
||||||
|
#
|
||||||
|
# (5) Depending on how your server is set up, you may also need to
|
||||||
|
# use the `RewriteOptions` directive to enable some options for
|
||||||
|
# the rewrite engine.
|
||||||
|
#
|
||||||
|
# https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriteoptions
|
||||||
|
#
|
||||||
|
# (6) Set %{ENV:PROTO} variable, to allow rewrites to redirect with the
|
||||||
|
# appropriate schema automatically (http or https).
|
||||||
|
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
|
||||||
|
# (1)
|
||||||
|
RewriteEngine On
|
||||||
|
|
||||||
|
# (2)
|
||||||
|
Options +FollowSymlinks
|
||||||
|
|
||||||
|
# (3)
|
||||||
|
# Options +SymLinksIfOwnerMatch
|
||||||
|
|
||||||
|
# (4)
|
||||||
|
# RewriteBase /
|
||||||
|
|
||||||
|
# (5)
|
||||||
|
# RewriteOptions <options>
|
||||||
|
|
||||||
|
# (6)
|
||||||
|
RewriteCond %{HTTPS} =on
|
||||||
|
RewriteRule ^ - [env=proto:https]
|
||||||
|
RewriteCond %{HTTPS} !=on
|
||||||
|
RewriteRule ^ - [env=proto:http]
|
||||||
|
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Forcing `https://` |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Redirect from the `http://` to the `https://` version of the URL.
|
||||||
|
# https://wiki.apache.org/httpd/RewriteHTTPToHTTPS
|
||||||
|
|
||||||
|
# <IfModule mod_rewrite.c>
|
||||||
|
# RewriteEngine On
|
||||||
|
# RewriteCond %{HTTPS} !=on
|
||||||
|
# RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
|
||||||
|
# </IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Suppressing / Forcing the `www.` at the beginning of URLs |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# The same content should never be available under two different
|
||||||
|
# URLs, especially not with and without `www.` at the beginning.
|
||||||
|
# This can cause SEO problems (duplicate content), and therefore,
|
||||||
|
# you should choose one of the alternatives and redirect the other
|
||||||
|
# one.
|
||||||
|
#
|
||||||
|
# By default `Option 1` (no `www.`) is activated.
|
||||||
|
# http://no-www.org/faq.php?q=class_b
|
||||||
|
#
|
||||||
|
# If you would prefer to use `Option 2`, just comment out all the
|
||||||
|
# lines from `Option 1` and uncomment the ones from `Option 2`.
|
||||||
|
#
|
||||||
|
# (!) NEVER USE BOTH RULES AT THE SAME TIME!
|
||||||
|
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
# Option 1: rewrite www.example.com → example.com
|
||||||
|
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteCond %{HTTPS} !=on
|
||||||
|
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
|
||||||
|
RewriteRule ^ %{ENV:PROTO}://%1%{REQUEST_URI} [R=301,L]
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
# Option 2: rewrite example.com → www.example.com
|
||||||
|
#
|
||||||
|
# Be aware that the following might not be a good idea if you use "real"
|
||||||
|
# subdomains for certain parts of your website.
|
||||||
|
|
||||||
|
# <IfModule mod_rewrite.c>
|
||||||
|
# RewriteEngine On
|
||||||
|
# RewriteCond %{HTTPS} !=on
|
||||||
|
# RewriteCond %{HTTP_HOST} !^www\. [NC]
|
||||||
|
# RewriteCond %{SERVER_ADDR} !=127.0.0.1
|
||||||
|
# RewriteCond %{SERVER_ADDR} !=::1
|
||||||
|
# RewriteRule ^ %{ENV:PROTO}://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
|
||||||
|
# </IfModule>
|
||||||
|
|
||||||
|
|
||||||
|
# ######################################################################
|
||||||
|
# # SECURITY #
|
||||||
|
# ######################################################################
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Clickjacking |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Protect website against clickjacking.
|
||||||
|
#
|
||||||
|
# The example below sends the `X-Frame-Options` response header with
|
||||||
|
# the value `DENY`, informing browsers not to display the content of
|
||||||
|
# the web page in any frame.
|
||||||
|
#
|
||||||
|
# This might not be the best setting for everyone. You should read
|
||||||
|
# about the other two possible values the `X-Frame-Options` header
|
||||||
|
# field can have: `SAMEORIGIN` and `ALLOW-FROM`.
|
||||||
|
# https://tools.ietf.org/html/rfc7034#section-2.1.
|
||||||
|
#
|
||||||
|
# Keep in mind that while you could send the `X-Frame-Options` header
|
||||||
|
# for all of your website’s pages, this has the potential downside that
|
||||||
|
# it forbids even non-malicious framing of your content (e.g.: when
|
||||||
|
# users visit your website using a Google Image Search results page).
|
||||||
|
#
|
||||||
|
# Nonetheless, you should ensure that you send the `X-Frame-Options`
|
||||||
|
# header for all pages that allow a user to make a state changing
|
||||||
|
# operation (e.g: pages that contain one-click purchase links, checkout
|
||||||
|
# or bank-transfer confirmation pages, pages that make permanent
|
||||||
|
# configuration changes, etc.).
|
||||||
|
#
|
||||||
|
# Sending the `X-Frame-Options` header can also protect your website
|
||||||
|
# against more than just clickjacking attacks:
|
||||||
|
# https://cure53.de/xfo-clickjacking.pdf.
|
||||||
|
#
|
||||||
|
# https://tools.ietf.org/html/rfc7034
|
||||||
|
# http://blogs.msdn.com/b/ieinternals/archive/2010/03/30/combating-clickjacking-with-x-frame-options.aspx
|
||||||
|
# https://www.owasp.org/index.php/Clickjacking
|
||||||
|
|
||||||
|
# <IfModule mod_headers.c>
|
||||||
|
|
||||||
|
# Header set X-Frame-Options "DENY"
|
||||||
|
|
||||||
|
# # `mod_headers` cannot match based on the content-type, however,
|
||||||
|
# # the `X-Frame-Options` response header should be send only for
|
||||||
|
# # HTML documents and not for the other resources.
|
||||||
|
|
||||||
|
# <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
|
||||||
|
# Header unset X-Frame-Options
|
||||||
|
# </FilesMatch>
|
||||||
|
|
||||||
|
# </IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Content Security Policy (CSP) |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Mitigate the risk of cross-site scripting and other content-injection
|
||||||
|
# attacks.
|
||||||
|
#
|
||||||
|
# This can be done by setting a `Content Security Policy` which
|
||||||
|
# whitelists trusted sources of content for your website.
|
||||||
|
#
|
||||||
|
# The example header below allows ONLY scripts that are loaded from
|
||||||
|
# the current website's origin (no inline scripts, no CDN, etc).
|
||||||
|
# That almost certainly won't work as-is for your website!
|
||||||
|
#
|
||||||
|
# To make things easier, you can use an online CSP header generator
|
||||||
|
# such as: http://cspisawesome.com/.
|
||||||
|
#
|
||||||
|
# http://content-security-policy.com/
|
||||||
|
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/
|
||||||
|
# http://www.w3.org/TR/CSP11/).
|
||||||
|
|
||||||
|
# <IfModule mod_headers.c>
|
||||||
|
|
||||||
|
# Header set Content-Security-Policy "script-src 'self'; object-src 'self'"
|
||||||
|
|
||||||
|
# # `mod_headers` cannot match based on the content-type, however,
|
||||||
|
# # the `Content-Security-Policy` response header should be send
|
||||||
|
# # only for HTML documents and not for the other resources.
|
||||||
|
|
||||||
|
# <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
|
||||||
|
# Header unset Content-Security-Policy
|
||||||
|
# </FilesMatch>
|
||||||
|
|
||||||
|
# </IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | File access |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Block access to directories without a default document.
|
||||||
|
#
|
||||||
|
# You should leave the following uncommented, as you shouldn't allow
|
||||||
|
# anyone to surf through every directory on your server (which may
|
||||||
|
# includes rather private places such as the CMS's directories).
|
||||||
|
|
||||||
|
<IfModule mod_autoindex.c>
|
||||||
|
Options -Indexes
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
# Block access to all hidden files and directories with the exception of
|
||||||
|
# the visible content from within the `/.well-known/` hidden directory.
|
||||||
|
#
|
||||||
|
# These types of files usually contain user preferences or the preserved
|
||||||
|
# state of an utility, and can include rather private places like, for
|
||||||
|
# example, the `.git` or `.svn` directories.
|
||||||
|
#
|
||||||
|
# The `/.well-known/` directory represents the standard (RFC 5785) path
|
||||||
|
# prefix for "well-known locations" (e.g.: `/.well-known/manifest.json`,
|
||||||
|
# `/.well-known/keybase.txt`), and therefore, access to its visible
|
||||||
|
# content should not be blocked.
|
||||||
|
#
|
||||||
|
# https://www.mnot.net/blog/2010/04/07/well-known
|
||||||
|
# https://tools.ietf.org/html/rfc5785
|
||||||
|
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteCond %{REQUEST_URI} "!(^|/)\.well-known/([^./]+./?)+$" [NC]
|
||||||
|
RewriteCond %{SCRIPT_FILENAME} -d [OR]
|
||||||
|
RewriteCond %{SCRIPT_FILENAME} -f
|
||||||
|
RewriteRule "(^|/)\." - [F]
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
# Block access to files that can expose sensitive information.
|
||||||
|
#
|
||||||
|
# By default, block access to backup and source files that may be
|
||||||
|
# left by some text editors and can pose a security risk when anyone
|
||||||
|
# has access to them.
|
||||||
|
#
|
||||||
|
# http://feross.org/cmsploit/
|
||||||
|
#
|
||||||
|
# (!) Update the `<FilesMatch>` regular expression from below to
|
||||||
|
# include any files that might end up on your production server and
|
||||||
|
# can expose sensitive information about your website. These files may
|
||||||
|
# include: configuration files, files that contain metadata about the
|
||||||
|
# project (e.g.: project dependencies), build scripts, etc..
|
||||||
|
|
||||||
|
<FilesMatch "(^#.*#|\.(bak|conf|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$">
|
||||||
|
|
||||||
|
# Apache < 2.3
|
||||||
|
<IfModule !mod_authz_core.c>
|
||||||
|
Order allow,deny
|
||||||
|
Deny from all
|
||||||
|
Satisfy All
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# Apache ≥ 2.3
|
||||||
|
<IfModule mod_authz_core.c>
|
||||||
|
Require all denied
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
</FilesMatch>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | HTTP Strict Transport Security (HSTS) |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Force client-side SSL redirection.
|
||||||
|
#
|
||||||
|
# If a user types `example.com` in their browser, even if the server
|
||||||
|
# redirects them to the secure version of the website, that still leaves
|
||||||
|
# a window of opportunity (the initial HTTP connection) for an attacker
|
||||||
|
# to downgrade or redirect the request.
|
||||||
|
#
|
||||||
|
# The following header ensures that browser will ONLY connect to your
|
||||||
|
# server via HTTPS, regardless of what the users type in the browser's
|
||||||
|
# address bar.
|
||||||
|
#
|
||||||
|
# (!) Remove the `includeSubDomains` optional directive if the website's
|
||||||
|
# subdomains are not using HTTPS.
|
||||||
|
#
|
||||||
|
# http://www.html5rocks.com/en/tutorials/security/transport-layer-security/
|
||||||
|
# https://tools.ietf.org/html/draft-ietf-websec-strict-transport-sec-14#section-6.1
|
||||||
|
# http://blogs.msdn.com/b/ieinternals/archive/2014/08/18/hsts-strict-transport-security-attacks-mitigations-deployment-https.aspx
|
||||||
|
|
||||||
|
# <IfModule mod_headers.c>
|
||||||
|
# Header always set Strict-Transport-Security "max-age=16070400; includeSubDomains"
|
||||||
|
# </IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Reducing MIME type security risks |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Prevent some browsers from MIME-sniffing the response.
|
||||||
|
#
|
||||||
|
# This reduces exposure to drive-by download attacks and cross-origin
|
||||||
|
# data leaks, and should be left uncommented, especially if the server
|
||||||
|
# is serving user-uploaded content or content that could potentially be
|
||||||
|
# treated as executable by the browser.
|
||||||
|
#
|
||||||
|
# http://www.slideshare.net/hasegawayosuke/owasp-hasegawa
|
||||||
|
# http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
|
||||||
|
# https://msdn.microsoft.com/en-us/library/ie/gg622941.aspx
|
||||||
|
# https://mimesniff.spec.whatwg.org/
|
||||||
|
|
||||||
|
<IfModule mod_headers.c>
|
||||||
|
Header set X-Content-Type-Options "nosniff"
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Reflected Cross-Site Scripting (XSS) attacks |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# (1) Try to re-enable the cross-site scripting (XSS) filter built
|
||||||
|
# into most web browsers.
|
||||||
|
#
|
||||||
|
# The filter is usually enabled by default, but in some cases it
|
||||||
|
# may be disabled by the user. However, in Internet Explorer for
|
||||||
|
# example, it can be re-enabled just by sending the
|
||||||
|
# `X-XSS-Protection` header with the value of `1`.
|
||||||
|
#
|
||||||
|
# (2) Prevent web browsers from rendering the web page if a potential
|
||||||
|
# reflected (a.k.a non-persistent) XSS attack is detected by the
|
||||||
|
# filter.
|
||||||
|
#
|
||||||
|
# By default, if the filter is enabled and browsers detect a
|
||||||
|
# reflected XSS attack, they will attempt to block the attack
|
||||||
|
# by making the smallest possible modifications to the returned
|
||||||
|
# web page.
|
||||||
|
#
|
||||||
|
# Unfortunately, in some browsers (e.g.: Internet Explorer),
|
||||||
|
# this default behavior may allow the XSS filter to be exploited,
|
||||||
|
# thereby, it's better to inform browsers to prevent the rendering
|
||||||
|
# of the page altogether, instead of attempting to modify it.
|
||||||
|
#
|
||||||
|
# https://hackademix.net/2009/11/21/ies-xss-filter-creates-xss-vulnerabilities
|
||||||
|
#
|
||||||
|
# (!) Do not rely on the XSS filter to prevent XSS attacks! Ensure that
|
||||||
|
# you are taking all possible measures to prevent XSS attacks, the
|
||||||
|
# most obvious being: validating and sanitizing your website's inputs.
|
||||||
|
#
|
||||||
|
# http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-iv-the-xss-filter.aspx
|
||||||
|
# http://blogs.msdn.com/b/ieinternals/archive/2011/01/31/controlling-the-internet-explorer-xss-filter-with-the-x-xss-protection-http-header.aspx
|
||||||
|
# https://www.owasp.org/index.php/Cross-site_Scripting_%28XSS%29
|
||||||
|
|
||||||
|
# <IfModule mod_headers.c>
|
||||||
|
|
||||||
|
# # (1) (2)
|
||||||
|
# Header set X-XSS-Protection "1; mode=block"
|
||||||
|
|
||||||
|
# # `mod_headers` cannot match based on the content-type, however,
|
||||||
|
# # the `X-XSS-Protection` response header should be send only for
|
||||||
|
# # HTML documents and not for the other resources.
|
||||||
|
|
||||||
|
# <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
|
||||||
|
# Header unset X-XSS-Protection
|
||||||
|
# </FilesMatch>
|
||||||
|
|
||||||
|
# </IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Server-side technology information |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Remove the `X-Powered-By` response header that:
|
||||||
|
#
|
||||||
|
# * is set by some frameworks and server-side languages
|
||||||
|
# (e.g.: ASP.NET, PHP), and its value contains information
|
||||||
|
# about them (e.g.: their name, version number)
|
||||||
|
#
|
||||||
|
# * doesn't provide any value as far as users are concern,
|
||||||
|
# and in some cases, the information provided by it can
|
||||||
|
# be used by attackers
|
||||||
|
#
|
||||||
|
# (!) If you can, you should disable the `X-Powered-By` header from the
|
||||||
|
# language / framework level (e.g.: for PHP, you can do that by setting
|
||||||
|
# `expose_php = off` in `php.ini`)
|
||||||
|
#
|
||||||
|
# https://php.net/manual/en/ini.core.php#ini.expose-php
|
||||||
|
|
||||||
|
<IfModule mod_headers.c>
|
||||||
|
Header unset X-Powered-By
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Server software information |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Prevent Apache from adding a trailing footer line containing
|
||||||
|
# information about the server to the server-generated documents
|
||||||
|
# (e.g.: error messages, directory listings, etc.)
|
||||||
|
#
|
||||||
|
# https://httpd.apache.org/docs/current/mod/core.html#serversignature
|
||||||
|
|
||||||
|
ServerSignature Off
|
||||||
|
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
# Prevent Apache from sending in the `Server` response header its
|
||||||
|
# exact version number, the description of the generic OS-type or
|
||||||
|
# information about its compiled-in modules.
|
||||||
|
#
|
||||||
|
# (!) The `ServerTokens` directive will only work in the main server
|
||||||
|
# configuration file, so don't try to enable it in the `.htaccess` file!
|
||||||
|
#
|
||||||
|
# https://httpd.apache.org/docs/current/mod/core.html#servertokens
|
||||||
|
|
||||||
|
#ServerTokens Prod
|
||||||
|
|
||||||
|
|
||||||
|
# ######################################################################
|
||||||
|
# # WEB PERFORMANCE #
|
||||||
|
# ######################################################################
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Compression |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
<IfModule mod_deflate.c>
|
||||||
|
|
||||||
|
# Force compression for mangled `Accept-Encoding` request headers
|
||||||
|
# https://developer.yahoo.com/blogs/ydn/pushing-beyond-gzipping-25601.html
|
||||||
|
|
||||||
|
<IfModule mod_setenvif.c>
|
||||||
|
<IfModule mod_headers.c>
|
||||||
|
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
|
||||||
|
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
|
||||||
|
</IfModule>
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
# Compress all output labeled with one of the following media types.
|
||||||
|
#
|
||||||
|
# (!) For Apache versions below version 2.3.7 you don't need to
|
||||||
|
# enable `mod_filter` and can remove the `<IfModule mod_filter.c>`
|
||||||
|
# and `</IfModule>` lines as `AddOutputFilterByType` is still in
|
||||||
|
# the core directives.
|
||||||
|
#
|
||||||
|
# https://httpd.apache.org/docs/current/mod/mod_filter.html#addoutputfilterbytype
|
||||||
|
|
||||||
|
<IfModule mod_filter.c>
|
||||||
|
AddOutputFilterByType DEFLATE "application/atom+xml" \
|
||||||
|
"application/javascript" \
|
||||||
|
"application/json" \
|
||||||
|
"application/ld+json" \
|
||||||
|
"application/manifest+json" \
|
||||||
|
"application/rdf+xml" \
|
||||||
|
"application/rss+xml" \
|
||||||
|
"application/schema+json" \
|
||||||
|
"application/vnd.geo+json" \
|
||||||
|
"application/vnd.ms-fontobject" \
|
||||||
|
"application/x-font-ttf" \
|
||||||
|
"application/x-javascript" \
|
||||||
|
"application/x-web-app-manifest+json" \
|
||||||
|
"application/xhtml+xml" \
|
||||||
|
"application/xml" \
|
||||||
|
"font/eot" \
|
||||||
|
"font/opentype" \
|
||||||
|
"image/bmp" \
|
||||||
|
"image/svg+xml" \
|
||||||
|
"image/vnd.microsoft.icon" \
|
||||||
|
"image/x-icon" \
|
||||||
|
"text/cache-manifest" \
|
||||||
|
"text/css" \
|
||||||
|
"text/html" \
|
||||||
|
"text/javascript" \
|
||||||
|
"text/plain" \
|
||||||
|
"text/vcard" \
|
||||||
|
"text/vnd.rim.location.xloc" \
|
||||||
|
"text/vtt" \
|
||||||
|
"text/x-component" \
|
||||||
|
"text/x-cross-domain-policy" \
|
||||||
|
"text/xml"
|
||||||
|
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
# Map the following filename extensions to the specified
|
||||||
|
# encoding type in order to make Apache serve the file types
|
||||||
|
# with the appropriate `Content-Encoding` response header
|
||||||
|
# (do note that this will NOT make Apache compress them!).
|
||||||
|
#
|
||||||
|
# If these files types would be served without an appropriate
|
||||||
|
# `Content-Enable` response header, client applications (e.g.:
|
||||||
|
# browsers) wouldn't know that they first need to uncompress
|
||||||
|
# the response, and thus, wouldn't be able to understand the
|
||||||
|
# content.
|
||||||
|
#
|
||||||
|
# https://httpd.apache.org/docs/current/mod/mod_mime.html#addencoding
|
||||||
|
|
||||||
|
<IfModule mod_mime.c>
|
||||||
|
AddEncoding gzip svgz
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Content transformation |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Prevent intermediate caches or proxies (e.g.: such as the ones
|
||||||
|
# used by mobile network providers) from modifying the website's
|
||||||
|
# content.
|
||||||
|
#
|
||||||
|
# https://tools.ietf.org/html/rfc2616#section-14.9.5
|
||||||
|
#
|
||||||
|
# (!) If you are using `mod_pagespeed`, please note that setting
|
||||||
|
# the `Cache-Control: no-transform` response header will prevent
|
||||||
|
# `PageSpeed` from rewriting `HTML` files, and, if the
|
||||||
|
# `ModPagespeedDisableRewriteOnNoTransform` directive isn't set
|
||||||
|
# to `off`, also from rewriting other resources.
|
||||||
|
#
|
||||||
|
# https://developers.google.com/speed/pagespeed/module/configuration#notransform
|
||||||
|
|
||||||
|
# <IfModule mod_headers.c>
|
||||||
|
# Header merge Cache-Control "no-transform"
|
||||||
|
# </IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | ETags |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Remove `ETags` as resources are sent with far-future expires headers.
|
||||||
|
#
|
||||||
|
# https://developer.yahoo.com/performance/rules.html#etags
|
||||||
|
# https://tools.ietf.org/html/rfc7232#section-2.3
|
||||||
|
|
||||||
|
# `FileETag None` doesn't work in all cases.
|
||||||
|
<IfModule mod_headers.c>
|
||||||
|
Header unset ETag
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
FileETag None
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Expires headers |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Serve resources with far-future expires headers.
|
||||||
|
#
|
||||||
|
# (!) If you don't control versioning with filename-based
|
||||||
|
# cache busting, you should consider lowering the cache times
|
||||||
|
# to something like one week.
|
||||||
|
#
|
||||||
|
# https://httpd.apache.org/docs/current/mod/mod_expires.html
|
||||||
|
|
||||||
|
<IfModule mod_expires.c>
|
||||||
|
|
||||||
|
ExpiresActive on
|
||||||
|
ExpiresDefault "access plus 1 month"
|
||||||
|
|
||||||
|
# CSS
|
||||||
|
|
||||||
|
ExpiresByType text/css "access plus 1 year"
|
||||||
|
|
||||||
|
|
||||||
|
# Data interchange
|
||||||
|
|
||||||
|
ExpiresByType application/atom+xml "access plus 1 hour"
|
||||||
|
ExpiresByType application/rdf+xml "access plus 1 hour"
|
||||||
|
ExpiresByType application/rss+xml "access plus 1 hour"
|
||||||
|
|
||||||
|
ExpiresByType application/json "access plus 0 seconds"
|
||||||
|
ExpiresByType application/ld+json "access plus 0 seconds"
|
||||||
|
ExpiresByType application/schema+json "access plus 0 seconds"
|
||||||
|
ExpiresByType application/vnd.geo+json "access plus 0 seconds"
|
||||||
|
ExpiresByType application/xml "access plus 0 seconds"
|
||||||
|
ExpiresByType text/xml "access plus 0 seconds"
|
||||||
|
|
||||||
|
|
||||||
|
# Favicon (cannot be renamed!) and cursor images
|
||||||
|
|
||||||
|
ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
|
||||||
|
ExpiresByType image/x-icon "access plus 1 week"
|
||||||
|
|
||||||
|
# HTML
|
||||||
|
|
||||||
|
ExpiresByType text/html "access plus 0 seconds"
|
||||||
|
|
||||||
|
|
||||||
|
# JavaScript
|
||||||
|
|
||||||
|
ExpiresByType application/javascript "access plus 1 year"
|
||||||
|
ExpiresByType application/x-javascript "access plus 1 year"
|
||||||
|
ExpiresByType text/javascript "access plus 1 year"
|
||||||
|
|
||||||
|
|
||||||
|
# Manifest files
|
||||||
|
|
||||||
|
ExpiresByType application/manifest+json "access plus 1 week"
|
||||||
|
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
|
||||||
|
ExpiresByType text/cache-manifest "access plus 0 seconds"
|
||||||
|
|
||||||
|
|
||||||
|
# Media files
|
||||||
|
|
||||||
|
ExpiresByType audio/ogg "access plus 1 month"
|
||||||
|
ExpiresByType image/bmp "access plus 1 month"
|
||||||
|
ExpiresByType image/gif "access plus 1 month"
|
||||||
|
ExpiresByType image/jpeg "access plus 1 month"
|
||||||
|
ExpiresByType image/png "access plus 1 month"
|
||||||
|
ExpiresByType image/svg+xml "access plus 1 month"
|
||||||
|
ExpiresByType image/webp "access plus 1 month"
|
||||||
|
ExpiresByType video/mp4 "access plus 1 month"
|
||||||
|
ExpiresByType video/ogg "access plus 1 month"
|
||||||
|
ExpiresByType video/webm "access plus 1 month"
|
||||||
|
|
||||||
|
|
||||||
|
# Web fonts
|
||||||
|
|
||||||
|
# Embedded OpenType (EOT)
|
||||||
|
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
|
||||||
|
ExpiresByType font/eot "access plus 1 month"
|
||||||
|
|
||||||
|
# OpenType
|
||||||
|
ExpiresByType font/opentype "access plus 1 month"
|
||||||
|
|
||||||
|
# TrueType
|
||||||
|
ExpiresByType application/x-font-ttf "access plus 1 month"
|
||||||
|
|
||||||
|
# Web Open Font Format (WOFF) 1.0
|
||||||
|
ExpiresByType application/font-woff "access plus 1 month"
|
||||||
|
ExpiresByType application/x-font-woff "access plus 1 month"
|
||||||
|
ExpiresByType font/woff "access plus 1 month"
|
||||||
|
|
||||||
|
# Web Open Font Format (WOFF) 2.0
|
||||||
|
ExpiresByType application/font-woff2 "access plus 1 month"
|
||||||
|
|
||||||
|
|
||||||
|
# Other
|
||||||
|
|
||||||
|
ExpiresByType text/x-cross-domain-policy "access plus 1 week"
|
||||||
|
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | File concatenation |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Allow concatenation from within specific files.
|
||||||
|
#
|
||||||
|
# e.g.:
|
||||||
|
#
|
||||||
|
# If you have the following lines in a file called, for
|
||||||
|
# example, `main.combined.js`:
|
||||||
|
#
|
||||||
|
# <!--#include file="js/jquery.js" -->
|
||||||
|
# <!--#include file="js/jquery.timer.js" -->
|
||||||
|
#
|
||||||
|
# Apache will replace those lines with the content of the
|
||||||
|
# specified files.
|
||||||
|
|
||||||
|
# <IfModule mod_include.c>
|
||||||
|
# <FilesMatch "\.combined\.js$">
|
||||||
|
# Options +Includes
|
||||||
|
# AddOutputFilterByType INCLUDES application/javascript \
|
||||||
|
# application/x-javascript \
|
||||||
|
# text/javascript
|
||||||
|
# SetOutputFilter INCLUDES
|
||||||
|
# </FilesMatch>
|
||||||
|
# <FilesMatch "\.combined\.css$">
|
||||||
|
# Options +Includes
|
||||||
|
# AddOutputFilterByType INCLUDES text/css
|
||||||
|
# SetOutputFilter INCLUDES
|
||||||
|
# </FilesMatch>
|
||||||
|
# </IfModule>
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
# | Filename-based cache busting |
|
||||||
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# If you're not using a build process to manage your filename version
|
||||||
|
# revving, you might want to consider enabling the following directives
|
||||||
|
# to route all requests such as `/style.12345.css` to `/style.css`.
|
||||||
|
#
|
||||||
|
# To understand why this is important and even a better solution than
|
||||||
|
# using something like `*.css?v231`, please see:
|
||||||
|
# http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
|
||||||
|
|
||||||
|
# <IfModule mod_rewrite.c>
|
||||||
|
# RewriteEngine On
|
||||||
|
# RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
# RewriteRule ^(.+)\.(\d+)\.(bmp|css|cur|gif|ico|jpe?g|js|png|svgz?|webp|webmanifest)$ $1.$3 [L]
|
||||||
|
# </IfModule>
|
||||||
BIN
.index.html.swp
Normal file
BIN
.index.html.swp
Normal file
Binary file not shown.
60
404.html
Normal file
60
404.html
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Page Not Found</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<style>
|
||||||
|
|
||||||
|
* {
|
||||||
|
line-height: 1.2;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
color: #888;
|
||||||
|
display: table;
|
||||||
|
font-family: sans-serif;
|
||||||
|
height: 100%;
|
||||||
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
display: table-cell;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin: 2em auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
color: #555;
|
||||||
|
font-size: 2em;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 280px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 280px) {
|
||||||
|
|
||||||
|
body, p {
|
||||||
|
width: 95%;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 1.5em;
|
||||||
|
margin: 0 0 0.3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Page Not Found</h1>
|
||||||
|
<p>Sorry, but the page you were trying to view does not exist.</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
<!-- IE needs 512+ bytes: https://blogs.msdn.microsoft.com/ieinternals/2010/08/18/friendly-http-error-pages/ -->
|
||||||
19
LICENSE.txt
Normal file
19
LICENSE.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) HTML5 Boilerplate
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
12
browserconfig.xml
Normal file
12
browserconfig.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Please read: https://msdn.microsoft.com/en-us/library/ie/dn455106.aspx -->
|
||||||
|
<browserconfig>
|
||||||
|
<msapplication>
|
||||||
|
<tile>
|
||||||
|
<square70x70logo src="tile.png"/>
|
||||||
|
<square150x150logo src="tile.png"/>
|
||||||
|
<wide310x150logo src="tile-wide.png"/>
|
||||||
|
<square310x310logo src="tile.png"/>
|
||||||
|
</tile>
|
||||||
|
</msapplication>
|
||||||
|
</browserconfig>
|
||||||
BIN
css/.main.css.swp
Normal file
BIN
css/.main.css.swp
Normal file
Binary file not shown.
86
css/jquery.slide.css
Normal file
86
css/jquery.slide.css
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
.slide {
|
||||||
|
position: relative;
|
||||||
|
margin-left: 100px auto;
|
||||||
|
margin-right: 100px auto;
|
||||||
|
margin-bottom: 100px auto;
|
||||||
|
margin-top: 10px;
|
||||||
|
width: 60%;
|
||||||
|
height: 450px;
|
||||||
|
background: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide ul li {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide .dots {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 20px;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 3;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide .dots li {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 10px;
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
border: 2px solid #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
opacity: 0.4;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background .5s, opacity .5s;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide .dots li.active {
|
||||||
|
background: #fff;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide .arrow {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 2;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
transition: background .5s, opacity .5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide .arrow .arrow-left,
|
||||||
|
.slide .arrow .arrow-right {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
margin-top: -25px;
|
||||||
|
display: block;
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 0.5;
|
||||||
|
transition: background .5s, opacity .5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide .arrow .arrow-left:hover,
|
||||||
|
.slide .arrow .arrow-right:hover {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide .arrow .arrow-left {
|
||||||
|
left: 20px;
|
||||||
|
background: url("../img/arrow-left.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide .arrow .arrow-right {
|
||||||
|
right: 20px;
|
||||||
|
background: url("../img/arrow-right.png");
|
||||||
|
}
|
||||||
308
css/main.css
Normal file
308
css/main.css
Normal file
@@ -0,0 +1,308 @@
|
|||||||
|
/*! HTML5 Boilerplate v6.0.1 | MIT License | https://html5boilerplate.com/ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* What follows is the result of much research on cross-browser styling.
|
||||||
|
* Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
|
||||||
|
* Kroc Camen, and the H5BP dev community and team.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Base styles: opinionated defaults
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
html {
|
||||||
|
color: #222;
|
||||||
|
font-size: 1em;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Remove text-shadow in selection highlight:
|
||||||
|
* https://twitter.com/miketaylr/status/12228805301
|
||||||
|
*
|
||||||
|
* Vendor-prefixed and regular ::selection selectors cannot be combined:
|
||||||
|
* https://stackoverflow.com/a/16982510/7133471
|
||||||
|
*
|
||||||
|
* Customize the background color to match your design.
|
||||||
|
*/
|
||||||
|
|
||||||
|
::-moz-selection {
|
||||||
|
background: #b3d4fc;
|
||||||
|
text-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
::selection {
|
||||||
|
background: #b3d4fc;
|
||||||
|
text-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A better looking default horizontal rule
|
||||||
|
*/
|
||||||
|
|
||||||
|
hr {
|
||||||
|
display: block;
|
||||||
|
height: 1px;
|
||||||
|
border: 0;
|
||||||
|
border-top: 1px solid #ccc;
|
||||||
|
margin: 1em 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Remove the gap between audio, canvas, iframes,
|
||||||
|
* images, videos and the bottom of their containers:
|
||||||
|
* https://github.com/h5bp/html5-boilerplate/issues/440
|
||||||
|
*/
|
||||||
|
|
||||||
|
audio,
|
||||||
|
canvas,
|
||||||
|
iframe,
|
||||||
|
img,
|
||||||
|
svg,
|
||||||
|
video {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Remove default fieldset styles.
|
||||||
|
*/
|
||||||
|
|
||||||
|
fieldset {
|
||||||
|
border: 0;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allow only vertical resizing of textareas.
|
||||||
|
*/
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
resize: vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Browser Upgrade Prompt
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
.browserupgrade {
|
||||||
|
margin: 0.2em 0;
|
||||||
|
background: #ccc;
|
||||||
|
color: #000;
|
||||||
|
padding: 0.2em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Author's custom styles
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Helper classes
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Hide visually and from screen readers
|
||||||
|
*/
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Hide only visually, but have it available for screen readers:
|
||||||
|
* https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
|
||||||
|
*
|
||||||
|
* 1. For long content, line feeds are not interpreted as spaces and small width
|
||||||
|
* causes content to wrap 1 word per line:
|
||||||
|
* https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
|
||||||
|
*/
|
||||||
|
|
||||||
|
.visuallyhidden {
|
||||||
|
border: 0;
|
||||||
|
clip: rect(0 0 0 0);
|
||||||
|
-webkit-clip-path: inset(50%);
|
||||||
|
clip-path: inset(50%);
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0;
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
white-space: nowrap; /* 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Extends the .visuallyhidden class to allow the element
|
||||||
|
* to be focusable when navigated to via the keyboard:
|
||||||
|
* https://www.drupal.org/node/897638
|
||||||
|
*/
|
||||||
|
|
||||||
|
.visuallyhidden.focusable:active,
|
||||||
|
.visuallyhidden.focusable:focus {
|
||||||
|
clip: auto;
|
||||||
|
-webkit-clip-path: none;
|
||||||
|
clip-path: none;
|
||||||
|
height: auto;
|
||||||
|
margin: 0;
|
||||||
|
overflow: visible;
|
||||||
|
position: static;
|
||||||
|
width: auto;
|
||||||
|
white-space: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Hide visually and from screen readers, but maintain layout
|
||||||
|
*/
|
||||||
|
|
||||||
|
.invisible {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Clearfix: contain floats
|
||||||
|
*
|
||||||
|
* For modern browsers
|
||||||
|
* 1. The space content is one way to avoid an Opera bug when the
|
||||||
|
* `contenteditable` attribute is included anywhere else in the document.
|
||||||
|
* Otherwise it causes space to appear at the top and bottom of elements
|
||||||
|
* that receive the `clearfix` class.
|
||||||
|
* 2. The use of `table` rather than `block` is only necessary if using
|
||||||
|
* `:before` to contain the top-margins of child elements.
|
||||||
|
*/
|
||||||
|
|
||||||
|
.clearfix:before,
|
||||||
|
.clearfix:after {
|
||||||
|
content: " "; /* 1 */
|
||||||
|
display: table; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.clearfix:after {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
EXAMPLE Media Queries for Responsive Design.
|
||||||
|
These examples override the primary ('mobile first') styles.
|
||||||
|
Modify as content requires.
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
@media only screen and (min-width: 35em) {
|
||||||
|
/* Style adjustments for viewports that meet the condition */
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print,
|
||||||
|
(-webkit-min-device-pixel-ratio: 1.25),
|
||||||
|
(min-resolution: 1.25dppx),
|
||||||
|
(min-resolution: 120dpi) {
|
||||||
|
/* Style adjustments for high resolution devices */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ==========================================================================
|
||||||
|
Print styles.
|
||||||
|
Inlined to avoid the additional HTTP request:
|
||||||
|
http://www.phpied.com/delay-loading-your-print-css/
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
*,
|
||||||
|
*:before,
|
||||||
|
*:after {
|
||||||
|
background: transparent !important;
|
||||||
|
color: #000 !important; /* Black prints faster:
|
||||||
|
http://www.sanbeiji.com/archives/953 */
|
||||||
|
box-shadow: none !important;
|
||||||
|
text-shadow: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
a,
|
||||||
|
a:visited {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
a[href]:after {
|
||||||
|
content: " (" attr(href) ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
abbr[title]:after {
|
||||||
|
content: " (" attr(title) ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Don't show links that are fragment identifiers,
|
||||||
|
* or use the `javascript:` pseudo protocol
|
||||||
|
*/
|
||||||
|
|
||||||
|
a[href^="#"]:after,
|
||||||
|
a[href^="javascript:"]:after {
|
||||||
|
content: "";
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
white-space: pre-wrap !important;
|
||||||
|
}
|
||||||
|
pre,
|
||||||
|
blockquote {
|
||||||
|
border: 1px solid #999;
|
||||||
|
page-break-inside: avoid;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Printing Tables:
|
||||||
|
* http://css-discuss.incutio.com/wiki/Printing_Tables
|
||||||
|
*/
|
||||||
|
|
||||||
|
thead {
|
||||||
|
display: table-header-group;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr,
|
||||||
|
img {
|
||||||
|
page-break-inside: avoid;
|
||||||
|
}
|
||||||
|
|
||||||
|
p,
|
||||||
|
h2,
|
||||||
|
h3 {
|
||||||
|
orphans: 3;
|
||||||
|
widows: 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2,
|
||||||
|
h3 {
|
||||||
|
page-break-after: avoid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.custom-restricted-width {
|
||||||
|
/* To limit the menu width to the content of the menu: */
|
||||||
|
display: inline-block;
|
||||||
|
/* Or set the width explicitly: */
|
||||||
|
/* width: 10em; */
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.limited-width {
|
||||||
|
width: 40%;
|
||||||
|
margin-right: 10%;
|
||||||
|
margin-left: 20%;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
447
css/normalize.css
vendored
Normal file
447
css/normalize.css
vendored
Normal file
@@ -0,0 +1,447 @@
|
|||||||
|
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
|
||||||
|
|
||||||
|
/* Document
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct the line height in all browsers.
|
||||||
|
* 2. Prevent adjustments of font size after orientation changes in
|
||||||
|
* IE on Windows Phone and in iOS.
|
||||||
|
*/
|
||||||
|
|
||||||
|
html {
|
||||||
|
line-height: 1.15; /* 1 */
|
||||||
|
-ms-text-size-adjust: 100%; /* 2 */
|
||||||
|
-webkit-text-size-adjust: 100%; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Sections
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the margin in all browsers (opinionated).
|
||||||
|
*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct display in IE 9-.
|
||||||
|
*/
|
||||||
|
|
||||||
|
article,
|
||||||
|
aside,
|
||||||
|
footer,
|
||||||
|
header,
|
||||||
|
nav,
|
||||||
|
section {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Correct the font size and margin on `h1` elements within `section` and
|
||||||
|
* `article` contexts in Chrome, Firefox, and Safari.
|
||||||
|
*/
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 2em;
|
||||||
|
margin: 0.67em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Grouping content
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct display in IE 9-.
|
||||||
|
* 1. Add the correct display in IE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
figcaption,
|
||||||
|
figure,
|
||||||
|
main { /* 1 */
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct margin in IE 8.
|
||||||
|
*/
|
||||||
|
|
||||||
|
figure {
|
||||||
|
margin: 1em 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Add the correct box sizing in Firefox.
|
||||||
|
* 2. Show the overflow in Edge and IE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
hr {
|
||||||
|
box-sizing: content-box; /* 1 */
|
||||||
|
height: 0; /* 1 */
|
||||||
|
overflow: visible; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||||
|
* 2. Correct the odd `em` font sizing in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
pre {
|
||||||
|
font-family: monospace, monospace; /* 1 */
|
||||||
|
font-size: 1em; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Text-level semantics
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Remove the gray background on active links in IE 10.
|
||||||
|
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
|
||||||
|
*/
|
||||||
|
|
||||||
|
a {
|
||||||
|
background-color: transparent; /* 1 */
|
||||||
|
-webkit-text-decoration-skip: objects; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Remove the bottom border in Chrome 57- and Firefox 39-.
|
||||||
|
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
||||||
|
*/
|
||||||
|
|
||||||
|
abbr[title] {
|
||||||
|
border-bottom: none; /* 1 */
|
||||||
|
text-decoration: underline; /* 2 */
|
||||||
|
text-decoration: underline dotted; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prevent the duplicate application of `bolder` by the next rule in Safari 6.
|
||||||
|
*/
|
||||||
|
|
||||||
|
b,
|
||||||
|
strong {
|
||||||
|
font-weight: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct font weight in Chrome, Edge, and Safari.
|
||||||
|
*/
|
||||||
|
|
||||||
|
b,
|
||||||
|
strong {
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||||
|
* 2. Correct the odd `em` font sizing in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
code,
|
||||||
|
kbd,
|
||||||
|
samp {
|
||||||
|
font-family: monospace, monospace; /* 1 */
|
||||||
|
font-size: 1em; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct font style in Android 4.3-.
|
||||||
|
*/
|
||||||
|
|
||||||
|
dfn {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct background and color in IE 9-.
|
||||||
|
*/
|
||||||
|
|
||||||
|
mark {
|
||||||
|
background-color: #ff0;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct font size in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
small {
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prevent `sub` and `sup` elements from affecting the line height in
|
||||||
|
* all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
sub,
|
||||||
|
sup {
|
||||||
|
font-size: 75%;
|
||||||
|
line-height: 0;
|
||||||
|
position: relative;
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub {
|
||||||
|
bottom: -0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
sup {
|
||||||
|
top: -0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Embedded content
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct display in IE 9-.
|
||||||
|
*/
|
||||||
|
|
||||||
|
audio,
|
||||||
|
video {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct display in iOS 4-7.
|
||||||
|
*/
|
||||||
|
|
||||||
|
audio:not([controls]) {
|
||||||
|
display: none;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the border on images inside links in IE 10-.
|
||||||
|
*/
|
||||||
|
|
||||||
|
img {
|
||||||
|
border-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide the overflow in IE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
svg:not(:root) {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Forms
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Change the font styles in all browsers (opinionated).
|
||||||
|
* 2. Remove the margin in Firefox and Safari.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
input,
|
||||||
|
optgroup,
|
||||||
|
select,
|
||||||
|
textarea {
|
||||||
|
font-family: sans-serif; /* 1 */
|
||||||
|
font-size: 100%; /* 1 */
|
||||||
|
line-height: 1.15; /* 1 */
|
||||||
|
margin: 0; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the overflow in IE.
|
||||||
|
* 1. Show the overflow in Edge.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
input { /* 1 */
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
||||||
|
* 1. Remove the inheritance of text transform in Firefox.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
select { /* 1 */
|
||||||
|
text-transform: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
|
||||||
|
* controls in Android 4.
|
||||||
|
* 2. Correct the inability to style clickable types in iOS and Safari.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
html [type="button"], /* 1 */
|
||||||
|
[type="reset"],
|
||||||
|
[type="submit"] {
|
||||||
|
-webkit-appearance: button; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the inner border and padding in Firefox.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button::-moz-focus-inner,
|
||||||
|
[type="button"]::-moz-focus-inner,
|
||||||
|
[type="reset"]::-moz-focus-inner,
|
||||||
|
[type="submit"]::-moz-focus-inner {
|
||||||
|
border-style: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Restore the focus styles unset by the previous rule.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button:-moz-focusring,
|
||||||
|
[type="button"]:-moz-focusring,
|
||||||
|
[type="reset"]:-moz-focusring,
|
||||||
|
[type="submit"]:-moz-focusring {
|
||||||
|
outline: 1px dotted ButtonText;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Correct the padding in Firefox.
|
||||||
|
*/
|
||||||
|
|
||||||
|
fieldset {
|
||||||
|
padding: 0.35em 0.75em 0.625em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct the text wrapping in Edge and IE.
|
||||||
|
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
||||||
|
* 3. Remove the padding so developers are not caught out when they zero out
|
||||||
|
* `fieldset` elements in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
legend {
|
||||||
|
box-sizing: border-box; /* 1 */
|
||||||
|
color: inherit; /* 2 */
|
||||||
|
display: table; /* 1 */
|
||||||
|
max-width: 100%; /* 1 */
|
||||||
|
padding: 0; /* 3 */
|
||||||
|
white-space: normal; /* 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Add the correct display in IE 9-.
|
||||||
|
* 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
||||||
|
*/
|
||||||
|
|
||||||
|
progress {
|
||||||
|
display: inline-block; /* 1 */
|
||||||
|
vertical-align: baseline; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the default vertical scrollbar in IE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Add the correct box sizing in IE 10-.
|
||||||
|
* 2. Remove the padding in IE 10-.
|
||||||
|
*/
|
||||||
|
|
||||||
|
[type="checkbox"],
|
||||||
|
[type="radio"] {
|
||||||
|
box-sizing: border-box; /* 1 */
|
||||||
|
padding: 0; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Correct the cursor style of increment and decrement buttons in Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
[type="number"]::-webkit-inner-spin-button,
|
||||||
|
[type="number"]::-webkit-outer-spin-button {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct the odd appearance in Chrome and Safari.
|
||||||
|
* 2. Correct the outline style in Safari.
|
||||||
|
*/
|
||||||
|
|
||||||
|
[type="search"] {
|
||||||
|
-webkit-appearance: textfield; /* 1 */
|
||||||
|
outline-offset: -2px; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
|
||||||
|
*/
|
||||||
|
|
||||||
|
[type="search"]::-webkit-search-cancel-button,
|
||||||
|
[type="search"]::-webkit-search-decoration {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct the inability to style clickable types in iOS and Safari.
|
||||||
|
* 2. Change font properties to `inherit` in Safari.
|
||||||
|
*/
|
||||||
|
|
||||||
|
::-webkit-file-upload-button {
|
||||||
|
-webkit-appearance: button; /* 1 */
|
||||||
|
font: inherit; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Interactive
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add the correct display in IE 9-.
|
||||||
|
* 1. Add the correct display in Edge, IE, and Firefox.
|
||||||
|
*/
|
||||||
|
|
||||||
|
details, /* 1 */
|
||||||
|
menu {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add the correct display in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
summary {
|
||||||
|
display: list-item;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Scripting
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct display in IE 9-.
|
||||||
|
*/
|
||||||
|
|
||||||
|
canvas {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct display in IE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
template {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hidden
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct display in IE 10-.
|
||||||
|
*/
|
||||||
|
|
||||||
|
[hidden] {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
35
doc/TOC.md
Normal file
35
doc/TOC.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
[HTML5 Boilerplate homepage](https://html5boilerplate.com/)
|
||||||
|
|
||||||
|
## Getting started
|
||||||
|
|
||||||
|
* [Usage](usage.md) — Overview of the project contents.
|
||||||
|
* [FAQ](faq.md) — Frequently asked questions along with their answers.
|
||||||
|
|
||||||
|
## HTML5 Boilerplate core
|
||||||
|
|
||||||
|
* [HTML](html.md) — Guide to the default HTML.
|
||||||
|
* [CSS](css.md) — Guide to the default CSS.
|
||||||
|
* [JavaScript](js.md) — Guide to the default JavaScript.
|
||||||
|
* [Everything else](misc.md).
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
* [Extending and customizing HTML5 Boilerplate](extend.md) — Going further
|
||||||
|
with the boilerplate.
|
||||||
|
|
||||||
|
## Related projects
|
||||||
|
|
||||||
|
The [H5BP organization](https://github.com/h5bp) maintains several projects
|
||||||
|
that complement HTML5 Boilerplate, projects that can help you improve different
|
||||||
|
aspects of your website/web app (e.g.: the performance, security, etc.).
|
||||||
|
|
||||||
|
* [Server Configs](https://github.com/h5bp/server-configs) — Fast and
|
||||||
|
smart configurations for web servers such as Apache and Nginx.
|
||||||
|
* [Apache](https://github.com/h5bp/server-configs-apache)
|
||||||
|
* [Google App Engine (GAE)](https://github.com/h5bp/server-configs-gae)
|
||||||
|
* [Internet Information Services (IIS)](https://github.com/h5bp/server-configs-iis)
|
||||||
|
* [lighttpd](https://github.com/h5bp/server-configs-lighttpd)
|
||||||
|
* [Nginx](https://github.com/h5bp/server-configs-nginx)
|
||||||
|
* [Node.js](https://github.com/h5bp/server-configs-node)
|
||||||
|
* [Ant Build Script](https://github.com/h5bp/ant-build-script) — Apache
|
||||||
|
Ant based build script.
|
||||||
164
doc/css.md
Normal file
164
doc/css.md
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
|
||||||
|
table of contents](TOC.md)
|
||||||
|
|
||||||
|
# The CSS
|
||||||
|
|
||||||
|
HTML5 Boilerplate's CSS includes:
|
||||||
|
|
||||||
|
* [Normalize.css](#normalizecss)
|
||||||
|
* [Useful defaults](#useful-defaults)
|
||||||
|
* [Common helpers](#common-helpers)
|
||||||
|
* [Placeholder media queries](#media-queries)
|
||||||
|
* [Print styles](#print-styles)
|
||||||
|
|
||||||
|
This starting CSS does not rely on the presence of
|
||||||
|
[conditional class names](https://www.paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/),
|
||||||
|
[conditional style sheets](https://css-tricks.com/how-to-create-an-ie-only-stylesheet/),
|
||||||
|
or [Modernizr](https://modernizr.com/), and it is ready to use no matter what
|
||||||
|
your development preferences happen to be.
|
||||||
|
|
||||||
|
|
||||||
|
## Normalize.css
|
||||||
|
|
||||||
|
In order to make browsers render all elements more consistently and in line
|
||||||
|
with modern standards, we include
|
||||||
|
[Normalize.css](https://necolas.github.io/normalize.css/) — a modern, HTML5-ready
|
||||||
|
alternative to CSS resets.
|
||||||
|
|
||||||
|
As opposed to CSS resets, Normalize.css:
|
||||||
|
|
||||||
|
* targets only the styles that need normalizing
|
||||||
|
* preserves useful browser defaults rather than erasing them
|
||||||
|
* corrects bugs and common browser inconsistencies
|
||||||
|
* improves usability with subtle improvements
|
||||||
|
* doesn't clutter the debugging tools
|
||||||
|
* has better documentation
|
||||||
|
|
||||||
|
For more information about Normalize.css, please refer to its [project
|
||||||
|
page](https://necolas.github.com/normalize.css/), as well as this
|
||||||
|
[blog post](http://nicolasgallagher.com/about-normalize-css/).
|
||||||
|
|
||||||
|
|
||||||
|
## Useful defaults
|
||||||
|
|
||||||
|
Several base styles are included that build upon `Normalize.css`. These
|
||||||
|
styles:
|
||||||
|
|
||||||
|
* provide basic typography settings that improve text readability
|
||||||
|
* protect against unwanted `text-shadow` during text highlighting
|
||||||
|
* tweak the default alignment of some elements (e.g.: `img`, `video`,
|
||||||
|
`fieldset`, `textarea`)
|
||||||
|
* style the prompt that is displayed to users using an outdated browser
|
||||||
|
|
||||||
|
You are free and even encouraged to modify or add to these base styles as your
|
||||||
|
project requires.
|
||||||
|
|
||||||
|
|
||||||
|
## Common helpers
|
||||||
|
|
||||||
|
Along with the base styles, we also provide some commonly used helper classes.
|
||||||
|
|
||||||
|
#### `.hidden`
|
||||||
|
|
||||||
|
The `hidden` class can be added to any element that you want to hide visually
|
||||||
|
and from screen readers. It could be an element that will be populated and
|
||||||
|
displayed later, or an element you will hide with JavaScript.
|
||||||
|
|
||||||
|
#### `.visuallyhidden`
|
||||||
|
|
||||||
|
The `visuallyhidden` class can be added to any element that you want to hide
|
||||||
|
visually, while still have its content accessible to screen readers.
|
||||||
|
|
||||||
|
See also:
|
||||||
|
|
||||||
|
* [CSS in Action: Invisible Content Just for Screen Reader
|
||||||
|
Users](http://webaim.org/techniques/css/invisiblecontent/)
|
||||||
|
* [Hiding content for
|
||||||
|
accessibility](https://snook.ca/archives/html_and_css/hiding-content-for-accessibility)
|
||||||
|
* [HTML5 Boilerplate - Issue #194](https://github.com/h5bp/html5-boilerplate/issues/194).
|
||||||
|
|
||||||
|
__N.B.__ [The visuallyhidden class can be an accessibility issue for users using high contrast modes.](https://www.paciellogroup.com/blog/2012/08/notes-on-accessible-css-image-sprites/)
|
||||||
|
|
||||||
|
>Use JavaScript to detect when images are disabled and remove the CSS visually hidden display state of the text alternative.
|
||||||
|
Use JavaScript to detect when Windows high contrast mode is enabled and remove the CSS visually hidden display state of the text alternative.
|
||||||
|
|
||||||
|
#### `.invisible`
|
||||||
|
|
||||||
|
The `invisible` class can be added to any element that you want to hide
|
||||||
|
visually and from screen readers, but without affecting the layout.
|
||||||
|
|
||||||
|
As opposed to the `hidden` class that effectively removes the element from the
|
||||||
|
layout, the `invisible` class will simply make the element invisible while
|
||||||
|
keeping it in the flow and not affecting the positioning of the surrounding
|
||||||
|
content.
|
||||||
|
|
||||||
|
__N.B.__ Try to stay away from, and don't use the classes specified above for
|
||||||
|
[keyword stuffing](https://en.wikipedia.org/wiki/Keyword_stuffing) as you will
|
||||||
|
harm your site's ranking!
|
||||||
|
|
||||||
|
#### `.clearfix`
|
||||||
|
|
||||||
|
The `clearfix` class can be added to any element to ensure that it always fully
|
||||||
|
contains its floated children.
|
||||||
|
|
||||||
|
Over the years there have been many variants of the clearfix hack, but currently,
|
||||||
|
we use the [micro clearfix](http://nicolasgallagher.com/micro-clearfix-hack/).
|
||||||
|
|
||||||
|
|
||||||
|
## Media Queries
|
||||||
|
|
||||||
|
HTML5 Boilerplate makes it easy for you to get started with a
|
||||||
|
[_mobile first_](http://www.lukew.com/presos/preso.asp?26) and [_responsive web
|
||||||
|
design_](http://alistapart.com/article/responsive-web-design) approach to
|
||||||
|
development. But it's worth remembering that there are [no silver
|
||||||
|
bullets](https://cloudfour.com/thinks/css-media-query-for-mobile-is-fools-gold/).
|
||||||
|
|
||||||
|
We include placeholder media queries to help you build up your mobile styles for
|
||||||
|
wider viewports and high-resolution displays. It's recommended that you adapt
|
||||||
|
these media queries based on the content of your site rather than mirroring the
|
||||||
|
fixed dimensions of specific devices.
|
||||||
|
|
||||||
|
If you do not want to take the _mobile first_ approach, you can simply edit or
|
||||||
|
remove these placeholder media queries. One possibility would be to work from
|
||||||
|
wide viewports down, and use `max-width` media queries instead (e.g.:
|
||||||
|
`@media only screen and (max-width: 480px)`).
|
||||||
|
|
||||||
|
|
||||||
|
## Print styles
|
||||||
|
|
||||||
|
Lastly, we provide some useful print styles that will optimize the printing
|
||||||
|
process, as well as make the printed pages easier to read.
|
||||||
|
|
||||||
|
At printing time, these styles will:
|
||||||
|
|
||||||
|
* strip all background colors, change the font color to black, and remove the
|
||||||
|
`text-shadow` — done in order to [help save printer ink and speed up the
|
||||||
|
printing process](http://www.sanbeiji.com/archives/953)
|
||||||
|
* underline and expand links to include the URL — done in order to allow users
|
||||||
|
to know where to refer to<br>
|
||||||
|
(exceptions to this are: the links that are
|
||||||
|
[fragment identifiers](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href),
|
||||||
|
or use the
|
||||||
|
[`javascript:` pseudo protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void#JavaScript_URIs))
|
||||||
|
* expand abbreviations to include the full description — done in order to allow
|
||||||
|
users to know what the abbreviations stands for
|
||||||
|
* provide instructions on how browsers should break the content into pages and
|
||||||
|
on [orphans/widows](https://en.wikipedia.org/wiki/Widows_and_orphans), namely,
|
||||||
|
we instruct
|
||||||
|
[supporting browsers](https://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28Cascading_Style_Sheets%29#Grammar_and_rules)
|
||||||
|
that they should:
|
||||||
|
|
||||||
|
* ensure the table header (`<thead>`) is [printed on each page spanned by the
|
||||||
|
table](http://css-discuss.incutio.com/wiki/Printing_Tables)
|
||||||
|
* prevent block quotations, preformatted text, images and table rows from
|
||||||
|
being split onto two different pages
|
||||||
|
* ensure that headings never appear on a different page than the text they
|
||||||
|
are associated with
|
||||||
|
* ensure that
|
||||||
|
[orphans and widows](https://en.wikipedia.org/wiki/Widows_and_orphans) do
|
||||||
|
[not appear on printed pages](https://css-tricks.com/almanac/properties/o/orphans/)
|
||||||
|
|
||||||
|
The print styles are included along with the other `css` to [avoid the
|
||||||
|
additional HTTP request](http://www.phpied.com/delay-loading-your-print-css/).
|
||||||
|
Also, they should always be included last, so that the other styles can be
|
||||||
|
overwritten.
|
||||||
693
doc/extend.md
Normal file
693
doc/extend.md
Normal file
@@ -0,0 +1,693 @@
|
|||||||
|
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
|
||||||
|
table of contents](TOC.md)
|
||||||
|
|
||||||
|
# Extend and customise HTML5 Boilerplate
|
||||||
|
|
||||||
|
Here is some useful advice for how you can make your project with HTML5
|
||||||
|
Boilerplate even better. We don't want to include it all by default, as
|
||||||
|
not everything fits with everyone's needs.
|
||||||
|
|
||||||
|
|
||||||
|
* [App Stores](#app-stores)
|
||||||
|
* [DNS prefetching](#dns-prefetching)
|
||||||
|
* [Google Universal Analytics](#google-universal-analytics)
|
||||||
|
* [Internet Explorer](#internet-explorer)
|
||||||
|
* [Miscellaneous](#miscellaneous)
|
||||||
|
* [News Feeds](#news-feeds)
|
||||||
|
* [Search](#search)
|
||||||
|
* [Social Networks](#social-networks)
|
||||||
|
* [URLs](#urls)
|
||||||
|
* [Web Apps](#web-apps)
|
||||||
|
|
||||||
|
|
||||||
|
## App Stores
|
||||||
|
|
||||||
|
### Smart App Banners in iOS 6+ Safari
|
||||||
|
|
||||||
|
Stop bothering everyone with gross modals advertising your entry in the
|
||||||
|
App Store. Include the following [meta tag](https://developer.apple.com/library/IOS/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html#//apple_ref/doc/uid/TP40002051-CH6-SW2)
|
||||||
|
will unintrusively allow the user the option to download your iOS app,
|
||||||
|
or open it with some data about the user's current state on the website.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="apple-itunes-app" content="app-id=APP_ID,app-argument=SOME_TEXT">
|
||||||
|
```
|
||||||
|
|
||||||
|
## DNS prefetching
|
||||||
|
|
||||||
|
In short, DNS Prefetching is a method of informing the browser of domain names
|
||||||
|
referenced on a site so that the client can resolve the DNS for those hosts,
|
||||||
|
cache them, and when it comes time to use them, have a faster turn around on
|
||||||
|
the request.
|
||||||
|
|
||||||
|
### Implicit prefetches
|
||||||
|
|
||||||
|
There is a lot of prefetching done for you automatically by the browser. When
|
||||||
|
the browser encounters an anchor in your html that does not share the same
|
||||||
|
domain name as the current location the browser requests, from the client OS,
|
||||||
|
the IP address for this new domain. The client first checks its cache and
|
||||||
|
then, lacking a cached copy, makes a request from a DNS server. These requests
|
||||||
|
happen in the background and are not meant to block the rendering of the
|
||||||
|
page.
|
||||||
|
|
||||||
|
The goal of this is that when the foreign IP address is finally needed it will
|
||||||
|
already be in the client cache and will not block the loading of the foreign
|
||||||
|
content. Fewer requests result in faster page load times. The perception of this
|
||||||
|
is increased on a mobile platform where DNS latency can be greater.
|
||||||
|
|
||||||
|
#### Disable implicit prefetching
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta http-equiv="x-dns-prefetch-control" content="off">
|
||||||
|
```
|
||||||
|
|
||||||
|
Even with X-DNS-Prefetch-Control meta tag (or http header) browsers will still
|
||||||
|
prefetch any explicit dns-prefetch links.
|
||||||
|
|
||||||
|
**_WARNING:_** THIS MAY MAKE YOUR SITE SLOWER IF YOU RELY ON RESOURCES FROM
|
||||||
|
FOREIGN DOMAINS.
|
||||||
|
|
||||||
|
### Explicit prefetches
|
||||||
|
|
||||||
|
Typically the browser only scans the HTML for foreign domains. If you have
|
||||||
|
resources that are outside of your HTML (a javascript request to a remote
|
||||||
|
server or a CDN that hosts content that may not be present on every page of
|
||||||
|
your site, for example) then you can queue up a domain name to be prefetched.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<link rel="dns-prefetch" href="//example.com">
|
||||||
|
<link rel="dns-prefetch" href="https://ajax.googleapis.com">
|
||||||
|
```
|
||||||
|
|
||||||
|
You can use as many of these as you need, but it's best if they are all
|
||||||
|
immediately after the [Meta
|
||||||
|
Charset](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-charset)
|
||||||
|
element (which should go right at the top of the `head`), so the browser can
|
||||||
|
act on them ASAP.
|
||||||
|
|
||||||
|
#### Common Prefetch Links
|
||||||
|
|
||||||
|
Amazon S3:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<link rel="dns-prefetch" href="//s3.amazonaws.com">
|
||||||
|
```
|
||||||
|
|
||||||
|
Google APIs:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<link rel="dns-prefetch" href="https://ajax.googleapis.com">
|
||||||
|
```
|
||||||
|
|
||||||
|
Microsoft Ajax Content Delivery Network:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<link rel="dns-prefetch" href="//ajax.microsoft.com">
|
||||||
|
<link rel="dns-prefetch" href="//ajax.aspnetcdn.com">
|
||||||
|
```
|
||||||
|
|
||||||
|
### Further reading about DNS prefetching
|
||||||
|
|
||||||
|
* https://developer.mozilla.org/en-US/docs/Controlling_DNS_prefetching
|
||||||
|
* https://dev.chromium.org/developers/design-documents/dns-prefetching
|
||||||
|
* https://blogs.msdn.microsoft.com/ie/2011/03/17/internet-explorer-9-network-performance-improvements/
|
||||||
|
* http://dayofjs.com/videos/22158462/web-browsers_alex-russel
|
||||||
|
|
||||||
|
|
||||||
|
## Google Universal Analytics
|
||||||
|
|
||||||
|
### More tracking settings
|
||||||
|
|
||||||
|
The [optimized Google Universal Analytics
|
||||||
|
snippet](https://mathiasbynens.be/notes/async-analytics-snippet#universal-analytics)
|
||||||
|
included with HTML5 Boilerplate includes something like this:
|
||||||
|
|
||||||
|
```js
|
||||||
|
ga('create', 'UA-XXXXX-X', 'auto'); ga('send', 'pageview');
|
||||||
|
```
|
||||||
|
|
||||||
|
To customize further, see Google's [Advanced
|
||||||
|
Setup](https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced),
|
||||||
|
[Pageview](https://developers.google.com/analytics/devguides/collection/analyticsjs/pages),
|
||||||
|
and [Event](https://developers.google.com/analytics/devguides/collection/analyticsjs/events) Docs.
|
||||||
|
|
||||||
|
### Anonymize IP addresses
|
||||||
|
|
||||||
|
In some countries, no personal data may be transferred outside jurisdictions
|
||||||
|
that do not have similarly strict laws (i.e. from Germany to outside the EU).
|
||||||
|
Thus a webmaster using the Google Universal Analytics may have to ensure that
|
||||||
|
no personal (trackable) data is transferred to the US. You can do that with
|
||||||
|
[the `ga('set', 'anonymizeIp', true);`
|
||||||
|
parameter](https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#anonymizeip)
|
||||||
|
before sending any events/pageviews. In use it looks like this:
|
||||||
|
|
||||||
|
```js
|
||||||
|
ga('create', 'UA-XXXXX-X', 'auto');
|
||||||
|
ga('set', 'anonymizeIp', true);
|
||||||
|
ga('send', 'pageview');
|
||||||
|
```
|
||||||
|
|
||||||
|
### Track jQuery AJAX requests in Google Analytics
|
||||||
|
|
||||||
|
An article by @JangoSteve explains how to [track jQuery AJAX requests in Google
|
||||||
|
Analytics](https://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/).
|
||||||
|
|
||||||
|
Add this to `plugins.js`:
|
||||||
|
|
||||||
|
```js
|
||||||
|
/*
|
||||||
|
* Log all jQuery AJAX requests to Google Analytics
|
||||||
|
* See: https://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/
|
||||||
|
*/
|
||||||
|
if (typeof ga !== "undefined" && ga !== null) {
|
||||||
|
$(document).ajaxSend(function(event, xhr, settings){
|
||||||
|
ga('send', 'pageview', settings.url);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Track JavaScript errors in Google Analytics
|
||||||
|
|
||||||
|
Add this function after `ga` is defined:
|
||||||
|
|
||||||
|
```js
|
||||||
|
(function(window){
|
||||||
|
var undefined,
|
||||||
|
link = function (href) {
|
||||||
|
var a = window.document.createElement('a');
|
||||||
|
a.href = href;
|
||||||
|
return a;
|
||||||
|
};
|
||||||
|
window.onerror = function (message, file, line, column) {
|
||||||
|
var host = link(file).hostname;
|
||||||
|
ga('send', {
|
||||||
|
'hitType': 'event',
|
||||||
|
'eventCategory': (host == window.location.hostname || host == undefined || host == '' ? '' : 'external ') + 'error',
|
||||||
|
'eventAction': message,
|
||||||
|
'eventLabel': (file + ' LINE: ' + line + (column ? ' COLUMN: ' + column : '')).trim(),
|
||||||
|
'nonInteraction': 1
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}(window));
|
||||||
|
```
|
||||||
|
|
||||||
|
### Track page scroll
|
||||||
|
|
||||||
|
Add this function after `ga` is defined:
|
||||||
|
|
||||||
|
```js
|
||||||
|
$(function(){
|
||||||
|
var isDuplicateScrollEvent,
|
||||||
|
scrollTimeStart = new Date,
|
||||||
|
$window = $(window),
|
||||||
|
$document = $(document),
|
||||||
|
scrollPercent;
|
||||||
|
|
||||||
|
$window.scroll(function() {
|
||||||
|
scrollPercent = Math.round(100 * ($window.height() + $window.scrollTop())/$document.height());
|
||||||
|
if (scrollPercent > 90 && !isDuplicateScrollEvent) { //page scrolled to 90%
|
||||||
|
isDuplicateScrollEvent = 1;
|
||||||
|
ga('send', 'event', 'scroll',
|
||||||
|
'Window: ' + $window.height() + 'px; Document: ' + $document.height() + 'px; Time: ' + Math.round((new Date - scrollTimeStart )/1000,1) + 's'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## Internet Explorer
|
||||||
|
|
||||||
|
### Prompt users to switch to "Desktop Mode" in IE10 Metro
|
||||||
|
|
||||||
|
IE10 does not support plugins, such as Flash, in Metro mode. If
|
||||||
|
your site requires plugins, you can let users know that via the
|
||||||
|
`x-ua-compatible` meta element, which will prompt them to switch
|
||||||
|
to Desktop Mode.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta http-equiv="x-ua-compatible" content="requiresActiveX=true">
|
||||||
|
```
|
||||||
|
|
||||||
|
Here's what it looks like alongside H5BP's default `x-ua-compatible`
|
||||||
|
values:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta http-equiv="x-ua-compatible" content="ie=edge,requiresActiveX=true">
|
||||||
|
```
|
||||||
|
|
||||||
|
You can find more information in [Microsoft's IEBlog post about prompting for
|
||||||
|
plugin use in IE10 Metro
|
||||||
|
Mode](https://blogs.msdn.microsoft.com/ie/2012/01/31/web-sites-and-a-plug-in-free-web/).
|
||||||
|
|
||||||
|
### IE Pinned Sites (IE9+)
|
||||||
|
|
||||||
|
Enabling your application for pinning will allow IE9 users to add it to their
|
||||||
|
Windows Taskbar and Start Menu. This comes with a range of new tools that you
|
||||||
|
can easily configure with the elements below. See more [documentation on IE9
|
||||||
|
Pinned Sites](https://msdn.microsoft.com/en-us/library/gg131029.aspx).
|
||||||
|
|
||||||
|
### Name the Pinned Site for Windows
|
||||||
|
|
||||||
|
Without this rule, Windows will use the page title as the name for your
|
||||||
|
application.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="application-name" content="Sample Title">
|
||||||
|
```
|
||||||
|
|
||||||
|
### Give your Pinned Site a tooltip
|
||||||
|
|
||||||
|
You know — a tooltip. A little textbox that appears when the user holds their
|
||||||
|
mouse over your Pinned Site's icon.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="msapplication-tooltip" content="A description of what this site does.">
|
||||||
|
```
|
||||||
|
|
||||||
|
### Set a default page for your Pinned Site
|
||||||
|
|
||||||
|
If the site should go to a specific URL when it is pinned (such as the
|
||||||
|
homepage), enter it here. One idea is to send it to a special URL so you can
|
||||||
|
track the number of pinned users, like so:
|
||||||
|
`https://www.example.com/index.html?pinned=true`
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="msapplication-starturl" content="https://www.example.com/index.html?pinned=true">
|
||||||
|
```
|
||||||
|
|
||||||
|
### Recolor IE's controls manually for a Pinned Site
|
||||||
|
|
||||||
|
IE9+ will automatically use the overall color of your Pinned Site's favicon to
|
||||||
|
shade its browser buttons. UNLESS you give it another color here. Only use
|
||||||
|
named colors (`red`) or hex colors (`#ff0000`).
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="msapplication-navbutton-color" content="#ff0000">
|
||||||
|
```
|
||||||
|
|
||||||
|
### Manually set the window size of a Pinned Site
|
||||||
|
|
||||||
|
If the site should open at a certain window size once pinned, you can specify
|
||||||
|
the dimensions here. It only supports static pixel dimensions. 800x600
|
||||||
|
minimum.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="msapplication-window" content="width=800;height=600">
|
||||||
|
```
|
||||||
|
|
||||||
|
### Jump List "Tasks" for Pinned Sites
|
||||||
|
|
||||||
|
Add Jump List Tasks that will appear when the Pinned Site's icon gets a
|
||||||
|
right-click. Each Task goes to the specified URL, and gets its own mini icon
|
||||||
|
(essentially a favicon, a 16x16 .ICO). You can add as many of these as you
|
||||||
|
need.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="msapplication-task" content="name=Task 1;action-uri=http://host/Page1.html;icon-uri=http://host/icon1.ico">
|
||||||
|
<meta name="msapplication-task" content="name=Task 2;action-uri=http://microsoft.com/Page2.html;icon-uri=http://host/icon2.ico">
|
||||||
|
```
|
||||||
|
|
||||||
|
### (Windows 8) High quality visuals for Pinned Sites
|
||||||
|
|
||||||
|
Windows 8 adds the ability for you to provide a PNG tile image and specify the
|
||||||
|
tile's background color. [Full details on the IE
|
||||||
|
blog](https://blogs.msdn.microsoft.com/ie/2012/06/08/high-quality-visuals-for-pinned-sites-in-windows-8/).
|
||||||
|
|
||||||
|
* Create a 144x144 image of your site icon, filling all of the canvas, and
|
||||||
|
using a transparent background.
|
||||||
|
* Save this image as a 32-bit PNG and optimize it without reducing
|
||||||
|
colour-depth. It can be named whatever you want (e.g. `metro-tile.png`).
|
||||||
|
* To reference the tile and its color, add the HTML `meta` elements described
|
||||||
|
in the IE Blog post.
|
||||||
|
|
||||||
|
### (Windows 8) Badges for Pinned Sites
|
||||||
|
|
||||||
|
IE10 will poll an XML document for badge information to display on your app's
|
||||||
|
tile in the Start screen. The user will be able to receive these badge updates
|
||||||
|
even when your app isn't actively running. The badge's value can be a number,
|
||||||
|
or one of a predefined list of glyphs.
|
||||||
|
|
||||||
|
* [Tutorial on IEBlog with link to badge XML schema](https://blogs.msdn.microsoft.com/ie/2012/04/03/pinned-sites-in-windows-8/)
|
||||||
|
* [Available badge values](https://msdn.microsoft.com/en-us/library/ie/br212849.aspx)
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="msapplication-badge" value="frequency=NUMBER_IN_MINUTES;polling-uri=https://www.example.com/path/to/file.xml">
|
||||||
|
```
|
||||||
|
|
||||||
|
### Disable link highlighting upon tap in IE10
|
||||||
|
|
||||||
|
Similar to [-webkit-tap-highlight-color](https://davidwalsh.name/mobile-highlight-color)
|
||||||
|
in iOS Safari. Unlike that CSS property, this is an HTML meta element, and its
|
||||||
|
value is boolean rather than a color. It's all or nothing.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="msapplication-tap-highlight" content="no" />
|
||||||
|
```
|
||||||
|
|
||||||
|
You can read about this useful element and more techniques in
|
||||||
|
[Microsoft's documentation on adapting WebKit-oriented apps for IE10](https://blogs.windows.com/buildingapps/2012/11/15/adapting-your-webkit-optimized-site-for-internet-explorer-10/)
|
||||||
|
|
||||||
|
## Search
|
||||||
|
|
||||||
|
### Direct search spiders to your sitemap
|
||||||
|
|
||||||
|
After creating a [sitemap](https://www.sitemaps.org/protocol.html)
|
||||||
|
|
||||||
|
Submit it to search engine tool:
|
||||||
|
* [Google](https://www.google.com/webmasters/tools/sitemap-list)
|
||||||
|
* [Bing](https://www.bing.com/toolbox/webmaster)
|
||||||
|
* [Yandex](https://webmaster.yandex.com/)
|
||||||
|
* [Baidu](https://zhanzhang.baidu.com/)
|
||||||
|
OR
|
||||||
|
Insert the following line anywhere in your robots.txt file, specifying the path to your sitemap:
|
||||||
|
```
|
||||||
|
Sitemap: https://example.com/sitemap_location.xml
|
||||||
|
```
|
||||||
|
|
||||||
|
### Hide pages from search engines
|
||||||
|
|
||||||
|
According to Heather Champ, former community manager at Flickr, you should not
|
||||||
|
allow search engines to index your "Contact Us" or "Complaints" page if you
|
||||||
|
value your sanity. This is an HTML-centric way of achieving that.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="robots" content="noindex">
|
||||||
|
```
|
||||||
|
|
||||||
|
**_WARNING:_** DO NOT INCLUDE ON PAGES THAT SHOULD APPEAR IN SEARCH ENGINES.
|
||||||
|
|
||||||
|
### Firefox and IE Search Plugins
|
||||||
|
|
||||||
|
Sites with in-site search functionality should be strongly considered for a
|
||||||
|
browser search plugin. A "search plugin" is an XML file which defines how your
|
||||||
|
plugin behaves in the browser. [How to make a browser search
|
||||||
|
plugin](https://www.google.com/search?ie=UTF-8&q=how+to+make+browser+search+plugin).
|
||||||
|
|
||||||
|
```html
|
||||||
|
<link rel="search" title="" type="application/opensearchdescription+xml" href="">
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Miscellaneous
|
||||||
|
|
||||||
|
* Use [polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills).
|
||||||
|
|
||||||
|
* Use [Microformats](http://microformats.org/wiki/Main_Page) (via
|
||||||
|
[microdata](http://microformats.org/wiki/microdata)) for optimum search
|
||||||
|
results
|
||||||
|
[visibility](https://webmasters.googleblog.com/2009/05/introducing-rich-snippets.html).
|
||||||
|
|
||||||
|
* If you're building a web app you may want [native style momentum scrolling in
|
||||||
|
iOS 5+](http://www.johanbrook.com/articles/native-style-momentum-scrolling-to-arrive-in-ios-5/)
|
||||||
|
using `-webkit-overflow-scrolling: touch`.
|
||||||
|
|
||||||
|
* If you want to disable the translation prompt in Chrome or block Google
|
||||||
|
Translate from translating your web page, use [`<meta name="google"
|
||||||
|
value="notranslate">`](https://support.google.com/translate/?hl=en#2641276).
|
||||||
|
To disable translation for a particular section of the web page, add
|
||||||
|
[`class="notranslate"`](https://support.google.com/translate/?hl=en#2641276).
|
||||||
|
|
||||||
|
* If you want to disable the automatic detection and formatting of possible
|
||||||
|
phone numbers in Safari on iOS, use [`<meta name="format-detection"
|
||||||
|
content="telephone=no">`](https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html/#//apple_ref/doc/uid/TP40008193-SW5).
|
||||||
|
|
||||||
|
* Avoid development/stage websites "leaking" into SERPs (search engine results
|
||||||
|
page) by [implementing X-Robots-tag
|
||||||
|
headers](https://github.com/h5bp/html5-boilerplate/issues/804).
|
||||||
|
|
||||||
|
|
||||||
|
## News Feeds
|
||||||
|
|
||||||
|
### RSS
|
||||||
|
|
||||||
|
Have an RSS feed? Link to it here. Want to [learn how to write an RSS feed from
|
||||||
|
scratch](http://www.rssboard.org/rss-specification)?
|
||||||
|
|
||||||
|
```html
|
||||||
|
<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss.xml">
|
||||||
|
```
|
||||||
|
|
||||||
|
### Atom
|
||||||
|
|
||||||
|
Atom is similar to RSS, and you might prefer to use it instead of or in
|
||||||
|
addition to it. [See what Atom's all
|
||||||
|
about](http://www.atomenabled.org/developers/syndication/).
|
||||||
|
|
||||||
|
```html
|
||||||
|
<link rel="alternate" type="application/atom+xml" title="Atom" href="/atom.xml">
|
||||||
|
```
|
||||||
|
|
||||||
|
### Pingbacks
|
||||||
|
|
||||||
|
Your server may be notified when another site links to yours. The href
|
||||||
|
attribute should contain the location of your pingback service.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<link rel="pingback" href="">
|
||||||
|
```
|
||||||
|
|
||||||
|
* High-level explanation: https://codex.wordpress.org/Introduction_to_Blogging#Pingbacks
|
||||||
|
* Step-by-step example case: http://www.hixie.ch/specs/pingback/pingback-1.0#TOC5
|
||||||
|
* PHP pingback service: https://web.archive.org/web/20131211032834/http://blog.perplexedlabs.com/2009/07/15/xmlrpc-pingbacks-using-php/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Social Networks
|
||||||
|
|
||||||
|
### Facebook Open Graph data
|
||||||
|
|
||||||
|
You can control the information that Facebook and others display when users
|
||||||
|
share your site. Below are just the most basic data points you might need. For
|
||||||
|
specific content types (including "website"), see [Facebook's built-in Open
|
||||||
|
Graph content
|
||||||
|
templates](https://developers.facebook.com/docs/opengraph/objects/builtin/).
|
||||||
|
Take full advantage of Facebook's support for complex data and activity by
|
||||||
|
following the [Open Graph
|
||||||
|
tutorial](https://developers.facebook.com/docs/opengraph/tutorial/).
|
||||||
|
|
||||||
|
For a reference of Open Graph's markup and properties, you may check
|
||||||
|
[Facebook's Open Graph Protocol reference](http://ogp.me/). Finally,
|
||||||
|
you can validate your markup with the [Facebook Object
|
||||||
|
Debugger](https://developers.facebook.com/tools/debug/) (needs
|
||||||
|
registration to Facebook).
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta property="fb:app_id" content="123456789">
|
||||||
|
<meta property="og:url" content="https://www.example.com/path/to/page.html">
|
||||||
|
<meta property="og:type" content="website">
|
||||||
|
<meta property="og:title" content="">
|
||||||
|
<meta property="og:image" content="https://www.example.com/path/to/image.jpg">
|
||||||
|
<meta property="og:description" content="">
|
||||||
|
<meta property="og:site_name" content="">
|
||||||
|
<meta property="article:author" content="">
|
||||||
|
```
|
||||||
|
|
||||||
|
### Twitter Cards
|
||||||
|
|
||||||
|
Twitter provides a snippet specification that serves a similar purpose to Open
|
||||||
|
Graph. In fact, Twitter will use Open Graph when Cards is not available. Note
|
||||||
|
that, as of this writing, Twitter requires that app developers activate Cards
|
||||||
|
on a per-domain basis. You can read more about the various snippet formats
|
||||||
|
and application process in the [official Twitter Cards
|
||||||
|
documentation](https://dev.twitter.com/docs/cards), and you can validate
|
||||||
|
your markup with the [Card validator](https://cards-dev.twitter.com/validator)
|
||||||
|
(needs registration to Twitter).
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="twitter:card" content="summary">
|
||||||
|
<meta name="twitter:site" content="@site_account">
|
||||||
|
<meta name="twitter:creator" content="@individual_account">
|
||||||
|
<meta name="twitter:url" content="https://www.example.com/path/to/page.html">
|
||||||
|
<meta name="twitter:title" content="">
|
||||||
|
<meta name="twitter:description" content="">
|
||||||
|
<meta name="twitter:image" content="https://www.example.com/path/to/image.jpg">
|
||||||
|
```
|
||||||
|
|
||||||
|
### Google+ / Schema.org
|
||||||
|
|
||||||
|
Google also provides a snippet specification that serves a similar
|
||||||
|
purpose to Facebook's Open Graph or Twitter Cards. While it helps you
|
||||||
|
to control information displayed on Google+, this metadata is a subset
|
||||||
|
of [schema.org's microdata vocabulary](https://schema.org/), which
|
||||||
|
covers many other schemas that can describe the content of your pages
|
||||||
|
to search engines. For this reason, this metadata is more generic for
|
||||||
|
SEO, notably for Google's search-engine, although this vocabulary is
|
||||||
|
also used by Microsoft, Pinterest or Yandex.
|
||||||
|
|
||||||
|
You can validate your markup with the [Structured Data Testing
|
||||||
|
Tool](https://developers.google.com/structured-data/testing-tool/).
|
||||||
|
Also, please note that this markup requires to add attributes to your
|
||||||
|
top `html` tag.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<html class="no-js" lang="" itemscope itemtype="http://schema.org/Article">
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<link rel="author" href="">
|
||||||
|
<link rel="publisher" href="">
|
||||||
|
<meta itemprop="name" content="">
|
||||||
|
<meta itemprop="description" content="">
|
||||||
|
<meta itemprop="image" content="">
|
||||||
|
```
|
||||||
|
|
||||||
|
## URLs
|
||||||
|
|
||||||
|
### Canonical URL
|
||||||
|
|
||||||
|
Signal to search engines and others "Use this URL for this page!" Useful when
|
||||||
|
parameters after a `#` or `?` is used to control the display state of a page.
|
||||||
|
`https://www.example.com/cart.html?shopping-cart-open=true` can be indexed as
|
||||||
|
the cleaner, more accurate `https://www.example.com/cart.html`.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<link rel="canonical" href="">
|
||||||
|
```
|
||||||
|
|
||||||
|
### Official shortlink
|
||||||
|
|
||||||
|
Signal to the world "This is the shortened URL to use this page!" Poorly
|
||||||
|
supported at this time. Learn more by reading the [article about shortlinks on
|
||||||
|
the Microformats wiki](http://microformats.org/wiki/rel-shortlink).
|
||||||
|
|
||||||
|
```html
|
||||||
|
<link rel="shortlink" href="h5bp.com">
|
||||||
|
```
|
||||||
|
|
||||||
|
### Separate mobile URLs
|
||||||
|
|
||||||
|
If you use separate URLs for desktop and mobile users, you should consider
|
||||||
|
helping search engine algorithms better understand the configuration on your
|
||||||
|
web site.
|
||||||
|
|
||||||
|
This can be done by adding the following annotations in your HTML pages:
|
||||||
|
|
||||||
|
* on the desktop page, add the `link rel="alternate"` tag pointing to the
|
||||||
|
corresponding mobile URL, e.g.:
|
||||||
|
|
||||||
|
`<link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.example.com/page.html" >`
|
||||||
|
|
||||||
|
* on the mobile page, add the `link rel="canonical"` tag pointing to the
|
||||||
|
corresponding desktop URL, e.g.:
|
||||||
|
|
||||||
|
`<link rel="canonical" href="https://www.example.com/page.html">`
|
||||||
|
|
||||||
|
For more information please see:
|
||||||
|
|
||||||
|
* https://developers.google.com/webmasters/smartphone-sites/details#separateurls
|
||||||
|
* https://developers.google.com/webmasters/smartphone-sites/feature-phones
|
||||||
|
|
||||||
|
|
||||||
|
## Web Apps
|
||||||
|
|
||||||
|
There are a couple of meta tags that provide information about a web app when
|
||||||
|
added to the Home Screen on iOS:
|
||||||
|
|
||||||
|
* Adding `apple-mobile-web-app-capable` will make your web app chrome-less and
|
||||||
|
provide the default iOS app view. You can control the color scheme of the
|
||||||
|
default view by adding `apple-mobile-web-app-status-bar-style`.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||||
|
```
|
||||||
|
|
||||||
|
* You can use `apple-mobile-web-app-title` to add a specific sites name for the
|
||||||
|
Home Screen icon. This works since iOS 6.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="apple-mobile-web-app-title" content="">
|
||||||
|
```
|
||||||
|
|
||||||
|
For further information please read the [official
|
||||||
|
documentation](https://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html)
|
||||||
|
on Apple's site.
|
||||||
|
|
||||||
|
|
||||||
|
### Apple Touch Icons
|
||||||
|
|
||||||
|
The Apple touch icons can be seen as the favicons of iOS devices.
|
||||||
|
|
||||||
|
The main sizes of the Apple touch icons are:
|
||||||
|
|
||||||
|
* `57×57px` – iPhone with @1x display and iPod Touch
|
||||||
|
* `72×72px` – iPad and iPad mini with @1x display running iOS ≤ 6
|
||||||
|
* `76×76px` – iPad and iPad mini with @1x display running iOS ≥ 7
|
||||||
|
* `114×114px` – iPhone with @2x display running iOS ≤ 6
|
||||||
|
* `120×120px` – iPhone with @2x and @3x display running iOS ≥ 7
|
||||||
|
* `144×144px` – iPad and iPad mini with @2x display running iOS ≤ 6
|
||||||
|
* `152×152px` – iPad and iPad mini with @2x display running iOS 7
|
||||||
|
* `180×180px` – iPad and iPad mini with @2x display running iOS 8
|
||||||
|
|
||||||
|
Displays meaning:
|
||||||
|
|
||||||
|
* @1x - non-Retina
|
||||||
|
* @2x - Retina
|
||||||
|
* @3x - Retina HD
|
||||||
|
|
||||||
|
More information about the displays of iOS devices can be found
|
||||||
|
[here](https://en.wikipedia.org/wiki/List_of_iOS_devices#Display).
|
||||||
|
|
||||||
|
In most cases, one `180×180px` touch icon named `icon.png`
|
||||||
|
and including:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<link rel="apple-touch-icon" href="icon.png">
|
||||||
|
```
|
||||||
|
|
||||||
|
in the `<head>` of the page is enough. If you use art-direction and/or
|
||||||
|
want to have different content for each device, you can add more touch
|
||||||
|
icons as written above.
|
||||||
|
|
||||||
|
For a more comprehensive overview, please refer to Mathias' [article on Touch
|
||||||
|
Icons](https://mathiasbynens.be/notes/touch-icons).
|
||||||
|
|
||||||
|
|
||||||
|
### Apple Touch Startup Image
|
||||||
|
|
||||||
|
Apart from that it is possible to add start-up screens for web apps on iOS. This
|
||||||
|
basically works by defining `apple-touch-startup-image` with an according link
|
||||||
|
to the image. Since iOS devices have different screen resolutions it is
|
||||||
|
necessary to add media queries to detect which image to load. Here is an
|
||||||
|
example for a retina iPhone:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<link rel="apple-touch-startup-image" media="(max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)" href="img/startup-retina.png">
|
||||||
|
```
|
||||||
|
|
||||||
|
However, it is possible to detect which start-up image to use with JavaScript.
|
||||||
|
The Mobile Boilerplate provides a useful function for this. Please see
|
||||||
|
[helpers.js](https://github.com/h5bp/mobile-boilerplate/blob/v4.1.0/js/helper.js#L336-L383)
|
||||||
|
for the implementation.
|
||||||
|
|
||||||
|
|
||||||
|
### Chrome Mobile web apps
|
||||||
|
|
||||||
|
Chrome Mobile has a specific meta tag for making apps [installable to the
|
||||||
|
homescreen](https://developer.chrome.com/multidevice/android/installtohomescreen)
|
||||||
|
which tries to be a more generic replacement to Apple's proprietary meta tag:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
|
```
|
||||||
|
|
||||||
|
Same applies to the touch icons:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<link rel="icon" sizes="192x192" href="highres-icon.png">
|
||||||
|
```
|
||||||
|
|
||||||
|
### Theme Color
|
||||||
|
|
||||||
|
You can add the [`theme-color` meta extension](https://html.spec.whatwg.org/multipage/semantics.html#meta-theme-color)
|
||||||
|
in the `<head>` of your pages to suggest the color that browsers and
|
||||||
|
OSes should use if they customize the display of individual pages in
|
||||||
|
their UIs with varying colors.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="theme-color" content="#ff69b4">
|
||||||
|
```
|
||||||
|
|
||||||
|
The `content` attribute extension can take any valid CSS color.
|
||||||
|
|
||||||
|
Currently, the `theme-color` meta extension is supported by [Chrome 39+
|
||||||
|
for Android Lollipop](https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android).
|
||||||
47
doc/faq.md
Normal file
47
doc/faq.md
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
|
||||||
|
table of contents](TOC.md)
|
||||||
|
|
||||||
|
# Frequently asked questions
|
||||||
|
|
||||||
|
* [Why is the Google Analytics code at the bottom? Google recommends it be
|
||||||
|
placed in the `<head>`.](#why-is-the-google-analytics-code-at-the-bottom-google-recommends-it-be-placed-in-the-head)
|
||||||
|
* [How can I integrate Bootstrap with HTML5
|
||||||
|
Boilerplate?](#how-can-i-integrate-bootstrap-with-html5-boilerplate)
|
||||||
|
* [Do I need to upgrade my site each time a new version of HTML5 Boilerplate is
|
||||||
|
released?](#do-i-need-to-upgrade-my-site-each-time-a-new-version-of-html5-boilerplate-is-released)
|
||||||
|
* [Where can I get help with support
|
||||||
|
questions?](#where-can-i-get-help-with-support-questions)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Why is the Google Analytics code at the bottom? Google recommends it be placed in the `<head>`.
|
||||||
|
|
||||||
|
The main advantage of placing it in the `<head>` is that you will track the
|
||||||
|
user's `pageview` even if they leave the page before it has been fully loaded.
|
||||||
|
|
||||||
|
Here's a handy quote from [Mathias Bynens](https://mathiasbynens.be/notes/async-analytics-snippet#comment-50) about our placement choice.
|
||||||
|
>I should point out that it’s Google — not me — recommending to place this
|
||||||
|
script before all other scripts in the document. The only real advantage is to
|
||||||
|
catch a pageView call if your page fails to load completely (for example, if
|
||||||
|
the user aborts loading, or quickly closes the page, etc.). Personally, I
|
||||||
|
wouldn’t count that as a page view, so I actually prefer to place this script
|
||||||
|
at the bottom, after all other scripts. This keeps all the scripts together and
|
||||||
|
reinforces that scripts at the bottom are the right move. (Usually I
|
||||||
|
concatenate and minify all my scripts into one .js file — the GA snippet being
|
||||||
|
the suffix.)
|
||||||
|
|
||||||
|
### How can I integrate [Bootstrap](https://getbootstrap.com/) with HTML5 Boilerplate?
|
||||||
|
|
||||||
|
Here's Nicolas Gallagher writing about how [HTML5 Boilerplate and Bootstrap complement each
|
||||||
|
other](https://www.quora.com/Is-Bootstrap-a-complement-or-an-alternative-to-HTML5-Boilerplate-or-viceversa/answer/Nicolas-Gallagher).
|
||||||
|
|
||||||
|
### Do I need to upgrade my site each time a new version of HTML5 Boilerplate is released?
|
||||||
|
|
||||||
|
No, same as you don't normally replace the foundation of a house once it
|
||||||
|
was built. However, there is nothing stopping you from trying to work in the
|
||||||
|
latest changes, but you'll have to assess the costs/benefits of doing so.
|
||||||
|
|
||||||
|
### Where can I get help with support questions?
|
||||||
|
|
||||||
|
Please ask for help on
|
||||||
|
[StackOverflow](https://stackoverflow.com/questions/tagged/html5boilerplate).
|
||||||
250
doc/html.md
Normal file
250
doc/html.md
Normal file
@@ -0,0 +1,250 @@
|
|||||||
|
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
|
||||||
|
table of contents](TOC.md)
|
||||||
|
|
||||||
|
# The HTML
|
||||||
|
|
||||||
|
By default, HTML5 Boilerplate provides two `html` pages:
|
||||||
|
|
||||||
|
* [`index.html`](#indexhtml) - a default HTML skeleton that should form the
|
||||||
|
basis of all pages on your website
|
||||||
|
* [`404.html`](#404html) - a placeholder 404 error page
|
||||||
|
|
||||||
|
|
||||||
|
## `index.html`
|
||||||
|
|
||||||
|
|
||||||
|
### The `no-js` Class
|
||||||
|
|
||||||
|
The `no-js` class is provided in order to allow you to more easily and
|
||||||
|
explicitly add custom styles based on whether JavaScript is disabled
|
||||||
|
(`.no-js`) or enabled (`.js`). Using this technique also helps [avoid the
|
||||||
|
FOUC](https://www.paulirish.com/2009/avoiding-the-fouc-v3/).
|
||||||
|
|
||||||
|
|
||||||
|
## Language Attribute
|
||||||
|
|
||||||
|
Please consider specifying the language of your content by adding a [value](http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) to the `lang`
|
||||||
|
attribute in the `<html>` as in this example:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<html class="no-js" lang="en">
|
||||||
|
```
|
||||||
|
|
||||||
|
### The order of the `<title>` and `<meta>` tags
|
||||||
|
|
||||||
|
The order in which the `<title>` and the `<meta>` tags are specified is
|
||||||
|
important because:
|
||||||
|
|
||||||
|
1) the charset declaration (`<meta charset="utf-8">`):
|
||||||
|
|
||||||
|
* must be included completely within the [first 1024 bytes of the
|
||||||
|
document](https://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#charset)
|
||||||
|
|
||||||
|
* should be specified as early as possible (before any content that could
|
||||||
|
be controlled by an attacker, such as a `<title>` element) in order to
|
||||||
|
avoid a potential [encoding-related security
|
||||||
|
issue](https://code.google.com/p/doctype-mirror/wiki/ArticleUtf7) in
|
||||||
|
Internet Explorer
|
||||||
|
|
||||||
|
2) the meta tag for compatibility mode
|
||||||
|
(`<meta http-equiv="x-ua-compatible" content="ie=edge">`):
|
||||||
|
|
||||||
|
* [needs to be included before all other tags except for the `<title>` and
|
||||||
|
the other `<meta>`
|
||||||
|
tags](https://msdn.microsoft.com/en-us/library/cc288325.aspx)
|
||||||
|
|
||||||
|
|
||||||
|
### `x-ua-compatible`
|
||||||
|
|
||||||
|
Internet Explorer 8/9/10 support [document compatibility
|
||||||
|
modes](https://msdn.microsoft.com/en-us/library/cc288325.aspx) that affect the
|
||||||
|
way webpages are interpreted and displayed. Because of this, even if your site's
|
||||||
|
visitor is using, let's say, Internet Explorer 9, it's possible that IE will not
|
||||||
|
use the latest rendering engine, and instead, decide to render your page using
|
||||||
|
the Internet Explorer 5.5 rendering engine.
|
||||||
|
|
||||||
|
Specifying the `x-ua-compatible` meta tag:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
|
```
|
||||||
|
|
||||||
|
or sending the page with the following HTTP response header
|
||||||
|
|
||||||
|
```
|
||||||
|
X-UA-Compatible: IE=edge
|
||||||
|
```
|
||||||
|
|
||||||
|
will force Internet Explorer 8/9/10 to render the webpage in the highest
|
||||||
|
available mode in [the various cases when it may
|
||||||
|
not](https://hsivonen.fi/doctype/#ie8), and therefore, ensure that anyone
|
||||||
|
browsing your site is treated to the best possible user experience that
|
||||||
|
browser can offer.
|
||||||
|
|
||||||
|
If possible, we recommend that you remove the `meta` tag and send only the
|
||||||
|
HTTP response header as the `meta` tag will not always work if your site is
|
||||||
|
served on a non-standard port, as Internet Explorer's preference option
|
||||||
|
`Display intranet sites in Compatibility View` is checked by default.
|
||||||
|
|
||||||
|
If you are using Apache as your webserver, including the
|
||||||
|
[`.htaccess`](https://github.com/h5bp/server-configs-apache) file takes care of
|
||||||
|
the HTTP header. If you are using a different server, check out our [other
|
||||||
|
server config](https://github.com/h5bp/server-configs).
|
||||||
|
|
||||||
|
Starting with Internet Explorer 11, [document modes are
|
||||||
|
deprecated](https://msdn.microsoft.com/library/bg182625.aspx#docmode).
|
||||||
|
If your business still relies on older web apps and services that were
|
||||||
|
designed for older versions of Internet Explorer, you might want to consider
|
||||||
|
enabling [Enterprise Mode](https://blogs.msdn.microsoft.com/ie/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11/) throughout your company.
|
||||||
|
|
||||||
|
|
||||||
|
## Meta Description
|
||||||
|
|
||||||
|
The `description` meta tag provides a short description of the page.
|
||||||
|
In some situations this description is used as a part of the snippet
|
||||||
|
shown in the search results.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="description" content="This is a description">
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Mobile Viewport
|
||||||
|
|
||||||
|
There are a few different options that you can use with the [`viewport` meta
|
||||||
|
tag](https://docs.google.com/present/view?id=dkx3qtm_22dxsrgcf4 "Viewport and
|
||||||
|
Media Queries - The Complete Idiot's Guide"). You can find out more in [the
|
||||||
|
Apple developer docs](https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html).
|
||||||
|
HTML5 Boilerplate comes with a simple setup that strikes a good balance for general use cases.
|
||||||
|
|
||||||
|
```html
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
```
|
||||||
|
|
||||||
|
## Web App Manifest
|
||||||
|
HTML5 Boilerplate includes a simple web app manifest file.
|
||||||
|
|
||||||
|
The web app manifest is a simple JSON file that allows you to control how your
|
||||||
|
app appears on a device's home screen, what it looks like when it launches
|
||||||
|
in that context and what happens when it is launched. This allows for much greater
|
||||||
|
control over the UI of a saved site or web app on a mobile device.
|
||||||
|
|
||||||
|
It's linked to from the HTML as follows:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<link rel="manifest" href="site.webmanifest">
|
||||||
|
```
|
||||||
|
Our [site.webmanifest](https://github.com/h5bp/html5-boilerplate/blob/master/src/site.webmanifest) contains a very skeletal "app" definition, just to show the basic usage.
|
||||||
|
You should fill this file out with [more information about your site or application](https://developer.mozilla.org/en-US/docs/Web/Manifest)
|
||||||
|
|
||||||
|
## Favicons and Touch Icon
|
||||||
|
|
||||||
|
The shortcut icons should be put in the root directory of your site. `favicon.ico`
|
||||||
|
is automatically picked up by browsers if it's placed in the root. HTML5
|
||||||
|
Boilerplate comes with a default set of icons (include favicon and one Apple
|
||||||
|
Touch Icon) that you can use as a baseline to create your own.
|
||||||
|
|
||||||
|
Please refer to the more detailed description in the [Extend section](extend.md)
|
||||||
|
of these docs.
|
||||||
|
|
||||||
|
## The Content Area
|
||||||
|
|
||||||
|
The central part of the boilerplate template is pretty much empty. This is
|
||||||
|
intentional, in order to make the boilerplate suitable for both web page and
|
||||||
|
web app development.
|
||||||
|
|
||||||
|
### Browser Upgrade Prompt
|
||||||
|
|
||||||
|
The main content area of the boilerplate includes a prompt to install an up to
|
||||||
|
date browser for users of IE 8 and lower. If you intended to support IE 8, then you
|
||||||
|
should remove the snippet of code.
|
||||||
|
|
||||||
|
## Modernizr
|
||||||
|
|
||||||
|
HTML5 Boilerplate uses a custom build of Modernizr.
|
||||||
|
|
||||||
|
[Modernizr](https://modernizr.com/) is a JavaScript library which adds classes to
|
||||||
|
the `html` element based on the results of feature test and which ensures that
|
||||||
|
all browsers can make use of HTML5 elements (as it includes the HTML5 Shiv).
|
||||||
|
This allows you to target parts of your CSS and JavaScript based on the
|
||||||
|
features supported by a browser.
|
||||||
|
|
||||||
|
Starting with version 3 Modernizr can be customized using the [modernizr-config.json](https://github.com/h5bp/html5-boilerplate/blob/master/modernizr-config.json) and the
|
||||||
|
[Modernizr command line utility](https://www.npmjs.com/package/modernizr-cli).
|
||||||
|
|
||||||
|
## What About Polyfills?
|
||||||
|
|
||||||
|
If you need to include [polyfills](https://remysharp.com/2010/10/08/what-is-a-polyfill)
|
||||||
|
in your project, you must make sure those load before any other JavaScript. If you're
|
||||||
|
using some polyfill CDN service, like [cdn.polyfill.io](https://cdn.polyfill.io/),
|
||||||
|
just put it before the other scripts in the bottom of the page:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script src="js/vendor/modernizr-3.5.0.min.js"></script>
|
||||||
|
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
|
||||||
|
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
|
||||||
|
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.2.1.min.js"><\/script>')</script>
|
||||||
|
<script src="js/plugins.js"></script>
|
||||||
|
<script src="js/main.js"></script>
|
||||||
|
</body>
|
||||||
|
```
|
||||||
|
|
||||||
|
If you like to just include the polyfills yourself, you could include them in
|
||||||
|
`js/plugins.js`. When you have a bunch of polyfills to load in, you could
|
||||||
|
also create a `polyfills.js` file in the `js/vendor` directory or include the files
|
||||||
|
individually and combine them using a build tool. Always ensure that the polyfills
|
||||||
|
are all loaded before any other Javascript.
|
||||||
|
|
||||||
|
There are some misconceptions about Modernizr and polyfills. It's important
|
||||||
|
to understand that Modernizr just handles feature checking, not polyfilling
|
||||||
|
itself. The only thing Modernizr does regarding polyfills is that the team
|
||||||
|
maintains [a huge list of cross Browser polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills).
|
||||||
|
|
||||||
|
### jQuery CDN for jQuery
|
||||||
|
|
||||||
|
The jQuery CDN version of the jQuery JavaScript library is referenced towards
|
||||||
|
the bottom of the page. A local fallback of jQuery is included for rare instances
|
||||||
|
when the CDN version might not be available, and to facilitate offline
|
||||||
|
development.
|
||||||
|
|
||||||
|
The jQuery CDN version was chosen over other potential candidates
|
||||||
|
([like Google's Hosted Libraries](https://developers.google.com/speed/libraries/))
|
||||||
|
because it's fast ([comparable or faster than Google by some
|
||||||
|
measures](https://www.cdnperf.com/#jsdelivr,cdnjs,google,yandex,microsoft,jquery,bootstrapcdn/https/90))
|
||||||
|
and, (unlike Google's CDN) is available to China's hundreds of millions of internet users.
|
||||||
|
For many years we [chose](https://github.com/h5bp/html5-boilerplate/issues/1191)
|
||||||
|
the Google Hosted version over the jQuery CDN because it was available
|
||||||
|
over HTTPS (the jQuery CDN was not,) and it offered a better chance of
|
||||||
|
hitting the cache lottery owing to the popularity of the Google CDN.
|
||||||
|
The first issue is no longer valid and the second is far outweighed by
|
||||||
|
being able to serve jQuery to Chinese users.
|
||||||
|
|
||||||
|
While the jQuery CDN is a strong default solution your site or application may
|
||||||
|
require a different configuration. Testing your site with services like
|
||||||
|
[WebPageTest](https://www.webpagetest.org/) and browser tools like
|
||||||
|
[PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/) will help you examine the real
|
||||||
|
world performance of your site and can show where you can optimize your specific
|
||||||
|
site or application.
|
||||||
|
|
||||||
|
### Google Universal Analytics Tracking Code
|
||||||
|
|
||||||
|
Finally, an optimized version of the Google Universal Analytics tracking code is
|
||||||
|
included. Google recommends that this script be placed at the top of the page.
|
||||||
|
Factors to consider: if you place this script at the top of the page, you’ll
|
||||||
|
be able to count users who don’t fully load the page, and you’ll incur the max
|
||||||
|
number of simultaneous connections of the browser.
|
||||||
|
|
||||||
|
Further information:
|
||||||
|
|
||||||
|
* [Optimizing the Google Universal Analytics
|
||||||
|
Snippet](https://mathiasbynens.be/notes/async-analytics-snippet#universal-analytics)
|
||||||
|
* [Introduction to
|
||||||
|
Analytics.js](https://developers.google.com/analytics/devguides/collection/analyticsjs/)
|
||||||
|
* [Google Analytics Demos & Tools](https://ga-dev-tools.appspot.com/)
|
||||||
|
|
||||||
|
**N.B.** The Google Universal Analytics snippet is included by default mainly
|
||||||
|
because Google Analytics is [currently one of the most popular tracking
|
||||||
|
solutions](https://trends.builtwith.com/analytics/Google-Analytics) out there.
|
||||||
|
However, its usage isn't set in stone, and you SHOULD consider exploring the
|
||||||
|
[alternatives](https://en.wikipedia.org/wiki/List_of_web_analytics_software)
|
||||||
|
and use whatever suits your needs best!
|
||||||
36
doc/js.md
Normal file
36
doc/js.md
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
|
||||||
|
table of contents](TOC.md)
|
||||||
|
|
||||||
|
# The JavaScript
|
||||||
|
|
||||||
|
Information about the default JavaScript included in the project.
|
||||||
|
|
||||||
|
## main.js
|
||||||
|
|
||||||
|
This file can be used to contain or reference your site/app JavaScript code.
|
||||||
|
If you're working on something more advanced you might replace this file
|
||||||
|
entirely. That's cool.
|
||||||
|
|
||||||
|
## plugins.js
|
||||||
|
|
||||||
|
This file can be used to contain all your plugins, such as jQuery plugins and
|
||||||
|
other 3rd party scripts for a simple site.
|
||||||
|
|
||||||
|
One approach is to put jQuery plugins inside of a `(function($){ ...
|
||||||
|
})(jQuery);` closure to make sure they're in the jQuery namespace safety
|
||||||
|
blanket. Read more about [jQuery plugin
|
||||||
|
authoring](https://learn.jquery.com/plugins/#Getting_Started).
|
||||||
|
|
||||||
|
By default the `plugins.js` file contains a small script to avoid `console`
|
||||||
|
errors in browsers that lack a `console`. The script will make sure that, if
|
||||||
|
a console method isn't available, that method will have the value of empty
|
||||||
|
function, thus, preventing the browser from throwing an error.
|
||||||
|
|
||||||
|
## vendor
|
||||||
|
|
||||||
|
This directory can be used to contain all 3rd party library code.
|
||||||
|
|
||||||
|
Minified versions of the latest jQuery and Modernizr libraries are included by
|
||||||
|
default. You may wish to create your own [custom Modernizr
|
||||||
|
build with the online builder](https://www.modernizr.com/download/) or [command
|
||||||
|
line tool](https://modernizr.com/docs#command-line-config).
|
||||||
158
doc/misc.md
Normal file
158
doc/misc.md
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
|
||||||
|
table of contents](TOC.md)
|
||||||
|
|
||||||
|
# Miscellaneous
|
||||||
|
|
||||||
|
* [.gitignore](#gitignore)
|
||||||
|
* [.editorconfig](#editorconfig)
|
||||||
|
* [Server Configuration](#server-configuration)
|
||||||
|
* [robots.txt](#robotstxt)
|
||||||
|
* [browserconfig.xml](#browserconfigxml)
|
||||||
|
|
||||||
|
--
|
||||||
|
|
||||||
|
## .gitignore
|
||||||
|
|
||||||
|
HTML5 Boilerplate includes a basic project-level `.gitignore`. This should
|
||||||
|
primarily be used to avoid certain project-level files and directories from
|
||||||
|
being kept under source control. Different development-environments will
|
||||||
|
benefit from different collections of ignores.
|
||||||
|
|
||||||
|
OS-specific and editor-specific files should be ignored using a "global
|
||||||
|
ignore" that applies to all repositories on your system.
|
||||||
|
|
||||||
|
For example, add the following to your `~/.gitconfig`, where the `.gitignore`
|
||||||
|
in your HOME directory contains the files and directories you'd like to
|
||||||
|
globally ignore:
|
||||||
|
|
||||||
|
```gitignore
|
||||||
|
[core]
|
||||||
|
excludesfile = ~/.gitignore
|
||||||
|
```
|
||||||
|
|
||||||
|
* More on global ignores: https://help.github.com/articles/ignoring-files/
|
||||||
|
* Comprehensive set of ignores on GitHub: https://github.com/github/gitignore
|
||||||
|
|
||||||
|
|
||||||
|
## .editorconfig
|
||||||
|
|
||||||
|
The `.editorconfig` file is provided in order to encourage and help you and
|
||||||
|
your team define and maintain consistent coding styles between different
|
||||||
|
editors and IDEs.
|
||||||
|
|
||||||
|
By default, `.editorconfig` includes some basic
|
||||||
|
[properties](http://editorconfig.org/#supported-properties) that reflect the
|
||||||
|
coding styles from the files provided by default, but you can easily change
|
||||||
|
them to better suit your needs.
|
||||||
|
|
||||||
|
In order for your editor/IDE to apply the
|
||||||
|
[properties](http://editorconfig.org/#supported-properties) from the
|
||||||
|
`.editorconfig` file, you may need to [install a
|
||||||
|
plugin]( http://editorconfig.org/#download).
|
||||||
|
|
||||||
|
__N.B.__ If you aren't using the server configurations provided by HTML5
|
||||||
|
Boilerplate, we highly encourage you to configure your server to block
|
||||||
|
access to `.editorconfig` files, as they can disclose sensitive information!
|
||||||
|
|
||||||
|
For more details, please refer to the [EditorConfig
|
||||||
|
project](http://editorconfig.org/).
|
||||||
|
|
||||||
|
|
||||||
|
## Server Configuration
|
||||||
|
|
||||||
|
H5BP includes a [`.htaccess`](#htaccess) file for the [Apache HTTP
|
||||||
|
server](https://httpd.apache.org/docs/). If you are not using Apache
|
||||||
|
as your web server, then you are encouraged to download a
|
||||||
|
[server configuration](https://github.com/h5bp/server-configs) that
|
||||||
|
corresponds to your web server and environment.
|
||||||
|
|
||||||
|
A `.htaccess` (hypertext access) file is an [Apache HTTP server
|
||||||
|
configuration file](https://github.com/h5bp/server-configs-apache).
|
||||||
|
The `.htaccess` file is mostly used for:
|
||||||
|
|
||||||
|
* Rewriting URLs
|
||||||
|
* Controlling cache
|
||||||
|
* Authentication
|
||||||
|
* Server-side includes
|
||||||
|
* Redirects
|
||||||
|
* Gzipping
|
||||||
|
|
||||||
|
If you have access to the main server configuration file (usually called
|
||||||
|
`httpd.conf`), you should add the logic from the `.htaccess` file in, for
|
||||||
|
example, a <Directory> section in the main configuration file. This is usually
|
||||||
|
the recommended way, as using .htaccess files slows down Apache!
|
||||||
|
|
||||||
|
To enable Apache modules locally, please see:
|
||||||
|
https://github.com/h5bp/server-configs-apache/wiki/How-to-enable-Apache-modules.
|
||||||
|
|
||||||
|
In the repo the `.htaccess` is used for:
|
||||||
|
|
||||||
|
* Allowing cross-origin access to web fonts
|
||||||
|
* CORS header for images when browsers request it
|
||||||
|
* Enable `404.html` as 404 error document
|
||||||
|
* Making the website experience better for IE users better
|
||||||
|
* Media UTF-8 as character encoding for `text/html` and `text/plain`
|
||||||
|
* Enabling the rewrite URLs engine
|
||||||
|
* Forcing or removing the `www.` at the begin of a URL
|
||||||
|
* It blocks access to directories without a default document
|
||||||
|
* It blocks access to files that can expose sensitive information.
|
||||||
|
* It reduces MIME type security risks
|
||||||
|
* It forces compressing (gzipping)
|
||||||
|
* It tells the browser whether they should request a specific file from the
|
||||||
|
server or whether they should grab it from the browser's cache
|
||||||
|
|
||||||
|
When using `.htaccess` we recommend reading all inline comments (the rules after
|
||||||
|
a `#`) in the file once. There is a bunch of optional stuff in it.
|
||||||
|
|
||||||
|
If you want to know more about the `.htaccess` file check out the
|
||||||
|
[Apache HTTP server docs](https://httpd.apache.org/docs/) or more
|
||||||
|
specifically the [htaccess
|
||||||
|
section](https://httpd.apache.org/docs/current/howto/htaccess.html).
|
||||||
|
|
||||||
|
Notice that the original repo for the `.htaccess` file is [this
|
||||||
|
one](https://github.com/h5bp/server-configs-apache).
|
||||||
|
|
||||||
|
|
||||||
|
## robots.txt
|
||||||
|
|
||||||
|
The `robots.txt` file is used to give instructions to web robots on what can
|
||||||
|
be crawled from the website.
|
||||||
|
|
||||||
|
By default, the file provided by this project includes the next two lines:
|
||||||
|
|
||||||
|
* `User-agent: *` - the following rules apply to all web robots
|
||||||
|
* `Disallow:` - everything on the website is allowed to be crawled
|
||||||
|
|
||||||
|
If you want to disallow certain pages you will need to specify the path in a
|
||||||
|
`Disallow` directive (e.g.: `Disallow: /path`) or, if you want to disallow
|
||||||
|
crawling of all content, use `Disallow: /`.
|
||||||
|
|
||||||
|
The `/robots.txt` file is not intended for access control, so don't try to
|
||||||
|
use it as such. Think of it as a "No Entry" sign, rather than a locked door.
|
||||||
|
URLs disallowed by the `robots.txt` file might still be indexed without being
|
||||||
|
crawled, and the content from within the `robots.txt` file can be viewed by
|
||||||
|
anyone, potentially disclosing the location of your private content! So, if
|
||||||
|
you want to block access to private content, use proper authentication instead.
|
||||||
|
|
||||||
|
For more information about `robots.txt`, please see:
|
||||||
|
|
||||||
|
* [robotstxt.org](http://www.robotstxt.org/)
|
||||||
|
* [How Google handles the `robots.txt` file](https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt)
|
||||||
|
|
||||||
|
|
||||||
|
## browserconfig.xml
|
||||||
|
|
||||||
|
The `browserconfig.xml` file is used to customize the tile displayed when users
|
||||||
|
pin your site to the Windows 8.1 start screen. In there you can define custom
|
||||||
|
tile colors, custom images or even [live tiles](https://msdn.microsoft.com/library/dn455106.aspx#CreatingLiveTiles).
|
||||||
|
|
||||||
|
By default, the file points to 2 placeholder tile images:
|
||||||
|
|
||||||
|
* `tile.png` (558x558px): used for `Small`, `Medium` and `Large` tiles.
|
||||||
|
This image resizes automatically when necessary.
|
||||||
|
* `tile-wide.png` (558x270px): user for `Wide` tiles.
|
||||||
|
|
||||||
|
Notice that IE11 uses the same images when adding a site to the `favorites`.
|
||||||
|
|
||||||
|
For more in-depth information about the `browserconfig.xml` file, please
|
||||||
|
see [MSDN](https://msdn.microsoft.com/library/dn320426.aspx).
|
||||||
130
doc/usage.md
Normal file
130
doc/usage.md
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
|
||||||
|
table of contents](TOC.md)
|
||||||
|
|
||||||
|
# Usage
|
||||||
|
|
||||||
|
The most basic usage of HTML5 Boilerplate is to create a static site or simple
|
||||||
|
app. Once you've downloaded or cloned the project, that process looks something
|
||||||
|
like this:
|
||||||
|
|
||||||
|
1. Set up the basic structure of the site.
|
||||||
|
2. Add some content, style, and functionality.
|
||||||
|
3. Run your site locally to see how it looks.
|
||||||
|
4. Deploy your site.
|
||||||
|
|
||||||
|
Cool, right? _It is_. That said, the smart defaults, baseline elements, default
|
||||||
|
attribute values and various other utilities that HTML5 Boilerplate offers can
|
||||||
|
serve as the foundation for whatever you're interested in building.
|
||||||
|
|
||||||
|
Even the basic use-case of a simple static site can be enhanced by manipulating
|
||||||
|
the code through an automated build process. Moving up in complexity HTML5
|
||||||
|
Boilerplate can be be integrated with whatever front-end framework, CMS or
|
||||||
|
e-commerce platform you're working with. Mix-and-match to your heart's content.
|
||||||
|
Use what you need (toss it in a blender if you need to) and discard the rest.
|
||||||
|
HTML5 Boilerplate is a starting point, not a destination.
|
||||||
|
|
||||||
|
## Basic structure
|
||||||
|
|
||||||
|
A basic HTML5 Boilerplate site initially looks something like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
.
|
||||||
|
├── css
|
||||||
|
│ ├── main.css
|
||||||
|
│ └── normalize.css
|
||||||
|
├── doc
|
||||||
|
├── img
|
||||||
|
├── js
|
||||||
|
│ ├── main.js
|
||||||
|
│ ├── plugins.js
|
||||||
|
│ └── vendor
|
||||||
|
│ ├── jquery.min.js
|
||||||
|
│ └── modernizr.min.js
|
||||||
|
├── .editorconfig
|
||||||
|
├── .htaccess
|
||||||
|
├── 404.html
|
||||||
|
├── browserconfig.xml
|
||||||
|
├── favicon.ico
|
||||||
|
├── humans.txt
|
||||||
|
├── icon.png
|
||||||
|
├── index.html
|
||||||
|
├── robots.txt
|
||||||
|
├── site.webmanifest
|
||||||
|
├── tile.png
|
||||||
|
└── tile-wide.png
|
||||||
|
```
|
||||||
|
|
||||||
|
What follows is a general overview of each major part and how to use them.
|
||||||
|
|
||||||
|
### css
|
||||||
|
|
||||||
|
This directory should contain all your project's CSS files. It includes some
|
||||||
|
initial CSS to help get you started from a solid foundation. [About the
|
||||||
|
CSS](css.md).
|
||||||
|
|
||||||
|
### doc
|
||||||
|
|
||||||
|
This directory contains all the HTML5 Boilerplate documentation. You can use it
|
||||||
|
as the location and basis for your own project's documentation.
|
||||||
|
|
||||||
|
### js
|
||||||
|
|
||||||
|
This directory should contain all your project's JS files. Libraries, plugins,
|
||||||
|
and custom code can all be included here. It includes some initial JS to help
|
||||||
|
get you started. [About the JavaScript](js.md).
|
||||||
|
|
||||||
|
### .htaccess
|
||||||
|
|
||||||
|
The default web server configs are for Apache. For more information, please
|
||||||
|
refer to the [Apache Server Configs
|
||||||
|
repository](https://github.com/h5bp/server-configs-apache).
|
||||||
|
|
||||||
|
Host your site on a server other than Apache? You're likely to find the
|
||||||
|
corresponding server configs project listed in our [Server Configs
|
||||||
|
](https://github.com/h5bp/server-configs/blob/master/README.md) repository.
|
||||||
|
|
||||||
|
### 404.html
|
||||||
|
|
||||||
|
A helpful custom 404 to get you started.
|
||||||
|
|
||||||
|
### browserconfig.xml
|
||||||
|
|
||||||
|
This file contains all settings regarding custom tiles for IE11 and Edge.
|
||||||
|
|
||||||
|
For more info on this topic, please refer to
|
||||||
|
[MSDN](https://msdn.microsoft.com/library/dn455106.aspx).
|
||||||
|
|
||||||
|
### .editorconfig
|
||||||
|
|
||||||
|
The `.editorconfig` file is provided in order to encourage and help you and
|
||||||
|
your team to maintain consistent coding styles between different
|
||||||
|
editors and IDEs. [Read more about the `.editorconfig` file](misc.md#editorconfig).
|
||||||
|
|
||||||
|
### index.html
|
||||||
|
|
||||||
|
This is the default HTML skeleton that should form the basis of all pages on
|
||||||
|
your site. If you are using a server-side templating framework, then you will
|
||||||
|
need to integrate this starting HTML with your setup.
|
||||||
|
|
||||||
|
Make sure that you update the URLs for the referenced CSS and JavaScript if you
|
||||||
|
modify the directory structure at all.
|
||||||
|
|
||||||
|
If you are using Google Universal Analytics, make sure that you edit the
|
||||||
|
corresponding snippet at the bottom to include your analytics ID.
|
||||||
|
|
||||||
|
### humans.txt
|
||||||
|
|
||||||
|
Edit this file to include the team that worked on your site/app, and the
|
||||||
|
technology powering it.
|
||||||
|
|
||||||
|
### robots.txt
|
||||||
|
|
||||||
|
Edit this file to include any pages you need hidden from search engines.
|
||||||
|
|
||||||
|
### Icons
|
||||||
|
|
||||||
|
Replace the default `favicon.ico`, `tile.png`, `tile-wide.png` and Apple
|
||||||
|
Touch Icon with your own.
|
||||||
|
|
||||||
|
If you want to use different Apple Touch Icons for different resolutions please
|
||||||
|
refer to the [according documentation](extend.md#apple-touch-icons).
|
||||||
BIN
favicon.ico
Normal file
BIN
favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 766 B |
15
humans.txt
Normal file
15
humans.txt
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# humanstxt.org/
|
||||||
|
# The humans responsible & technology colophon
|
||||||
|
|
||||||
|
# TEAM
|
||||||
|
|
||||||
|
<name> -- <role> -- <twitter>
|
||||||
|
|
||||||
|
# THANKS
|
||||||
|
|
||||||
|
<name>
|
||||||
|
|
||||||
|
# TECHNOLOGY COLOPHON
|
||||||
|
|
||||||
|
CSS3, HTML5
|
||||||
|
Apache Server Configs, jQuery, Modernizr, Normalize.css
|
||||||
0
img/.gitignore
vendored
Normal file
0
img/.gitignore
vendored
Normal file
BIN
img/arrow-left.png
Normal file
BIN
img/arrow-left.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 864 B |
BIN
img/arrow-right.png
Normal file
BIN
img/arrow-right.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
img/irisbegovic.png
Normal file
BIN
img/irisbegovic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
BIN
img/jastusnice.png
Normal file
BIN
img/jastusnice.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 318 KiB |
54
index.html
Normal file
54
index.html
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html class="no-js" lang="">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||||
|
<title></title>
|
||||||
|
<meta name="description" content="">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
|
<link rel="manifest" href="site.webmanifest">
|
||||||
|
<link rel="apple-touch-icon" href="icon.png">
|
||||||
|
<!-- Place favicon.ico in the root directory -->
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="css/normalize.css">
|
||||||
|
<link rel="stylesheet" href="css/main.css">
|
||||||
|
<link rel="stylesheet" href="css/jquery.slide.css">
|
||||||
|
<link rel="stylesheet" href="https://unpkg.com/purecss@1.0.0/build/pure-min.css" integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w" crossorigin="anonymous">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!--[if lte IE 9]>
|
||||||
|
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p>
|
||||||
|
<![endif]-->
|
||||||
|
<p><img src="img/irisbegovic.png" /></p>
|
||||||
|
<div class="pure-menu custom-restricted-width">
|
||||||
|
<ul class="pure-menu-list">
|
||||||
|
<li class="pure-menu-item"><a href="#" class="pure-menu-link"><span>appearences</span> <span>pojavljivanja</span></a></li>
|
||||||
|
<li class="pure-menu-item"><a href="#" class="pure-menu-link">works djela</a></li>
|
||||||
|
<li class="pure-menu-item"><a href="#" class="pure-menu-link">captures bilježi</a></li>
|
||||||
|
<li class="pure-menu-item"><a href="#" class="pure-menu-link">drawings crteži</a></li>
|
||||||
|
<li class="pure-menu-item"><a href="#" class="pure-menu-link">diet ishrana</a></li>
|
||||||
|
<li class="pure-menu-item"><a href="#" class="pure-menu-link">remarks opaske</a></li>
|
||||||
|
<li class="pure-menu-item"><a href="#" class="pure-menu-link">trash smeće</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Add your site or application content here -->
|
||||||
|
<div class="slide limited-width">
|
||||||
|
<ul>
|
||||||
|
<li data-bg="https://picsum.photos/1200/450/?random"></li>
|
||||||
|
<li data-bg="https://picsum.photos/1200/460/?random"></li>
|
||||||
|
<li data-bg="https://picsum.photos/1200/480/?random"></li>
|
||||||
|
<li data-bg="https://picsum.photos/1200/490/?random"></li>
|
||||||
|
<li data-bg="https://picsum.photos/1300/490/?random"></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<script src="js/vendor/modernizr-3.5.0.min.js"></script>
|
||||||
|
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
|
||||||
|
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.2.1.min.js"><\/script>')</script>
|
||||||
|
<script src="js/plugins.js"></script>
|
||||||
|
<script src="js/main.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
4
js/main.js
Normal file
4
js/main.js
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
$(function() {
|
||||||
|
$('.slide').slide();
|
||||||
|
});
|
||||||
|
|
||||||
259
js/plugins.js
Normal file
259
js/plugins.js
Normal file
@@ -0,0 +1,259 @@
|
|||||||
|
// Avoid `console` errors in browsers that lack a console.
|
||||||
|
(function() {
|
||||||
|
var method;
|
||||||
|
var noop = function () {};
|
||||||
|
var methods = [
|
||||||
|
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
|
||||||
|
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
|
||||||
|
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
|
||||||
|
'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
|
||||||
|
];
|
||||||
|
var length = methods.length;
|
||||||
|
var console = (window.console = window.console || {});
|
||||||
|
|
||||||
|
while (length--) {
|
||||||
|
method = methods[length];
|
||||||
|
|
||||||
|
// Only stub undefined methods.
|
||||||
|
if (!console[method]) {
|
||||||
|
console[method] = noop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}());
|
||||||
|
|
||||||
|
// Place any jQuery/helper plugins in here.
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* jquery.slide v1.1.0
|
||||||
|
* A simple jQuery slider.
|
||||||
|
* https://github.com/cobish/jquery.slide
|
||||||
|
|
||||||
|
* Copyright (c) 2016, cobish
|
||||||
|
* Released under the MIT license.
|
||||||
|
*/
|
||||||
|
(function($, window) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var slide = {
|
||||||
|
// default options
|
||||||
|
defaults: {
|
||||||
|
isAutoSlide: true, // 自动轮播
|
||||||
|
isHoverStop: true, // 鼠标移上是否停止轮播
|
||||||
|
isBlurStop: true, // Window失去焦点是否停止轮播
|
||||||
|
isShowDots: true, // 是否显示状态点
|
||||||
|
isShowArrow: true, // 是否显示左右箭头
|
||||||
|
isHoverShowArrow: true, // 是否鼠标移上才显示箭头
|
||||||
|
isLoadAllImgs: false, // 是否一次性加载完全部图片
|
||||||
|
slideSpeed: 10000, // 轮播速度 (ms)
|
||||||
|
switchSpeed: 500, // 图片切换速度 (ms)
|
||||||
|
dotsClass: 'dots', // 状态点样式
|
||||||
|
dotActiveClass: 'active', // 状态点激活样式
|
||||||
|
dotsEvent: 'click', // 状态点事件,click或mouseover或mouseenter
|
||||||
|
arrowClass: 'arrow', // 箭头样式
|
||||||
|
arrowLeftClass: 'arrow-left', // 左箭头样式
|
||||||
|
arrowRightClass: 'arrow-right' // 右箭头样式
|
||||||
|
},
|
||||||
|
|
||||||
|
// curr options
|
||||||
|
options: null,
|
||||||
|
|
||||||
|
// 当前索引
|
||||||
|
curIndex: 0,
|
||||||
|
|
||||||
|
// 定时器
|
||||||
|
timer: null,
|
||||||
|
|
||||||
|
// 状态点集合
|
||||||
|
dotsList: [],
|
||||||
|
|
||||||
|
// init function
|
||||||
|
init: function(elem, options) {
|
||||||
|
var $self = $(elem),
|
||||||
|
list = $self.find('ul li'),
|
||||||
|
self = this,
|
||||||
|
o;
|
||||||
|
|
||||||
|
o = this.options = $.extend({}, this.defaults, options);
|
||||||
|
|
||||||
|
// 显示状态点
|
||||||
|
if (o.isShowDots) {
|
||||||
|
this._createDots(elem, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示左右箭头
|
||||||
|
if (o.isShowArrow) {
|
||||||
|
this._createArrow(elem, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 一次性加载完全部图片
|
||||||
|
if (o.isLoadAllImgs) {
|
||||||
|
list.each(function() {
|
||||||
|
$(this).css({
|
||||||
|
'background': 'url(' + $(this).attr('data-bg') + ')',
|
||||||
|
'opacity': '0',
|
||||||
|
'z-index': '0',
|
||||||
|
'background-position': '50% 50%',
|
||||||
|
'background-size': 'cover'
|
||||||
|
});
|
||||||
|
$(this).attr('data-bg', '');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示第一个
|
||||||
|
this._showBlock(list[this.curIndex]);
|
||||||
|
|
||||||
|
// 自动轮播
|
||||||
|
if (o.isAutoSlide) {
|
||||||
|
this._defaultSlide(list);
|
||||||
|
|
||||||
|
// 鼠标移入移除事件
|
||||||
|
if (o.isHoverStop) {
|
||||||
|
var className = $self.attr('class');
|
||||||
|
$self.on('mouseenter', function(e) {
|
||||||
|
clearInterval(self.timer);
|
||||||
|
}).on('mouseleave', function() {
|
||||||
|
clearInterval(self.timer);
|
||||||
|
self._defaultSlide(list);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Window获取失去焦点事件
|
||||||
|
if (o.isBlurStop) {
|
||||||
|
$(window).on('blur', function() {
|
||||||
|
clearInterval(self.timer);
|
||||||
|
}).on('focus', function() {
|
||||||
|
clearInterval(self.timer);
|
||||||
|
self._defaultSlide(list);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// default slide
|
||||||
|
_defaultSlide: function(list) {
|
||||||
|
var self = this;
|
||||||
|
this.timer = setInterval(function() {
|
||||||
|
self._hideBlock(list[self.curIndex]);
|
||||||
|
self.curIndex = (self.curIndex + 1) % list.length;
|
||||||
|
self._showBlock(list[self.curIndex]);
|
||||||
|
}, this.options.slideSpeed);
|
||||||
|
},
|
||||||
|
|
||||||
|
// show block
|
||||||
|
_showBlock: function(block) {
|
||||||
|
var o = this.options,
|
||||||
|
$block = $(block),
|
||||||
|
bg = $(block).attr('data-bg');
|
||||||
|
|
||||||
|
if (bg) {
|
||||||
|
$block.css({
|
||||||
|
'background': 'url(' + bg + ')',
|
||||||
|
'opacity': '0',
|
||||||
|
'z-index': '0',
|
||||||
|
'background-position': '50% 50%',
|
||||||
|
'background-size': 'cover'
|
||||||
|
});
|
||||||
|
$block.attr('data-bg', '');
|
||||||
|
}
|
||||||
|
|
||||||
|
$block.stop().animate({
|
||||||
|
'opacity': '1',
|
||||||
|
'z-index': '1'
|
||||||
|
}, o.switchSpeed);
|
||||||
|
|
||||||
|
if (o.isShowDots) {
|
||||||
|
$(this.dotsList[this.curIndex]).addClass(o.dotActiveClass);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// hide block
|
||||||
|
_hideBlock: function(block) {
|
||||||
|
var o = this.options;
|
||||||
|
|
||||||
|
$(block).stop().animate({
|
||||||
|
'opacity': '0',
|
||||||
|
'z-index': '0'
|
||||||
|
}, o.switchSpeed);
|
||||||
|
|
||||||
|
if (o.isShowDots) {
|
||||||
|
$(this.dotsList[this.curIndex]).removeClass(o.dotActiveClass);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// create dots
|
||||||
|
_createDots: function(elem, list) {
|
||||||
|
var self = this,
|
||||||
|
dotsEvent = this.options.dotsEvent;
|
||||||
|
|
||||||
|
var dots = $('<ol/>', {
|
||||||
|
class: this.options.dotsClass
|
||||||
|
});
|
||||||
|
|
||||||
|
var dotsList = [];
|
||||||
|
for (var i = 0; i < list.length; i++) {
|
||||||
|
dotsList[i] = $('<li/>');
|
||||||
|
dots.append(dotsList[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(elem).append(dots);
|
||||||
|
this.dotsList = dotsList;
|
||||||
|
|
||||||
|
// dots添加事件
|
||||||
|
if (dotsEvent === 'click' || dotsEvent === 'mouseover' || dotsEvent === 'mouseenter') {
|
||||||
|
dots.find('li').on(dotsEvent, function() {
|
||||||
|
self._hideBlock(list[self.curIndex]);
|
||||||
|
self.curIndex = $(this).index();
|
||||||
|
self._showBlock(list[self.curIndex]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// create arrowClass
|
||||||
|
_createArrow: function(elem, list) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
var arrow = $('<div/>', {
|
||||||
|
class: this.options.arrowClass
|
||||||
|
});
|
||||||
|
|
||||||
|
var leftArrow = $('<a/>', {
|
||||||
|
class: this.options.arrowLeftClass
|
||||||
|
});
|
||||||
|
|
||||||
|
var rightArrow = $('<a/>', {
|
||||||
|
class: this.options.arrowRightClass
|
||||||
|
});
|
||||||
|
|
||||||
|
arrow.append(leftArrow).append(rightArrow);
|
||||||
|
$(elem).append(arrow);
|
||||||
|
|
||||||
|
if (this.options.isHoverShowArrow) {
|
||||||
|
arrow.css('opacity', 0);
|
||||||
|
$(elem).on('mouseenter', function() {
|
||||||
|
arrow.css('opacity', 1);
|
||||||
|
}).on('mouseleave', function() {
|
||||||
|
arrow.css('opacity', 0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
leftArrow.on('click', function() {
|
||||||
|
self._hideBlock(list[self.curIndex]);
|
||||||
|
self.curIndex = (list.length + (self.curIndex - 1)) % list.length;
|
||||||
|
self._showBlock(list[self.curIndex]);
|
||||||
|
});
|
||||||
|
|
||||||
|
rightArrow.on('click', function() {
|
||||||
|
self._hideBlock(list[self.curIndex]);
|
||||||
|
self.curIndex = (self.curIndex + 1) % list.length;
|
||||||
|
self._showBlock(list[self.curIndex]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// main function
|
||||||
|
$.fn.slide = function(options) {
|
||||||
|
slide.init(this, options);
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
})(jQuery, window);
|
||||||
4
js/vendor/jquery-3.2.1.min.js
vendored
Normal file
4
js/vendor/jquery-3.2.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
234
js/vendor/jquery.slide.js
vendored
Normal file
234
js/vendor/jquery.slide.js
vendored
Normal file
@@ -0,0 +1,234 @@
|
|||||||
|
/*!
|
||||||
|
* jquery.slide v1.1.0
|
||||||
|
* A simple jQuery slider.
|
||||||
|
* https://github.com/cobish/jquery.slide
|
||||||
|
|
||||||
|
* Copyright (c) 2016, cobish
|
||||||
|
* Released under the MIT license.
|
||||||
|
*/
|
||||||
|
(function($, window) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var slide = {
|
||||||
|
// default options
|
||||||
|
defaults: {
|
||||||
|
isAutoSlide: true, // 自动轮播
|
||||||
|
isHoverStop: true, // 鼠标移上是否停止轮播
|
||||||
|
isBlurStop: true, // Window失去焦点是否停止轮播
|
||||||
|
isShowDots: true, // 是否显示状态点
|
||||||
|
isShowArrow: true, // 是否显示左右箭头
|
||||||
|
isHoverShowArrow: true, // 是否鼠标移上才显示箭头
|
||||||
|
isLoadAllImgs: false, // 是否一次性加载完全部图片
|
||||||
|
slideSpeed: 10000, // 轮播速度 (ms)
|
||||||
|
switchSpeed: 500, // 图片切换速度 (ms)
|
||||||
|
dotsClass: 'dots', // 状态点样式
|
||||||
|
dotActiveClass: 'active', // 状态点激活样式
|
||||||
|
dotsEvent: 'click', // 状态点事件,click或mouseover或mouseenter
|
||||||
|
arrowClass: 'arrow', // 箭头样式
|
||||||
|
arrowLeftClass: 'arrow-left', // 左箭头样式
|
||||||
|
arrowRightClass: 'arrow-right' // 右箭头样式
|
||||||
|
},
|
||||||
|
|
||||||
|
// curr options
|
||||||
|
options: null,
|
||||||
|
|
||||||
|
// 当前索引
|
||||||
|
curIndex: 0,
|
||||||
|
|
||||||
|
// 定时器
|
||||||
|
timer: null,
|
||||||
|
|
||||||
|
// 状态点集合
|
||||||
|
dotsList: [],
|
||||||
|
|
||||||
|
// init function
|
||||||
|
init: function(elem, options) {
|
||||||
|
var $self = $(elem),
|
||||||
|
list = $self.find('ul li'),
|
||||||
|
self = this,
|
||||||
|
o;
|
||||||
|
|
||||||
|
o = this.options = $.extend({}, this.defaults, options);
|
||||||
|
|
||||||
|
// 显示状态点
|
||||||
|
if (o.isShowDots) {
|
||||||
|
this._createDots(elem, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示左右箭头
|
||||||
|
if (o.isShowArrow) {
|
||||||
|
this._createArrow(elem, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 一次性加载完全部图片
|
||||||
|
if (o.isLoadAllImgs) {
|
||||||
|
list.each(function() {
|
||||||
|
$(this).css({
|
||||||
|
'background': 'url(' + $(this).attr('data-bg') + ')',
|
||||||
|
'opacity': '0',
|
||||||
|
'z-index': '0',
|
||||||
|
'background-position': '50% 50%',
|
||||||
|
'background-size': 'cover'
|
||||||
|
});
|
||||||
|
$(this).attr('data-bg', '');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 显示第一个
|
||||||
|
this._showBlock(list[this.curIndex]);
|
||||||
|
|
||||||
|
// 自动轮播
|
||||||
|
if (o.isAutoSlide) {
|
||||||
|
this._defaultSlide(list);
|
||||||
|
|
||||||
|
// 鼠标移入移除事件
|
||||||
|
if (o.isHoverStop) {
|
||||||
|
var className = $self.attr('class');
|
||||||
|
$self.on('mouseenter', function(e) {
|
||||||
|
clearInterval(self.timer);
|
||||||
|
}).on('mouseleave', function() {
|
||||||
|
clearInterval(self.timer);
|
||||||
|
self._defaultSlide(list);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Window获取失去焦点事件
|
||||||
|
if (o.isBlurStop) {
|
||||||
|
$(window).on('blur', function() {
|
||||||
|
clearInterval(self.timer);
|
||||||
|
}).on('focus', function() {
|
||||||
|
clearInterval(self.timer);
|
||||||
|
self._defaultSlide(list);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// default slide
|
||||||
|
_defaultSlide: function(list) {
|
||||||
|
var self = this;
|
||||||
|
this.timer = setInterval(function() {
|
||||||
|
self._hideBlock(list[self.curIndex]);
|
||||||
|
self.curIndex = (self.curIndex + 1) % list.length;
|
||||||
|
self._showBlock(list[self.curIndex]);
|
||||||
|
}, this.options.slideSpeed);
|
||||||
|
},
|
||||||
|
|
||||||
|
// show block
|
||||||
|
_showBlock: function(block) {
|
||||||
|
var o = this.options,
|
||||||
|
$block = $(block),
|
||||||
|
bg = $(block).attr('data-bg');
|
||||||
|
|
||||||
|
if (bg) {
|
||||||
|
$block.css({
|
||||||
|
'background': 'url(' + bg + ')',
|
||||||
|
'opacity': '0',
|
||||||
|
'z-index': '0',
|
||||||
|
'background-position': '50% 50%',
|
||||||
|
'background-size': 'cover'
|
||||||
|
});
|
||||||
|
$block.attr('data-bg', '');
|
||||||
|
}
|
||||||
|
|
||||||
|
$block.stop().animate({
|
||||||
|
'opacity': '1',
|
||||||
|
'z-index': '1'
|
||||||
|
}, o.switchSpeed);
|
||||||
|
|
||||||
|
if (o.isShowDots) {
|
||||||
|
$(this.dotsList[this.curIndex]).addClass(o.dotActiveClass);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// hide block
|
||||||
|
_hideBlock: function(block) {
|
||||||
|
var o = this.options;
|
||||||
|
|
||||||
|
$(block).stop().animate({
|
||||||
|
'opacity': '0',
|
||||||
|
'z-index': '0'
|
||||||
|
}, o.switchSpeed);
|
||||||
|
|
||||||
|
if (o.isShowDots) {
|
||||||
|
$(this.dotsList[this.curIndex]).removeClass(o.dotActiveClass);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// create dots
|
||||||
|
_createDots: function(elem, list) {
|
||||||
|
var self = this,
|
||||||
|
dotsEvent = this.options.dotsEvent;
|
||||||
|
|
||||||
|
var dots = $('<ol/>', {
|
||||||
|
class: this.options.dotsClass
|
||||||
|
});
|
||||||
|
|
||||||
|
var dotsList = [];
|
||||||
|
for (var i = 0; i < list.length; i++) {
|
||||||
|
dotsList[i] = $('<li/>');
|
||||||
|
dots.append(dotsList[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(elem).append(dots);
|
||||||
|
this.dotsList = dotsList;
|
||||||
|
|
||||||
|
// dots添加事件
|
||||||
|
if (dotsEvent === 'click' || dotsEvent === 'mouseover' || dotsEvent === 'mouseenter') {
|
||||||
|
dots.find('li').on(dotsEvent, function() {
|
||||||
|
self._hideBlock(list[self.curIndex]);
|
||||||
|
self.curIndex = $(this).index();
|
||||||
|
self._showBlock(list[self.curIndex]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// create arrowClass
|
||||||
|
_createArrow: function(elem, list) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
var arrow = $('<div/>', {
|
||||||
|
class: this.options.arrowClass
|
||||||
|
});
|
||||||
|
|
||||||
|
var leftArrow = $('<a/>', {
|
||||||
|
class: this.options.arrowLeftClass
|
||||||
|
});
|
||||||
|
|
||||||
|
var rightArrow = $('<a/>', {
|
||||||
|
class: this.options.arrowRightClass
|
||||||
|
});
|
||||||
|
|
||||||
|
arrow.append(leftArrow).append(rightArrow);
|
||||||
|
$(elem).append(arrow);
|
||||||
|
|
||||||
|
if (this.options.isHoverShowArrow) {
|
||||||
|
arrow.css('opacity', 0);
|
||||||
|
$(elem).on('mouseenter', function() {
|
||||||
|
arrow.css('opacity', 1);
|
||||||
|
}).on('mouseleave', function() {
|
||||||
|
arrow.css('opacity', 0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
leftArrow.on('click', function() {
|
||||||
|
self._hideBlock(list[self.curIndex]);
|
||||||
|
self.curIndex = (list.length + (self.curIndex - 1)) % list.length;
|
||||||
|
self._showBlock(list[self.curIndex]);
|
||||||
|
});
|
||||||
|
|
||||||
|
rightArrow.on('click', function() {
|
||||||
|
self._hideBlock(list[self.curIndex]);
|
||||||
|
self.curIndex = (self.curIndex + 1) % list.length;
|
||||||
|
self._showBlock(list[self.curIndex]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// main function
|
||||||
|
$.fn.slide = function(options) {
|
||||||
|
slide.init(this, options);
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
})(jQuery, window);
|
||||||
3
js/vendor/modernizr-3.5.0.min.js
vendored
Normal file
3
js/vendor/modernizr-3.5.0.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5
robots.txt
Normal file
5
robots.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# www.robotstxt.org/
|
||||||
|
|
||||||
|
# Allow crawling of all content
|
||||||
|
User-agent: *
|
||||||
|
Disallow:
|
||||||
8
site.webmanifest
Normal file
8
site.webmanifest
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"icons": [{
|
||||||
|
"src": "icon.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png"
|
||||||
|
}],
|
||||||
|
"start_url": "/"
|
||||||
|
}
|
||||||
BIN
tile-wide.png
Normal file
BIN
tile-wide.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Reference in New Issue
Block a user