https://github.com/kessiler/google-adsense
Web Component wrapper for Google Adsense code using Polymer
https://github.com/kessiler/google-adsense
google-adsense javascript polymer
Last synced: about 2 months ago
JSON representation
Web Component wrapper for Google Adsense code using Polymer
- Host: GitHub
- URL: https://github.com/kessiler/google-adsense
- Owner: kessiler
- Created: 2014-07-02T04:19:40.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-08-10T02:27:20.000Z (almost 11 years ago)
- Last Synced: 2024-11-10T20:11:59.263Z (7 months ago)
- Topics: google-adsense, javascript, polymer
- Language: JavaScript
- Size: 539 KB
- Stars: 13
- Watchers: 4
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# <google-adsense>
==============Web Component wrapper for Google Adsense code using [Polymer](http://polymer-project.org).
> Maintained by [Kessiler Rodrigues](https://github.com/kessiler).## Demo
[Check it live!](http://kessiler.github.io/google-adsense)
## Install
Install the component using [Bower](http://bower.io/):
```sh
$ bower install google-adsense --save
```Or [download as ZIP](https://github.com/kessiler/google-adsense/archive/master.zip).
## Usage
1. Import Web Components' polyfill:
```html
```2. Import Google Adsense custom element:
```html
```3. Start using it!
```html
```
## OptionsAttribute | Options | Default | Description
--- | --- | --- | ---
`client` | *int* | `8949501714982201` | your id from ad.
`slot` | *int* | `2732884579` | number of slot ad.
`width` | *int* | `728` | width size of ad.
`height` | *int* | `90` | height size of ad.## Responsive
To make the ad responsive, you must create media queries for the class "ads-responsive".
* Example
```sh
@media(min-width: 320px) { .ads-responsive { width: 300px; height: 250px; } }
@media(min-width: 500px) { .ads-responsive { width: 468px; height: 60px; } }
@media(min-width: 800px) { .ads-responsive { width: 728px; height: 90px; } }
```## Development
In order to run it locally you'll need to fetch some dependencies and a basic server setup.
* Install [Bower](http://bower.io/) & [Grunt](http://gruntjs.com/):
```sh
$ [sudo] npm install -g bower grunt-cli
```* Install local dependencies:
```sh
$ bower install && npm install
```* To test your project, start the development server and open `http://localhost:8000`.
```sh
$ grunt server
```## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -m 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request## License
[MIT License](http://opensource.org/licenses/MIT)