Difference between revisions of "Template:Ads recomended"
m |
m |
||
Line 3: | Line 3: | ||
<body> | <body> | ||
<script> | <script> | ||
− | if (window.matchMedia | + | |
− | var d1 = document.getElementById('adsrecomended'); | + | if (window.matchMedia) { |
− | d1.insertAdjacentHTML('beforeend', '<ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-9226951475373251" data-ad-slot="3158273233"></ins>'); | + | if(window.matchMedia('(prefers-color-scheme: dark)').matches){ |
− | } | + | var d1 = document.getElementById('adsrecomended'); |
− | else { | + | d1.insertAdjacentHTML('beforeend', '<ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-9226951475373251" data-ad-slot="3158273233"></ins>'); |
− | var d1 = document.getElementById('adsrecomended'); | + | } else { |
− | d1.insertAdjacentHTML('beforeend', '<ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-9226951475373251" data-ad-slot="3159268773"></ins>'); | + | // Light |
+ | } | ||
+ | } else { | ||
+ | var d1 = document.getElementById('adsrecomended'); | ||
+ | d1.insertAdjacentHTML('beforeend', '<ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-9226951475373251" data-ad-slot="3159268773"></ins>'); | ||
} | } | ||
</script> | </script> |
Revision as of 15:39, 22 July 2021