Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Primer commit #23

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
12fd023
Primer commit
AriellaRogueN Jan 22, 2018
0085450
agregando eslint-gitignore
AriellaRogueN Jan 22, 2018
0077120
Merge pull request #3 from tcltere/Avances
tcltere Jan 23, 2018
1e3368f
Agregando html-imagenes
AriellaRogueN Jan 24, 2018
ac30d97
segundo commit
tcltere Jan 24, 2018
7cf7cf3
agregando archivo app.js
tcltere Jan 24, 2018
f778e4b
Iniciando configuracion testeo
AriellaRogueN Jan 24, 2018
03588c8
Agregando cambios
AriellaRogueN Jan 24, 2018
3381f84
Merge branch 'Avances' of https://github.com/AriellaRogueN/cardify in…
AriellaRogueN Jan 24, 2018
b83c517
Corrigiendo errore
AriellaRogueN Jan 24, 2018
a126486
probando cambios tere
tcltere Jan 24, 2018
8dfff73
Merge pull request #5 from tcltere/Avances
AriellaRogueN Jan 24, 2018
55f2ed2
subiendo readme
tcltere Jan 24, 2018
17f2457
Instalando dependencias mocha-chai, Añadiendo función
AriellaRogueN Jan 25, 2018
abec72d
Instalando dependecias mocha-chai, Agregando función
AriellaRogueN Jan 25, 2018
f04c010
carpeta de test
tcltere Jan 25, 2018
6df2550
Merge branch 'Avances' into Avances
AriellaRogueN Jan 25, 2018
6fbdc9e
Merge pull request #6 from tcltere/Avances
AriellaRogueN Jan 25, 2018
b058e7b
agregando cambios js
AriellaRogueN Jan 25, 2018
bd095ff
agregando cambios js
AriellaRogueN Jan 25, 2018
447350d
funcion de hover
tcltere Jan 30, 2018
59ca3cb
Merge branch 'Avances' into Avances
AriellaRogueN Jan 30, 2018
b71a90f
Merge pull request #7 from tcltere/Avances
AriellaRogueN Jan 30, 2018
f29e8cc
cambio
tcltere Jan 30, 2018
e6f414c
modificando js
AriellaRogueN Jan 30, 2018
3292633
Modificando JSs
AriellaRogueN Jan 30, 2018
1edf635
Modificando Test/Agregando Libreria
AriellaRogueN Jan 31, 2018
5766e00
function nueva
tcltere Feb 1, 2018
85ef91b
nueva fun
tcltere Feb 1, 2018
762632d
subiendo funcion
tcltere Feb 1, 2018
0887353
Merge branch 'Avances' into Avances
AriellaRogueN Feb 1, 2018
2f40f4d
Agregando tests
AriellaRogueN Feb 1, 2018
1da44f4
Merge branch 'master' of https://github.com/AriellaRogueN/cardify int…
AriellaRogueN Feb 1, 2018
a21f5e8
Merge pull request #10 from tcltere/Avances
AriellaRogueN Feb 1, 2018
cbf5291
agregando cambios Js
AriellaRogueN Feb 1, 2018
746f7b8
Modificando html-js
AriellaRogueN Feb 1, 2018
a3e5933
Anadiendo cambios Js
AriellaRogueN Feb 2, 2018
b8ff43f
Agregando Readme Final
AriellaRogueN Feb 2, 2018
9ae5b8d
Añadiendo Librería-TestDomOk-ArreglandoReadMe
AriellaRogueN Feb 2, 2018
e630938
Arreglando readme
AriellaRogueN Feb 2, 2018
0daa15b
modicicando Json
AriellaRogueN Feb 2, 2018
c3608dc
arreglando Readme
AriellaRogueN Feb 3, 2018
eb5d686
agregando ejemplo readme
AriellaRogueN Feb 3, 2018
8c1a5e2
Update README.md
AriellaRogueN Feb 3, 2018
4c7e323
Update README.md
AriellaRogueN Feb 3, 2018
dcaf736
Update README.md
AriellaRogueN Feb 3, 2018
43e69c0
Update README.md
AriellaRogueN Feb 3, 2018
322a490
Update README.md
AriellaRogueN Feb 3, 2018
c425f70
Update README.md
AriellaRogueN Feb 3, 2018
2eb6b04
Update README.md
AriellaRogueN Feb 4, 2018
1cda71a
Update README.md
AriellaRogueN Feb 4, 2018
a1e4369
CAmbios Readme
AriellaRogueN Feb 4, 2018
b49ea49
Cambios Readme
AriellaRogueN Feb 4, 2018
4326c3a
Arreglo Json
AriellaRogueN Feb 4, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
31 changes: 31 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"parserOptions": {
"ecmaVersion": 6
},
"rules": {
"keyword-spacing": 1,
"space-before-function-paren": [1, "never"],
"eqeqeq": 1,
"space-infix-ops": 1,
"comma-spacing": 1,
"brace-style": 1,
"no-multiple-empty-lines": 1,
"camelcase": 1,
"func-call-spacing": 1,
"key-spacing": 1,
"semi": 1,
"no-floating-decimal": 1,
"no-multi-spaces": 1,
"object-property-newline": 1,
"padded-blocks": [1, "never"],
"space-before-blocks": 1,
"space-in-parens": 1,
"spaced-comment": 1,
"quotes": [1, "single"],
"id-length": [1, {
"exceptions": ["i", "j", "x"]
}],
"indent": [1, 2],
"no-array-constructor": 1
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
92 changes: 55 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,72 @@
# Cardify
# Imaginator

* **Track:** _Common Core_
* **Curso:** _JS Deep Dive: Crea tu propia librería usando JavaScript_
* **Unidad:** _Producto final_
- - -

***

Implementar un plugin de jQuery que dado un _contenedor_ debe buscar todas las
imágenes que encuentre dentro del _contenedor_ y reemplazarlas por un nuevo
elemento `<figure>` que contenga la imagen (`<img>`) además de un `<figcaption>`
con el texto del atributo `alt` de la imagen.
Plugin de Jquery que permite agregar etiquetas `<figure` y `<figcaption>` al pasar el mouse por las imagenes. La etiqueta `<figcaption>`, mostrará el texto del atributo Alt.

## Flujo de trabajo
- - -

1. Debes realizar un [**fork**](https://gist.github.com/ivandevp/1de47ae69a5e139a6622d78c882e1f74)
de este repositorio.
## Instalación
### Global (navegador)

2. Luego deberás **clonar** tu fork en tu máquina. Recuerda que el comando a usar
es `git clone` y su estructura normalmente se ve así:
`<script src="jquery.imaginator.js"></script>`

```bash
git clone https://github.com/<nombre-de-usuario>/cardify.git
```
### Uso

3. Cuando hayas terminado tu producto, envía un Pull Request a la rama que tus
instructorxs este repositorio
(puedes solicitar apoyo de tus profes para este paso).
`$(content).imaginator();
`

> Nota: No olvides que es una buena práctica describir tu proyecto en este
> archivo `README.md` :smiley:.
## Funcionamiento
1. #### Inicializar el proyecto con el comando:
npm init

***
2. #### Descargar Imaginator con el comando:
npm install imaginator

3. #### Enlazar script a Documento html.
` <script>jquery.imaginator.js</script>`

## Instalación
4. #### Pegar el siguiente código en el documento JS principal:

### Global (navegador)
var imaginator = require('imaginator');

5. #### Colocar las imagenes dentro de un contenedor con class "content", las imagenes deben incluir el atributo alt con alguna descripción de la imagen.

<div class="content">
<div class="imagenes">
<img src="corgi.jpg" alt="Corgi"/>
</div>
</div.


6. #### Comienza a utilizar el Plugin.

## Ejemplo

![](https://media.giphy.com/media/xThtacKxgD3QBRdMLm/giphy.gif).

## Herramientas de Producción
- JQuery ~v. 3.2.1

## Dependencias de Desarrollo
- Mocha ^ 5.0.0
- Chai ^ 4.1.2
- ESlint ~v 4.16.0
- Jsdom ^11.6.1


Autor: Teresita Cañete,
Ariella Rodríguez.
Enero,2018.
Licencia: ISC License.


```html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="path-to-cardify.js"></script>
```

## Uso

```js
// `container` es el selector del contenedor donde se buscarán todas las
// imágenes a ser procesadas.
$(container).cardify({});
```



`

## Ejemplos

...
Binary file added assets/.DS_Store
Binary file not shown.
66 changes: 66 additions & 0 deletions assets/js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
const $ = require('jquery');

$(document).ready(function() {
// Llamando plugin
$('.content').imaginator();
});

(function($) {
$.fn.imaginator = function() {
$('.content img').mouseover(function() {
let imagenFigure = $(this).attr('alt');
$(this).each(function() {
$(this).wrap('<figure></figure>');
$('figure').css({
'display': 'inline-block',
'border': '3px solid #eee',
'width': '250px',
'margin': '30px',
'z-index': '10',
});

$('content').css({
'float': 'left',
'width': '30%',
});

$(this).css({
'filter': 'brightness(0.4)',
});

$('figure').append('<figcaption>' + imagenFigure + '</figcaption>');
$('figcaption').css({
'text-align': 'center',
'font-size': '30px',
'padding': '5px 10px',
'border-radius': '2px',
'display': 'inline-block',
'background': '#000',
'color': '#fff',
'width': '91%', });
});
});

$('.content img').mouseout(function() {
$('figcaption').unwrap();
$('img').css({
'filter': 'brightness(1)',
});
$('figcaption').remove();
});
};
})($);


// Tests

const checkAlt = function() {
var alt = $('.img-item').attr('alt');
if (alt === '') {
// alert('Debe agregar atributo alt');
} else {
// alert('Atributo alt ok');
}
};

module.exports = checkAlt;
27 changes: 27 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Imaginator</title>

</head>

<body>
<!--Div contenedor de imagenes-->
<div class="content">
<div class="imagenes">
<img src="assets/images/corgi.jpg" width="250px" height="250px" alt="Raza: Corgi" />
<img src="assets/images/pastorA.jpeg" width="250px" height="250px" alt=" Raza: Pastor Alemán" />
<img src="assets/images/Labrador.jpeg" width="250px" height="250px" alt="Raza: Labrador" />
</div>
</div>
<!--Scripts-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="assets/js/index.js"></script>
</body>
</html>


Loading