-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.js
88 lines (88 loc) · 2.42 KB
/
popup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// // ----- USER INPUT
//
// const routes = [
// {
// id: 1,
// routeName: 'pageOne',
// routeHTML: '<h1>HELLO WORLD</h1>',
// routeStyle: '.test123 { background: aqua}',
// },
// {
// id: 2,
// routeName: 'pageTwo',
// routeHTML: '<h1>HELLO WORLD 2</h1>',
// routeStyle: '.test123 { background: aqua}',
// routeNotes: '#Hello World',
// }
// ];
//
// // ---- PROGRESS BAR
//
// class Timer extends HTMLElement {
//
// constructor() {
// super();
//
// this.setAttribute('id', 'timer');
//
// const shadow = this.attachShadow({mode: 'open'});
//
// this.button = document.createElement('button');
// this.button.setAttribute('id', 'timerButton');
// this.button.setAttribute('clock', 'stop');
// this.button.addEventListener('click', () => {
// this.toggleButton();
// this.toggleTimer();
// });
//
// this.timer = document.createElement('h1');
// this.timer.setAttribute('id', 'timerClock');
//
// const style = document.createElement('style');
// style.textContent =
// `
// :host {
// width: 100vw;
// }
// #progress {
// background: red;
// height: 1rem;
// max-width: 0%;
// }
// `;
// shadow.appendChild(style);
// shadow.appendChild(this.button);
// shadow.appendChild(this.timer);
// }
//
// toggleButton() {
// if(this.button.getAttribute('clock') === 'stop') {
// this.button.setAttribute('clock', 'start');
// }
// if(this.button.getAttribute('clock') === 'start') {
// this.button.setAttribute('clock', 'stop');
// }
// }
//
// toggleTimer() {
// if(this.button.getAttribute('clock') === 'stop') {
// this.resetTimer();
// }
// if(this.button.getAttribute('clock') === 'start') {
// this.startTimer();
// }
// }
//
// resetTimer() {
// this.timer.textContent = '';
// }
//
// startTimer() {
// this.timer.textContent = 'START';
// }
// }
//
// customElements.define('timer', Timer, {extends: 'div'});
// const timerElement = document.createElement('div', { is: 'timer'});
// appShell.insertAdjacentElement("afterend", timerElement);
//