:HTML/embed_music_list_pt
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
<link rel="stylesheet" type="text/css" media="screen" hr...
<style type="text/css">
tbody tr th {
padding: 0 5px;
}
tbody tr td.number {
text-align: center;
}
tbody tr td.mark {
text-align: center;
}
tbody tr td.text {
text-align: left;
}
</style>
<script type="text/javascript" src="https://marines.saku...
<script type="text/javascript" src="https://marines.saku...
<script type="text/javascript">
var musics;
var table;
var level_min = 1;
var level_max = 399;
var level_delta = 50;
var notes_min = 0;
var notes_max = 1399;
var notes_delta = 100;
$(document).ready(function() {
$.getJSON('https://library.maplia.jp/json/musics_pol...
musics = data;
table = $('#table_musics');
// レベルフィルタ
select_level = $('#select_level');
select_level.append($('<option/>', {
value: -1, text: 'すべて'
}));
for (var i = level_min; i <= level_max; i += level...
select_level.append($('<option/>', {
value: i, text: (i == 1 ? -1 : i) + (level_del...
}));
}
// ノート数フィルタ
select_notes = $('#select_notes');
select_notes.append($('<option/>', {
value: -1, text: 'すべて'
}));
for (var i = notes_min; i <= notes_max; i += notes...
select_notes.append($('<option/>', {
value: i, text: i + '~' + (i + notes_delta - 1)
}));
}
createMusicTable();
filterMusicTable();
});
});
function createMusicTable() {
var table_data = {};
table_data.thead_column_classes = [
'style_th', 'style_th', 'style_th', 'style_th', 's...
];
table_data.tbody_column_classes = [
'style_th', 'text', 'mark', 'number', 'number'
];
table_data.thead = [];
table_data.tbody = [];
table_data.thead[0] = {
values: ['#', 'タイトル', '難易度', 'レベル', 'ノ...
};
$.each(musics, function(i, music) {
if (music.music_deleted) {
return true;
}
const charts = {
'bsc': music.basic, 'adv': music.advanced,
'hrd': music.hard, 'exp': music.expert
};
const full_title = music.title
+ (typeof music.subtitle === "undefined" ? '' : ...
$.each(charts, function(key, chart) {
if (typeof chart === 'undefined') {
return true;
}
if (chart.level) {
const class_name = 'chart_pt_' + (chart.level ...
const number = '-';
table_data.tbody[table_data.tbody.length] = {
id: music.id + '_' + key,
class_name: class_name,
values: [
number, full_title, key, chart.level, char...
]
};
}
});
});
table.json2table(table_data);
table.tablesorter({sortList: [[3, 1]]});
}
function filterMusicTable() {
const mode = parseInt($(':radio[name="mode"]:checked...
const diff = parseInt($(':radio[name="diff"]:checked...
const level = parseInt($('select[name="level"]').val...
const notes = parseInt($('select[name="notes"]').val...
let count = 0;
$('#table_musics tbody tr').each(function (i, item) {
const item_level = parseInt($(item).find('td')[2]....
const item_notes = parseInt($(item).find('td')[3]....
$(item).show();
// 難易度フィルタ
if (item.id.indexOf('_bsc') > -1 && ![0, 1].includ...
$(item).hide(); return true;
}
if (item.id.indexOf('_adv') > -1 && ![0, 2].includ...
$(item).hide(); return true;
}
if (item.id.indexOf('_hrd') > -1 && ![0, 3].includ...
$(item).hide(); return true;
}
if (item.id.indexOf('_exp') > -1 && ![0, 4].includ...
$(item).hide(); return true;
}
// レベルフィルタ
if ((level != -1) && (item_level < (level == 1 ? -...
$(item).hide(); return true;
}
// ノート数フィルタ
if ((notes != -1) && (item_notes < notes || (item_...
$(item).hide(); return true;
}
count++;
});
if (count <= 0) {
$('#table_rows').text('フィルター条件に該当する譜...
} else {
$('#table_rows').text(count + '譜面が該当しました');
}
}
</script>
<div>
<p>
難易度フィルター:
<label><input type="radio" name="diff" value="0" onc...
<label><input type="radio" name="diff" value="1" onc...
<label><input type="radio" name="diff" value="2" onc...
<label><input type="radio" name="diff" value="3" onc...
<label><input type="radio" name="diff" value="4" onc...
</p>
<p>
レベルフィルター: <select id="select_level" name="le...
/
ノート数フィルター: <select id="select_notes" name="...
</p>
<p id="table_rows"></p>
<table id="table_musics" class="tablesorter style_tabl...
</div>
終了行:
<link rel="stylesheet" type="text/css" media="screen" hr...
<style type="text/css">
tbody tr th {
padding: 0 5px;
}
tbody tr td.number {
text-align: center;
}
tbody tr td.mark {
text-align: center;
}
tbody tr td.text {
text-align: left;
}
</style>
<script type="text/javascript" src="https://marines.saku...
<script type="text/javascript" src="https://marines.saku...
<script type="text/javascript">
var musics;
var table;
var level_min = 1;
var level_max = 399;
var level_delta = 50;
var notes_min = 0;
var notes_max = 1399;
var notes_delta = 100;
$(document).ready(function() {
$.getJSON('https://library.maplia.jp/json/musics_pol...
musics = data;
table = $('#table_musics');
// レベルフィルタ
select_level = $('#select_level');
select_level.append($('<option/>', {
value: -1, text: 'すべて'
}));
for (var i = level_min; i <= level_max; i += level...
select_level.append($('<option/>', {
value: i, text: (i == 1 ? -1 : i) + (level_del...
}));
}
// ノート数フィルタ
select_notes = $('#select_notes');
select_notes.append($('<option/>', {
value: -1, text: 'すべて'
}));
for (var i = notes_min; i <= notes_max; i += notes...
select_notes.append($('<option/>', {
value: i, text: i + '~' + (i + notes_delta - 1)
}));
}
createMusicTable();
filterMusicTable();
});
});
function createMusicTable() {
var table_data = {};
table_data.thead_column_classes = [
'style_th', 'style_th', 'style_th', 'style_th', 's...
];
table_data.tbody_column_classes = [
'style_th', 'text', 'mark', 'number', 'number'
];
table_data.thead = [];
table_data.tbody = [];
table_data.thead[0] = {
values: ['#', 'タイトル', '難易度', 'レベル', 'ノ...
};
$.each(musics, function(i, music) {
if (music.music_deleted) {
return true;
}
const charts = {
'bsc': music.basic, 'adv': music.advanced,
'hrd': music.hard, 'exp': music.expert
};
const full_title = music.title
+ (typeof music.subtitle === "undefined" ? '' : ...
$.each(charts, function(key, chart) {
if (typeof chart === 'undefined') {
return true;
}
if (chart.level) {
const class_name = 'chart_pt_' + (chart.level ...
const number = '-';
table_data.tbody[table_data.tbody.length] = {
id: music.id + '_' + key,
class_name: class_name,
values: [
number, full_title, key, chart.level, char...
]
};
}
});
});
table.json2table(table_data);
table.tablesorter({sortList: [[3, 1]]});
}
function filterMusicTable() {
const mode = parseInt($(':radio[name="mode"]:checked...
const diff = parseInt($(':radio[name="diff"]:checked...
const level = parseInt($('select[name="level"]').val...
const notes = parseInt($('select[name="notes"]').val...
let count = 0;
$('#table_musics tbody tr').each(function (i, item) {
const item_level = parseInt($(item).find('td')[2]....
const item_notes = parseInt($(item).find('td')[3]....
$(item).show();
// 難易度フィルタ
if (item.id.indexOf('_bsc') > -1 && ![0, 1].includ...
$(item).hide(); return true;
}
if (item.id.indexOf('_adv') > -1 && ![0, 2].includ...
$(item).hide(); return true;
}
if (item.id.indexOf('_hrd') > -1 && ![0, 3].includ...
$(item).hide(); return true;
}
if (item.id.indexOf('_exp') > -1 && ![0, 4].includ...
$(item).hide(); return true;
}
// レベルフィルタ
if ((level != -1) && (item_level < (level == 1 ? -...
$(item).hide(); return true;
}
// ノート数フィルタ
if ((notes != -1) && (item_notes < notes || (item_...
$(item).hide(); return true;
}
count++;
});
if (count <= 0) {
$('#table_rows').text('フィルター条件に該当する譜...
} else {
$('#table_rows').text(count + '譜面が該当しました');
}
}
</script>
<div>
<p>
難易度フィルター:
<label><input type="radio" name="diff" value="0" onc...
<label><input type="radio" name="diff" value="1" onc...
<label><input type="radio" name="diff" value="2" onc...
<label><input type="radio" name="diff" value="3" onc...
<label><input type="radio" name="diff" value="4" onc...
</p>
<p>
レベルフィルター: <select id="select_level" name="le...
/
ノート数フィルター: <select id="select_notes" name="...
</p>
<p id="table_rows"></p>
<table id="table_musics" class="tablesorter style_tabl...
</div>
ページ名: