-
-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 Browser Console when ENVIRONMENT.flags.debug is set
- Loading branch information
1 parent
63ad480
commit c9513e5
Showing
8 changed files
with
152 additions
and
34 deletions.
There are no files selected for viewing
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,49 @@ | ||
|
||
browser-console { | ||
position: fixed; | ||
top: auto; | ||
right: auto; | ||
bottom: 0px; | ||
left: 0px; | ||
z-index: 2049; | ||
} | ||
|
||
browser-console button { | ||
display: inline-block; | ||
min-width: 32px; | ||
margin: 0px; | ||
padding: 0px; | ||
line-height: 32px; | ||
height: 32px; | ||
color: var(--element-default-color); | ||
font-size: 24px; | ||
text-align: center; | ||
background: var(--layout-default-background); | ||
border: 1px solid transparent; | ||
border-radius: 4px; | ||
box-sizing: border-box; | ||
transition: 200ms all ease-out; | ||
vertical-align: middle; | ||
user-select: none; | ||
appearance: none; | ||
-moz-appearance: none; | ||
-webkit-appearance: none; | ||
outline: none; | ||
cursor: pointer; | ||
} | ||
|
||
browser-console button:hover, | ||
browser-console button.active { | ||
color: var(--element-active-color); | ||
} | ||
|
||
browser-console button:before { | ||
display: inline-block; | ||
width: 100%; | ||
font-family: 'icon'; | ||
text-align: center; | ||
speak: none; | ||
-webkit-font-smoothing: antialiased; | ||
content: '\e1b0'; | ||
} | ||
|
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,56 @@ | ||
|
||
import { Element } from '../../design/index.mjs'; | ||
|
||
|
||
|
||
const Console = function(/* browser, widgets */) { | ||
|
||
this.button = Element.from('button'); | ||
this.element = Element.from('browser-console'); | ||
this.console = null; | ||
|
||
let console = window.document.querySelector('base-console'); | ||
if (console !== null) { | ||
this.console = Element.from(console); | ||
} | ||
|
||
|
||
this.button.on('click', () => { | ||
|
||
if (this.console !== null) { | ||
|
||
if (this.console.state() === 'active') { | ||
|
||
this.console.state(''); | ||
this.button.state(''); | ||
|
||
} else { | ||
|
||
this.console.state('active'); | ||
this.button.state('active'); | ||
|
||
} | ||
|
||
} | ||
|
||
}); | ||
|
||
this.button.render(this.element); | ||
|
||
}; | ||
|
||
|
||
Console.prototype = { | ||
|
||
erase: function(target) { | ||
this.element.erase(target); | ||
}, | ||
|
||
render: function(target) { | ||
this.element.render(target); | ||
} | ||
|
||
}; | ||
|
||
export { Console }; | ||
|
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