cards.html 3.5 KB
Newer Older
E
edisonxiang 已提交
1 2
{{ if isset .Site.Params "cards" }}
{{ if .Site.Params.cards.enable }}
F
freesky-edward 已提交
3
{{ if gt (len .Site.Params.card) 0 }}
E
edisonxiang 已提交
4 5
<div class="bannernew">
    <div class="content">
L
Librahang 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

        <!-- banner -->
        <div id="carousel-example-generic" class="carousel slide" data-ride="carousel" ontouchstart='getFlag()'
            ontouchmove='setFlag()' ontouchend='change()'>

            <ol class="carousel-indicators">
                <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                <li data-target="#carousel-example-generic" data-slide-to="2"></li>
            </ol>

            <div class="carousel-inner wrapper" role="listbox">
                <div class="item active">
                    <img src="../img/bannernew.jpg">
                    <div class="carousel-caption">
                        <p>{{ i18n "main_cards_title" }}</p>
                        <p>{{ i18n "main_cards_description" }}</p>
                    </div>
                </div>
                <div class="item">
                    <img src="../img/2.jpg">
                    <div class="carousel-caption">
28
                        <p>{{ i18n "main_cards_title_second" }}&nbsp;<a style="font-size:17px;color:white"href="https://gitee.com/openeuler/iSulad">{{ i18n "main_cards_title_enter_repository"}}</a></p>
L
Librahang 已提交
29 30 31 32 33 34
                        <p>{{ i18n "main_cards_description_second" }}</p>
                    </div>
                </div>
                <div class="item">
                    <img src="../img/3.jpg">
                    <div class="carousel-caption">
35
                        <p>{{ i18n "main_cards_title_third" }}&nbsp;<a style="font-size:17px;color:white"href="https://gitee.com/openeuler/A-Tune">{{ i18n "main_cards_title_enter_repository"}}</a></p>
L
Librahang 已提交
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
                        <p>{{ i18n "main_cards_description_third" }}</p>
                    </div>
                </div>
            </div>

            <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
                <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
            </a>
            <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
                <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
            </a>
        </div>







        <!-- <h2>{{ i18n "main_cards_title" }}</h2>
        <p> {{ i18n "main_cards_description" }}</p> -->
E
edisonxiang 已提交
57
    </div>
L
Librahang 已提交
58

E
edisonxiang 已提交
59 60 61 62 63
    <div class="cards">
        <ul>
            {{ range .Site.Params.card }}
            <a href="{{ .url }}">
                <!--<img src="{{ .image }}" alt="{{ .title }}">-->
L
Librahang 已提交
64
                <li >
E
edisonxiang 已提交
65 66 67 68 69 70 71 72 73
                    <i class="icon icon{{ .weight }}"></i>
                    <h3>{{ .title }}</h3>
                    <p>{{ .description }}</p>
                </li>
            </a>
            {{ end }}
        </ul>
    </div>
</div>
L
Librahang 已提交
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

<script>
    var flagX,flagXM;

    function getFlag(){
        flagX = event.touches[0].pageX;
        flagXM = flagX;
    }

    function setFlag(){
        flagXM = event.touches[0].pageX;
    }

    function change(){
        var range = flagXM - flagX;

        if(Math.abs(range) < 30){
            return false;
        }     
        var direction = range < 0 ?'next':'prev';
        $("#carousel-example-generic").carousel(direction);
    }


</script>

E
edisonxiang 已提交
100 101
{{ end }}
{{ end }}
E
edisonxiang 已提交
102
{{ end }}