Skip to content

Commit

Permalink
intial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rommelfreddy committed Feb 1, 2021
0 parents commit 548091d
Show file tree
Hide file tree
Showing 10 changed files with 6,609 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Magento 2 Module to integrate fancybox

## Description

this module integrates the [fancybox jquery plugin](https://fancyapps.com/fancybox/3/).

## Install

Install the extension via composer:

```
composer install webidea24/magento2-module-fancybox
```

## Usage - Example

```
<script>
require(['jquery', 'fancybox'], function($) {
$().fancybox({"selector": "[data-fancybox='gallery']"});
});
</script>
```

16 changes: 16 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "webidea24/magento2-module-fancybox",
"description": "Magento 2 Module to integrate fancybox",
"license": [
"MIT"
],
"type": "magento2-module",
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Webidea24\\Fancybox\\": ""
}
}
}
5 changes: 5 additions & 0 deletions etc/module.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Webidea24_Fancybox" setup_version="1.0.0"/>
</config>
6 changes: 6 additions & 0 deletions registration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Webidea24_Fancybox',
__DIR__
);
7 changes: 7 additions & 0 deletions view/frontend/layout/default.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="Webidea24_Fancybox::css/jquery.fancybox.min.css"/>
</head>
</page>
10 changes: 10 additions & 0 deletions view/frontend/requirejs-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var config = {
map: {
'*': {
fancybox: 'Webidea24_Fancybox/js/jquery.fancybox',
}
},
shim: {
'fancybox': ['jquery']
},
};
Loading

0 comments on commit 548091d

Please sign in to comment.