This Gist demonstrates usage of PHP Object-oriented classes using
spl_autoload
, ECMAScript 2015 modules via webpack and Babel, and CSS custom-properties via Myth.
Last active
October 10, 2023 07:23
-
-
Save shgysk8zer0/4392b21268e39f4003e9 to your computer and use it in GitHub Desktop.
PHP URLSearchParams class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": ["es2015"], | |
"sourceMaps": true, | |
"only": "*.js", | |
"compact": true, | |
"comments": false | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ecmaFeatures": { | |
"arrowFunctions": true, | |
"blockBindings": true, | |
"classes": true, | |
"destructuring": true, | |
"forOf": true, | |
"generators": true, | |
"templateStrings": true, | |
"unicodeCodePointEscapes": true, | |
"jsx": false, | |
"modules": true | |
}, | |
"rules": { | |
"semi": 2, | |
"quotes": [1, "single"], | |
"strict": 0, | |
"comma-spacing": 1, | |
"new-cap": 0, | |
"no-new": 0, | |
"camelcase": 0, | |
"no-underscore-dangle": 0, | |
"no-negated-in-lhs": 0, | |
"no-extra-boolean-cast": 0, | |
"no-redeclare": 0, | |
"no-shadow": 0, | |
"consistent-return": 0, | |
"eqeqeq": 0, | |
"no-extend-native": 0, | |
"no-undef": 0, | |
"no-unused-expressions": 0, | |
"no-console": 0, | |
"no-alert": 0, | |
"no-unused-vars": 0, | |
"no-loop-func": 0, | |
"no-eval": 0 | |
}, | |
"env": { | |
"browser": true, | |
"es6": true, | |
"worker": true, | |
"node": false, | |
"amd": false, | |
"mocha": false, | |
"jasmine": false, | |
"jquery": false, | |
"prototypejs": false, | |
"shelljs": false, | |
"meteor": false, | |
"mongo": false, | |
"applescript": false | |
}, | |
"globals": { | |
"document": false, | |
"window": false, | |
"ga": true | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Auto detect text files and perform LF normalization | |
* text=auto | |
# Custom for Visual Studio | |
*.cs diff=csharp | |
# Standard to msysgit | |
*.doc diff=astextplain | |
*.DOC diff=astextplain | |
*.docx diff=astextplain | |
*.DOCX diff=astextplain | |
*.dot diff=astextplain | |
*.DOT diff=astextplain | |
*.pdf diff=astextplain | |
*.PDF diff=astextplain | |
*.rtf diff=astextplain | |
*.RTF diff=astextplain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/patches/ | |
*.patch | |
/node_modules/ | |
/npm-debug.log | |
################# | |
## Eclipse | |
################# | |
*.pydevproject | |
.project | |
.metadata | |
bin/ | |
tmp/ | |
*.tmp | |
*.bak | |
*.swp | |
*~.nib | |
local.properties | |
.classpath | |
.settings/ | |
.loadpath | |
# External tool builders | |
.externalToolBuilders/ | |
# Locally stored "Eclipse launch configurations" | |
*.launch | |
# CDT-specific | |
.cproject | |
# PDT-specific | |
.buildpath | |
################# | |
## Visual Studio | |
################# | |
## Ignore Visual Studio temporary files, build results, and | |
## files generated by popular Visual Studio add-ons. | |
# User-specific files | |
*.suo | |
*.user | |
*.sln.docstates | |
# Build results | |
[Dd]ebug/ | |
[Rr]elease/ | |
x64/ | |
build/ | |
[Bb]in/ | |
[Oo]bj/ | |
# MSTest test Results | |
[Tt]est[Rr]esult*/ | |
[Bb]uild[Ll]og.* | |
*_i.c | |
*_p.c | |
*.ilk | |
*.meta | |
*.obj | |
*.pch | |
*.pdb | |
*.pgc | |
*.pgd | |
*.rsp | |
*.sbr | |
*.tlb | |
*.tli | |
*.tlh | |
*.tmp | |
*.tmp_proj | |
*.log | |
*.vspscc | |
*.vssscc | |
.builds | |
*.pidb | |
*.log | |
*.scc | |
# Visual C++ cache files | |
ipch/ | |
*.aps | |
*.ncb | |
*.opensdf | |
*.sdf | |
*.cachefile | |
# Visual Studio profiler | |
*.psess | |
*.vsp | |
*.vspx | |
# Guidance Automation Toolkit | |
*.gpState | |
# ReSharper is a .NET coding add-in | |
_ReSharper*/ | |
*.[Rr]e[Ss]harper | |
# TeamCity is a build add-in | |
_TeamCity* | |
# DotCover is a Code Coverage Tool | |
*.dotCover | |
# NCrunch | |
*.ncrunch* | |
.*crunch*.local.xml | |
# Installshield output folder | |
[Ee]xpress/ | |
# DocProject is a documentation generator add-in | |
DocProject/buildhelp/ | |
DocProject/Help/*.HxT | |
DocProject/Help/*.HxC | |
DocProject/Help/*.hhc | |
DocProject/Help/*.hhk | |
DocProject/Help/*.hhp | |
DocProject/Help/Html2 | |
DocProject/Help/html | |
# Click-Once directory | |
publish/ | |
# Publish Web Output | |
*.Publish.xml | |
*.pubxml | |
*.publishproj | |
# NuGet Packages Directory | |
## TODO: If you have NuGet Package Restore enabled, uncomment the next line | |
#packages/ | |
# Windows Azure Build Output | |
csx | |
*.build.csdef | |
# Windows Store app package directory | |
AppPackages/ | |
# Others | |
sql/ | |
*.Cache | |
ClientBin/ | |
[Ss]tyle[Cc]op.* | |
~$* | |
*~ | |
*.dbmdl | |
*.[Pp]ublish.xml | |
*.pfx | |
*.publishsettings | |
# RIA/Silverlight projects | |
Generated_Code/ | |
# Backup & report files from converting an old project file to a newer | |
# Visual Studio version. Backup files are not needed, because we have git ;-) | |
_UpgradeReport_Files/ | |
Backup*/ | |
UpgradeLog*.XML | |
UpgradeLog*.htm | |
# SQL Server files | |
App_Data/*.mdf | |
App_Data/*.ldf | |
############# | |
## Windows detritus | |
############# | |
# Windows image file caches | |
Thumbs.db | |
ehthumbs.db | |
# Folder config file | |
Desktop.ini | |
# Recycle Bin used on file shares | |
$RECYCLE.BIN/ | |
# Mac crap | |
.DS_Store | |
############# | |
## Python | |
############# | |
*.py[cod] | |
# Packages | |
*.egg | |
*.egg-info | |
dist/ | |
build/ | |
eggs/ | |
parts/ | |
var/ | |
sdist/ | |
develop-eggs/ | |
.installed.cfg | |
# Installer logs | |
pip-log.txt | |
# Unit test / coverage reports | |
.coverage | |
.tox | |
#Translations | |
*.mo | |
#Mr Developer | |
.mr.developer.cfg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Options -Indexes +SymLinksIfOwnerMatch | |
<IfModule php5_module> | |
DirectoryIndex index.php | |
php_value auto_prepend_file ./autoloader.php | |
<IfModule env_module> | |
SetEnv AUTOLOAD_DIR ./ | |
SetEnv AUTOLOAD_EXTS .php | |
SetEnv AUTOLOAD_FUNC spl_autoload | |
</IfModule> | |
</IfModule> | |
<IfModule !php5_module> | |
DirectoryIndex index.html | |
</IfModule> | |
#Configure PHP's autoloader and set include_path, min PHP version | |
<IfModule headers_module> | |
Header set X-Frame-Options "SAMEORIGIN" | |
Header set X-Content-Type-Options nosniff | |
Header set X-XSS-Protection "1; mode=block" | |
Header set Cache-Control "public, must-revalidate, proxy-revalidate, no-transform" | |
# Header set X-UA-Compatible "IE=edge,chrome=1" | |
Header set Connection "Keep-Alive" | |
Header set Content-Security-Policy "default-src 'self' https://assets-cdn.github.com https://render.githubusercontent.com; script-src 'self' https://gist.github.com https://render.githubusercontent.com; style-src 'self' 'unsafe-inline' https://assets-cdn.github.com; img-src 'self' https://assets-cdn.github.com; child-src 'self' https://render.githubusercontent.com; font-src 'none'; connect-src 'none'; object-src 'none'; media-src 'none'; frame-ancestors *;" | |
# `mod_headers` can't match based on the content-type, however, we only | |
# want to send this header for HTML pages and not for the other resource; connect-src 'self' https://render.githubusercontent.com/stats/timing/local/imgs | |
<FilesMatch "\.(appcache|crx|css|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svg|svgz|ttf|vcf|webapp|webm|webp|woff2?|xml|xpi)$"> | |
Header set Cache-Control "public, must-revalidate, proxy-revalidate, no-transform" | |
Header unset X-Frame-Options | |
Header unset X-XSS-Protection | |
Header unset X-UA-Compatible | |
</FilesMatch> | |
<Files manifest.appcache> | |
# Header set Cache-Control "public, no-cache, no-store, must-revalidate, proxy-revalidate, no-transform" | |
Header unset Accept-Ranges | |
</Files> | |
<IfModule ssl_module> | |
Header set Strict-Transport-Security max-age=16070400; | |
</IfModule> | |
<IfModule setenvif_module> | |
<FilesMatch "\.(gif|ico|jpe?g|png|svgz?|webp)$"> | |
SetEnvIf Origin ":" IS_CORS | |
Header set Access-Control-Allow-Origin "*" env=IS_CORS | |
</FilesMatch> | |
</IfModule> | |
</IfModule> | |
# ------------------------------------------------------------------------------ | |
# | UTF-8 encoding | | |
# ------------------------------------------------------------------------------ | |
# Use UTF-8 encoding for anything served as `text/html` or `text/plain`. | |
AddDefaultCharset utf-8 | |
# ------------------------------------------------------------------------------ | |
# | Proper MIME types for all files | | |
# ------------------------------------------------------------------------------ | |
<IfModule mime_module> | |
AddCharset utf-8 .atom .css .js .json .rss .vtt .webapp .xml | |
# Audio | |
AddType audio/mp4 .m4a .f4a .f4b | |
AddType audio/ogg .oga .ogg | |
# JavaScript | |
# Normalize to standard type (it's sniffed in IE anyways): | |
# http://tools.ietf.org/html/rfc4329#section-7.2 | |
AddType application/javascript .js .es6 .jsonp | |
AddType application/json .json | |
# Video | |
AddType video/mp4 .mp4 .m4v .f4v .f4p | |
AddType video/ogg .ogv | |
AddType video/webm .webm | |
AddType video/x-flv .flv | |
# Web fonts | |
AddType application/font-woff .woff | |
AddType application/font-woff2 .woff2 | |
AddType application/vnd.ms-fontobject .eot | |
# Browsers usually ignore the font MIME types and sniff the content, | |
# however, Chrome shows a warning if other MIME types are used for the | |
# following fonts. | |
AddType application/x-font-ttf .ttc .ttf | |
AddType font/opentype .otf | |
# Make SVGZ fonts work on iPad: | |
# https://twitter.com/FontSquirrel/status/14855840545 | |
AddType image/svg+xml .svg .svgz | |
AddEncoding gzip .svgz | |
# Other | |
AddType application/octet-stream .safariextz | |
AddType application/x-chrome-extension .crx | |
AddType application/x-opera-extension .oex | |
AddType application/x-shockwave-flash .swf | |
AddType application/x-web-app-manifest+json .webapp | |
AddType application/x-xpinstall .xpi | |
AddType application/xml .atom .rdf .rss .xml | |
AddType text/x-markdown .md | |
AddType image/webp .webp | |
AddType image/x-icon .ico | |
AddType text/cache-manifest .appcache .manifest | |
AddType text/vtt .vtt | |
AddType text/x-component .htc | |
AddType text/x-vcard .vcf | |
AddType application/pgp-keys .gpg .pgp | |
</IfModule> | |
# Block access to backup and source files. | |
# These files may be left by some text editors and can pose a great security | |
# danger when anyone has access to them. | |
<FilesMatch "(^#.*|~.*|\.(bak|ht.*|dav|conf(ig)?|dist|fla|inc|ini|log|psd|sql|sw[op]|asc|(ba)?sh|md|yml|lock|log|git.*|gpg|pgp))$"> | |
Require all denied | |
</FilesMatch> | |
<FilesMatch "^(ajax|custom|unit)\.php$"> | |
Require all denied | |
</FilesMatch> | |
<FilesMatch "\.html$"> | |
Require all granted | |
</FilesMatch> | |
<IfModule deflate_module> | |
# Force compression for mangled headers. | |
# http://developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping | |
<IfModule setenvif_module> | |
<IfModule headers_module> | |
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 MIME-types | |
# (for Apache versions below 2.3.7, you don't need to enable `mod_filter` | |
# and can remove the `<IfModule filter_module>` and `</IfModule>` lines | |
# as `AddOutputFilterByType` is still in the core directives). | |
<IfModule filter_module> | |
AddOutputFilterByType DEFLATE application/atom+xml \ | |
application/javascript \ | |
application/json \ | |
application/rss+xml \ | |
application/vnd.ms-fontobject \ | |
application/x-font-ttf \ | |
application/x-web-app-manifest+json \ | |
application/xhtml+xml \ | |
application/xml \ | |
font/opentype \ | |
image/svg+xml \ | |
image/x-icon \ | |
text/css \ | |
text/html \ | |
text/plain \ | |
text/x-component \ | |
text/xml | |
</IfModule> | |
</IfModule> | |
# ------------------------------------------------------------------------------ | |
# | Content transformations | | |
# ------------------------------------------------------------------------------ | |
# Prevent some of the mobile network providers from modifying the content of | |
# your site: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.5. | |
# ------------------------------------------------------------------------------ | |
# | ETag removal | | |
# ------------------------------------------------------------------------------ | |
# Since we're sending far-future expires headers (see below), ETags can | |
# be removed: http://developer.yahoo.com/performance/rules.html#etags. | |
# `FileETag None` is not enough for every server. | |
<IfModule headers_module> | |
Header unset ETag | |
</IfModule> | |
FileETag None | |
# ------------------------------------------------------------------------------ | |
# | Expires headers (for better cache control) | | |
# ------------------------------------------------------------------------------ | |
# The following expires headers are set pretty far in the future. If you don't | |
# control versioning with filename-based cache busting, consider lowering the | |
# cache time for resources like CSS and JS to something like 1 week. | |
# The following expires headers are set pretty far in the future. If you don't | |
# control versioning with filename-based cache busting, consider lowering the | |
# cache time for resources like CSS and JS to something like 1 week. | |
<IfModule expires_module> | |
ExpiresActive on | |
ExpiresDefault "access plus 1 month" | |
# CSS | |
ExpiresByType text/css "access plus 1 year" | |
# Data interchange | |
ExpiresByType application/json "access plus 0 seconds" | |
ExpiresByType application/xml "access plus 0 seconds" | |
ExpiresByType text/xml "access plus 0 seconds" | |
# Favicon (cannot be renamed!) | |
ExpiresByType image/x-icon "access plus 1 week" | |
# HTML components (HTCs) | |
ExpiresByType text/x-component "access plus 1 month" | |
# HTML | |
ExpiresByType text/html "access plus 0 seconds" | |
# JavaScript | |
ExpiresByType application/javascript "access plus 1 year" | |
# Manifest files | |
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds" | |
ExpiresByType text/cache-manifest "access plus 0 seconds" | |
# Media | |
ExpiresByType audio/ogg "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 video/mp4 "access plus 1 month" | |
ExpiresByType video/ogg "access plus 1 month" | |
ExpiresByType video/webm "access plus 1 month" | |
# Web feeds | |
ExpiresByType application/atom+xml "access plus 1 hour" | |
ExpiresByType application/rss+xml "access plus 1 hour" | |
# Web fonts | |
ExpiresByType application/font-woff "access plus 1 month" | |
ExpiresByType application/vnd.ms-fontobject "access plus 1 month" | |
ExpiresByType application/x-font-ttf "access plus 1 month" | |
ExpiresByType font/opentype "access plus 1 month" | |
ExpiresByType image/svg+xml "access plus 1 month" | |
</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 `/css/style.12345.css` to `/css/style.css`. | |
# To understand why this is important and a better idea than `*.css?v231`, read: | |
# http://stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring | |
# ------------------------------------------------------------------------------ | |
# | File concatenation | | |
# ------------------------------------------------------------------------------ | |
# Allow concatenation from within specific CSS and JS files, e.g.: | |
# Inside of `script.combined.js` you could have | |
# <!--#include file="libs/jquery.js" --> | |
# <!--#include file="plugins/jquery.idletimer.js" --> | |
# and they would be included into this single file. | |
# <IfModule include_module> | |
# <FilesMatch "\.?(combined|polyfills)\.js$"> | |
# Options +Includes | |
# AddOutputFilterByType INCLUDES application/javascript application/json | |
# SetOutputFilter INCLUDES | |
# </FilesMatch> | |
# </IfModule> | |
<IfModule rewrite_module> | |
# Redirect all non-existing to index.php | |
RewriteEngine on | |
<IfModule ssl_module> | |
# Force HTTPS | |
RewriteCond %{HTTPS} !=on | |
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L] | |
</IfModule> | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-l | |
RewriteRule . ./index.html [L] | |
</IfModule> | |
# ------------------------------------------------------------------------------ | |
# | Error pages | | |
# ------------------------------------------------------------------------------ | |
ErrorDocument 400 /index.html | |
ErrorDocument 401 /index.html | |
ErrorDocument 402 /index.html | |
ErrorDocument 403 /index.html | |
ErrorDocument 404 /index.html | |
ErrorDocument 500 /index.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
set_include_path(realpath(getenv('AUTOLOAD_DIR'))); | |
spl_autoload_register(getenv('AUTOLOAD_FUNC')); | |
spl_autoload_extensions(getenv('AUTOLOAD_EXTS')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.spacer { | |
display: inline-block; | |
height: 100%; | |
width: 0; | |
padding: 0; | |
margin: 0 0.5em; | |
border-right: 2px solid currentColor; | |
} | |
.center { | |
text-align: center; | |
} | |
.resizeable { | |
resize: both; | |
overflow: auto; | |
} | |
@media screen and (min-width: 800px) { | |
.sticky { | |
position: sticky; | |
margin-top: 0; | |
} | |
} | |
.blur { | |
filter: blur(1px); | |
} | |
.grayscale { | |
filter: grayscale(1); | |
} | |
.blur.grayscale { | |
filter: blur(1px) grayscale(1) | |
} | |
.flex { | |
display: flex; | |
} | |
.flex.row { | |
flex-direction: row; | |
} | |
.flex.column { | |
flex-direction: column; | |
} | |
.flex.wrap { | |
flex-wrap: wrap; | |
} | |
.block { | |
display: block; | |
} | |
.inline { | |
display: inline; | |
} | |
.inline-block { | |
display: inline-block; | |
} | |
.currentColor { | |
fill: currentColor; | |
} | |
:root.hidden * { | |
animation-play-state: paused; | |
} | |
:root.offline { | |
pointer-events: none; | |
} | |
:root.loading { | |
cursor: progress; | |
} | |
.logo svg { | |
width: 100%; | |
height: 100%; | |
} | |
.logo { | |
display: inline-block; | |
*display: inline; | |
*zoom: 1; | |
width: 3rem; | |
height: 3rem; | |
overflow: visible; | |
transition: all 1s cubic-bezier(.68,-0.55,.27,1.55) 0s; | |
} | |
.logo svg, | |
.logo img | |
{ | |
overflow: visible; | |
} | |
footer .logo{ | |
color: #333; | |
} | |
.icon { | |
color: inherit; | |
max-width: 100%; | |
max-height: 100%; | |
width: 1em; | |
height: 1em; | |
} | |
.icon svg { | |
color: inherit; | |
fill: currentColor; | |
} | |
.logo:hover { | |
transform: scale(2)rotateZ(360deg); | |
} | |
.copyleft { | |
color: var(--alt-color); | |
font-size: 3rem; | |
} | |
.copyleft::before { | |
content: '©'; | |
display: inline-block; | |
*display: inline; | |
*zoom: 1; | |
transform: rotateY(180deg); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@supports(filter: none) { | |
[data-filter="blur"] {filter: blur(0.15em);} | |
[data-filter="brightness"] {filter: brightness(50%);} | |
[data-filter="contrast"] {filter: contrast(50%);} | |
[data-filter="drop-shadow"] {filter: drop-shadow(.5em .5em 1em #222);} | |
[data-filter="grayscale"] {filter: grayscale(50%);} | |
[data-filter="invert"] {filter: invert(50%);} | |
[data-filter="opacity"] {filter: opacity(50%);} | |
[data-filter="sepia"] {filter: sepia(50%);} | |
[data-filter="saturate"] {filter: saturate(50%);} | |
[data-hover-filter="blur"]:hover {filter: blur(0.15em);} | |
[data-hover-filter="brightness"]:hover {filter: brightness(50%);} | |
[data-hover-filter="contrast"]:hover {filter: contrast(50%);} | |
[data-hover-filter="drop-shadow"]:hover {filter: drop-shadow(.5em .5em 1em #222);} | |
[data-hover-filter="grayscale"]:hover {filter: grayscale(50%);} | |
[data-hover-filter="invert"]:hover {filter: invert(50%);} | |
[data-hover-filter="opacity"]:hover {filter: opacity(50%);} | |
[data-hover-filter="sepia"]:hover {filter: sepia(50%);} | |
[data-hover-filter="saturate"]:hover {filter: saturate(50%);} | |
[data-hover-filter] {transition: filter 800ms;} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class zQ { | |
constructor(selector) { | |
if (typeof selector === 'string') { | |
this.results = Array.from(document.querySelectorAll(selector)); | |
} else if (selector instanceof NodeList || selector instanceof HTMLCollection) { | |
this.results = Array.from(selector); | |
} else { | |
this.results = [selector]; | |
} | |
} | |
includes(item) { | |
return this.results.includes(item); | |
} | |
each(callback) { | |
this.results.forEach(callback); | |
return this; | |
} | |
some(callback) { | |
return this.results.some(callback); | |
} | |
every(callback) { | |
return this.results.every(callback); | |
} | |
filter(callback) { | |
return new zQ(this.results.filter(callback)); | |
} | |
on(event, callback) { | |
return this.each(item => item.addEventListener(event, callback)); | |
} | |
click(callback) { | |
return this.on('click', callback); | |
} | |
load(callback) { | |
return this.on('load', callback); | |
} | |
change(callback) { | |
return this.on('change', callback); | |
} | |
input(callback) { | |
return this.on('input', callback); | |
} | |
submit(callback) { | |
return this.on('submit', callback); | |
} | |
dblclick(callback) { | |
return this.on('dblclick', callback); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Chris Zuber <[email protected]> | |
* @copyright 2016, Chris Zuber | |
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3 (GPL-3.0) | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU General Public License | |
* as published by the Free Software Foundation, either version 3 | |
* of the License, or (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU General Public License for more details. | |
* | |
* You should have received a copy of the GNU General Public License | |
* along with this program. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
trait DOMAttributes | |
{ | |
/** | |
* Sets attribute ($name) to $value | |
* | |
* @param string $name Name of attribute to set | |
* @param string $value Value to set it to | |
*/ | |
final public function __set($name, $value) | |
{ | |
$this->setAttribute($name, $value); | |
} | |
/** | |
* Retrieves the value of an attribute | |
* | |
* @param string $name Name of the attribute | |
* @return string Its value | |
*/ | |
final public function __get($name) | |
{ | |
return $this->getAttribute($name); | |
} | |
/** | |
* Checks if an attribute is set | |
* | |
* @param string $name The name of the attribute | |
* @return boolean | |
*/ | |
final public function __isset($name) | |
{ | |
return $this->hasAttribute($name); | |
} | |
/** | |
* Removes an attribute | |
* | |
* @param string $name The name of the attribute | |
* @return void | |
*/ | |
final public function __unset($name) | |
{ | |
$this->removeAttribute($name); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Chris Zuber <[email protected]> | |
* @copyright 2016, Chris Zuber | |
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3 (GPL-3.0) | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU General Public License | |
* as published by the Free Software Foundation, either version 3 | |
* of the License, or (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU General Public License for more details. | |
* | |
* You should have received a copy of the GNU General Public License | |
* along with this program. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
class Element extends \DOMElement implements \MagicInterface | |
{ | |
use DOMAttributes; | |
use HTMLString; | |
/** | |
* Easily create and append a new \DOMElement and set attributes | |
* | |
* @param string $tagName Tag name of the element | |
* @param string $content Text content of the element | |
* @param array $attributes Key => value array of attributes to set | |
* @return \DOMElement The newly created and appended element | |
*/ | |
final public function __invoke($tagName, $content = null, Array $attributes = array()) | |
{ | |
$node = $this->appendChild($this->ownerDocument->createElement($tagName, $content)); | |
array_map([$node, 'setAttribute'], array_keys($attributes), array_values($attributes)); | |
return $node; | |
} | |
/** | |
* Magic call method allowing chaining of attribute setting | |
* | |
* @param string $name The name of the attribue | |
* @param string $value The value to set it to | |
* @return HTMLElement | |
* @example $this->foo('bar')->... | |
*/ | |
final public function __call($name, $value) | |
{ | |
$this->setAttribute($name, $value); | |
return $this; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zQ from './dom.js'; | |
export function $(sel) { | |
return new zQ(sel); | |
} | |
export function emptyInputListener(change) { | |
if (this.value === '' && (!this.matches('last-of-type'))) { | |
this.closest('.container').remove(); | |
} | |
} | |
export function addNewInput(click) { | |
let key = ''; | |
while (true) { | |
key = prompt('Enter name for input'); | |
if (typeof key === 'string') { | |
if (key.length !== 0) { | |
break; | |
} | |
} else { | |
return; | |
} | |
if (key.length !== 0) { | |
break; | |
} | |
} | |
let container = document.createElement('div'); | |
click.target.parentElement.insertBefore(container, click.target); | |
container.classList.add('container'); | |
let label = container.appendChild(document.createElement('label')); | |
let input = container.appendChild(document.createElement('input')); | |
label.setAttribute('for', `#${key}`); | |
label.textContent = key; | |
input.name = key; | |
input.id = key; | |
$(input).change(emptyInputListener); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>URLSearchParams Gist</title> | |
<meta charset="utf-8" /> | |
</head> | |
<body> | |
<script src="https://gist.github.com/shgysk8zer0/4392b21268e39f4003e9.js"></script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Chris Zuber <[email protected]> | |
* @copyright 2016, Chris Zuber | |
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3 (GPL-3.0) | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU General Public License | |
* as published by the Free Software Foundation, either version 3 | |
* of the License, or (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU General Public License for more details. | |
* | |
* You should have received a copy of the GNU General Public License | |
* along with this program. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
class HTMLDocument extends \DOMDocument | |
{ | |
use HTMLString; | |
const CHARSET = 'UTF-8'; | |
public $head; | |
public $body; | |
static $print_on_exit = true; | |
public function __construct($title = null, $charset = self::CHARSET) | |
{ | |
parent::__construct('1.0', $charset); | |
$this->loadHTML('<!DOCTYPE html>'); | |
$this->registerNodeClass('\\DOMElement', '\\Element'); | |
$this->appendChild($this->createElement('html')); | |
$html = $this->documentElement; | |
$this->head = $html('head'); | |
$this->body = $html('body'); | |
$head = $this->head; | |
if (is_string($title)) { | |
$head('title', $title); | |
} | |
$head('meta', null, ['charset' => strtolower($charset)]); | |
} | |
/** | |
* Prints the document on exit if $print_on_exit is true | |
*/ | |
final public function __destruct() | |
{ | |
if (static::$print_on_exit) { | |
exit($this); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Chris Zuber <[email protected]> | |
* @copyright 2016, Chris Zuber | |
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3 (GPL-3.0) | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU General Public License | |
* as published by the Free Software Foundation, either version 3 | |
* of the License, or (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU General Public License for more details. | |
* | |
* You should have received a copy of the GNU General Public License | |
* along with this program. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
trait HTMLString | |
{ | |
/** | |
* Gets a \DOMElement or \DOMDocument as an HTML string | |
* | |
* @return string The document or element as an HTML string | |
*/ | |
final public function __toString() | |
{ | |
return ($this instanceof \DOMDocument) | |
? $this->saveHTML() | |
: $this->ownerDocument->saveHTML($this); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
svg > use { | |
fill: currentColor; | |
} | |
button, [role="button"] { | |
display: inline-block; | |
color: var(--alt-color); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@charset 'UTF-8'; | |
@import url(viewport.css); | |
@import url(window.css); | |
@import url(normalize.css); | |
@import url(root.css); | |
@import url(window.css); | |
@import url(class_rules.css); | |
@import url(data-filter.css); | |
@import url(icons.css); | |
@import url(misc.css); | |
:root { | |
/*================= Set color vars here =================*/ | |
--default-color: #333; | |
--alt-color: #f9f9f9; | |
--primary-color: rgb(117, 151, 242); | |
--highlight-color: rgb(72, 96, 168); | |
--link-color: hsl(209, 62%, 45%); | |
--visited-color: #551A8B; | |
--border-color: rgb(45, 45, 45); | |
/*========== Set background images, etc here ==========*/ | |
--main-bg: linear-gradient(whitesmoke, gainsboro); | |
--glass-grad: linear-gradient(to top left, rgba(80, 80, 80, 0.7), rgba(140, 140, 140, 0.9), rgba(40, 40, 40, 0.7)); | |
--shadow: rgba(20, 20, 20, 0.9); | |
--tint-glass: linear-gradient(rgba(40, 40, 40, 0.8), rgba(80, 80, 80, 0.7)); | |
--header-bg: linear-gradient(rgba(40, 40, 40, 1), rgba(80, 80, 80, 0.97)); | |
--progress-grad: linear-gradient(var(--highlight-color), var(--primary-color), var(--highlight-color)); | |
/*==================== Set fonts here ====================*/ | |
--header-font: 'PressStart'; | |
--article-font: 'Ubuntu'; | |
--article-header-font: var(--header-font); | |
--icon-font: 'Web Symbols'; | |
/*================ Set various icons here ================*/ | |
--link-icon: ' K'; | |
--tag-icon: ' , '; | |
--new-tab-icon: ' D'; | |
--download-icon: ' A'; | |
--next-icon: ')'; | |
--prev-icon: '('; | |
--unchecked-icon: ' \\'; | |
--checked-icon: ' .'; | |
--dropdown-open-icon: '[ '; | |
--dropdown-closed-icon: '] '; | |
--close-icon: '\''; | |
--search-icon: 'L'; | |
--attachmnent-icon: 'A'; | |
--fullscreen-icon: '%'; | |
/*================== Set cursors here ==================*/ | |
--default-cursor: auto; | |
--pointer: pointer; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$package = json_decode(file_get_contents('package.json')); | |
$dom = new \HTMLDocument($package->name); | |
$head = $dom->head; | |
$body = $dom->body; | |
$head('meta', null, [ | |
'name' => 'description', | |
'content' => $package->description | |
]); | |
$head('meta', null, [ | |
'name' => 'keywords', | |
'content' => join(', ', $package->keywords) | |
]); | |
$head('link', null, [ | |
'rel' => 'icon', | |
'type' => 'image/svg+xml', | |
'sizes' => 'any', | |
'href' => 'favicon.svg' | |
]); | |
$head('meta', null, [ | |
'name' => 'referrer', | |
'content' => 'origin-when-cross-origin' | |
]); | |
$head('script', null, [ | |
'type' => 'application/javascript', | |
'defer' => '', | |
'src' => 'modules.min.js' | |
]); | |
$head('link', null, [ | |
'rel' => 'stylesheet', | |
'href' => 'style.css', | |
'media' => 'all' | |
]); | |
unset($head); | |
$by = $body('a', "Made by: {$package->author->name}", ['href' => "{$package->author->url}"]); | |
// Create an instance of URLSearchParams | |
$params = new URLSearchParams('foo=bar'); | |
$form = $body('form', null, [ | |
'action' => '.', | |
'method' => 'GET' | |
]); | |
// Import from URL query string | |
foreach ($_GET as $key => $value) { | |
$div = $form('div', null, ['class' => 'container']); | |
$params->$key = $value; | |
$label = $div('label', $key); | |
$input = $div('input', null, ['name' => $key, 'value' => $value, 'id' => $key]); | |
$label->for = "#{$input->id}"; | |
} | |
$form('button', 'Add new', [ | |
'type' => 'button', | |
'id' => 'add-input' | |
]); | |
$form('button', 'Submit', ['type' => 'submit']); | |
$form('button', 'Reset', ['type' => 'reset']); | |
unset($key, $value, $form, $label, $input); | |
// Check if name paramater is set, greet, and remove the param | |
if (isset($params->name)) { | |
$body('p', "Welcome, {$params->name}."); | |
unset($params->name); | |
} | |
// Append a link created from $params | |
$body('a', 'Your link', ['href' => "?{$params}"]); | |
$body('br'); | |
// Add Gist | |
$gist = $body('a', null, [ | |
'href' => $package->repository->url, | |
'target' => '_blank', | |
'title' => 'View Gist on GitHub' | |
]); | |
$svg = $gist('svg', null, ['width' => 60, 'height' => '60']); | |
$svg('use', null, ['xlink:href' => 'octicons.svg#gist']); | |
$body('br'); | |
$body('iframe', null, [ | |
'src' => 'gist.html', | |
'sandbox' => 'allow-scripts allow-top-navigation', | |
'width' => 800, | |
'height' => 1200 | |
]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Chris Zuber <[email protected]> | |
* @copyright 2016, Chris Zuber | |
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3 (GPL-3.0) | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU General Public License | |
* as published by the Free Software Foundation, either version 3 | |
* of the License, or (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU General Public License for more details. | |
* | |
* You should have received a copy of the GNU General Public License | |
* along with this program. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
trait IteratorTrait | |
{ | |
/** | |
* Returns the value at the current position | |
* | |
* @param void | |
* @return mixed Whatever the current value is | |
*/ | |
public function current() | |
{ | |
return current($this->{self::MAGIC_PROPERTY}); | |
} | |
/** | |
* Returns the key (not index) at current position | |
* | |
* @param void | |
* @return mixed Probably a string, but could be an integer. | |
*/ | |
public function key() | |
{ | |
return key($this->{self::MAGIC_PROPERTY}); | |
} | |
/** | |
* Increment to the next position in the array | |
* | |
* @param void | |
* @return void | |
*/ | |
public function next() | |
{ | |
next($this->{self::MAGIC_PROPERTY}); | |
} | |
/** | |
* Reset to the beginning of the array | |
* | |
* @param void | |
* @return void | |
*/ | |
public function rewind() | |
{ | |
reset($this->{self::MAGIC_PROPERTY}); | |
} | |
/** | |
* Checks that the end of the array has not been exceeded | |
* | |
* @param void | |
* @return bool Whether or not there is data set at current position | |
*/ | |
public function valid() | |
{ | |
return $this->key() !== null; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Chris Zuber <[email protected]> | |
* @copyright 2016, Chris Zuber | |
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3 (GPL-3.0) | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU General Public License | |
* as published by the Free Software Foundation, either version 3 | |
* of the License, or (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU General Public License for more details. | |
* | |
* You should have received a copy of the GNU General Public License | |
* along with this program. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
interface MagicInterface | |
{ | |
/** | |
* Converts class into string | |
* @return string | |
*/ | |
public function __toString(); | |
/** | |
* Magic setter method | |
* | |
* @param string $key Paramater name | |
* @param mixed $value Paramater value | |
*/ | |
public function __set($key, $value); | |
/** | |
* Magic getter method | |
* | |
* @param string $key Paramater name | |
* @return string Since these are search params, it must be a string | |
*/ | |
public function __get($key); | |
/** | |
* Magic isset method | |
* | |
* @param string $key Paramater name | |
* @return boolean | |
*/ | |
public function __isset($key); | |
/** | |
* Magic unset method | |
* | |
* @param string $key Paramater name | |
*/ | |
public function __unset($key); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Chris Zuber <[email protected]> | |
* @copyright 2016, Chris Zuber | |
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3 (GPL-3.0) | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU General Public License | |
* as published by the Free Software Foundation, either version 3 | |
* of the License, or (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU General Public License for more details. | |
* | |
* You should have received a copy of the GNU General Public License | |
* along with this program. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
trait MagicMethods | |
{ | |
/** | |
* Magic setter method | |
* | |
* @param string $key Paramater name | |
* @param mixed $value Paramater value | |
*/ | |
final public function __set($key, $value) | |
{ | |
$this->{self::MAGIC_PROPERTY}[$key] = $value; | |
} | |
/** | |
* Magic getter method | |
* | |
* @param string $key Paramater name | |
* @return string Since these are search params, it must be a string | |
*/ | |
final public function __get($key) | |
{ | |
return isset($this->{$key}) ? $this->{self::MAGIC_PROPERTY}[$key] : null; | |
} | |
/** | |
* Magic isset method | |
* | |
* @param string $key Paramater name | |
* @return boolean | |
*/ | |
final public function __isset($key) | |
{ | |
return array_key_exists($key, $this->{self::MAGIC_PROPERTY}); | |
} | |
/** | |
* Magic unset method | |
* | |
* @param string $key Paramater name | |
*/ | |
final public function __unset($key) | |
{ | |
unset($this->{self::MAGIC_PROPERTY}[$key]); | |
} | |
/** | |
* Converts class into string | |
* @return string | |
*/ | |
abstract public function __toString(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::-moz-selection { | |
background-color: var(--primary-color); | |
text-shadow: none; | |
} | |
::selection { | |
background-color: var(--primary-color); | |
text-shadow: none; | |
} | |
*, *:after, *:before { | |
box-sizing: inherit; | |
max-width: 100%; | |
} | |
:root { | |
box-sizing: border-box; | |
} | |
menu[type="context"] { | |
display: none; | |
} | |
a[target="_blank"]::after { | |
content: var(--new-tab-icon); | |
} | |
[download]::after { | |
content: var(--download-icon); | |
} | |
button, | |
[role="button"] | |
{ | |
min-width: 2rem; | |
padding: 0.2rem; | |
background-color: var(--primary-color); | |
background-image: url('../../images/gradients/header_links.png'); | |
background-image: linear-gradient(var(--primary-color), var(--highlight-color)); | |
font-family: inherit; | |
color: var(--default-color); | |
border: 0.2rem outset var(--primary-color); | |
} | |
button:disabled, | |
button:active | |
{ | |
background-color: var(--highlight-color); | |
background-image: linear-gradient(var(--highlight-color), var(--primary-color)); | |
border: 0.2rem inset var(--primary-color); | |
box-shadow: 0 0 0.3rem var(--shadow) inset; | |
cursor: not-allowed; | |
} | |
a, | |
[download] | |
{ | |
font-family: inherit; | |
color: var(--link-color); | |
text-decoration: none; | |
} | |
a::after { | |
font-family: var(--icon-font); | |
} | |
img { | |
max-width: 100%; | |
height: auto; | |
} | |
figure { | |
border: 0.1em solid dimgray; | |
text-align: center; | |
} | |
figure figcaption { | |
color: dimgray; | |
text-decoration: underline; | |
font-style: italic; | |
} | |
blockquote { | |
color: #777; | |
font-family: 'Libertine'; | |
font-style: italic; | |
padding: 0px 15px; | |
border-left: 4px solid #DDD; | |
} | |
blockquote cite { | |
display: block; | |
} | |
blockquote cite::before { | |
content: ' — '; | |
} | |
a, | |
button:not(:disabled), | |
[role="button"], | |
input[type="submit"], | |
input[type="reset"], | |
input[type="image"], | |
[data-show], | |
[data-show-modal], | |
[data-close], | |
[data-delete] | |
{ | |
cursor: var(--pointer); | |
} | |
[data-icon]::after { | |
display: inline; | |
font-family: var(--icon-font); | |
font-size: inherit; | |
font-size-adjust: none; | |
font-stretch: none; | |
content: ' 'attr(data-icon)' '; | |
vertical-align: baseline; | |
} | |
[data-caption] { | |
position: relative; | |
} | |
[data-caption]:hover::before { | |
all: initial; | |
display: block; | |
min-width: 100%; | |
position: absolute; | |
bottom: 0; | |
content: attr(data-caption); | |
font-size: 0.8rem; | |
text-align: center; | |
background-color: rgba(255, 255, 255, 0.8); | |
border: 1px solid #333; | |
overflow: visible; | |
} | |
[data-close]::after, | |
[data-delete]::after | |
{ | |
font-family: var(--icon-font); | |
content: var(--close-icon); | |
} | |
[data-fullscreen]:empty::after { | |
content: var(--fullscreen-icon); | |
font-family: var(--icon-font); | |
} | |
code { | |
display: inline-block; | |
padding: 0.1rem; | |
background-color: #F5F5F5; | |
background-color: rgba(0, 0, 0, 0.04); | |
color: #333; | |
font-size: 0.9rem; | |
font-family: hack, Courier, monospace; | |
border-radius: 0.2rem; | |
white-space: pre; | |
} | |
pre > code { | |
display: block; | |
padding: 1rem; | |
background-color: rgb(51, 51, 51); | |
color: rgb(255, 249, 217); | |
border-radius: 0.3rem; | |
overflow-x: auto; | |
} | |
[contenteditable="true"]:empty { | |
min-height: 1.3rem; | |
border: 1px dotted dimgray; | |
} | |
[contenteditable="true"] img { | |
resize: both; | |
} | |
ol > ol { | |
list-style-type: upper-alpha; | |
} | |
ol > ol > ol { | |
list-style-type: upper-roman; | |
} | |
ol > ol > ol > ol { | |
list-style-type: lower-alpha; | |
} | |
ol > ol > ol > ol > ol { | |
list-style-type: lower-roman; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {$, emptyInputListener, addNewInput} from './functions.js'; | |
$(window).load(load => { | |
new Notification(document.title, { | |
body: document.querySelector('meta[name="description"]').content, | |
icon: document.querySelector('link[rel="icon"]').href | |
}); | |
$('input').change(emptyInputListener); | |
$('#add-input').click(addNewInput); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function(e){function t(r){if(n[r])return n[r].exports;var u=n[r]={exports:{},id:r,loaded:!1};return e[r].call(u.exports,u,u.exports,t),u.loaded=!0,u.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var r=n(1);(0,r.$)(window).load(function(e){new Notification(document.title,{body:"An example of advanced PHP and JavaScript",icon:document.querySelector('link[rel="icon"]').href}),(0,r.$)("input").change(r.emptyInputListener),(0,r.$)("#add-input").click(r.addNewInput)})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function u(e){return new c["default"](e)}function i(e){""!==this.value||this.matches("last-of-type")||this.closest(".container").remove()}function o(e){for(var t="";;){if(t=prompt("Enter name for input"),"string"!=typeof t)return;if(0!==t.length)break;if(0!==t.length)break}var n=document.createElement("div");e.target.parentElement.insertBefore(n,e.target),n.classList.add("container");var r=n.appendChild(document.createElement("label")),o=n.appendChild(document.createElement("input"));r.setAttribute("for","#"+t),r.textContent=t,o.name=t,o.id=t,u(o).change(i)}Object.defineProperty(t,"__esModule",{value:!0}),t.$=u,t.emptyInputListener=i,t.addNewInput=o;var a=n(2),c=r(a)},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(){function e(t){n(this,e),"string"==typeof t?this.results=Array.from(document.querySelectorAll(t)):t instanceof NodeList||t instanceof HTMLCollection?this.results=Array.from(t):this.results=[t]}return r(e,[{key:"includes",value:function(e){return this.results.includes(e)}},{key:"each",value:function(e){return this.results.forEach(e),this}},{key:"some",value:function(e){return this.results.some(e)}},{key:"every",value:function(e){return this.results.every(e)}},{key:"filter",value:function(t){return new e(this.results.filter(t))}},{key:"on",value:function(e,t){return this.each(function(n){return n.addEventListener(e,t)})}},{key:"click",value:function(e){return this.on("click",e)}},{key:"load",value:function(e){return this.on("load",e)}},{key:"change",value:function(e){return this.on("change",e)}},{key:"input",value:function(e){return this.on("input",e)}},{key:"submit",value:function(e){return this.on("submit",e)}},{key:"dblclick",value:function(e){return this.on("dblclick",e)}}]),e}();t["default"]=u}]); | |
//# sourceMappingURL=modules.min.js.map |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"version":3,"sources":["webpack:///modules.min.js","webpack:///webpack/bootstrap 5556bb0b0838caac0bdf","webpack:///./modules.js","webpack:///./functions.js","webpack:///./dom.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","_functions","$","window","load","Notification","document","title","body","icon","querySelector","href","change","emptyInputListener","click","addNewInput","_interopRequireDefault","obj","__esModule","default","sel","_dom2","this","value","matches","closest","remove","key","prompt","length","container","createElement","target","parentElement","insertBefore","classList","add","label","appendChild","input","setAttribute","textContent","name","Object","defineProperty","_dom","_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","props","i","descriptor","enumerable","configurable","writable","protoProps","staticProps","prototype","zQ","selector","results","Array","from","querySelectorAll","NodeList","HTMLCollection","item","includes","callback","forEach","some","every","filter","event","each","addEventListener","on"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAE,WACAE,GAAAJ,EACAK,QAAA,EAUA,OANAP,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,QAAA,EAGAF,EAAAD,QAvBA,GAAAD,KAqCA,OATAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,GAGAV,EAAA,KDMM,SAASI,EAAQD,EAASH,GAE/B,YAAa,IAAIW,GAAWX,EAAoB,IE7CjD,EAAAW,EAAAC,GAAEC,QAAQC,KAAK,SAAAA,GACd,GAAIC,cAAaC,SAASC,OACzBC,KAAM,4CACNC,KAAMH,SAASI,cAAc,oBAAoBC,QAH5B,EAAAV,EAAAC,GAKpB,SAASU,OAAXX,EAAAY,qBALsB,EAAAZ,EAAAC,GAMpB,cAAcY,MAAhBb,EAAAc,gBF2CK,SAASrB,EAAQD,EAASH,GAE/B,YG3Ce,SAAA0B,GAAAC,GAAA,MAAAA,MAAAC,WAAAD,GAAAE,UAAAF,GART,QAASf,GAAEkB,GACjB,MAAO,IAAAC,cAAOD,GADR,QAGSP,GAAmBD,GACf,KAAfU,KAAKC,OAAkBD,KAAKE,QAAQ,iBACvCF,KAAKG,QAAQ,cAAcC,SAFtB,QAKSX,GAAYD,GAAO,IAClC,GAAIa,GAAM,KACG,IACZA,EAAMC,OAAO,wBACM,gBAARD,GAKV,MAJA,IAAmB,IAAfA,EAAIE,OACP,KAFF,IAOmB,IAAfF,EAAIE,OACP,MAVF,GAaIC,GAAYxB,SAASyB,cAAc,MAfLjB,GAgB5BkB,OAAOC,cAAcC,aAAaJ,EAAWhB,EAAMkB,QAhBvBF,EAiBxBK,UAAUC,IAAI,YAjBU,IAkB9BC,GAAQP,EAAUQ,YAAYhC,SAASyB,cAAc,UACrDQ,EAAQT,EAAUQ,YAAYhC,SAASyB,cAAc,SAnBvBM,GAoB5BG,aAAa,MAAnB,IAA8Bb,GApBIU,EAqB5BI,YAAcd,EArBcY,EAsB5BG,KAAOf,EAtBqBY,EAuB5B5C,GAAKgC,EAvBuBzB,EAwBhCqC,GAAO3B,OAAOC,GHmBH8B,OAAOC,eAAenD,EAAQ,cAAc8B,OAAM,IAAO9B,EGnDvDS,IAAAT,EAGAoB,qBAAApB,EAKAsB,aAAA,IAAA8B,GAAAvD,EAAA,GAAA+B,EAAAL,EAAA6B,IH+CV,SAASnD,EAAQD,GAEtB,YAAqkB,SAASqD,GAAgBC,EAASC,GAAa,KAAKD,YAAoBC,IAAc,KAAM,IAAIC,WAAU,qCAAlqBN,OAAOC,eAAenD,EAAQ,cAAc8B,OAAM,GAAO,IAAI2B,GAAa,WAAW,QAASC,GAAiBnB,EAAOoB,GAAO,IAAI,GAAIC,GAAE,EAAEA,EAAED,EAAMvB,OAAOwB,IAAI,CAAC,GAAIC,GAAWF,EAAMC,EAAGC,GAAWC,WAAWD,EAAWC,aAAY,EAAMD,EAAWE,cAAa,EAAQ,SAAWF,KAAWA,EAAWG,UAAS,GAAKd,OAAOC,eAAeZ,EAAOsB,EAAW3B,IAAI2B,IAAc,MAAO,UAASN,EAAYU,EAAWC,GAAuI,MAAvHD,IAAWP,EAAiBH,EAAYY,UAAUF,GAAeC,GAAYR,EAAiBH,EAAYW,GAAoBX,MI1D/hBa,EAAA,WACpB,QADoBA,GACRC,GAAUhB,EAAAxB,KADFuC,GAEK,gBAAbC,GACVxC,KAAKyC,QAAUC,MAAMC,KAAK3D,SAAS4D,iBAAiBJ,IAC1CA,YAAoBK,WAAYL,YAAoBM,gBAC9D9C,KAAKyC,QAAUC,MAAMC,KAAKH,GAE1BxC,KAAKyC,SAAWD,GAqCC,MA3CnBZ,GADoBW,IAAAlC,IAAA,WAAAJ,MAAA,SAUX8C,GACR,MAAO/C,MAAKyC,QAAQO,SAASD,MADf1C,IAAA,OAAAJ,MAAA,SAGVgD,GAAU,MACdjD,MAAKyC,QAAQS,QAAQD,GACdjD,QAFOK,IAAA,OAAAJ,MAAA,SAIVgD,GACJ,MAAOjD,MAAKyC,QAAQU,KAAKF,MADX5C,IAAA,QAAAJ,MAAA,SAGTgD,GACL,MAAOjD,MAAKyC,QAAQW,MAAMH,MADX5C,IAAA,SAAAJ,MAAA,SAGTgD,GACN,MAAO,IAAIV,GAAGvC,KAAKyC,QAAQY,OAAOJ,OADlB5C,IAAA,KAAAJ,MAAA,SAGdqD,EAAOL,GACT,MAAOjD,MAAKuD,KAAK,SAAAR,GAAA,MAAQA,GAAKS,iBAAiBF,EAAOL,QADnC5C,IAAA,QAAAJ,MAAA,SAGdgD,GACL,MAAOjD,MAAKyD,GAAG,QAASR,MADT5C,IAAA,OAAAJ,MAAA,SAGXgD,GACJ,MAAOjD,MAAKyD,GAAG,OAAQR,MADT5C,IAAA,SAAAJ,MAAA,SAGRgD,GACN,MAAOjD,MAAKyD,GAAG,SAAUR,MADT5C,IAAA,QAAAJ,MAAA,SAGXgD,GACL,MAAOjD,MAAKyD,GAAG,QAASR,MADT5C,IAAA,SAAAJ,MAAA,SAGTgD,GACN,MAAOjD,MAAKyD,GAAG,SAAUR,MADT5C,IAAA,WAAAJ,MAAA,SAGRgD,GACR,MAAOjD,MAAKyD,GAAG,WAAYR,OA7CRV,IAAApE,cAAAoE","file":"modules.min.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';var _functions=__webpack_require__(1);(0,_functions.$)(window).load(function(load){new Notification(document.title,{body:'An example of advanced PHP and JavaScript',icon:document.querySelector('link[rel=\"icon\"]').href});(0,_functions.$)('input').change(_functions.emptyInputListener);(0,_functions.$)('#add-input').click(_functions.addNewInput);});\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';Object.defineProperty(exports,\"__esModule\",{value:true});exports.$=$;exports.emptyInputListener=emptyInputListener;exports.addNewInput=addNewInput;var _dom=__webpack_require__(2);var _dom2=_interopRequireDefault(_dom);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function $(sel){return new _dom2.default(sel);}function emptyInputListener(change){if(this.value===''&&!this.matches('last-of-type')){this.closest('.container').remove();}}function addNewInput(click){var key='';while(true){key=prompt('Enter name for input');if(typeof key==='string'){if(key.length!==0){break;}}else {return;}if(key.length!==0){break;}}var container=document.createElement('div');click.target.parentElement.insertBefore(container,click.target);container.classList.add('container');var label=container.appendChild(document.createElement('label'));var input=container.appendChild(document.createElement('input'));label.setAttribute('for','#'+key);label.textContent=key;input.name=key;input.id=key;$(input).change(emptyInputListener);}\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t'use strict';Object.defineProperty(exports,\"__esModule\",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if(\"value\" in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError(\"Cannot call a class as a function\");}}var zQ=function(){function zQ(selector){_classCallCheck(this,zQ);if(typeof selector==='string'){this.results=Array.from(document.querySelectorAll(selector));}else if(selector instanceof NodeList||selector instanceof HTMLCollection){this.results=Array.from(selector);}else {this.results=[selector];}}_createClass(zQ,[{key:'includes',value:function includes(item){return this.results.includes(item);}},{key:'each',value:function each(callback){this.results.forEach(callback);return this;}},{key:'some',value:function some(callback){return this.results.some(callback);}},{key:'every',value:function every(callback){return this.results.every(callback);}},{key:'filter',value:function filter(callback){return new zQ(this.results.filter(callback));}},{key:'on',value:function on(event,callback){return this.each(function(item){return item.addEventListener(event,callback);});}},{key:'click',value:function click(callback){return this.on('click',callback);}},{key:'load',value:function load(callback){return this.on('load',callback);}},{key:'change',value:function change(callback){return this.on('change',callback);}},{key:'input',value:function input(callback){return this.on('input',callback);}},{key:'submit',value:function submit(callback){return this.on('submit',callback);}},{key:'dblclick',value:function dblclick(callback){return this.on('dblclick',callback);}}]);return zQ;}();exports.default=zQ;\n\n/***/ }\n/******/ ]);\n\n\n/** WEBPACK FOOTER **\n ** modules.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 5556bb0b0838caac0bdf\n **/","import {$, emptyInputListener, addNewInput} from './functions.js';\n$(window).load(load => {\n\tnew Notification(document.title, {\n\t\tbody: 'An example of advanced PHP and JavaScript',\n\t\ticon: document.querySelector('link[rel=\"icon\"]').href\n\t});\n\t$('input').change(emptyInputListener);\n\t$('#add-input').click(addNewInput);\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./modules.js\n **/","import zQ from './dom.js';\nexport function $(sel) {\n\treturn new zQ(sel);\n}\nexport function emptyInputListener(change) {\n\tif (this.value === '' && (!this.matches('last-of-type'))) {\n\t\tthis.closest('.container').remove();\n\t}\n}\nexport function addNewInput(click) {\n\tlet key = '';\n\twhile (true) {\n\t\tkey = prompt('Enter name for input');\n\t\tif (typeof key === 'string') {\n\t\t\tif (key.length !== 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t\tif (key.length !== 0) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tlet container = document.createElement('div');\n\tclick.target.parentElement.insertBefore(container, click.target);\n\tcontainer.classList.add('container');\n\tlet label = container.appendChild(document.createElement('label'));\n\tlet input = container.appendChild(document.createElement('input'));\n\tlabel.setAttribute('for', `#${key}`);\n\tlabel.textContent = key;\n\tinput.name = key;\n\tinput.id = key;\n\t$(input).change(emptyInputListener);\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./functions.js\n **/","export default class zQ {\n\tconstructor(selector) {\n\t\tif (typeof selector === 'string') {\n\t\t\tthis.results = Array.from(document.querySelectorAll(selector));\n\t\t} else if (selector instanceof NodeList || selector instanceof HTMLCollection) {\n\t\t\tthis.results = Array.from(selector);\n\t\t} else {\n\t\t\tthis.results = [selector];\n\t\t}\n\t}\n\tincludes(item) {\n\t\treturn this.results.includes(item);\n\t}\n\teach(callback) {\n\t\tthis.results.forEach(callback);\n\t\treturn this;\n\t}\n\tsome(callback) {\n\t\treturn this.results.some(callback);\n\t}\n\tevery(callback) {\n\t\treturn this.results.every(callback);\n\t}\n\tfilter(callback) {\n\t\treturn new zQ(this.results.filter(callback));\n\t}\n\ton(event, callback) {\n\t\treturn this.each(item => item.addEventListener(event, callback));\n\t}\n\tclick(callback) {\n\t\treturn this.on('click', callback);\n\t}\n\tload(callback) {\n\t\treturn this.on('load', callback);\n\t}\n\tchange(callback) {\n\t\treturn this.on('change', callback);\n\t}\n\tinput(callback) {\n\t\treturn this.on('input', callback);\n\t}\n\tsubmit(callback) {\n\t\treturn this.on('submit', callback);\n\t}\n\tdblclick(callback) {\n\t\treturn this.on('dblclick', callback);\n\t}\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./dom.js\n **/"],"sourceRoot":""} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ | |
/** | |
* 1. Set default font family to sans-serif. | |
* 2. Prevent iOS and IE text size adjust after device orientation change, | |
* without disabling user zoom. | |
*/ | |
html { | |
font-family: sans-serif; /* 1 */ | |
-ms-text-size-adjust: 100%; /* 2 */ | |
-webkit-text-size-adjust: 100%; /* 2 */ | |
} | |
/** | |
* Remove default margin. | |
*/ | |
body { | |
margin: 0; | |
} | |
/* HTML5 display definitions | |
========================================================================== */ | |
/** | |
* Correct `block` display not defined for any HTML5 element in IE 8/9. | |
* Correct `block` display not defined for `details` or `summary` in IE 10/11 | |
* and Firefox. | |
* Correct `block` display not defined for `main` in IE 11. | |
*/ | |
article, | |
aside, | |
details, | |
figcaption, | |
figure, | |
footer, | |
header, | |
main, | |
menu, | |
nav, | |
section, | |
summary { | |
display: block; | |
} | |
/** | |
* 1. Correct `inline-block` display not defined in IE 8/9. | |
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. | |
*/ | |
audio, | |
canvas, | |
progress, | |
video { | |
display: inline-block; /* 1 */ | |
vertical-align: baseline; /* 2 */ | |
} | |
/** | |
* Prevent displaying `audio` without controls in Mobile Safari 4/5/6/7. | |
*/ | |
audio:not([controls]) { | |
display: none; | |
height: 0; | |
} | |
/** | |
* Address `[hidden]` styling not present in IE 8/9/10. | |
* Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22. | |
*/ | |
[hidden], | |
template { | |
display: none; | |
} | |
/* Links | |
========================================================================== */ | |
/** | |
* Remove the gray background color from active links in IE 10. | |
*/ | |
a { | |
background-color: transparent; | |
} | |
/** | |
* Improve readability of focused elements when they are also in an | |
* active/hover state. | |
*/ | |
a:active, | |
a:hover { | |
outline: 0; | |
} | |
/* Text-level semantics | |
========================================================================== */ | |
/** | |
* Address inconsistent styling of `abbr[title]`. | |
* 1. Correct styling in Firefox 39 and Opera 12. | |
* 2. Correct missing styling in Chrome, Edge, IE, Opera, and Safari. | |
*/ | |
abbr[title] { | |
border-bottom: none; /* 1 */ | |
text-decoration: underline; /* 2 */ | |
text-decoration: underline dotted; /* 2 */ | |
} | |
/** | |
* Address inconsistent styling of b and strong. | |
* 1. Correct duplicate application of `bolder` in Safari 6.0.2. | |
* 2. Correct style set to `bold` in Edge 12+, Safari 6.2+, and Chrome 18+. | |
*/ | |
b, | |
strong { | |
font-weight: inherit; /* 1 */ | |
} | |
b, | |
strong { | |
font-weight: bolder; /* 2 */ | |
} | |
/** | |
* Address styling not present in Safari and Chrome. | |
*/ | |
dfn { | |
font-style: italic; | |
} | |
/** | |
* Address variable `h1` font-size and margin within `section` and `article` | |
* contexts in Firefox 4+, Safari, and Chrome. | |
*/ | |
h1 { | |
font-size: 2em; | |
margin: 0.67em 0; | |
} | |
/** | |
* Address styling not present in IE 8/9. | |
*/ | |
mark { | |
background-color: #ff0; | |
color: #000; | |
} | |
/** | |
* Address inconsistent and variable font size in all browsers. | |
*/ | |
small { | |
font-size: 80%; | |
} | |
/** | |
* Prevent `sub` and `sup` affecting `line-height` in all browsers. | |
*/ | |
sub, | |
sup { | |
font-size: 75%; | |
line-height: 0; | |
position: relative; | |
vertical-align: baseline; | |
} | |
sup { | |
top: -0.5em; | |
} | |
sub { | |
bottom: -0.25em; | |
} | |
/* Embedded content | |
========================================================================== */ | |
/** | |
* Remove border when inside `a` element in IE 8/9/10. | |
*/ | |
img { | |
border: 0; | |
} | |
/** | |
* Correct overflow not hidden in IE 9/10/11. | |
*/ | |
svg:not(:root) { | |
overflow: hidden; | |
} | |
/* Grouping content | |
========================================================================== */ | |
/** | |
* Address margin not present in IE 8/9 and Safari. | |
*/ | |
figure { | |
margin: 1em 40px; | |
} | |
/** | |
* Address inconsistent styling of `hr`. | |
* 1. Correct `box-sizing` set to `border-box` in Firefox. | |
* 2. Correct `overflow` set to `hidden` in IE 8/9/10/11 and Edge 12. | |
*/ | |
hr { | |
box-sizing: content-box; /* 1 */ | |
height: 0; /* 1 */ | |
overflow: visible; /* 2 */ | |
} | |
/** | |
* Contain overflow in all browsers. | |
*/ | |
pre { | |
overflow: auto; | |
} | |
/** | |
* 1. Correct inheritance and scaling of font-size for preformatted text. | |
* 2. Address odd `em`-unit font size rendering in all browsers. | |
*/ | |
code, | |
kbd, | |
pre, | |
samp { | |
font-family: monospace, monospace; /* 1 */ | |
font-size: 1em; /* 2 */ | |
} | |
/* Forms | |
========================================================================== */ | |
/** | |
* Known limitation: by default, Chrome and Safari on OS X allow very limited | |
* styling of `select`, unless a `border` property is set. | |
*/ | |
/** | |
* 1. Correct font properties not being inherited. | |
* 2. Address margins set differently in Firefox 4+, Safari, and Chrome. | |
*/ | |
button, | |
input, | |
optgroup, | |
select, | |
textarea { | |
font: inherit; /* 1 */ | |
margin: 0; /* 2 */ | |
} | |
/** | |
* Address `overflow` set to `hidden` in IE 8/9/10/11. | |
*/ | |
button { | |
overflow: visible; | |
} | |
/** | |
* Address inconsistent `text-transform` inheritance for `button` and `select`. | |
* All other form control elements do not inherit `text-transform` values. | |
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. | |
* Correct `select` style inheritance in Firefox. | |
*/ | |
button, | |
select { | |
text-transform: none; | |
} | |
/** | |
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` | |
* and `video` controls. | |
* 2. Correct inability to style clickable `input` types in iOS. | |
* 3. Improve usability and consistency of cursor style between image-type | |
* `input` and others. | |
*/ | |
button, | |
html input[type="button"], /* 1 */ | |
input[type="reset"], | |
input[type="submit"] { | |
-webkit-appearance: button; /* 2 */ | |
cursor: pointer; /* 3 */ | |
} | |
/** | |
* Re-set default cursor for disabled elements. | |
*/ | |
button[disabled], | |
html input[disabled] { | |
cursor: default; | |
} | |
/** | |
* Remove inner padding and border in Firefox 4+. | |
*/ | |
button::-moz-focus-inner, | |
input::-moz-focus-inner { | |
border: 0; | |
padding: 0; | |
} | |
/** | |
* Restore focus style in Firefox 4+ (unset by a rule above) | |
*/ | |
button:-moz-focusring, | |
input:-moz-focusring { | |
outline: 1px dotted ButtonText; | |
} | |
/** | |
* Address Firefox 4+ setting `line-height` on `input` using `!important` in | |
* the UA stylesheet. | |
*/ | |
input { | |
line-height: normal; | |
} | |
/** | |
* It's recommended that you don't attempt to style these elements. | |
* Firefox's implementation doesn't respect box-sizing, padding, or width. | |
* | |
* 1. Address box sizing set to `content-box` in IE 8/9/10. | |
* 2. Remove excess padding in IE 8/9/10. | |
*/ | |
input[type="checkbox"], | |
input[type="radio"] { | |
box-sizing: border-box; /* 1 */ | |
padding: 0; /* 2 */ | |
} | |
/** | |
* Fix the cursor style for Chrome's increment/decrement buttons. For certain | |
* `font-size` values of the `input`, it causes the cursor style of the | |
* decrement button to change from `default` to `text`. | |
*/ | |
input[type="number"]::-webkit-inner-spin-button, | |
input[type="number"]::-webkit-outer-spin-button { | |
height: auto; | |
} | |
/** | |
* Address `appearance` set to `searchfield` in Safari and Chrome. | |
*/ | |
input[type="search"] { | |
-webkit-appearance: textfield; | |
} | |
/** | |
* Remove inner padding and search cancel button in Safari and Chrome on OS X. | |
* Safari (but not Chrome) clips the cancel button when the search input has | |
* padding (and `textfield` appearance). | |
*/ | |
input[type="search"]::-webkit-search-cancel-button, | |
input[type="search"]::-webkit-search-decoration { | |
-webkit-appearance: none; | |
} | |
/** | |
* Define consistent border, margin, and padding. | |
*/ | |
fieldset { | |
border: 1px solid #c0c0c0; | |
margin: 0 2px; | |
padding: 0.35em 0.625em 0.75em; | |
} | |
/** | |
* 1. Correct `color` not being inherited in IE 8/9/10/11. | |
* 2. Remove padding so people aren't caught out if they zero out fieldsets. | |
*/ | |
legend { | |
border: 0; /* 1 */ | |
padding: 0; /* 2 */ | |
} | |
/** | |
* Remove default vertical scrollbar in IE 8/9/10/11. | |
*/ | |
textarea { | |
overflow: auto; | |
} | |
/** | |
* Restore font weight (unset by a rule above). | |
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X. | |
*/ | |
optgroup { | |
font-weight: bold; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "PHP-URLSearchParams-Demo", | |
"version": "0.0.1", | |
"description": "A Gist showing off PHP and JavaScript classes/modules", | |
"keywords": ["PHP", "JavaScript", "ECMAScript 2015", "ES6", "CSS", "modules"], | |
"author": { | |
"name": "Chris Zuber", | |
"email": "[email protected]", | |
"url": "https://chriszuber.com" | |
}, | |
"contributors": [], | |
"license": "GPL-3.0", | |
"repository" : { | |
"type" : "git", | |
"url" : "https://gist.github.com/shgysk8zer0/4392b21268e39f4003e9" | |
}, | |
"engines": { | |
"php": ">5.5.0", | |
"npm": "~3.5.0" | |
}, | |
"dependencies": {}, | |
"devDependencies": { | |
"eslint": "*", | |
"webpack": "^1.0.0", | |
"babel-core": "*", | |
"babel-preset-es2015": "*", | |
"babel-loader": "^6.2.1" | |
}, | |
"scripts": { | |
"build:css": "myth import.css -c styles.css", | |
"build:js": "webpack" | |
}, | |
"babel": { | |
"presets": ["es2015"], | |
"sourceMaps": true, | |
"only": "*.js", | |
"compact": true, | |
"comments": false | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Chris Zuber <[email protected]> | |
* @copyright 2016, Chris Zuber | |
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3 (GPL-3.0) | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU General Public License | |
* as published by the Free Software Foundation, either version 3 | |
* of the License, or (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU General Public License for more details. | |
* | |
* You should have received a copy of the GNU General Public License | |
* along with this program. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
trait QueryString | |
{ | |
/** | |
* Converts $_params into an HTTP query (without the leading "?") | |
* | |
* @return string "foo=bar&name=John+Smith" | |
*/ | |
final public function __toString() | |
{ | |
return http_build_query($this->{self::MAGIC_PROPERTY}); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root { | |
background-image: var(--main-bg); | |
background-size: cover; | |
background-position: center; | |
background-repeat: no-repeat; | |
color: var(--default-color); | |
text-shadow: var(--shadow); | |
cursor: var(--default-cursor); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@charset 'UTF-8';@-moz-viewport{width:auto;width:device-width;height:auto;height:device-height;zoom:1;user-zoom:fixed;}@-webkit-viewport{width:auto;width:device-width;height:auto;height:device-height;zoom:1;user-zoom:fixed;}@-o-viewport{width:auto;width:device-width;height:auto;height:device-height;zoom:1;user-zoom:fixed;}@-ms-viewport{width:auto;width:device-width;height:auto;height:device-height;zoom:1;user-zoom:fixed;}@viewport{width:auto;width:device-width;height:auto;height:device-height;zoom:1;user-zoom:fixed;}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}body{margin:0;}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block;}audio,canvas,progress,video{display:inline-block;vertical-align:baseline;}audio:not([controls]){display:none;height:0;}[hidden],template{display:none;}a{background-color:transparent;}a:active,a:hover{outline:0;}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted;}b,strong{font-weight:inherit;}b,strong{font-weight:bolder;}dfn{font-style:italic;}h1{font-size:2em;margin:0.67em 0;}mark{background-color:#ff0;color:#000;}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-0.5em;}sub{bottom:-0.25em;}img{border:0;}svg:not(:root){overflow:hidden;}figure{margin:1em 40px;}hr{box-sizing:content-box;height:0;overflow:visible;}pre{overflow:auto;}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em;}button,input,optgroup,select,textarea{font:inherit;margin:0;}button{overflow:visible;}button,select{text-transform:none;}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;}button[disabled],html input[disabled]{cursor:default;}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}button:-moz-focusring,input:-moz-focusring{outline:1px dotted ButtonText;}input{line-height:normal;}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto;}input[type="search"]{-webkit-appearance:textfield;}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em;}legend{border:0;padding:0;}textarea{overflow:auto;}optgroup{font-weight:bold;}:root{background-image:-webkit-linear-gradient(whitesmoke, gainsboro);background-image:linear-gradient(whitesmoke, gainsboro);background-size:cover;background-position:center;background-repeat:no-repeat;color:#333;text-shadow:rgba(20, 20, 20, 0.9);cursor:auto;}@media screen and (min-width:1000px){:root{font-size:1.3vw;}}@media screen and (max-width:999px) and (min-width:500px){:root{font-size:2vw;}}@media screen and (max-width: 499px){:root{font-size:3vw;}}body{min-height:100vh;-webkit-align-content:space-between;-ms-flex-line-pack:justify;align-content:space-between;-webkit-box-align:stretch;-webkit-align-items:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}.spacer{display:inline-block;height:100%;width:0;padding:0;margin:0 0.5em;border-right:2px solid currentColor;}.center{text-align:center;}.resizeable{resize:both;overflow:auto;}@media screen and (min-width: 800px){.sticky{position:-webkit-sticky;position:sticky;margin-top:0;}}.blur{-webkit-filter:blur(1px);filter:blur(1px);}.grayscale{-webkit-filter:grayscale(1);filter:grayscale(1);}.blur.grayscale{-webkit-filter:blur(1px) grayscale(1);filter:blur(1px) grayscale(1);}.flex{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}.flex.row{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}.flex.column{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}.flex.wrap{-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;}.block{display:block;}.inline{display:inline;}.inline-block{display:inline-block;}.currentColor{fill:currentColor;}:root.hidden *{-webkit-animation-play-state:paused;animation-play-state:paused;}:root.offline{pointer-events:none;}:root.loading{cursor:progress;}.logo svg{width:100%;height:100%;}.logo{display:inline-block;*display:inline;*zoom:1;width:3rem;height:3rem;overflow:visible;-webkit-transition:all 1s cubic-bezier(.68,-0.55,.27,1.55) 0s;transition:all 1s cubic-bezier(.68,-0.55,.27,1.55) 0s;}.logo svg,.logo img{overflow:visible;}footer .logo{color:#333;}.icon{color:inherit;max-width:100%;max-height:100%;width:1em;height:1em;}.icon svg{color:inherit;fill:currentColor;}.logo:hover{-webkit-transform:scale(2)rotateZ(360deg);transform:scale(2)rotateZ(360deg);}.copyleft{color:#f9f9f9;font-size:3rem;}.copyleft::before{content:'©';display:inline-block;*display:inline;*zoom:1;-webkit-transform:rotateY(180deg);transform:rotateY(180deg);}@supports ((-webkit-filter: none) or (filter: none)){[data-filter="blur"]{-webkit-filter:blur(0.15em);filter:blur(0.15em);}[data-filter="brightness"]{-webkit-filter:brightness(50%);filter:brightness(50%);}[data-filter="contrast"]{-webkit-filter:contrast(50%);filter:contrast(50%);}[data-filter="drop-shadow"]{-webkit-filter:drop-shadow(.5em .5em 1em #222);filter:drop-shadow(.5em .5em 1em #222);}[data-filter="grayscale"]{-webkit-filter:grayscale(50%);filter:grayscale(50%);}[data-filter="invert"]{-webkit-filter:invert(50%);filter:invert(50%);}[data-filter="opacity"]{-webkit-filter:opacity(50%);filter:opacity(50%);}[data-filter="sepia"]{-webkit-filter:sepia(50%);filter:sepia(50%);}[data-filter="saturate"]{-webkit-filter:saturate(50%);filter:saturate(50%);}[data-hover-filter="blur"]:hover{-webkit-filter:blur(0.15em);filter:blur(0.15em);}[data-hover-filter="brightness"]:hover{-webkit-filter:brightness(50%);filter:brightness(50%);}[data-hover-filter="contrast"]:hover{-webkit-filter:contrast(50%);filter:contrast(50%);}[data-hover-filter="drop-shadow"]:hover{-webkit-filter:drop-shadow(.5em .5em 1em #222);filter:drop-shadow(.5em .5em 1em #222);}[data-hover-filter="grayscale"]:hover{-webkit-filter:grayscale(50%);filter:grayscale(50%);}[data-hover-filter="invert"]:hover{-webkit-filter:invert(50%);filter:invert(50%);}[data-hover-filter="opacity"]:hover{-webkit-filter:opacity(50%);filter:opacity(50%);}[data-hover-filter="sepia"]:hover{-webkit-filter:sepia(50%);filter:sepia(50%);}[data-hover-filter="saturate"]:hover{-webkit-filter:saturate(50%);filter:saturate(50%);}[data-hover-filter]{-webkit-transition:-webkit-filter 800ms, filter 800ms;transition:filter 800ms;}}svg > use{fill:currentColor;}button,[role="button"]{display:inline-block;color:#f9f9f9;}::-moz-selection{background-color:rgb(117, 151, 242);text-shadow:none;}::selection{background-color:rgb(117, 151, 242);text-shadow:none;}*,*:after,*:before{box-sizing:inherit;max-width:100%;}:root{box-sizing:border-box;}menu[type="context"]{display:none;}a[target="_blank"]::after{content:' D';}[download]::after{content:' A';}button,[role="button"]{min-width:2rem;padding:0.2rem;background-color:rgb(117, 151, 242);background-image:url('../../images/gradients/header_links.png');background-image:-webkit-linear-gradient(rgb(117, 151, 242), rgb(72, 96, 168));background-image:linear-gradient(rgb(117, 151, 242), rgb(72, 96, 168));font-family:inherit;color:#333;border:0.2rem outset rgb(117, 151, 242);}button:disabled,button:active{background-color:rgb(72, 96, 168);background-image:-webkit-linear-gradient(rgb(72, 96, 168), rgb(117, 151, 242));background-image:linear-gradient(rgb(72, 96, 168), rgb(117, 151, 242));border:0.2rem inset rgb(117, 151, 242);box-shadow:0 0 0.3rem rgba(20, 20, 20, 0.9) inset;cursor:not-allowed;}a,[download]{font-family:inherit;color:hsl(209, 62%, 45%);text-decoration:none;}a::after{font-family:'Web Symbols';}img{max-width:100%;height:auto;}figure{border:0.1em solid dimgray;text-align:center;}figure figcaption{color:dimgray;text-decoration:underline;font-style:italic;}blockquote{color:#777;font-family:'Libertine';font-style:italic;padding:0px 15px;border-left:4px solid #DDD;}blockquote cite{display:block;}blockquote cite::before{content:' — ';}a,button:not(:disabled),[role="button"],input[type="submit"],input[type="reset"],input[type="image"],[data-show],[data-show-modal],[data-close],[data-delete]{cursor:pointer;}[data-icon]::after{display:inline;font-family:'Web Symbols';font-size:inherit;font-size-adjust:none;font-stretch:none;content:' 'attr(data-icon)' ';vertical-align:baseline;}[data-caption]{position:relative;}[data-caption]:hover::before{all:initial;display:block;min-width:100%;position:absolute;bottom:0;content:attr(data-caption);font-size:0.8rem;text-align:center;background-color:rgba(255, 255, 255, 0.8);border:1px solid #333;overflow:visible;}[data-close]::after,[data-delete]::after{font-family:'Web Symbols';content:'\'';}[data-fullscreen]:empty::after{content:'%';font-family:'Web Symbols';}code{display:inline-block;padding:0.1rem;background-color:#F5F5F5;background-color:rgba(0, 0, 0, 0.04);color:#333;font-size:0.9rem;font-family:hack, Courier, monospace;border-radius:0.2rem;white-space:pre;}pre > code{display:block;padding:1rem;background-color:rgb(51, 51, 51);color:rgb(255, 249, 217);border-radius:0.3rem;overflow-x:auto;}[contenteditable="true"]:empty{min-height:1.3rem;border:1px dotted dimgray;}[contenteditable="true"] img{resize:both;}ol > ol{list-style-type:upper-alpha;}ol > ol > ol{list-style-type:upper-roman;}ol > ol > ol > ol{list-style-type:lower-alpha;}ol > ol > ol > ol > ol{list-style-type:lower-roman;} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Chris Zuber <[email protected]> | |
* @copyright 2016, Chris Zuber | |
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3 (GPL-3.0) | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU General Public License | |
* as published by the Free Software Foundation, either version 3 | |
* of the License, or (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU General Public License for more details. | |
* | |
* You should have received a copy of the GNU General Public License | |
* along with this program. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
/** | |
* Class for creating and modifying search paramaters for URLs | |
*/ | |
final class URLSearchParams implements \Iterator, \MagicInterface | |
{ | |
use IteratorTrait; | |
use MagicMethods; | |
use QueryString; | |
const MAGIC_PROPERTY = '_params'; | |
protected $_params = array(); | |
/** | |
* Creates a new instance of URLSearchParams | |
* | |
* @param string $params Query string for a URL | |
*/ | |
public function __construct($params = '') | |
{ | |
parse_str($params, $this->{self::MAGIC_PROPERTY}); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@-moz-viewport { | |
width: auto; | |
width: device-width; | |
height: auto; | |
height: device-height; | |
zoom:1; | |
user-zoom: fixed; | |
} | |
@-webkit-viewport { | |
width: auto; | |
width: device-width; | |
height: auto; | |
height: device-height; | |
zoom:1; | |
user-zoom: fixed; | |
} | |
@-o-viewport { | |
width: auto; | |
width: device-width; | |
height: auto; | |
height: device-height; | |
zoom:1; | |
user-zoom: fixed; | |
} | |
@-ms-viewport { | |
width: auto; | |
width: device-width; | |
height: auto; | |
height: device-height; | |
zoom:1; | |
user-zoom: fixed; | |
} | |
@viewport { | |
width: auto; | |
width: device-width; | |
height: auto; | |
height: device-height; | |
zoom:1; | |
user-zoom: fixed; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webpack = require('webpack'); | |
module.exports = { | |
entry: './modules.js', | |
output: { | |
path: __dirname, | |
filename: 'modules.min.js' | |
}, | |
module: { | |
loaders: [ | |
{ | |
loader: 'babel-loader', | |
test: /\.js$/, | |
exclude: /node_modules/, | |
query: { | |
presets: 'es2015', | |
}, | |
} | |
] | |
}, | |
plugins: [ | |
// Avoid publishing files when compilation fails | |
new webpack.NoErrorsPlugin(), | |
new webpack.optimize.UglifyJsPlugin({compress: {warnings: false}}) | |
], | |
stats: { | |
// Nice colored output | |
colors: true | |
}, | |
// Create Sourcemaps for the bundle | |
devtool: 'source-map' | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media screen and (min-width:1000px) { | |
:root { | |
font-size: 1.3vw; | |
} | |
} | |
@media screen and (max-width:999px) and (min-width:500px) { | |
:root { | |
font-size: 2vw; | |
} | |
} | |
@media screen and (max-width: 499px) { | |
:root { | |
font-size: 3vw; | |
} | |
} | |
body { | |
min-height: 100vh; | |
align-content: space-between; | |
align-items: stretch; | |
justify-content: space-between; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment