├── GUIDE.md
├── LICENSE
├── README.md
└── src
├── index.css
├── index.html
├── index.js
├── iro.min.js
├── jsmediatags.min.js
├── jszip.min.js
├── md.min.js
└── template.html
/GUIDE.md:
--------------------------------------------------------------------------------
1 | # blamscamp guide
2 |
3 | [Youtube tutorial here](https://www.youtube.com/watch?v=fE6G0zSec1E)
4 |
5 | ## basic usage
6 |
7 | To use blamscamp, fill in your album title and artist name. You can also upload a cover image. Click the "add song" button to add songs to your album. You can set the title for each individual song and choose its audio file from the file browser.
8 |
9 | Most of these fields are optional, so you can have an album with no cover and no artist if you want, or no title. Your choice.
10 |
11 | You can set the background colour, foreground colour (font colour,) and highlight colour (colour for album name/artist name/song titles).
12 |
13 | You can add additional files to include in the resulting zip file. If you add images, you can use them in the "custom css," otherwise they're just loose in the zip file. Try not to have multiple files with the same file name.
14 |
15 | Click "generate" to see a live preview in the second pane.
16 |
17 | Click "export zip" to get a zip file that contains your player, music files, and cover image. This is what you upload to itch.io.
18 |
19 | ## adding to itch.io
20 |
21 | On the itch.io main page, click the dropdown next to your icon and hit "upload a new project."
22 |
23 | You must have the following fields set:
24 |
25 | - "Classification" should be "Soundtrack"
26 | - "Kind of project" should be "HTML"
27 |
28 | Now, uploaded your exported ZIP file. Select the option "this file will be played in the browser."
29 |
30 | Next, tweak the viewport dimensions. This decides how big the widget is going to be. I found the maximum width is 960px. The height will depend on how many songs you have in your album. The more songs you have the taller the widget will have to be.
31 |
32 | Make sure the following other checkboxes are checked:
33 |
34 | - "Automatically start on page load"
35 | - this avoids the "run soundtrack" button when you open the page
36 | - "Enable scrollbars"
37 | - This will allow users to scroll down inside the applet if your height isn't tall enough. Otherwise, things will be cutoff.
38 |
39 | After doing all this, the blamscamp player should appear when you open up your project's store page.
40 |
41 | If you want your music to also be purchasable, upload a second ZIP that just contains the music files. If you set your project to purchasable, this is the zip that a buyer will download. You can put higher quality audio files in that zip or other goodies if you want.
42 |
43 | ## troubleshooting
44 |
45 | ### audio doesn't play
46 |
47 | This can be caused by using an unsupported audio format. Please try MP3 files. They are very widely supported.
48 |
49 | ### doesn't work on mobile
50 |
51 | This is true, I would like to improve this in the future.
52 |
53 | ### editor suddenly broke/needs to refresh
54 |
55 | This may be a bug. If you're inclined to make a bug report, please open the debugger console and copy the error message to a bug report, or send in an email to blackle@suricrasia.online
56 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | CC0 1.0 Universal
2 |
3 | Statement of Purpose
4 |
5 | The laws of most jurisdictions throughout the world automatically confer
6 | exclusive Copyright and Related Rights (defined below) upon the creator and
7 | subsequent owner(s) (each and all, an "owner") of an original work of
8 | authorship and/or a database (each, a "Work").
9 |
10 | Certain owners wish to permanently relinquish those rights to a Work for the
11 | purpose of contributing to a commons of creative, cultural and scientific
12 | works ("Commons") that the public can reliably and without fear of later
13 | claims of infringement build upon, modify, incorporate in other works, reuse
14 | and redistribute as freely as possible in any form whatsoever and for any
15 | purposes, including without limitation commercial purposes. These owners may
16 | contribute to the Commons to promote the ideal of a free culture and the
17 | further production of creative, cultural and scientific works, or to gain
18 | reputation or greater distribution for their Work in part through the use and
19 | efforts of others.
20 |
21 | For these and/or other purposes and motivations, and without any expectation
22 | of additional consideration or compensation, the person associating CC0 with a
23 | Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
24 | and Related Rights in the Work, voluntarily elects to apply CC0 to the Work
25 | and publicly distribute the Work under its terms, with knowledge of his or her
26 | Copyright and Related Rights in the Work and the meaning and intended legal
27 | effect of CC0 on those rights.
28 |
29 | 1. Copyright and Related Rights. A Work made available under CC0 may be
30 | protected by copyright and related or neighboring rights ("Copyright and
31 | Related Rights"). Copyright and Related Rights include, but are not limited
32 | to, the following:
33 |
34 | i. the right to reproduce, adapt, distribute, perform, display, communicate,
35 | and translate a Work;
36 |
37 | ii. moral rights retained by the original author(s) and/or performer(s);
38 |
39 | iii. publicity and privacy rights pertaining to a person's image or likeness
40 | depicted in a Work;
41 |
42 | iv. rights protecting against unfair competition in regards to a Work,
43 | subject to the limitations in paragraph 4(a), below;
44 |
45 | v. rights protecting the extraction, dissemination, use and reuse of data in
46 | a Work;
47 |
48 | vi. database rights (such as those arising under Directive 96/9/EC of the
49 | European Parliament and of the Council of 11 March 1996 on the legal
50 | protection of databases, and under any national implementation thereof,
51 | including any amended or successor version of such directive); and
52 |
53 | vii. other similar, equivalent or corresponding rights throughout the world
54 | based on applicable law or treaty, and any national implementations thereof.
55 |
56 | 2. Waiver. To the greatest extent permitted by, but not in contravention of,
57 | applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
58 | unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
59 | and Related Rights and associated claims and causes of action, whether now
60 | known or unknown (including existing as well as future claims and causes of
61 | action), in the Work (i) in all territories worldwide, (ii) for the maximum
62 | duration provided by applicable law or treaty (including future time
63 | extensions), (iii) in any current or future medium and for any number of
64 | copies, and (iv) for any purpose whatsoever, including without limitation
65 | commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes
66 | the Waiver for the benefit of each member of the public at large and to the
67 | detriment of Affirmer's heirs and successors, fully intending that such Waiver
68 | shall not be subject to revocation, rescission, cancellation, termination, or
69 | any other legal or equitable action to disrupt the quiet enjoyment of the Work
70 | by the public as contemplated by Affirmer's express Statement of Purpose.
71 |
72 | 3. Public License Fallback. Should any part of the Waiver for any reason be
73 | judged legally invalid or ineffective under applicable law, then the Waiver
74 | shall be preserved to the maximum extent permitted taking into account
75 | Affirmer's express Statement of Purpose. In addition, to the extent the Waiver
76 | is so judged Affirmer hereby grants to each affected person a royalty-free,
77 | non transferable, non sublicensable, non exclusive, irrevocable and
78 | unconditional license to exercise Affirmer's Copyright and Related Rights in
79 | the Work (i) in all territories worldwide, (ii) for the maximum duration
80 | provided by applicable law or treaty (including future time extensions), (iii)
81 | in any current or future medium and for any number of copies, and (iv) for any
82 | purpose whatsoever, including without limitation commercial, advertising or
83 | promotional purposes (the "License"). The License shall be deemed effective as
84 | of the date CC0 was applied by Affirmer to the Work. Should any part of the
85 | License for any reason be judged legally invalid or ineffective under
86 | applicable law, such partial invalidity or ineffectiveness shall not
87 | invalidate the remainder of the License, and in such case Affirmer hereby
88 | affirms that he or she will not (i) exercise any of his or her remaining
89 | Copyright and Related Rights in the Work or (ii) assert any associated claims
90 | and causes of action with respect to the Work, in either case contrary to
91 | Affirmer's express Statement of Purpose.
92 |
93 | 4. Limitations and Disclaimers.
94 |
95 | a. No trademark or patent rights held by Affirmer are waived, abandoned,
96 | surrendered, licensed or otherwise affected by this document.
97 |
98 | b. Affirmer offers the Work as-is and makes no representations or warranties
99 | of any kind concerning the Work, express, implied, statutory or otherwise,
100 | including without limitation warranties of title, merchantability, fitness
101 | for a particular purpose, non infringement, or the absence of latent or
102 | other defects, accuracy, or the present or absence of errors, whether or not
103 | discoverable, all to the greatest extent permissible under applicable law.
104 |
105 | c. Affirmer disclaims responsibility for clearing rights of other persons
106 | that may apply to the Work or any use thereof, including without limitation
107 | any person's Copyright and Related Rights in the Work. Further, Affirmer
108 | disclaims responsibility for obtaining any necessary consents, permissions
109 | or other rights required for any use of the Work.
110 |
111 | d. Affirmer understands and acknowledges that Creative Commons is not a
112 | party to this document and has no duty or obligation with respect to this
113 | CC0 or use of the Work.
114 |
115 | For more information, please see
116 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | # blamscamp
4 |
5 | > Mmh, options, runnin' out of options,
6 | >
7 | > Mmh, options, used to have options
8 |
9 | bandcamp is great (at time of writing,) but it would be great to have more options for selling zip files of MP3s on the internet. So I created this tool, which lets you create a bandcamp-style audio player for an individual album. The player is an entirely self-contained website, and can be hosted on a variety of platforms, but was designed specifically for itch.io.
10 |
11 | [You can use it here](https://suricrasia.online/blamscamp/)
12 |
13 | [Read a guide here](GUIDE.md)
14 |
15 | [Youtube tutorial here](https://www.youtube.com/watch?v=fE6G0zSec1E)
16 |
17 | [Collection of Blamscamp albums on itch.io](https://itch.io/c/2306643/blamscamp-albums)
18 |
19 | ## roadmap
20 |
21 | - [x] reimport exported zip files for editing
22 | - [x] bulk import music or zip file of music/cover art
23 | - [x] auto parsing of music title from ID3 tags
24 | - [x] auto parsing of music order from ID3 tags
25 | - [x] custom css field
26 | - [x] loading indicator
27 | - [x] option to add additional files to the generated zip file (e.g. so one can set a background image through custom css)
28 | - [x] auto-updating of the generated player
29 | - [x] allow remembering position
30 | - [x] allow setting playback rate
31 | - [ ] next/previous track buttons
32 | - [ ] custom background image
33 | - [ ] lyrics display for each track
34 | - [ ] option to re-encode audio to lower bitrate
35 | - [ ] improve mobile support on itch.io. ostensibly only unity games are allowed to have dynamic sizing.
36 |
37 | ## serving
38 |
39 | To host the blamscamp editor, all you need are the files in the "src" directory.
40 |
41 | To host the blamscamp player, all you need are the files provided in the exported zip.
42 |
43 | **NOTE:** Your web server must support the Accept-Ranges header for track seeking to work.
44 |
45 | ## contributing
46 |
47 | Pull requests are welcome! But please note the following:
48 |
49 | The aesthetics of the blamscamp player was intended to follow the same design ethos as the bandcamp player. That is, very utilitarian. My thinking is that the basic styles of the player should be very simple, so that custom CSS can be more readily applied.
50 |
51 | The generated blamscamp player must not receive any added dependencies. The generator must stay as a single, self-contained file that is as small as reasonably possible. The point is for the generated file to be lightweight. Stick to Vanilla JS.
52 |
53 | The blamscamp editor, i.e. index.html, also uses Vanilla JS. I see this as a feature and not a bug. I would like to stick to vanilla as long as possible. That said, if things get too cumbersome I would be amenable to using a framework as long as it's lightweight. Right now blamscamp loads almost instantaniously and I would like to keep it that way.
54 |
55 | Additionally, I have set a dependency budget of "4" for this project. The target dependencies are:
56 |
57 | - [x] JSZip (added)
58 | - [x] an ID3 Tag Parser
59 | - [x] color picker
60 | - [ ] an MP3 audio encoder
61 |
62 | Dependencies of dependencies count toward the total.
63 |
64 | Things we would like:
65 |
66 | - UI polish in either the editor or player
67 | - refactoring to make the code simpler
68 | - if a new browser feature that has a caniuse score of >95% can remove like 10 lines of code, go for it!
69 | - implementations of roadmap features
70 |
71 | ## license
72 |
73 | This software is public domain, aside from the libraries [jszip](https://stuk.github.io/jszip/), [jsmediatags](https://github.com/aadsm/jsmediatags), [iro](https://iro.js.org/), and [Alamantus's FeatherWiki markdown parser](https://codeberg.org/Alamantus/FeatherWiki/src/commit/1e1bb77f42e057b53cd31acf0345612cbc51c6f4/helpers/md.js).
74 |
--------------------------------------------------------------------------------
/src/index.css:
--------------------------------------------------------------------------------
1 |
2 | html {
3 | background: grey;
4 | height: 100%;
5 | }
6 |
7 | body {
8 | font-family: sans-serif;
9 | background: white;
10 | display: grid;
11 | grid-template-columns: 1fr 1fr;
12 | width: 100%;
13 | height: 100%;
14 | margin: auto;
15 | }
16 |
17 | .editor {
18 | margin: 0 0 0 10px;
19 | overflow-y: scroll;
20 | }
21 |
22 | .preview {
23 | line-height: 0;
24 | }
25 | .preview > * {
26 | line-height: initial;
27 | }
28 |
29 | h1, h2, h3, p {
30 | margin: 10px 0;
31 | }
32 |
33 | iframe {
34 | width: 100%;
35 | height: 100%;
36 | border: 1px solid grey;
37 | box-sizing: border-box;
38 | }
39 |
40 | .well {
41 | padding: 5px 10px;
42 | border: 1px solid #ddd;
43 | margin: 5px 20px 5px 0px;
44 | background: #eee;
45 | }
46 |
47 | input {
48 | margin: 10px 0;
49 | }
50 |
51 | input[type='text'] {
52 | border: 1px solid grey;
53 | border-radius: 2px;
54 | }
55 |
56 | .code_editor {
57 | padding: 0.5rem 1rem;
58 | font-family: monospace;
59 | width: 100%;
60 | box-sizing: border-box;
61 | line-height: 1.5;
62 | margin: 0;
63 | resize: vertical;
64 | min-height: 15em;
65 | }
66 |
67 | button {
68 | margin: 5px 0;
69 | border-radius: 0;
70 | padding: 4px 8px;
71 | border: 1px solid grey;
72 | background-color: #eee;
73 | text-align: center;
74 | vertical-align: middle;
75 | cursor: pointer;
76 | flex-shrink: 0;
77 | }
78 |
79 | button:hover {
80 | background-color: #e6e6e6;
81 | }
82 |
83 | .color_area {
84 | display: flex;
85 | flex-wrap: wrap;
86 | align-items: flex-start;
87 | margin-top: 20px;
88 | margin-bottom: 20px;
89 | }
90 |
91 | .color_pickers {
92 | flex-grow: 1;
93 | }
94 |
95 | #iro {
96 | padding-right: 20px;
97 | }
98 |
99 | .color_picker {
100 | font-family: monospace;
101 | width: 10ch;
102 | padding-left: 3ch;
103 | background: white no-repeat;
104 | background-size: 2ch 100%;
105 | font-size: 125%;
106 | }
107 |
108 | .song {
109 | display: flex;
110 | align-items: center;
111 | }
112 |
113 | .well > * {
114 | margin: 0 5px
115 | }
116 |
117 | .song_title {
118 | flex-grow: 1;
119 | }
120 |
121 | .meta_fields {
122 | width: 450px;
123 | max-width: 90%;
124 | font-size: 120%;
125 | }
126 |
127 | .image_preview {
128 | max-height: 48px;
129 | width: auto;
130 | max-width: 200px;
131 | vertical-align: middle;
132 | }
133 |
134 | .spinner {
135 | background: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%20-256%201792%201792%22%3E%3Cpath%20d%3D%22M617.492%201123.797q0%2060-42.5%20102t-101.5%2042q-60%200-102-42t-42-102q0-60%2042-102t102-42q59%200%20101.5%2042t42.5%20102zm432%20192q0%2053-37.5%2090.5t-90.5%2037.5q-53%200-90.5-37.5t-37.5-90.5q0-53%2037.5-90.5t90.5-37.5q53%200%2090.5%2037.5t37.5%2090.5zm-608-640q0%2066-47%20113t-113%2047q-66%200-113-47t-47-113q0-66%2047-113t113-47q66%200%20113%2047t47%20113zm1040%20448q0%2046-33%2079t-79%2033q-46%200-79-33t-33-79q0-46%2033-79t79-33q46%200%2079%2033t33%2079zm-832-896q0%2073-51.5%20124.5t-124.5%2051.5q-73%200-124.5-51.5t-51.5-124.5q0-73%2051.5-124.5t124.5-51.5q73%200%20124.5%2051.5t51.5%20124.5zm464-192q0%2080-56%20136t-136%2056q-80%200-136-56t-56-136q0-80%2056-136t136-56q80%200%20136%2056t56%20136zm544%20640q0%2040-28%2068t-68%2028q-40%200-68-28t-28-68q0-40%2028-68t68-28q40%200%2068%2028t28%2068zm-208-448q0%2033-23.5%2056.5t-56.5%2023.5q-33%200-56.5-23.5t-23.5-56.5q0-33%2023.5-56.5t56.5-23.5q33%200%2056.5%2023.5t23.5%2056.5z%22%2F%3E%3C%2Fsvg%3E');
136 | width: 20px;
137 | height: 20px;
138 | background-size: contain;
139 | background-position: center;
140 | animation: spin 2s ease-in-out infinite;
141 | display: inline-block;
142 | vertical-align: middle;
143 | }
144 |
145 | .hidden {
146 | display: none;
147 | }
148 | .invisible {
149 | visibility: hidden;
150 | }
151 | .disabled {
152 | opacity: .5;
153 | pointer-events: none;
154 | }
155 | #iro.disabled {
156 | opacity: .25;
157 | }
158 |
159 | #version {
160 | font-size: 60%;
161 | opacity: .6;
162 | }
163 |
164 | @keyframes spin {
165 | 0% { transform: rotate(0deg); }
166 | 100% { transform: rotate(360deg); }
167 | }
168 |
169 | #add_extra_button, .code_editor {
170 | margin-top: 5px;
171 | }
172 |
173 | summary {
174 | cursor: pointer;
175 | }
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |