-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08e4ec8
commit a04c488
Showing
12 changed files
with
82 additions
and
88 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,5 @@ | ||
# TODO | ||
|
||
- IMPORTANT: add feature to set the lang and long of weather widget | ||
|
||
- add simple adding from custom widgets | ||
|
||
- add random notes widget | ||
|
||
|
||
- add function to save label in index.js file | ||
|
||
- clean up configureWidgets.js file | ||
- add vanilla toast lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { addWidget } from "../configureWidgets.js"; | ||
|
||
const addButton = document.getElementById("addWidgetButton"); | ||
const menu = document.querySelector(".widgetButtonsMenu"); | ||
|
||
addButton.addEventListener("click", function () { | ||
if (menu.style.display === "none" || menu.style.display === "") { | ||
menu.style.display = "block"; | ||
} else { | ||
menu.style.display = "none"; | ||
} | ||
}); | ||
|
||
document.addEventListener("click", function (event) { | ||
if (!menu.contains(event.target) && event.target !== addButton) { | ||
menu.style.display = "none"; | ||
} else if (menu.contains(event.target) && event.target !== addButton) { | ||
menu.style.display = "none"; | ||
addWidget(event.target.getAttribute("data-widgetType")); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { widgets } from "./configureWidgets.js"; | ||
|
||
export function rePosWidgets(){ | ||
let width = window.innerWidth | ||
let height = window.innerHeight | ||
for (let w of widgets) { | ||
const anchorX = w.data.anchorX; | ||
const anchorY = w.data.anchorY; | ||
let newXPos; | ||
let newYPos; | ||
|
||
// rePos x | ||
if (anchorX[0] == "right") { | ||
newXPos = width - parseInt(w.uniqueWidgetData.width) - parseInt(anchorX[1]); | ||
} else if (anchorX[0] == "left") { | ||
newXPos = parseInt(anchorX[1]); | ||
} | ||
|
||
// rePos y | ||
if (anchorY[0] == "bottom") { | ||
newYPos = height - parseInt(w.uniqueWidgetData.height) - parseInt(anchorY[1]); | ||
} else if (anchorY[0] == "top") { | ||
newYPos = parseInt(anchorY[1]); | ||
} | ||
|
||
|
||
w.data.xPos = newXPos + "px"; | ||
w.data.yPos = newYPos + "px"; | ||
w.updatePos(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { widgets } from "./configureWidgets.js"; | ||
|
||
window.electronAPI.onSavePage(() => { | ||
for (let w of widgets) { | ||
w.saveData(); | ||
} | ||
}); | ||
|
||
addEventListener("beforeunload", (event) => { | ||
for (let w of widgets) { | ||
w.saveData(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters