Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit d0ac793
Author: Andrey Marakulin <[email protected]>
Date:   Fri Feb 10 00:01:53 2023 +0300

    Hide clock if window too small

commit 356650d
Author: Andrey Marakulin <[email protected]>
Date:   Thu Feb 9 23:33:27 2023 +0300

    aA

commit 69f709f
Author: Andrey Marakulin <[email protected]>
Date:   Thu Feb 9 23:20:39 2023 +0300

    Replace webkit style

commit 80e5f59
Author: Andrey Marakulin <[email protected]>
Date:   Thu Feb 9 22:53:48 2023 +0300

    Delete shit code

commit 3d57441
Author: Andrey Marakulin <[email protected]>
Date:   Thu Feb 9 22:47:17 2023 +0300

    try1
  • Loading branch information
annndruha committed Feb 9, 2023
1 parent 980982f commit 26592a4
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 60 deletions.
7 changes: 4 additions & 3 deletions css/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
}

.grid-item {
/*display: block;*/
overflow: hidden;
padding: 5px 10px 5px 10px;
padding: 5px calc(1vw - 4px) 5px calc(1vw - 4px);
height: 100px;
width: 200px;
transition: padding 500ms;
Expand Down Expand Up @@ -75,14 +76,14 @@
border-radius: 0.5em;
max-height: 50px;
min-height: 50px;
max-width: -webkit-fill-available;
max-width: 100%;
}


.grid-item-inside:hover .icon {
max-height: 60px;
min-height: 60px;
max-width: none;
max-width: 120%;
}

.grid-item-inside:hover .grid-item-inside-icon {
Expand Down
9 changes: 2 additions & 7 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ function setStorageAndReload(storageData, message){
chrome.storage.local.set(storageData, () => {
console.log(message)
initSettingsValues()
beautyfyView()
initClock()
compareJson()
setTimeout(loadAllIcons, 200)
Expand Down Expand Up @@ -56,7 +55,6 @@ document.addEventListener("DOMContentLoaded", () => {
chrome.storage.local.get(['rows'], function (res) {
if (varDefined(res['rows'])){
initSettingsValues()
beautyfyView()
initClock()
compareJson()
}
Expand All @@ -70,12 +68,9 @@ document.addEventListener('scroll', function () {
hideAllRightClick()
}, true)

window.addEventListener('resize', () => {
beautyfyView()
})

$('.settings').on('transitionend', () => {
beautyfyView()
window.addEventListener('resize', () => {
initClock()
})

$(document).on('keyup',function(e) {
Expand Down
34 changes: 0 additions & 34 deletions js/bookmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,42 +199,8 @@ function makeGrid(cols, rows, fromfile=false) {
}
}

beautyfyView()
updateBottomMenu(cols)
updateHeaderMenu()
gridItemRightClick()
initKeybinds()
}

function beautyfyView() {
chrome.storage.local.get(['cols', 'rows'], function (res) {
let cols = res['cols']
let app_container = document.getElementById('app-container')
let style = app_container.currentStyle || window.getComputedStyle(app_container)
let margin = style.marginRight
let windowWidth = app_container.clientWidth - parseFloat(margin)
const states = [cols * 150, cols * 130, cols * 113, cols * 92]
let key = 0
const keys = {
0: {'pb': '50px', 'pi': '10px'},
1: {'pb': '10px', 'pi': '10px'},
2: {'pb': '5px', 'pi': '5px'},
3: {'pb': '1px', 'pi': '1px'},
4: {'pb': '0px', 'pi': '1px'}
}
if (windowWidth >= states[0]) {
key = 0
} else if (states[0] >= windowWidth && windowWidth > states[1]) {
key = 1
} else if (states[1] >= windowWidth && windowWidth > states[2]) {
key = 2
} else if (states[2] >= windowWidth && windowWidth > states[3]) {
key = 3
} else if (states[3] >= windowWidth) {
key = 4
}
$('.content').css('padding-right', keys[key]['pb']).css('padding-left', keys[key]['pb'])
$('.grid-item').css('padding-right', keys[key]['pi']).css('padding-left', keys[key]['pi'])
$('.pseudo-grid-item').css('padding-right', keys[key]['pi']).css('padding-left', keys[key]['pi'])
})
}
14 changes: 10 additions & 4 deletions js/clock.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ function updateTime(){

function initClock(){
chrome.storage.local.get(['show-clock'], function (res) {
if (res['show-clock']) {
$('.clock-div').css('display', 'block')
$('.content').css('padding-top', '35px')
if (window.innerHeight > 512) {
if (res['show-clock']){
$('.clock-div').css('display', 'block')
$('.content').css('padding-top', '35px')
}
else {
$('.clock-div').css('display', 'none')
$('.content').css('padding-top', '120px')
}
} else {
$('.clock-div').css('display', 'none')
$('.content').css('padding-top', '120px')
$('.content').css('padding-top', '0')
}
updateTime()
})
Expand Down
2 changes: 1 addition & 1 deletion js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $('#store-link').on('click', function (e) {

$('#git-link').on('click', function (e) {
e.stopPropagation()
openLink('https://github.com/annndruha/PulchraBookmarks')
openLink('https://github.com/Annndruha/PulchraBookmarks')
})


Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Pulchra Bookmarks",
"description": "Pulchra Bookmarks extension",
"version": "1.0.2",
"version": "1.0.3",
"manifest_version": 3,
"minimum_chrome_version": "96",
"chrome_url_overrides": {
Expand Down
20 changes: 10 additions & 10 deletions newtab.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!--Hello there!-->
<!--You can help this project by contributing-->
<!--to this repository:-->
<!--https://github.com/annndruha/pulchra-bookmarks-->
<!--https://github.com/Annndruha/PulchraBookmarks-->
<html lang="en">
<head>
<title>Bookmarks</title>
Expand Down Expand Up @@ -176,14 +176,6 @@
</label>
</div>
</div>
<div class="row rowhover" id="reload-icons">
<div class="item-left">
<span>Reload icons</span>
</div>
<div class="item-right">
<img id="icon-reload-icons" draggable="false" class="settings-icon" src="images/icons/autorenew_black.svg" alt="">
</div>
</div>
<div class="row rowgroup">
<div class="rowgroup-title">
<span>Other</span>
Expand All @@ -192,9 +184,17 @@
<div class="row rowgroup-separator">
<div class="separator"></div>
</div>
<div class="row rowhover" id="reload-icons">
<div class="item-left">
<span>Reload icons</span>
</div>
<div class="item-right">
<img id="icon-reload-icons" draggable="false" class="settings-icon" src="images/icons/autorenew_black.svg" alt="">
</div>
</div>
<div class="row rowhover" id="report_bug">
<div class="item-left">
<span>Report a bug</span>
<span>Bug report</span>
</div>
<div class="item-right">
<img class="settings-icon" draggable="false" src="images/icons/bug_report.svg" alt="">
Expand Down

0 comments on commit 26592a4

Please sign in to comment.