Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from francoischalifour/feature/preview-on-deploy
Deploys on pull requests
- Loading branch information
Showing
5 changed files
with
229 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
# JavaScript | ||
|
||
> This is a medium-zoom example using vanilla JavaScript. | ||
> This is a *medium-zoom* example using vanilla JavaScript. | ||
## Production | ||
|
||
Open [`index.html`](index.html) which contains the [production version](https://unpkg.com/medium-zoom@0/dist/medium-zoom.min.js) of medium-zoom. | ||
The root [`index.html`](index.html) is the demo file. It contains the [production version](https://unpkg.com/medium-zoom@0/dist/medium-zoom.min.js) of library. The *medium-zoom* code is in [`demo.js`](demo.js). | ||
|
||
## Development | ||
|
||
Open [`development.html`](development.html) which contains the [development version](../../dist/medium-zoom.min.js) of medium-zoom. | ||
If you're developing, you want to open [`development/index.html`](development/index.html), which contains the [development version](../../dist/medium-zoom.min.js) of medium-zoom (which is updated with `npm run dev`). | ||
|
||
[See dev instructions](../../README.md#dev). | ||
To learn more about how to contribute, please [see the dev instructions](../../README.md#dev). | ||
|
||
## Preview | ||
|
||
The preview folder gets the [library](preview/medium-zoom.min.js) overriden with a build version on deploy. This process is automated with [Netlify](https://www.netlify.com/) to check if pull requests work as expected. You shouldn't need to access to the [preview version](preview/index.html) of the demo by yourself. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="theme-color" content="#4caf50"> | ||
|
||
<link rel="shortcut icon" href="../favicon.ico"> | ||
|
||
<link href="https://fonts.googleapis.com/css?family=Varela+Round|Work+Sans" rel="stylesheet"> | ||
<link href="../reset.css" rel="stylesheet"> | ||
<link href="../style.css" rel="stylesheet"> | ||
|
||
<title>Medium Zoom | Demo</title> | ||
</head> | ||
|
||
<body> | ||
<header class="header"> | ||
<h1 class="header__title">Medium Zoom</h1> | ||
<div class="header__subtitle">Medium zoom on your pictures in vanilla JavaScript</div> | ||
|
||
<div class="header__info"> | ||
<a href="https://github.com/francoischalifour/medium-zoom" class="button">View on GitHub</a> | ||
<a href="https://francoischalifour.com/lab/medium-image-zoom" class="button">Read the article</a> | ||
</div> | ||
</header> | ||
|
||
<article class="container"> | ||
<figure> | ||
<img | ||
id="zoom-default" | ||
src="../images/image-1.jpg" | ||
alt="Zoom with default options" | ||
> | ||
<figcaption>Zoom with default options</figcaption> | ||
</figure> | ||
|
||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. | ||
Tempora praesentium cupiditate fugit voluptas, rem eligendi, voluptatem molestias pariatur atque amet, | ||
dicta, similique beatae optio quos! Hic necessitatibus dicta magni, tempore. | ||
Atque illo voluptatibus fugiat id pariatur cum quasi vel ut repellendus iure quaerat, | ||
doloremque sit voluptatum odio maiores provident consequuntur accusantium saepe. | ||
</p> | ||
|
||
<figure> | ||
<img | ||
id="zoom-margin" | ||
src="../images/image-2.jpg" | ||
alt="Zoom with margin" | ||
> | ||
<figcaption>Zoom with margin</figcaption> | ||
</figure> | ||
|
||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. | ||
Ea dolores quaerat, quis modi nostrum sequi adipisci ratione esse | ||
blanditiis error beatae vel non vero dolor nemo. Animi nemo quisquam ducimus! | ||
</p> | ||
|
||
<figure> | ||
<img | ||
id="zoom-background" | ||
src="../images/image-3.jpg" | ||
alt="Zoom with background color" | ||
> | ||
<figcaption>Zoom with background color</figcaption> | ||
</figure> | ||
|
||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dignissimos magnam illo, | ||
quam iusto, autem ratione commodi deleniti vero magni fuga consectetur expedita, | ||
voluptatum enim quidem? Rem, minima laboriosam hic! Id. | ||
</p> | ||
|
||
<figure class="pull-right"> | ||
<img | ||
id="zoom-scrollOffset" | ||
src="../images/image-4.jpg" | ||
alt="Zoom without scroll effect" | ||
> | ||
<figcaption>Zoom without scroll offset</figcaption> | ||
</figure> | ||
|
||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus cum nulla | ||
eligendi recusandae at quae odio, harum nesciunt ut temporibus vitae, laudantium minus. | ||
Iste officia aliquid, laborum ratione maxime beatae. | ||
</p> | ||
|
||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Enim asperiores totam fugiat | ||
repellendus laboriosam accusantium, possimus similique quos repellat molestias excepturi | ||
ad perspiciatis beatae! Qui repellat numquam incidunt, accusamus autem. | ||
</p> | ||
|
||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. | ||
Corrupti provident sunt recusandae enim commodi ab dolorem ipsum dolor magni | ||
reprehenderit accusantium quasi a autem neque asperiores, tenetur impedit repudiandae quos. | ||
</p> | ||
|
||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. | ||
Accusamus cum nulla eligendi recusandae at quae odio, harum nesciunt ut | ||
temporibus vitae, laudantium minus. Iste officia aliquid, laborum ratione maxime beatae. | ||
</p> | ||
|
||
<figure class="pull-left"> | ||
<img | ||
id="zoom-metaClick" | ||
src="../images/image-5.jpg" | ||
alt="Zoom without meta click" | ||
> | ||
<figcaption>Zoom without meta click</figcaption> | ||
</figure> | ||
|
||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. | ||
Accusamus cum nulla eligendi recusandae at quae odio, harum nesciunt ut | ||
temporibus vitae, laudantium minus. Iste officia aliquid, laborum ratione maxime beatae. | ||
</p> | ||
|
||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. | ||
Corrupti provident sunt recusandae enim commodi ab dolorem ipsum dolor magni | ||
reprehenderit accusantium quasi a autem neque asperiores, tenetur impedit repudiandae quos. | ||
</p> | ||
|
||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. | ||
Corporis veritatis cupiditate iure velit laboriosam eius nesciunt officiis | ||
odit cumque deleniti assumenda esse exercitationem ducimus, accusantium eligendi itaque dolorem molestias saepe! | ||
</p> | ||
|
||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. | ||
Accusamus cum nulla eligendi recusandae at quae odio, harum nesciunt ut | ||
temporibus vitae, laudantium minus. Iste officia aliquid, laborum ratione maxime beatae. | ||
</p> | ||
|
||
<figure> | ||
<img | ||
id="zoom-trigger" | ||
src="../images/image-6.jpg" | ||
alt="Zoom to trigger" | ||
> | ||
<figcaption> | ||
<button id="btn-trigger" class="button">Trigger the zoom</button> | ||
</figcaption> | ||
</figure> | ||
|
||
<p> | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit. | ||
Corrupti provident sunt recusandae enim commodi ab dolorem ipsum dolor magni | ||
reprehenderit accusantium quasi a autem neque asperiores, tenetur impedit repudiandae quos. | ||
</p> | ||
|
||
<figure> | ||
<img | ||
id="zoom-detach" | ||
src="../images/image-7.jpg" | ||
alt="Zoom detached after 5 seconds" | ||
> | ||
<figcaption>Zoom detached after 5 seconds</figcaption> | ||
</figure> | ||
|
||
<h2>Journal</h2> | ||
|
||
<blockquote id="journal"> | ||
<p>In this journal appears the history of the images zoomed.</p> | ||
</blockquote> | ||
|
||
</article> | ||
|
||
<footer class="footer"> | ||
<div class="footer__links"> | ||
<a href="https://github.com/francoischalifour/medium-zoom" class="button">View on GitHub</a> | ||
<a href="http://francoischalifour.com/lab/medium-image-zoom" class="button">Read the article</a> | ||
</div> | ||
|
||
<div class="footer__copyright"> | ||
Made by <a href="https://francoischalifour.com">François Chalifour</a> | ||
</div> | ||
|
||
<p><a href="#">Back to top</a></p> | ||
</footer> | ||
|
||
<script> | ||
console.info('You\'re in development environment 🛠') | ||
</script> | ||
<script src="../../../dist/medium-zoom.min.js"></script> | ||
<script> | ||
if (!window.mediumZoom) { | ||
throw new Error('This environment is only available locally.') | ||
} | ||
</script> | ||
<script src="../demo.js"></script> | ||
</body> | ||
</html> |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// This is the default file that gets filled on deploy. | ||
window.mediumZoom = function () { | ||
throw new Error('You\'re either viewing this page locally or the deployment didn\'t go well.') | ||
} |
This file contains 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