mirror of
https://github.com/jcreek/EstimationPoker.git
synced 2026-07-15 12:03:46 +00:00
fix(*): Fix google ad styling
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import { onMount } from 'svelte';
|
import { onMount, tick } from 'svelte';
|
||||||
|
|
||||||
export let closeModal;
|
export let closeModal;
|
||||||
export let joinRoom;
|
export let joinRoom;
|
||||||
@@ -29,11 +29,28 @@
|
|||||||
rememberName = event.target.checked;
|
rememberName = event.target.checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
let adContainer;
|
||||||
if (typeof window !== 'undefined' && window.adsbygoogle) {
|
let adPushed = false;
|
||||||
window.adsbygoogle = window.adsbygoogle || [];
|
|
||||||
window.adsbygoogle.push({});
|
function tryPushAd() {
|
||||||
}
|
if (adPushed || !adContainer) return;
|
||||||
|
if (adContainer.offsetWidth === 0) return;
|
||||||
|
if (typeof window === 'undefined' || !window.adsbygoogle) return;
|
||||||
|
window.adsbygoogle = window.adsbygoogle || [];
|
||||||
|
window.adsbygoogle.push({});
|
||||||
|
adPushed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
onMount(async () => {
|
||||||
|
await tick();
|
||||||
|
tryPushAd();
|
||||||
|
if (adPushed || typeof ResizeObserver === 'undefined') return;
|
||||||
|
const observer = new ResizeObserver(() => {
|
||||||
|
tryPushAd();
|
||||||
|
if (adPushed) observer.disconnect();
|
||||||
|
});
|
||||||
|
observer.observe(adContainer);
|
||||||
|
return () => observer.disconnect();
|
||||||
});
|
});
|
||||||
|
|
||||||
$: userName = typeof localStorage !== 'undefined' ? localStorage.getItem('userName') || '' : '';
|
$: userName = typeof localStorage !== 'undefined' ? localStorage.getItem('userName') || '' : '';
|
||||||
@@ -67,7 +84,9 @@
|
|||||||
<button on:click={handleSubmit}>Save</button>
|
<button on:click={handleSubmit}>Save</button>
|
||||||
</div>
|
</div>
|
||||||
<!-- Name Entry - Square Ad -->
|
<!-- Name Entry - Square Ad -->
|
||||||
<ins class="adsbygoogle"
|
<ins
|
||||||
|
bind:this={adContainer}
|
||||||
|
class="adsbygoogle"
|
||||||
style="display:block"
|
style="display:block"
|
||||||
data-ad-client="ca-pub-5812114745839139"
|
data-ad-client="ca-pub-5812114745839139"
|
||||||
data-ad-slot="5531796845"
|
data-ad-slot="5531796845"
|
||||||
@@ -105,6 +124,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
|
||||||
|
width: min(90vw, 22rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-container {
|
.input-container {
|
||||||
@@ -147,6 +167,11 @@
|
|||||||
background-color: #005f8a;
|
background-color: #005f8a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.adsbygoogle {
|
||||||
|
align-self: stretch;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
|
|||||||
Reference in New Issue
Block a user