Skip to content

Commit

Permalink
Project import
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiří Hýbek authored and Jiří Hýbek committed Nov 11, 2015
0 parents commit bfd2670
Show file tree
Hide file tree
Showing 17 changed files with 1,449 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .gitignore
@@ -0,0 +1,26 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
node_modules

# OS X
.DS_Store
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 META Platform

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
77 changes: 77 additions & 0 deletions README.md
@@ -0,0 +1,77 @@
# WA MediaBox

GALLERIES / PAGINATION / IFRAME / YOUTUBE VIDEOS / RESPONSIVE / MODERN DESIGN

**NO jQuery needed**

[See DEMO at official page](http://jiri.hybek.cz/wa-mediabox/)

## Usage

Load MediaBox JavaScript and CSS:

```html
<script type="text/javascript" src="wa-mediabox/dist/wa-mediabox.min.js"></script>
<link rel="stylesheet" type="text/css" href="wa-mediabox/dist/wa-mediabox.min.css" />
```

When page loads then following elements are bound to MediaBox:

### For images:

```html
<a href="image.jpg" data-mediabox="my-gallery-name" data-title="Sample image">
<img src="image-thumb.jpg" alt="Image" />
</a>
```

### For iframes:

```html
<a href="https://www.youtube.com/embed/FA_8TY9Z5Zg?rel=0"
data-mediabox="my-gallery-name"
data-iframe="true"
data-width="853"
data-height="480"
data-title="Sample video in iframe">
<img src="image-thumb.jpg" alt="Image" />
</a>
```

**YouTube videos are detected automatically so you can omit data-iframe attribute.**

## JavaScript API

```html
<script type="text/javascript">
//Bind single element manually
WAMediaBox.bind(document.querySelector(".my-element"));
//Bind all child elements
WAMediaBox.bindAll(document.querySelector(".my-parent-element"));
//Translate - set before any binding
WAMediaBox.lang = {
prev: "Previous",
next: "Next",
close: "Close",
openInNew: "Open in new window"
};
</script>
```html

## License

The MIT License (MIT)

Copyright (c) 2015 WA Studio (www.webarts.name)
Copyright (c) 2015 Jiri Hybek (jiri.hybek.cz)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Binary file added demo/image1-thumb.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/image1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/image2-thumb.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/image2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/image3-thumb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added demo/image3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
264 changes: 264 additions & 0 deletions demo/index.html
@@ -0,0 +1,264 @@
<!DOCTYPE <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<meta name="author" content="Jiří Hýbek" />
<meta name="robots" content="all,follow" />

<title>WA MediaBox Demo</title>

<link href='https://fonts.googleapis.com/css?family=Roboto:400,100,300' rel='stylesheet' type='text/css'>

<script type="text/javascript" src="../dist/wa-mediabox.min.js"></script>
<link rel="stylesheet" href="../dist/wa-mediabox.min.css" />

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/highlight.min.js"></script>

<script type="text/javascript">
hljs.initHighlightingOnLoad();
</script>

<style>

body {
padding: 30px;
font-family: "Roboto", sans-serif;
font-size: 14px;
line-height: 1.8;
font-weight: 500;
background: #f3f3f3;
color: #555555;
}

#gallery {
text-align: center;
padding: 0px 20px;
margin: auto;
}

#gallery img {
margin: 10px;
max-width: 100%;
vertical-align: top;
border: 0px none;
box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.15);
transition: box-shadow 0.2s;
-webkit-transition: box-shadow 0.2s;
background: #ffffff;
}

#gallery img:hover {
box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.25);
}

#gallery a {
display: inline-block;
text-decoration: none;
}

.wrap {
width: 900px;
margin: auto;
}

h1, h2 {
font-weight: 100;
}

h1 {
font-size: 42px;
margin-bottom: 20px;
text-align: center;
}

h2 {
font-size: 38px;
margin-bottom: 30px;
color: #1976D2;
}

.features {
text-align: center;
color: #999999;
font-size: 16px;
text-transform: uppercase;
font-weight: 300;
}

.features span {
color: #1976D2;
}

p {
margin-bottom: 20px;
}

pre {
border: 1px dashed #bbbbbb;
background: #eeeeee;
margin-bottom: 20px;
}

.note {
padding: 12px 16px;
background: #FFFDE7;
border: 1px solid #FBC02D;
font-weight: bold;
}

