
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
@_000407/transpose.js
Advanced tools
This is a simple utility for transposing the chords in a given composition. Once the CSS selector for the element that contains the chord, and the target transposition index is provided, the library can transpose the chord defined within the said element,
transpose.js
- Chord Transposition made simpleThis is a simple utility for transposing the chords in a given composition. Once the CSS selector for the element that contains the chord, and the target transposition index is provided, the library can transpose the chord defined within the said element, to the given transposition index. Transposition index i
is in the range [-12 <= i <= +12]
.
import { Transpose } from '@_00407/transpose.js';
const t = new Transpose();
t.transpose(+1);
<script type="text/javascript" src="https://kanchana.senadheera.net/transpose.js/dist/transpose.min.js"></script> <!-- Transposer instance will be initialized in the window object -->
<button class="transpose transpose-down" onclick="Transposer.transpose(-1)">-1</button>
<button class="transpose transpose-reset" onclick="Transposer.transpose(0)">R</button>
<button class="transpose transpose-up" onclick="Transposer.transpose(+1)">+1</button>
N/A
npm install @_000407/transpose.js
<script type="text/javascript" src="https://kanchana.senadheera.net/transpose.js/dist/transpose.min.js"></script>
You may customize the behavior of transposed output rendering, selection of containers of chords etc as follows.
init
method of an instance - accepts an object contains configurationProperty | Description | Type | Req/Opt | Default |
---|---|---|---|---|
selector | CSS selector of the elements that contain the chords. | string | Optional | span.chord |
render | Function that renders the transposed chord output. | function | Optional | see Rendering |
By default, the rendering is done using the following function.
function(offset) {
for(let c of document.querySelectorAll(this.selector)) {
c.innerHTML = this.transposeChord(c.innerHTML, offset);
}
}
// During construction
const t = new Transposer({
selector: "span.chord",
render: function(offset) {
console.log("Overridden version");
for(let c of document.querySelectorAll(this.selector)) {
c.innerHTML = this.transposeChord(c.innerHTML, offset);
}
}
});
// Using init method
t.init({
selector: "span.chord",
render: function(offset) {
console.log("Overridden version");
for(let c of document.querySelectorAll(this.selector)) {
c.innerHTML = this.transposeChord(c.innerHTML, offset);
}
}
});
N/A
N/A
N/A
N/A
N/A
We use SemVer for versioning. For the versions available, see the tags on this repository.
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details
N/A
FAQs
This is a simple utility for transposing the chords in a given composition. Once the CSS selector for the element that contains the chord, and the target transposition index is provided, the library can transpose the chord defined within the said element,
The npm package @_000407/transpose.js receives a total of 0 weekly downloads. As such, @_000407/transpose.js popularity was classified as not popular.
We found that @_000407/transpose.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.