Skip to content

Commit 3f50e11

Browse files
fixing spacing
1 parent 69028e9 commit 3f50e11

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

resize-observer/resize-observer-border-radius.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@
2626
<div>
2727
</div>
2828
<script>
29-
const resizeObserver = new ResizeObserver(entries => {
30-
for (let entry of entries) {
31-
entry.target.style.borderRadius = Math.min(100, (entry.contentRect.width/10) +
32-
(entry.contentRect.height/10)) + 'px';
33-
}
34-
});
35-
36-
resizeObserver.observe(document.querySelector('div'));
29+
const resizeObserver = new ResizeObserver(entries => {
30+
for (let entry of entries) {
31+
entry.target.style.borderRadius = Math.min(100, (entry.contentRect.width/10) +
32+
(entry.contentRect.height/10)) + 'px';
33+
}
34+
});
3735

36+
resizeObserver.observe(document.querySelector('div'));
3837
</script>
3938
</body>
4039
</html>

resize-observer/resize-observer-text.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ <h1>So what happened?</h1>
4040
<p>And remember, don't do anything that affects anything, unless it turns out you were supposed to, in which case, for the love of God, don't not do it! Ow, my spirit! I don't want to be rescued. You guys aren't Santa! You're not even robots. I've got to find a way to escape the horrible ravages of youth. Suddenly, I'm going to the bathroom like clockwork, every three hours. And those jerks at Social Security stopped sending me checks. Now 'I' have to pay 'them'!</p>
4141
</div>
4242
<script>
43-
if(ResizeObserver) {
44-
const h1Elem = document.querySelector('h1');
45-
const pElem = document.querySelector('p');
43+
if(ResizeObserver) {
44+
const h1Elem = document.querySelector('h1');
45+
const pElem = document.querySelector('p');
4646

47-
const resizeObserver = new ResizeObserver(entries => {
48-
for (let entry of entries) {
49-
h1Elem.style.fontSize = Math.max(2, entry.contentRect.width/200) + 'rem';
50-
pElem.style.fontSize = Math.max(1.2, entry.contentRect.width/600) + 'rem';
51-
}
52-
});
47+
const resizeObserver = new ResizeObserver(entries => {
48+
for (let entry of entries) {
49+
h1Elem.style.fontSize = Math.max(2, entry.contentRect.width/200) + 'rem';
50+
pElem.style.fontSize = Math.max(1.2, entry.contentRect.width/600) + 'rem';
51+
}
52+
});
5353

54-
resizeObserver.observe(document.querySelector('div'));
55-
}
54+
resizeObserver.observe(document.querySelector('div'));
55+
}
5656
</script>
5757
</body>
5858
</html>

0 commit comments

Comments
 (0)