fix buttons overlapping inserted text in reader in bottom mode

This commit is contained in:
wareya committed 2019-08-15 12:53:08 -04:00
1 parent be8db8083e
commit 5c6a0ffe17
2 files changed
+25 -4

No files matched your search

+9 -3
View File
@@ -50,7 +50,6 @@ button
position: fixed; position: fixed;
right: 5px; right: 5px;
height: 2em; height: 2em;
bottom: calc( 10px + 2em );
} }
#button_delete #button_delete
{ {
@@ -58,14 +57,21 @@ button
position: fixed; position: fixed;
right: 5px; right: 5px;
height: 2em; height: 2em;
bottom: 5px;
} }
</style> </style>
<style id=new_color_style> <style id=new_style>
body > p:nth-of-type(1) body > p:nth-of-type(1)
{ {
color: #CCCCCC; color: #CCCCCC;
} }
#button_delete
{
bottom: 5px;
}
#button_pause
{
bottom: calc( 10px + 2em );
}
</style> </style>
<script src="include/browser-polyfill.min.js" charset="UTF-8"></script> <script src="include/browser-polyfill.min.js" charset="UTF-8"></script>
<script src="reader.js" charset="UTF-8"></script> <script src="reader.js" charset="UTF-8"></script>
+16 -1
View File
@@ -31,12 +31,27 @@ function update_styles()
target.marginLeft = reader_settings.reader_margin; target.marginLeft = reader_settings.reader_margin;
target.marginRight = reader_settings.reader_margin; target.marginRight = reader_settings.reader_margin;
target.fontFamily = reader_settings.reader_font; target.fontFamily = reader_settings.reader_font;
let target2 = document.querySelector("#new_color_style"); let target2 = document.querySelector("#new_style");
let elements = document.body.getElementsByTagName("p"); let elements = document.body.getElementsByTagName("p");
let which = String(reader_settings.reader_reverse ? elements.length : 1); let which = String(reader_settings.reader_reverse ? elements.length : 1);
let delete_css = "bottom: 5px";
let pause_css = "bottom: calc( 10px + 2em )";
if(reader_settings.reader_reverse)
{
delete_css = "top: 5px";
pause_css = "top: calc( 10px + 2em )";
}
target2.textContent = `body > p:nth-of-type(${which}) target2.textContent = `body > p:nth-of-type(${which})
{ {
color: ${reader_settings.reader_fg}; color: ${reader_settings.reader_fg};
}
#button_delete
{
${delete_css};
}
#button_pause
{
${pause_css};
}`; }`;
console.log("attempted to update styles"); console.log("attempted to update styles");
console.log(target2.textContent); console.log(target2.textContent);