Skip to content

Commit 1f6d635

Browse files
committed
scale the font and button sizes better
1 parent 28c2034 commit 1f6d635

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

src/content-script/update-description.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ chrome.runtime.onMessage.addListener((request) => {
33

44
// testing some stuff
55

6-
let descriptionContainer = document.querySelectorAll('div.px-5.pt-4')
6+
let descriptionContainer = document.getElementById('descriptionContainer');
7+
// remove the <pre> element from the page
78
console.log(descriptionContainer)
89
// end testing
910

src/popup/popup.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ a:hover {
127127
height: 30px;
128128
}
129129

130+
.settings-btn {
131+
width: 250px;
132+
}
133+
130134
#settings-menu {
131135
text-align: center;
132136
}

src/popup/popup.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,16 @@ async function main(): Promise<void> {
175175
fontSizeElement.style.setProperty('--dynamic-font-size', `${data.fontSize}px`);
176176

177177
if (parseInt(data.fontSize) >= 18) {
178-
let width = (parseInt(data.fontSize) * 20 + 180);
179-
document.body.style.width = `${width}px`;
178+
let width = (parseInt(data.fontSize) * 24 + 200);
179+
document.body.style.width = `${width + 20}px`;
180180
fixCodeContainer.style.maxWidth = `${width}px`;
181181
analyzeCodeResponse.style.maxWidth = `${width}px`;
182182
}
183+
184+
let sizes = document.getElementsByClassName('material-button');
185+
for (let i = 0; i < sizes.length; i++) {
186+
(sizes[i] as HTMLElement).style.width = `${data.fontSize * 13}px`;
187+
}
183188
}
184189
});
185190

src/popup/settings.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ <h2 class="title">Settings</h2>
1414
<image src="../assets/images/home-icon.png" alt="Home" />
1515
</a>
1616
</div>
17-
<label for="font-size-select">Font Size</label>
18-
<select name="fontSize" id="font-size-select" class="material-button select">
17+
<label for="font-size-select">Display Size</label>
18+
<select name="fontSize" id="font-size-select" class="material-button select settings-btn">
1919
<option value="12">Extra Small (XS)</option>
2020
<option value="14">Small (S)</option>
2121
<option value="16">Medium (M)</option>
2222
<option value="18">Large (L)</option>
2323
<option value="22">Extra Large (XL)</option>
2424
</select>
25-
<button id="hide-tags-btn" class="material-button">
25+
<button id="hide-tags-btn" class="material-button settings-btn">
2626
<span id="toggle-show-tags-text"> </span> Show Company Tags
2727
</button>
2828
</body>

0 commit comments

Comments
 (0)