forked from soundio/soundstage
-
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.
Moves soundstage-player to elements/
- Loading branch information
Showing
9 changed files
with
98 additions
and
99 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,2 @@ | ||
|
||
export { default } from './soundstage-player/module.js'; |
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 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
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,28 @@ | ||
body { | ||
padding: 0 0 2.5rem 0; | ||
} | ||
|
||
.console-pre { | ||
padding: 0 1.25rem 0 1.25rem; | ||
border-left: 2px solid #dddddd; | ||
} | ||
|
||
.result-pre { | ||
position: fixed; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
margin: 0; | ||
padding: 1.25rem; | ||
box-shadow: 0 0 20px rgba(10, 0, 20, 0.125) | ||
} | ||
|
||
.pass-result-pre { | ||
color: black; | ||
background-color: greenyellow; | ||
} | ||
|
||
.fail-result-pre { | ||
color: white; | ||
background-color: orangered; | ||
} |
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,53 @@ | ||
|
||
// Console | ||
|
||
const consolePre = document.getElementById('console'); | ||
const log = window.console.log; | ||
const trace = window.console.trace; | ||
|
||
let n = 0; | ||
|
||
function stripCSS(output, string) { | ||
// If this is a CSS string, ignore | ||
if (n) { | ||
--n; | ||
return output; | ||
} | ||
|
||
// Count CSS strings that will appear as next arguments | ||
const text = string | ||
.replace(/%c/g, () => (++n, '')) | ||
.replace(/%s/, ''); | ||
|
||
output.push(text); | ||
return output; | ||
} | ||
/* | ||
window.console.log = function() { | ||
log.apply(this, arguments); | ||
const strings = Array.from(arguments).reduce(stripCSS, []); | ||
consolePre.append(strings.join('') + '\n'); | ||
}; | ||
window.console.trace = function() { | ||
trace.apply(this, arguments); | ||
const strings = Array.from(arguments).reduce(stripCSS, []); | ||
consolePre.append(strings.join('') + '\n'); | ||
}; | ||
*/ | ||
|
||
// Result | ||
|
||
const resultPre = document.getElementById('result'); | ||
|
||
export function fail(message) { | ||
resultPre.classList.add('fail-result-pre'); | ||
resultPre.innerHTML = 'FAIL' + (message ? '\n\n' + message : ''); | ||
resultPre.hidden = false; | ||
} | ||
|
||
export function pass() { | ||
resultPre.classList.add('pass-result-pre'); | ||
resultPre.innerHTML = 'PASS'; | ||
resultPre.hidden = false; | ||
} |