Шаблон:Ads recomended — различия между версиями
Alexander (обсуждение | вклад) м |
Alexander (обсуждение | вклад) м |
||
| (не показано 11 промежуточных версий этого же участника) | |||
| Строка 2: | Строка 2: | ||
<html> | <html> | ||
<body> | <body> | ||
| − | <div class="adsrecomended" | + | <div class="adsrecomended" id="adsrecomended"> |
| − | |||
| − | |||
| − | |||
| − | |||
| − | > | ||
<script> | <script> | ||
| − | document.getElementById(' | + | if (window.matchMedia) { |
| + | if(window.matchMedia('(prefers-color-scheme: dark)').matches){ | ||
| + | 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="3158273233"></ins>'); | ||
| + | } 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>'); | ||
| + | } | ||
| + | } 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> | ||
| − | |||
<script> | <script> | ||
| − | (adsbygoogle = window. | + | (adsbygoogle = window.adsbygoogle || []).push({}); |
</script> | </script> | ||
</div> | </div> | ||
Текущая версия на 15:18, 16 августа 2022