• forked:SAPPORO OMIKUJI
Import an externally hosted application
Check style

  • JavaScript
  • CSS
  • HTML
  • Images
  • Input Data
  • ReadMe
  • forked:SAPPORO OMIKUJI
  • jquery-1.11.2.min.js  
  • imgLiquid.js  
  • oridomi.min.js  
  •  
  • history

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
 
var PG = PG || {};
 
// プロパティの設定
PG.property = {
    image : "http://schema.org/image",
    label : "http://purl.org/dc/elements/1.1/title",
    detail : "http://purl.org/dc/elements/1.1/description",
    address : "http://uidcenter.org/vocab/ucr/ug#address",
    long : "http://www.w3.org/2003/01/geo/wgs84_pos#long",
    lat : "http://www.w3.org/2003/01/geo/wgs84_pos#lat"
}
    
// デフォルト言語
PG.language = "ja";
    
$(function() {
    // オーバーレイを追加
    $('body').append('<div class="modal-overlay"></div>');
    // オーバーレイをフェードイン
    $('.modal-overlay').fadeIn('slow');
 
    // モーダルコンテンツを追加
    var modal = '<div class="modal-content"><div id="comment"><p>Click Here!</p><ul><li id="ja">日本語</li><li id="en">English</li><li id="zhCHS">简体中文</li><li id="zhCHT">繁體中文</li><li id="ko">한국어</li></ul></div><img id="cat" src="http://app.linkdata.org/asset/79eaad8f.png" /></div>';
    $('body').append(modal);
    // モーダルコンテンツの表示位置を設定
    modalResize();
    
    // 猫出現
    setTimeout(function(){
        $('.modal-content').fadeIn('slow');
    }, 500);
    
    // コメントボックスの操作
    $("#comment, #cat").on('click', function() {
        $("#comment li").toggle(500);
    });
 
    // .modal-overlayをクリック
    $('#comment li').off().click(function(){
        PG.language = $(this).attr("id");
        // モーダルコンテンツとオーバーレイをフェードアウト
        $('.modal-content').fadeOut('slow');
        $('.modal-overlay').fadeOut('slow',function(){
            // オーバーレイを削除
            $('.modal-overlay').remove();
        });
    });
 
    // リサイズしたら表示位置を再取得
    $(window).on('resize', function(){
        modalResize();
    });
 
    // モーダルコンテンツの表示位置を設定する関数
    function modalResize(){
        // ウィンドウの横幅、高さを取得
        var w = $(window).width();
        var h = $(window).height();
        console.log("w:" + w + "h:" + h);
 
        // モーダルコンテンツの表示位置を取得
        var x = (w / 2) -120;
        var y = (h / 2) -200;
        console.log("x:" + x + "y:" + y);
 
        // モーダルコンテンツの表示位置を設定
        $('.modal-content').css({'left': x + 'px','top': y + 'px'});
    }
    
    // スマホでもボタンがへこむ効果を付ける
    var $elm = $('#push');
    $elm.bind('touchstart', function() {
        $(this).addClass('tch-active');
    });
    $elm.bind('touchend', function() {
        $(this).removeClass('tch-active');
    });
});
 
$("#push").click(function () {
    var list = "";
    $("#result").empty();
    $("#omikuji, #showAll").remove();
    // 指定されたworkを全件取得
    $.each(LinkData.getWorks(), function(workKey, workValue) {
        // workに含まれるfileを全件取得
        var propUri = stringToUri(PG.property, workValue);
        $.each(LinkData.getFiles(workValue), function(fileKey, fileValue) {
            var filename = fileValue.split("_");
            if (filename[filename.length-1]==PG.language) {
                var index = 0;
                var random = 0;
                var subList = [];
                // subjectを全件取得
                $.each(LinkData.getSubjects(workValue, fileValue), function(subjKey, subjValue) {
                    var image = "";
                    var label = "";
                    var detail = "";
                    var address = "";
                    var longitude = "";
jquery-1.11.2.min.js
imgLiquid.js
oridomi.min.js
Playing...

jquery-1.11.2.min.js
imgLiquid.js
oridomi.min.js