mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-22 19:01:51 +08:00
improve title display for english titles
This commit is contained in:
parent
4537386305
commit
ad79a77c51
@ -106,4 +106,14 @@ html, body{
|
||||
background-position-y: 0;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
.alpha-title .song-title-char {
|
||||
transform: scale(1.3, 1);
|
||||
font-size: 80%;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.song-title-apos {
|
||||
padding-left: 4px;
|
||||
}
|
@ -147,11 +147,27 @@ function SongSelect(){
|
||||
var songTitle = song.title;
|
||||
var songTitleSpace = songTitle.replace(/ /g, ' ');
|
||||
var songPreview = song.preview;
|
||||
var skipChars = [];
|
||||
|
||||
_code += "<div id='song-"+songID+"' class='song' data-title='"+songTitle+"' data-song-id='"+songID+"' data-preview='"+songPreview+"'><div class='song-title'>";
|
||||
var cl = /^[\x00-\xFF]*$/.test(songTitle) ? 'song-title alpha-title' : 'song-title';
|
||||
_code += "<div id='song-"+songID+"' class='song' data-title='"+songTitle+"' data-song-id='"+songID+"' data-preview='"+songPreview+"'><div class='"+cl+"'>";
|
||||
for (var c=0; c<songTitle.length; c++) {
|
||||
if (skipChars.indexOf(c) > -1) {
|
||||
continue;
|
||||
};
|
||||
|
||||
var ch = songTitle.charAt(c) == ' ' ? ' ' : songTitle.charAt(c);
|
||||
|
||||
var isApos = false;
|
||||
if (songTitle.charAt(c+1) == '\'') {
|
||||
ch = ch + '\'';
|
||||
skipChars.push(c+1);
|
||||
isApos = true;
|
||||
};
|
||||
|
||||
var cl = ch == ' ' ? 'song-title-char song-title-space' : 'song-title-char';
|
||||
cl = isApos ? cl + ' song-title-apos' : cl;
|
||||
|
||||
_code += '<span class="' + cl + '" alt="' + ch + '">' + ch + '</span>';
|
||||
};
|
||||
_code += "</div><ul class='difficulties'>";
|
||||
|
Loading…
Reference in New Issue
Block a user