A fairly basic and simple-to-use vanilla-JS portfolio gallery I made for my website portfolio website. This is currently structured around showing off your web works, with bullet-points for accomplishments and a "View Site" button
- Include the files in
dist/*
in your respective CSS and JS folders. - Add a reference to the stylesheet in the head of your html file.
- Add a reference to the script below the
</body>
tag of your html file. - Add an element for each gallery you would like. Give it a unique ID. NOTE: You may style this element to set a size, but note that the responsive design of this gallery is built to work with 100% of the window's width and height. You may have to add your own responsive styles to make it work properly.
- Underneath your zgallery.js script reference, add a new
<script></script>
block. - Within this script block you can now call
new ZGallery(id, [ items ]);
for each element you previously created. See below for item structure.
new ZGallery("#helloGallery", [
{
title: "Hello!"
points: [ "This is an item.", "And these...", "... are some bullet-points for the item!" ],
href: "http://linktowebsite.com/",
img: "images/site0.jpg"
},
{ ... }
]);
href
is a URL that a "View Site" button on each item will link to. It is added to ana
element that looks like a button.img
will be added to all corresponding elements as a background-image. Path is relative to the html file holding the gallery element.