Initial commit
This commit is contained in:
commit
74f1a0f742
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
node_modules/
|
||||
public/
|
||||
21
package.json
Normal file
21
package.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "achord",
|
||||
"version": "0.1.0",
|
||||
"description": "",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
"start": "node ./src/index",
|
||||
"dev": "NODE_ENV=development DEBUG=koa* node ./src/index",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@koa/router": "^10.0.0",
|
||||
"koa": "^2.13.1",
|
||||
"koa-static-server": "^1.5.2",
|
||||
"koa-views": "^7.0.1",
|
||||
"pug": "^3.0.2",
|
||||
"simplechordpro": "^1.0.1"
|
||||
}
|
||||
}
|
||||
136
src/cp.js
Normal file
136
src/cp.js
Normal file
@ -0,0 +1,136 @@
|
||||
const { createCP, parseCP, transpose, keys } = require('simplechordpro')
|
||||
|
||||
exports.process = (input) => {
|
||||
const data = {
|
||||
metadata: {
|
||||
title: '',
|
||||
artist: '',
|
||||
tempo: ''
|
||||
},
|
||||
raw: input,
|
||||
stripped: [],
|
||||
formatted: ''
|
||||
}
|
||||
|
||||
const lines = data.raw.split('\n')
|
||||
lines.forEach(line => {
|
||||
let re, match
|
||||
|
||||
// Title
|
||||
re = /\{title\: (.*)\}/
|
||||
if (re.test(line)) {
|
||||
data.metadata.title = line.match(re)[1]
|
||||
return
|
||||
}
|
||||
|
||||
// Artist
|
||||
re = /\{artist\: (.*)\}/
|
||||
if (re.test(line)) {
|
||||
data.metadata.artist = line.match(re)[1]
|
||||
return
|
||||
}
|
||||
|
||||
// Tempo
|
||||
re = /\{tempo\: (.*)\}/
|
||||
if (re.test(line)) {
|
||||
data.metadata.tempo = line.match(re)[1]
|
||||
return
|
||||
}
|
||||
|
||||
// Intro
|
||||
re = /\{start_of_intro\}/
|
||||
if (re.test(line)) {
|
||||
data.stripped.push('<span class="section">intro</span>')
|
||||
return
|
||||
}
|
||||
re = /\{end_of_intro\}/
|
||||
if (re.test(line)) {
|
||||
return
|
||||
}
|
||||
|
||||
// Chorus
|
||||
re = /\{start_of_chorus\}/
|
||||
if (re.test(line)) {
|
||||
data.stripped.push('<span class="section">chorus</span>')
|
||||
return
|
||||
}
|
||||
re = /\{end_of_chorus\}/
|
||||
if (re.test(line)) {
|
||||
return
|
||||
}
|
||||
|
||||
// Verse
|
||||
re = /\{start_of_verse\}/
|
||||
if (re.test(line)) {
|
||||
data.stripped.push('<span class="section">verse</span>')
|
||||
return
|
||||
}
|
||||
re = /\{end_of_verse\}/
|
||||
if (re.test(line)) {
|
||||
return
|
||||
}
|
||||
|
||||
// Bridge
|
||||
re = /\{start_of_bridge\}/
|
||||
if (re.test(line)) {
|
||||
data.stripped.push('<span class="section">bridge</span>')
|
||||
return
|
||||
}
|
||||
re = /\{end_of_bridge\}/
|
||||
if (re.test(line)) {
|
||||
return
|
||||
}
|
||||
|
||||
// Instrumental
|
||||
re = /\{start_of_instrumental\}/
|
||||
if (re.test(line)) {
|
||||
data.stripped.push('<span class="section">instrumental</span>')
|
||||
return
|
||||
}
|
||||
re = /\{end_of_instrumental\}/
|
||||
if (re.test(line)) {
|
||||
return
|
||||
}
|
||||
|
||||
// Outro
|
||||
re = /\{start_of_outro\}/
|
||||
if (re.test(line)) {
|
||||
data.stripped.push('<span class="section">outro</span>')
|
||||
return
|
||||
}
|
||||
re = /\{end_of_outro\}/
|
||||
if (re.test(line)) {
|
||||
return
|
||||
}
|
||||
|
||||
// Other
|
||||
re = /\{.*\}/
|
||||
if (re.test(line)) {
|
||||
return
|
||||
}
|
||||
re = /\{end_of_outro\}/
|
||||
if (re.test(line)) {
|
||||
return
|
||||
}
|
||||
|
||||
// Otherwise
|
||||
data.stripped.push(line)
|
||||
})
|
||||
|
||||
data.stripped = data.stripped.join('\n')
|
||||
data.formatted = parseCP(data.stripped)
|
||||
|
||||
let linesFormatted = data.formatted.split('\n')
|
||||
linesFormatted = linesFormatted.map(line => {
|
||||
// Chords
|
||||
re = /^[\sA-GMmbsaugdim12345679\#\/\.\,]+$/
|
||||
if (re.test(line)) {
|
||||
line = `<span class="chords">${line}</span>`
|
||||
}
|
||||
|
||||
return line
|
||||
})
|
||||
data.formatted = linesFormatted.join('\n')
|
||||
|
||||
return data
|
||||
}
|
||||
67
src/index.js
Normal file
67
src/index.js
Normal file
@ -0,0 +1,67 @@
|
||||
const Koa = require('koa')
|
||||
const Router = require('@koa/router')
|
||||
const views = require('koa-views')
|
||||
const serve = require('koa-static-server')
|
||||
|
||||
const app = new Koa()
|
||||
const router = new Router()
|
||||
const render = views(__dirname + '/../views', {
|
||||
map: {
|
||||
html: 'pug'
|
||||
}
|
||||
})
|
||||
|
||||
const cp = require('./cp')
|
||||
const utils = require('./utils')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
router
|
||||
.get('/(.*)', async (ctx, next) => {
|
||||
const pathDecoded = decodeURI(ctx.path)
|
||||
const localPath = path.join('public', pathDecoded)
|
||||
|
||||
if (fs.existsSync(localPath) && fs.lstatSync(localPath).isDirectory()) {
|
||||
await ctx.render('dir.pug', {
|
||||
title: pathDecoded,
|
||||
directories: utils.getDirectories('./public', pathDecoded),
|
||||
files: utils.getFiles('./public', pathDecoded),
|
||||
currentPath: pathDecoded,
|
||||
parentDir: path.resolve(pathDecoded, '..')
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (fs.existsSync(localPath) && fs.lstatSync(localPath).isFile()) {
|
||||
switch (path.extname(localPath)) {
|
||||
case '.txt':
|
||||
const text = await fs.readFileSync(localPath, 'utf8')
|
||||
data = cp.process(text)
|
||||
|
||||
await ctx.render('file.pug', {
|
||||
title: data.metadata.title,
|
||||
currentPath: pathDecoded,
|
||||
data: data
|
||||
})
|
||||
break;
|
||||
|
||||
case '.mp3':
|
||||
case '.wav':
|
||||
await ctx.render('audio.pug', {
|
||||
audioFilename: path.basename(localPath),
|
||||
audioFilepath: localPath.replace(/^public\//, '/raw/'),
|
||||
})
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
app
|
||||
.use(serve({rootDir: 'static', rootPath: '/static'}))
|
||||
.use(serve({rootDir: 'public', rootPath: '/raw'}))
|
||||
.use(render)
|
||||
.use(router.routes())
|
||||
.use(router.allowedMethods())
|
||||
.listen(3000)
|
||||
24
src/utils.js
Normal file
24
src/utils.js
Normal file
@ -0,0 +1,24 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
exports.getDirectories = (source, subdir) => {
|
||||
return fs.readdirSync(path.join(source, subdir), { withFileTypes: true })
|
||||
.filter(dirent => dirent.isDirectory())
|
||||
.map(dirent => {
|
||||
return {
|
||||
name: dirent.name,
|
||||
link: encodeURI(path.join(subdir, dirent.name))
|
||||
}
|
||||
})
|
||||
}
|
||||
exports.getFiles = (source, subdir) => {
|
||||
return fs.readdirSync(path.join(source, subdir), { withFileTypes: true })
|
||||
.filter(dirent => dirent.isFile())
|
||||
.map(dirent => {
|
||||
return {
|
||||
name: dirent.name,
|
||||
extension: path.extname(dirent.name),
|
||||
link: encodeURI(path.join(subdir, dirent.name))
|
||||
}
|
||||
})
|
||||
}
|
||||
BIN
static/fonts/IBMPlexMono-Bold.ttf
Normal file
BIN
static/fonts/IBMPlexMono-Bold.ttf
Normal file
Binary file not shown.
BIN
static/fonts/IBMPlexMono-BoldItalic.ttf
Normal file
BIN
static/fonts/IBMPlexMono-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
static/fonts/IBMPlexMono-ExtraLight.ttf
Normal file
BIN
static/fonts/IBMPlexMono-ExtraLight.ttf
Normal file
Binary file not shown.
BIN
static/fonts/IBMPlexMono-ExtraLightItalic.ttf
Normal file
BIN
static/fonts/IBMPlexMono-ExtraLightItalic.ttf
Normal file
Binary file not shown.
BIN
static/fonts/IBMPlexMono-Italic.ttf
Normal file
BIN
static/fonts/IBMPlexMono-Italic.ttf
Normal file
Binary file not shown.
BIN
static/fonts/IBMPlexMono-Light.ttf
Normal file
BIN
static/fonts/IBMPlexMono-Light.ttf
Normal file
Binary file not shown.
BIN
static/fonts/IBMPlexMono-LightItalic.ttf
Normal file
BIN
static/fonts/IBMPlexMono-LightItalic.ttf
Normal file
Binary file not shown.
BIN
static/fonts/IBMPlexMono-Medium.ttf
Normal file
BIN
static/fonts/IBMPlexMono-Medium.ttf
Normal file
Binary file not shown.
BIN
static/fonts/IBMPlexMono-MediumItalic.ttf
Normal file
BIN
static/fonts/IBMPlexMono-MediumItalic.ttf
Normal file
Binary file not shown.
BIN
static/fonts/IBMPlexMono-Regular.ttf
Normal file
BIN
static/fonts/IBMPlexMono-Regular.ttf
Normal file
Binary file not shown.
BIN
static/fonts/IBMPlexMono-SemiBold.ttf
Normal file
BIN
static/fonts/IBMPlexMono-SemiBold.ttf
Normal file
Binary file not shown.
BIN
static/fonts/IBMPlexMono-SemiBoldItalic.ttf
Normal file
BIN
static/fonts/IBMPlexMono-SemiBoldItalic.ttf
Normal file
Binary file not shown.
BIN
static/fonts/IBMPlexMono-Thin.ttf
Normal file
BIN
static/fonts/IBMPlexMono-Thin.ttf
Normal file
Binary file not shown.
BIN
static/fonts/IBMPlexMono-ThinItalic.ttf
Normal file
BIN
static/fonts/IBMPlexMono-ThinItalic.ttf
Normal file
Binary file not shown.
93
static/fonts/OFL.txt
Normal file
93
static/fonts/OFL.txt
Normal file
@ -0,0 +1,93 @@
|
||||
Copyright © 2017 IBM Corp. with Reserved Font Name "Plex"
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
2573
static/fork-awesome/css/fork-awesome.css
Normal file
2573
static/fork-awesome/css/fork-awesome.css
Normal file
File diff suppressed because it is too large
Load Diff
12
static/fork-awesome/css/fork-awesome.min.css
vendored
Normal file
12
static/fork-awesome/css/fork-awesome.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
static/fork-awesome/css/fork-awesome.min.css.map
Normal file
1
static/fork-awesome/css/fork-awesome.min.css.map
Normal file
File diff suppressed because one or more lines are too long
446
static/fork-awesome/css/v5-compat.css
Normal file
446
static/fork-awesome/css/v5-compat.css
Normal file
@ -0,0 +1,446 @@
|
||||
/*!
|
||||
Fork Awesome 1.1.7
|
||||
License - https://forkaweso.me/Fork-Awesome/license
|
||||
|
||||
Copyright 2018 Dave Gandy & Fork Awesome
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
.fas,
|
||||
.fab,
|
||||
.far {
|
||||
display: inline-block;
|
||||
font: normal normal normal 14px/1 ForkAwesome;
|
||||
font-size: inherit;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
.fas.fa-chart-area:before {
|
||||
content: "\f1fe";
|
||||
}
|
||||
.fas.fa-arrows-alt:before {
|
||||
content: "\f047";
|
||||
}
|
||||
.fas.fa-expand-arrows-alt:before {
|
||||
content: "\f0b2";
|
||||
}
|
||||
.fas.fa-arrows-alt-h:before {
|
||||
content: "\f07e";
|
||||
}
|
||||
.fas.fa-arrows-alt-v:before {
|
||||
content: "\f07d";
|
||||
}
|
||||
.fas.fa-calendar-alt:before {
|
||||
content: "\f073";
|
||||
}
|
||||
.fas.fa-circle-notch:before {
|
||||
content: "\f1ce";
|
||||
}
|
||||
.fas.fa-cloud-download-alt:before {
|
||||
content: "\f0ed";
|
||||
}
|
||||
.fas.fa-cloud-upload-alt:before {
|
||||
content: "\f0ee";
|
||||
}
|
||||
.fas.fa-credit-card:before {
|
||||
content: "\f283";
|
||||
}
|
||||
.fas.fa-dollar-sign:before {
|
||||
content: "\f155";
|
||||
}
|
||||
.fas.fa-euro-sign:before {
|
||||
content: "\f153";
|
||||
}
|
||||
.fas.fa-exchange-alt:before {
|
||||
content: "\f0ec";
|
||||
}
|
||||
.fas.fa-external-link-alt:before {
|
||||
content: "\f08e";
|
||||
}
|
||||
.fas.fa-external-link-square-alt:before {
|
||||
content: "\f14c";
|
||||
}
|
||||
.fas.fa-eye-dropper:before {
|
||||
content: "\f1fb";
|
||||
}
|
||||
.fas.fa-pound-sign:before {
|
||||
content: "\f154";
|
||||
}
|
||||
.fas.fa-glass-martini:before {
|
||||
content: "\f000";
|
||||
}
|
||||
.fas.fa-shekel-sign:before {
|
||||
content: "\f20b";
|
||||
}
|
||||
.fas.fa-rupee-sign:before {
|
||||
content: "\f156";
|
||||
}
|
||||
.fas.fa-won-sign:before {
|
||||
content: "\f159";
|
||||
}
|
||||
.fas.fa-level-down-alt:before {
|
||||
content: "\f149";
|
||||
}
|
||||
.fas.fa-level-up-alt:before {
|
||||
content: "\f148";
|
||||
}
|
||||
.fas.fa-chart-line:before {
|
||||
content: "\f201";
|
||||
}
|
||||
.fas.fa-long-arrow-alt-down:before {
|
||||
content: "\f175";
|
||||
}
|
||||
.fas.fa-long-arrow-alt-left:before {
|
||||
content: "\f177";
|
||||
}
|
||||
.fas.fa-long-arrow-alt-right:before {
|
||||
content: "\f178";
|
||||
}
|
||||
.fas.fa-long-arrow-alt-up:before {
|
||||
content: "\f176";
|
||||
}
|
||||
.fas.fa-map-marker-alt:before {
|
||||
content: "\f041";
|
||||
}
|
||||
.fas.fa-mobile-alt:before {
|
||||
content: "\f10b";
|
||||
}
|
||||
.fas.fa-pencil-alt:before {
|
||||
content: "\f040";
|
||||
}
|
||||
.fas.fa-pen-square:before {
|
||||
content: "\f14b";
|
||||
}
|
||||
.fas.fa-chart-pie:before {
|
||||
content: "\f200";
|
||||
}
|
||||
.fas.fa-yen-sign:before {
|
||||
content: "\f157";
|
||||
}
|
||||
.fas.fa-ruble-sign:before {
|
||||
content: "\f158";
|
||||
}
|
||||
.fas.fa-shield-alt:before {
|
||||
content: "\f132";
|
||||
}
|
||||
.fas.fa-sign-in-alt:before {
|
||||
content: "\f090";
|
||||
}
|
||||
.fas.fa-sign-out-alt:before {
|
||||
content: "\f08b";
|
||||
}
|
||||
.fas.fa-sliders-h:before {
|
||||
content: "\f1de";
|
||||
}
|
||||
.fas.fa-tablet-alt:before {
|
||||
content: "\f10a";
|
||||
}
|
||||
.fas.fa-tachometer-alt:before {
|
||||
content: "\f0e4";
|
||||
}
|
||||
.fas.fa-thumbtack:before {
|
||||
content: "\f08d";
|
||||
}
|
||||
.fas.fa-ticket-alt:before {
|
||||
content: "\f145";
|
||||
}
|
||||
.fas.fa-trash-alt:before {
|
||||
content: "\f1f8";
|
||||
}
|
||||
.fas.fa-lira-sign:before {
|
||||
content: "\f195";
|
||||
}
|
||||
.fab.fa-linkedin-in:before {
|
||||
content: "\fe01";
|
||||
}
|
||||
.fab.fa-linkedin:before {
|
||||
content: "\f08c";
|
||||
}
|
||||
.far.fa-address-book:before {
|
||||
content: "\f2ba";
|
||||
}
|
||||
.far.fa-address-card:before {
|
||||
content: "\f2bc";
|
||||
}
|
||||
.far.fa-arrow-alt-circle-down:before {
|
||||
content: "\f01a";
|
||||
}
|
||||
.far.fa-arrow-alt-circle-left:before {
|
||||
content: "\f190";
|
||||
}
|
||||
.far.fa-arrow-alt-circle-right:before {
|
||||
content: "\f18e";
|
||||
}
|
||||
.far.fa-arrow-alt-circle-up:before {
|
||||
content: "\f01b";
|
||||
}
|
||||
.far.fa-bell:before {
|
||||
content: "\f0f3";
|
||||
}
|
||||
.far.fa-bell-slash:before {
|
||||
content: "\f1f7";
|
||||
}
|
||||
.far.fa-bookmark:before {
|
||||
content: "\f097";
|
||||
}
|
||||
.far.fa-building:before {
|
||||
content: "\f0f7";
|
||||
}
|
||||
.far.fa-calendar-check:before {
|
||||
content: "\f274";
|
||||
}
|
||||
.far.fa-calendar-minus:before {
|
||||
content: "\f272";
|
||||
}
|
||||
.far.fa-calendar:before {
|
||||
content: "\f133";
|
||||
}
|
||||
.far.fa-calendar-plus:before {
|
||||
content: "\f271";
|
||||
}
|
||||
.far.fa-calendar-times:before {
|
||||
content: "\f273";
|
||||
}
|
||||
.far.fa-caret-square-down:before {
|
||||
content: "\f150";
|
||||
}
|
||||
.far.fa-caret-square-left:before {
|
||||
content: "\f191";
|
||||
}
|
||||
.far.fa-caret-square-right:before {
|
||||
content: "\f152";
|
||||
}
|
||||
.far.fa-caret-square-up:before {
|
||||
content: "\f151";
|
||||
}
|
||||
.far.fa-check-circle:before {
|
||||
content: "\f05d";
|
||||
}
|
||||
.far.fa-check-square:before {
|
||||
content: "\f046";
|
||||
}
|
||||
.far.fa-circle:before {
|
||||
content: "\f10c";
|
||||
}
|
||||
.far.fa-clock:before {
|
||||
content: "\f017";
|
||||
}
|
||||
.far.fa-comment:before {
|
||||
content: "\f0e5";
|
||||
}
|
||||
.far.fa-comment-dots:before {
|
||||
content: "\f27b";
|
||||
}
|
||||
.far.fa-comments:before {
|
||||
content: "\f0e6";
|
||||
}
|
||||
.far.fa-dot-circle:before {
|
||||
content: "\f192";
|
||||
}
|
||||
.far.fa-id-card:before {
|
||||
content: "\f2c3";
|
||||
}
|
||||
.far.fa-envelope:before {
|
||||
content: "\f003";
|
||||
}
|
||||
.far.fa-envelope-open:before {
|
||||
content: "\f2b7";
|
||||
}
|
||||
.far.fa-file-archive:before {
|
||||
content: "\f1c6";
|
||||
}
|
||||
.far.fa-file-audio:before {
|
||||
content: "\f1c7";
|
||||
}
|
||||
.far.fa-file-code:before {
|
||||
content: "\f1c9";
|
||||
}
|
||||
.far.fa-file-excel:before {
|
||||
content: "\f1c3";
|
||||
}
|
||||
.far.fa-file-image:before {
|
||||
content: "\f1c5";
|
||||
}
|
||||
.far.fa-file-video:before {
|
||||
content: "\f1c8";
|
||||
}
|
||||
.far.fa-copy:before,
|
||||
.far.fa-file:before {
|
||||
content: "\f016";
|
||||
}
|
||||
.far.fa-file-pdf:before {
|
||||
content: "\f1c1";
|
||||
}
|
||||
.far.fa-file-powerpoint:before {
|
||||
content: "\f1c4";
|
||||
}
|
||||
.far.fa-file-alt:before {
|
||||
content: "\f0f6";
|
||||
}
|
||||
.far.fa-file-word:before {
|
||||
content: "\f1c2";
|
||||
}
|
||||
.far.fa-flag:before {
|
||||
content: "\f11d";
|
||||
}
|
||||
.far.fa-save:before {
|
||||
content: "\f0c7";
|
||||
}
|
||||
.far.fa-folder:before {
|
||||
content: "\f114";
|
||||
}
|
||||
.far.fa-folder-open:before {
|
||||
content: "\f115";
|
||||
}
|
||||
.far.fa-frown:before {
|
||||
content: "\f119";
|
||||
}
|
||||
.far.fa-futbol:before {
|
||||
content: "\f1e3";
|
||||
}
|
||||
.far.fa-hand-rock:before {
|
||||
content: "\f255";
|
||||
}
|
||||
.far.fa-hand-lizard:before {
|
||||
content: "\f258";
|
||||
}
|
||||
.far.fa-hand-point-down:before {
|
||||
content: "\f0a7";
|
||||
}
|
||||
.far.fa-hand-point-left:before {
|
||||
content: "\f0a5";
|
||||
}
|
||||
.far.fa-hand-point-right:before {
|
||||
content: "\f0a4";
|
||||
}
|
||||
.far.fa-hand-point-up:before {
|
||||
content: "\f0a6";
|
||||
}
|
||||
.far.fa-hand-paper:before {
|
||||
content: "\256";
|
||||
}
|
||||
.far.fa-hand-pointer:before {
|
||||
content: "\f25a";
|
||||
}
|
||||
.far.fa-hand-scissors:before {
|
||||
content: "\f257";
|
||||
}
|
||||
.far.fa-hand-spock:before {
|
||||
content: "\f259";
|
||||
}
|
||||
.far.fa-handshake:before {
|
||||
content: "\f2b5";
|
||||
}
|
||||
.far.fa-hdd:before {
|
||||
content: "\f0a0";
|
||||
}
|
||||
.far.fa-heart:before {
|
||||
content: "\f08a";
|
||||
}
|
||||
.far.fa-hospital:before {
|
||||
content: "\f0f8";
|
||||
}
|
||||
.far.fa-hourglass:before {
|
||||
content: "\f250";
|
||||
}
|
||||
.far.fa-id-card:before {
|
||||
content: "\f2c3";
|
||||
}
|
||||
.far.fa-keyboard:before {
|
||||
content: "\f11c";
|
||||
}
|
||||
.far.fa-lemon:before {
|
||||
content: "\f094";
|
||||
}
|
||||
.far.fa-lightbulb:before {
|
||||
content: "\f0eb";
|
||||
}
|
||||
.far.fa-meh:before {
|
||||
content: "\f11a";
|
||||
}
|
||||
.far.fa-minus-square:before {
|
||||
content: "\f147";
|
||||
}
|
||||
.far.fa-money-bill-alt:before {
|
||||
content: "\f0d6";
|
||||
}
|
||||
.far.fa-moon:before {
|
||||
content: "\f186";
|
||||
}
|
||||
.far.fa-newspaper:before {
|
||||
content: "\f1ea";
|
||||
}
|
||||
.far.fa-paper-plane:before {
|
||||
content: "\f1d9";
|
||||
}
|
||||
.far.fa-pause-circle:before {
|
||||
content: "\f28c";
|
||||
}
|
||||
.far.fa-edit:before {
|
||||
content: "\f044";
|
||||
}
|
||||
.far.fa-image:before {
|
||||
content: "\f03e";
|
||||
}
|
||||
.far.fa-play-circle:before {
|
||||
content: "\f01d";
|
||||
}
|
||||
.far.fa-plus-square:before {
|
||||
content: "\f196";
|
||||
}
|
||||
.far.fa-question-circle:before {
|
||||
content: "\f92c";
|
||||
}
|
||||
.far.fa-share-square:before {
|
||||
content: "\f045";
|
||||
}
|
||||
.far.fa-smile:before {
|
||||
content: "\f118";
|
||||
}
|
||||
.far.fa-snowflake:before {
|
||||
content: "\f2dc";
|
||||
}
|
||||
.far.fa-futbol:before {
|
||||
content: "\f1e3";
|
||||
}
|
||||
.far.fa-star-half:before {
|
||||
content: "\f089";
|
||||
}
|
||||
.far.fa-star:before {
|
||||
content: "\f006";
|
||||
}
|
||||
.far.fa-sticky-note:before {
|
||||
content: "\f24a";
|
||||
}
|
||||
.far.fa-stop-circle:before {
|
||||
content: "\f28e";
|
||||
}
|
||||
.far.fa-sun:before {
|
||||
content: "\f185";
|
||||
}
|
||||
.far.fa-thumbs-down:before {
|
||||
content: "\f088";
|
||||
}
|
||||
.far.fa-thumbs-up:before {
|
||||
content: "\f087";
|
||||
}
|
||||
.far.fa-times-circle:before {
|
||||
content: "\f05c";
|
||||
}
|
||||
.far.fa-window-close:before {
|
||||
content: "\f2d4";
|
||||
}
|
||||
.far.fa-trash-alt:before {
|
||||
content: "\f014";
|
||||
}
|
||||
.far.fa-user-circle:before {
|
||||
content: "\f2be";
|
||||
}
|
||||
.far.fa-user:before {
|
||||
content: "\f2c0";
|
||||
}
|
||||
12
static/fork-awesome/css/v5-compat.min.css
vendored
Normal file
12
static/fork-awesome/css/v5-compat.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
static/fork-awesome/css/v5-compat.min.css.map
Normal file
1
static/fork-awesome/css/v5-compat.min.css.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["v5-compat.css"],"names":[],"mappings":";;;;;;;;;;;AAaA,KACA,KAFA,KAGE,QAAA,aACA,KAAA,OAAA,OAAA,OAAA,KAAA,EAAA,YACA,UAAA,QACA,eAAA,KACA,uBAAA,YACA,wBAAA,UAEgB,0BAChB,QAAA,QAEgB,0BAChB,QAAA,QAEuB,iCACvB,QAAA,QAEkB,4BAClB,QAAA,QAEkB,4BAClB,QAAA,QAEkB,4BAClB,QAAA,QAEkB,4BAClB,QAAA,QAEwB,kCACxB,QAAA,QAEsB,gCACtB,QAAA,QAEiB,2BACjB,QAAA,QAEiB,2BACj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BAClB,QAAA,QAEkB,4BAClB,QAAA,QAEe,yBACf,QAAA,QAEiB,2BACjB,QAAA,QAEU,oBACV,QAAA"}
|
||||
BIN
static/fork-awesome/fonts/forkawesome-webfont.eot
Normal file
BIN
static/fork-awesome/fonts/forkawesome-webfont.eot
Normal file
Binary file not shown.
2849
static/fork-awesome/fonts/forkawesome-webfont.svg
Normal file
2849
static/fork-awesome/fonts/forkawesome-webfont.svg
Normal file
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 470 KiB |
BIN
static/fork-awesome/fonts/forkawesome-webfont.ttf
Normal file
BIN
static/fork-awesome/fonts/forkawesome-webfont.ttf
Normal file
Binary file not shown.
BIN
static/fork-awesome/fonts/forkawesome-webfont.woff
Normal file
BIN
static/fork-awesome/fonts/forkawesome-webfont.woff
Normal file
Binary file not shown.
BIN
static/fork-awesome/fonts/forkawesome-webfont.woff2
Normal file
BIN
static/fork-awesome/fonts/forkawesome-webfont.woff2
Normal file
Binary file not shown.
96
static/stylesheet.css
Normal file
96
static/stylesheet.css
Normal file
@ -0,0 +1,96 @@
|
||||
@font-face {
|
||||
font-family: 'IBM Plex Mono';
|
||||
src: url('/static/fonts/IBMPlexMono-Regular.ttf');
|
||||
font-weight: 400;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'IBM Plex Mono';
|
||||
src: url('/static/fonts/IBMPlexMono-SemiBold.ttf');
|
||||
font-weight: 600;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'IBM Plex Mono';
|
||||
src: url('/static/fonts/IBMPlexMono-Bold.ttf');
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: 'IBM Plex Mono', monospace;
|
||||
}
|
||||
main {
|
||||
width: 100%;
|
||||
max-width: 60rem;
|
||||
margin: 0 auto;
|
||||
padding: 8px;
|
||||
}
|
||||
h1 {
|
||||
font-weight: 600;
|
||||
}
|
||||
p {
|
||||
display: block;
|
||||
padding-bottom: 4px;
|
||||
unicode-bidi: embed;
|
||||
font-family: 'IBM Plex Mono', monospace;
|
||||
white-space: pre;
|
||||
overflow-x: auto;
|
||||
}
|
||||
a {
|
||||
color: #4a34e1;
|
||||
}
|
||||
a.button {
|
||||
padding: 6px 8px;
|
||||
color: #4a34e1;
|
||||
border: solid 1px #4a34e1;
|
||||
border-radius: 3px;
|
||||
text-decoration: none;
|
||||
}
|
||||
a.button:focus, a.button:hover {
|
||||
color: #fff;
|
||||
background-color:#4a34e1;
|
||||
}
|
||||
|
||||
span.section {
|
||||
color: #777;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
span.section::before {
|
||||
content: '[';
|
||||
}
|
||||
span.section::after {
|
||||
content: ']';
|
||||
}
|
||||
span.chords {
|
||||
color: #9740ff;
|
||||
}
|
||||
|
||||
.explorer {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
||||
grid-gap: 8px;
|
||||
}
|
||||
.explorer--directories a.button {
|
||||
color: #0a6f52;
|
||||
border: solid 1px #0a6f52;
|
||||
}
|
||||
.explorer--directories a.button:focus, .explorer--directories a.button:hover {
|
||||
color: #fff;
|
||||
background-color:#0a6f52;
|
||||
}
|
||||
.explorer--audio a.button {
|
||||
color: #bd5900;
|
||||
border: solid 1px #bd5900;
|
||||
}
|
||||
.explorer--audio a.button:focus, .explorer--audio a.button:hover {
|
||||
color: #fff;
|
||||
background-color:#bd5900;
|
||||
}
|
||||
|
||||
audio {
|
||||
width: 100%;
|
||||
}
|
||||
6
views/audio.pug
Normal file
6
views/audio.pug
Normal file
@ -0,0 +1,6 @@
|
||||
extends base
|
||||
|
||||
block content
|
||||
h1= audioFilename
|
||||
|
||||
audio(controls src=audioFilepath)
|
||||
13
views/base.pug
Normal file
13
views/base.pug
Normal file
@ -0,0 +1,13 @@
|
||||
doctype html
|
||||
html(lang="en")
|
||||
head
|
||||
meta(charset="UTF-8")
|
||||
meta(http-equiv="X-UA-Compatible", content="IE=edge")
|
||||
meta(name="viewport", content="width=device-width, initial-scale=1.0")
|
||||
title= title
|
||||
link(rel="stylesheet", href="/static/stylesheet.css")
|
||||
link(rel="stylesheet", href="/static/fork-awesome/css/fork-awesome.min.css")
|
||||
|
||||
body
|
||||
main
|
||||
block content
|
||||
34
views/dir.pug
Normal file
34
views/dir.pug
Normal file
@ -0,0 +1,34 @@
|
||||
extends base
|
||||
|
||||
block content
|
||||
h1= currentPath
|
||||
|
||||
br
|
||||
|
||||
.explorer.explorer--directories
|
||||
if currentPath !== '/'
|
||||
a(href= parentDir).button
|
||||
i.fa.fa-folder
|
||||
| ../
|
||||
each entry in directories
|
||||
a(href= entry.link).button
|
||||
i.fa.fa-folder
|
||||
| #{entry.name}
|
||||
|
||||
br
|
||||
|
||||
.explorer.explorer--files
|
||||
each entry in files
|
||||
if entry.extension == '.txt'
|
||||
a(href= entry.link).button
|
||||
i.fa.fa-file-text-o
|
||||
| #{entry.name}
|
||||
|
||||
br
|
||||
|
||||
.explorer.explorer--audio
|
||||
each entry in files
|
||||
if entry.extension == '.mp3' || entry.extension == '.wav'
|
||||
a(href= entry.link).button
|
||||
i.fa.fa-file-audio-o
|
||||
| #{entry.name}
|
||||
13
views/file.pug
Normal file
13
views/file.pug
Normal file
@ -0,0 +1,13 @@
|
||||
extends base
|
||||
|
||||
block content
|
||||
if (data.metadata.title)
|
||||
h1= data.metadata.title
|
||||
|
||||
if (data.metadata.artist)
|
||||
h2= data.metadata.artist
|
||||
|
||||
if (data.metadata.tempo)
|
||||
p Tempo: !{data.metadata.tempo}
|
||||
|
||||
p !{data.formatted}
|
||||
Loading…
x
Reference in New Issue
Block a user