.github {
margin-top: 7px;
display: inline-block;
text-decoration: none;
padding: 10px 12px 10px 10px;
height: 32px;
line-height: 34px;
font-weight: 300;
font-size: 14px;
text-transform: uppercase;
float: right;
background: transparent;
color: #444444;
border: 1px solid #999999;
border-radius: 3px;
transition: background 0.3s, color 0.3s, border-color 0.3s;
-webit-transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.github:hover {
background: #444444;
color: #ffffff;
border-color: #444444;
}

.github svg {
vertical-align: top;
width: 32px;
height: 32px;
fill: #444444;
margin-right: 10px;
transition: fill 0.3s;
-webkit-transition: fill 0.3s;
}

.github:hover svg {
fill: #ffffff;
}

@media all and (max-width: 899px) {

.wrap {
width: 95%;
}

}

</style>

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-61055707-1', 'auto');
ga('send', 'pageview');

</script>

</head>
<body>

<h1>WA MediaBox</h1>

<p class="features">
<span>Galleries</span> /
<span>Pagination</span> /
<span>Iframe</span> /
<span>YouTube videos</span> /
<span>Responsive</span> /
<span>Modern design</span> /
<span>NO jQuery</span>
</p>

<div id="gallery">
<a href="image1.jpg" data-mediabox="gallery-1" data-title="Sample image 1"><img src="image1-thumb.jpg" alt="Image 1" /></a>
<a href="image2.jpg" data-mediabox="gallery-1"><img src="image2-thumb.jpg" alt="Image 2" /></a>
<a href="image3.png" data-mediabox="gallery-1" data-title="Sample image 3"><img src="image3-thumb.png" alt="Image 3" /></a>
<a href="https://www.youtube.com/embed/FA_8TY9Z5Zg?rel=0" data-mediabox="gallery-1" data-width="853" data-height="480" data-title="Sample video"><img src="video-thumb.jpg" alt="Video" /></a>
</div>

<div class="wrap">

<a href="https://github.com/jirihybek/wa-mediabox" target="_blank" class="github"><svg viewBox="0 0 24 24"><path d="M4,2H20A2,2 0 0,1 22,4V20A2,2 0 0,1 20,22H14.85C14.5,21.92 14.5,21.24 14.5,21V18.26C14.5,17.33 14.17,16.72 13.81,16.41C16.04,16.16 18.38,15.32 18.38,11.5C18.38,10.39 18,9.5 17.35,8.79C17.45,8.54 17.8,7.5 17.25,6.15C17.25,6.15 16.41,5.88 14.5,7.17C13.71,6.95 12.85,6.84 12,6.84C11.15,6.84 10.29,6.95 9.5,7.17C7.59,5.88 6.75,6.15 6.75,6.15C6.2,7.5 6.55,8.54 6.65,8.79C6,9.5 5.62,10.39 5.62,11.5C5.62,15.31 7.95,16.17 10.17,16.42C9.89,16.67 9.63,17.11 9.54,17.76C8.97,18 7.5,18.45 6.63,16.93C6.63,16.93 6.1,15.97 5.1,15.9C5.1,15.9 4.12,15.88 5,16.5C5,16.5 5.68,16.81 6.14,17.97C6.14,17.97 6.73,19.91 9.5,19.31V21C9.5,21.24 9.5,21.92 9.14,22H4A2,2 0 0,1 2,20V4A2,2 0 0,1 4,2Z" /></svg> Get on GitHub</a>

<h2>Usage</h2>
<p>Load MediaBox JavaScript and CSS:</p>

<pre><code class="html">&lt;script type="text/javascript" src="wa-mediabox/dist/wa-mediabox.min.js"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" type="text/css" href="wa-mediabox/dist/wa-mediabox.min.css" /&gt;</code></pre>

<p>When page loads then following elements are bound to MediaBox:</p>

<h3>For images:</h3>
<pre><code class="html">&lt;a href="image.jpg" data-mediabox="my-gallery-name" data-title="Sample image"&gt;
&lt;img src="image-thumb.jpg" alt="Image" /&gt;
&lt;/a&gt; </code></pre>

<h3>For iframes:</h3>
<pre><code class="html">&lt;a href="https://www.youtube.com/embed/FA_8TY9Z5Zg?rel=0"
data-mediabox="my-gallery-name"
data-iframe="true"
data-width="853"
data-height="480"
data-title="Sample video in iframe"&gt;
&lt;img src="image-thumb.jpg" alt="Image" /&gt;
&lt;/a&gt; </code></pre>

<p class="note">YouTube videos are detected automatically so you can omit <code>data-iframe</code> attribute.</p>

<h2>JavaScript API</h2>

<pre><code class="javascript">//Bind single element manually
WAMediaBox.bind(document.querySelector(".my-element"));

//Bind all child elements
WAMediaBox.bindAll(document.querySelector(".my-parent-element"));

//Translate - set before any binding
WAMediaBox.lang = {
prev: "Previous",
next: "Next",
close: "Close",
openInNew: "Open in new window"
};</code></pre>

<h2>License</h2>
<p>The MIT License (MIT)</p>

<p>Copyright (c) 2015 WA Studio (www.webarts.name)<br />Copyright (c) 2015 Jiri Hybek (jiri.hybek.cz)</p>

<p>Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:</p>

<p>The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.</p>

<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.</p>

</div>

</body>
</html>
Binary file added demo/video-thumb.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dist/wa-mediabox.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bfd2670

Please sign in to comment.