==============
Web Component wrapper for Google Adsense code using Polymer.
Maintained by Kessiler Rodrigues.
Install the component using Bower:
$ bower install google-adsense --save
Or download as ZIP.
-
Import Web Components' polyfill:
<script src="bower_components/platform/platform.js"></script>
-
Import Google Adsense custom element:
<link rel="import" href="bower_components/google-adsense/dist/google-adsense.html">
-
Start using it!
<google-adsense></google-adsense>
Attribute | 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. |
To make the ad responsive, you must create media queries for the class "ads-responsive".
-
Example
@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; } }
In order to run it locally you'll need to fetch some dependencies and a basic server setup.
-
$ [sudo] npm install -g bower grunt-cli
-
Install local dependencies:
$ bower install && npm install
-
To test your project, start the development server and open
http://localhost:8000
.$ grunt server
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request