弘帝企业智能建站系统交流平台

 找回密码
 立即注册
查看: 2313|回复: 1

弘帝框架尝鲜版本

[复制链接]
发表于 2019-8-15 21:34:59 | 显示全部楼层 |阅读模式
hondy.js非成熟版本,每周更新!以hondy.site.login.js.hondy.form.js为准

$(function () {
        $(".sethome,.favorite").click(function () {
                if ($(this).hasClass("sethome")) {
                        setHome($(this)[0], '');
                } else {
                        AddFavorite("", "");
                }
        });
        var cur = $("menu ul .on").index();
        $("menu ul li").hover(function () {
                $("menu ul li").removeClass();
                $(this).addClass("on");
        }, function () {
                $("menu ul li").removeClass();
                $("menu ul li").eq(cur).addClass("on");
        })
        $.getScript("../../../systhemes/js/bootstrap.min.js", function () {
                var navbar = $("navbar-toggler");
                if (navbar.length > 0) {
                        for (var i = 0; i < navbar.length; i++) {
                                var o = navbar.eq(i);
                                var menu = o.attr("menu");
                                var show = o.attr("show");
                                var hide = "";
                                if (show == true) {
                                        show = ' aria-expanded="true"';
                                } else {
                                        show = ' aria-expanded="false"';
                                        hide = "display:none";
                                }
                                o.html('<button class="navbar-toggler fa fa-navicon ' + o.attr("btn") + '"' + show + '></button><div class="' + o.attr("menu") + '" style="' + hide + '">' + $("#" + o.attr("tar")).html() + '</div>');
                                o.find("button").click(function () {
                                        switch ($(this).attr("act")) {
                                                case "in":
                                                        if ($(this).attr("aria-expanded") == "false") {
                                                                $(this).attr("aria-expanded", "true");
                                                                $(this).next().fadeIn(800);
                                                        } else {
                                                                $(this).attr("aria-expanded", "false");
                                                                $(this).next().fadeOut(800);
                                                        }
                                                        break;
                                                default:
                                                        if ($(this).attr("aria-expanded") == "false") {
                                                                $(this).attr("aria-expanded", "true");
                                                        } else {
                                                                $(this).attr("aria-expanded", "false");
                                                        }
                                                        $(this).next().slideToggle(800);
                                                        break;
                                        }
                                });
                                window.onresize = function () {
                                        o.find("button").attr("aria-expanded", "false");
                                        o.find("button").next().fadeOut();
                                }
                        }
                }
        });
        $(".TabTitle").hover(function () {
                $(this).closest("#TabStrip").find(".TabContent").addClass("hide");
                $(this).closest("#TabStrip").find(".TabContent").eq($(this).index() - 1).removeClass("hide");
        })
        ulbox();
        isImgLoad(carousel);
});
var ulbox = function () {
        var o = $(".ul-col");
        if (o.length > 0) {
                for (var i = 0; i < o.length; i++) {
                        var w = o.eq(i).find("ul").width();
                        w = w / responsive(w);
                        o.eq(i).find("li").css("width", w);
                }
        }
}
$(window).bind('resize', function () {
        ulbox();
});
var rndsearch = function (css, max) {
        var kw = $("." + css).find(".Descript").html();
        var k = kw.split(' ');
        var kws = [];
        var html = "";
        for (var i = 0; i < k.length; i++) {
                if (k != "") {
                        kws.push(k);
                }
        }
        var rand = [];
        rand = rnd(0, kws.length, max);
        for (var i = 0; i < rand.length; i++) {
                html = html + "<a>" + kws[rand] + "</a>"
        }
        $("." + css).find(".Descript").html(html).find("a").on("click", function () {
                var kw = $(this).html();
                $.send("", {
                        kw: kw,
                        so: 1
                });
        });
}
var rnd = function (min, max, count) {
        var randoms = [];
        while (true) {
                var isExists = false;
                var random = parseInt(min + (max - min) * (Math.random()))
                for (var i = 0; i < randoms.length; i++) {
                        if (random === randoms) {
                                isExists = true;
                                break;
                        }
                }
                if (!isExists)
                        randoms.push(random);
                if (randoms.length === count)
                        break;
        }
        return randoms;
}

function responsive(v) {
        if (v > 1200) {
                return 5;
        }
        if (v > 960) {
                return 4;
        }
        if (v > 720) {
                return 3;
        }
        return 2
}

function AddFavorite(sURL, sTitle) {
        try {
                if (typeof (sURL) == "undefined" || sURL.length == 0) {
                        sURL = window.location;
                }
                if (typeof (sTitle) == "undefined" || sTitle.length == 0) {
                        sTitle = document.title;
                }
                window.external.addFavorite(sURL, sTitle);
        } catch (e) {
                try {
                        window.sidebar.addPanel(sTitle, sURL, "");
                } catch (e) {
                        alert("您使用的浏览器不支持此功能,请按“Ctrl + D”键手工加入收藏!");
                }
        }
}

function setHome(objid, urls) {
        var a = objid,
                b = urls,
                c = "unknown";
        try {
                if (typeof (b) == "undefined" || b.length == 0) {
                        b = location.href;
                }
                a.style.behavior = "url(#default#homepage)";
                var d = a.isHomePage(b);
                d = (d = d || a.isHomePage(b + "/")) || a.isHomePage(b + "/#");
                d = "" + d;
                if (d != "true") {
                        a.setHomePage(b);
                } else {
                        alert("您已经设为首页了!");
                }
        } catch (e) {
                alert("您的浏览器不支持自动设置主页,请使用浏览器菜单手动设置!");
                return "unknown"
        }
};
var marquee = [];
var carousel = function (v) {
        if ($(v).length > 0) {
                $.getScript("../../../systhemes/js/msclass.js", function () {
                        var count = $(v).length;
                        for (var i = 0; i < count; i++) {
                                if (i == 0) {
                                        var ID = "";
                                } else {
                                        var ID = i
                                }
                                var MSClassID = $(v).eq(i).attr("sid");
                                if (MSClassID == undefined) {
                                        var MSClassID = v + ID;
                                } else {
                                        MSClassID = MSClassID + ID
                                }
                                $(v).eq(i).find("ul").wrapAll("<div id='" + MSClassID + "'></div>");
                                var w = $("#" + MSClassID).width();
                                if ($(v).eq(i).attr("mode") == "full") {
                                        var ContentID = "BoxContent" + ID;
                                        $(v).eq(i).find("ul").attr("id", ContentID);
                                        var delay = 5000;
                                        var dir = 2;
                                        var ss = w;
                                        var st = 2;
                                        var step = 0.1
                                } else {
                                        var delay = 1000;
                                        var dir = 2;
                                        var ss = parseInt(w / responsive(w));
                                        var st = 0;
                                        var step = 2;
                                }
                                $(v).eq(i).find("li").css({
                                        width: ss
                                });
                                var h = parseInt($(v).eq(i).find("ul li").outerHeight());
                                $(v).eq(i).find("ul").css({
                                        "display": "inline-flex",
                                        "flex-wrap": "nowrap"
                                })
                                marquee = new Marquee({
                                        MSClassID: MSClassID,
                                        ContentID: ContentID,
                                        Direction: dir,
                                        Step: step,
                                        Width: w,
                                        Height: h,
                                        Timer: 1,
                                        DelayTime: delay,
                                        WaitTime: 3000,
                                        SwitchType: st,
                                        ScrollStep: ss,
                                        AutoStart: 1
                                });
                        }
                        var resizeTimer = null;
                        $(window).bind('resize', function () {
                                if (resizeTimer) clearTimeout(resizeTimer);
                                resizeTimer = setTimeout(function () {
                                        for (var i = 0; i < count; i++) {
                                                $(v).eq(i).find("ul").closest("div").css({
                                                        width: "100%",
                                                        height: $(v).eq(i).find("ul li").outerHeight()
                                                });
                                        }
                                }, 500);
                        });
                });
        }
}
$.extend({
        send: function (url, args) {
                var body = $(document.body),
                        form = $("<form method='post'></form>"),
                        input;
                form.attr({
                        "action": url
                });
                $.each(args, function (key, value) {
                        input = $("<input type='hidden'>");
                        input.attr({
                                "name": key
                        });
                        input.val(value);
                        form.append(input)
                });
                form.appendTo(document.body);
                form.submit();
                document.body.removeChild(form[0])
        }
});
var t_img;
var isLoad = true;
var isImgLoad = function (callback, v) {
        if (v == undefined) v = "carousel";
        $(v).find('img').each(function () {
                if (this.height === 0) {
                        isLoad = false;
                        return false;
                }
        });
        if (isLoad) {
                clearTimeout(t_img);
                callback(v);
        } else {
                isLoad = true;
                t_img = setTimeout(function () {
                        isImgLoad(callback, v);
                }, 500);
        }
}

回复

使用道具 举报

 楼主| 发表于 2019-8-15 21:35:34 | 显示全部楼层
hondy.scss

@import url(../../../SysThemes/css/bootstrap.min.css);
@import url(../../../SysThemes/css/awesome.css);
@import url(../../../SysThemes/css/wow.css);
$blue:#1E61BA;
$dark:#383838;
$gray:#eee;
$grey:#bebebe;
$green:#54BA19;
$light:#f8f8f8;
$orange:#FF9900;
$red:#f00;
$txt-gray:#888;
$txt-grey:#666;
$white:#fff;

:root {
    font-size: 0.875rem
}

::after,
::before {
    font-family: fontawesome
}

html {
    overflow-x: hidden
}

@-ms-viewport {
    width: device-width
}

a,
a:hover {
    text-decoration: none
}

body {
    margin: 0
}

menu {
    margin: 0;
    padding: 0;

    ul {
        display: flex;
        flex-flow: row nowrap;
        justify-content: space-between;
        margin-bottom: 0;

        li {
            flex: 1;
            position: relative;

            a {
                display: flex;
                justify-content: center;
                padding: 8px 10px;
            }

            ul {
                display: none;
                flex-flow: column nowrap;
                position: absolute;
                z-index: 1000;
                min-width: 100%;

                li a {
                    white-space: nowrap;
                    padding-top: 8px;
                    padding-bottom: 8px;
                    color: $white
                }
            }
        }
    }
}

ul li {
    position: relative;
    box-sizing: border-box;
}

.bb-gray-1 {
    border-bottom: 1px solid $gray
}

.bb-grey-1 {
    border-bottom: 1px solid $grey
}

.blue {
    background-color: $blue;
    color: $white;

    * {
        color: $white;
    }
}

.bottom {
    font-size: .75rem;

    h3 {
        font-size: 1rem;
        font-weight: 700;
    }
}

.dark {
    background: $dark;
    color: $gray;

    * {
        color: $gray;
    }

    .bottom {
        color: $grey;

        * {
            color: $grey;
        }
    }

}

.gray {
    background-color: $gray
}

.light {
    background-color: $light
}


.menu {
    display: none;
    width: 100%;
    position: fixed;
    left: 0;
    z-index: 2000;
    background: #000;

    ul {
        display: flex;
        flex-flow: column wrap;
        width: 100%;
        padding: 10px;

        li {
            background: rgba(255, 255, 255, .2);
            margin: 2px;

            a {
                display: flex;
                align-items: center;
                line-height: 2em;
                color: #fff;

                b {
                    width: 0;
                    height: 0;
                    margin-top: 0px;
                    margin-left: 10px;
                    border-left: 5px solid $white;
                    border-top: 5px solid transparent;
                    border-bottom: 5px solid transparent;

                }
            }

            ul {
                display: none;
                padding-top: 5px;
                padding-bottom: 5px;

                li a {
                    white-space: pre-wrap;
                    line-height: 1.5em;
                    padding: 10px;
                }
            }
        }
    }
}

.nav {
    display: flex;
    flex-flow: row wrap;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 30px;

    menu {
        display: none
    }

    .title {
        font-size: 1.2rem;
        border-bottom: 1px dotted #ccc;
    }

    .path {
        font-size: 75%;

        * {
            font-size: 75%;
        }
    }
}

dd,
li,
ul {
    padding: 0;
    margin: 0;
    list-style: none
}

sign {
    margin-left: 5px;
    margin-right: 5px
}

.power .dd {
    padding-left: 1em;
    padding-right: 1em
}

.navbar-toggler {
    display: inline-flex;
    width: 50px;
    height: 50px;
    border-radius: 5px;
    align-items: center;
    justify-content: center;

    &::before {
        font-size: 30px
    }
}

.wp-fixed .navbar-toggler {
    position: fixed;
    z-index: 2000;
    top: 15px;
    right: 15px;
}

.about .intro {
    line-height: 200%
}

.hidden,
.hide {
    display: none
}

.body {
    margin-top: 2em;
    min-height: 380px
}

.order {
    display: flex;
    flex-flow: column wrap
}

.phone {
    .Margin {
        text-align: right;

        .hotline {
            display: inline-flex;
            flex-direction: column;
            text-align: left;
            padding-left: 60px;
            position: relative;

            &::before {
                display: flex;
                content: '\f098';
                line-height: 1em;
                margin-right: 10px;
                color: $green;
                font-size: 4.5rem;
                position: absolute;
                left: 0;
                top: 0;
                align-items: center
            }

            .dd {
                display: block;
                clear: both;
                font-size: 2.5rem;
                line-height: 1em;
                font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
                color: $orange;
            }
        }
    }
}

#ArticleIntro ul {
    display: flex;
    flex-flow: column wrap;

    li {
        margin-bottom: 20px;

        .detail {
            position: relative;
            padding-left: 88px;

            .intro {
                color: $txt-gray;
                position: relative;

                .enter {
                    position: absolute;
                    bottom: 0;
                    right: 0;

                    a {
                        text-transform: uppercase;
                        background: $gray;
                        padding: 0 10px;
                        color: $txt-grey;
                        font-size: 12px;
                    }

                }
            }

            .LongDatePlus {
                position: absolute;
                z-index: 10;
                left: 0;
                top: 6px;
                padding: 8px;
                margin-right: 20px;
                text-align: center;

                .dd {
                    display: block;
                    font-size: 28px;
                    font-weight: 700;
                    line-height: 30px
                }
            }
        }
    }
}

#ArticleList {
    ul {
        li {
            margin-bottom: 10px;

            .Article {
                display: flex;
                text-align: left;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;

                h6 {
                    margin-bottom: 0;

                    a {
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        white-space: nowrap;
                        overflow: hidden;
                        text-overflow: ellipsis;

                        &::before {
                            display: inline-flex;
                            content: '\f0da';
                            margin-right: 10px;
                            overflow-x: auto;
                            text-overflow: inherit;
                        }
                    }
                }
            }
        }
    }
}

#ArticleView ul,
#ProductView ul {
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
    margin-bottom: 0;

    li {
        display: flex;
        flex-flow: column wrap;
        width: 50%;
        padding: 10px;
        max-height: 320px;
        min-width: 110px;
        overflow: hidden;

        .thumbs {
            display: flex;
            width: 100%;
            height: calc(100% - 3em);

            a {
                display: flex;
                justify-content: center;
                width: 100%;
                max-width: 100%;
                height: 100%;
                align-items: center;
                justify-content: center;

                img {
                    width: 100%;
                    height: 100%;
                    max-width: 100%;
                    max-height: 100%;
                }
            }
        }

        >span a,
        >a {
            display: block;
            width: 100%;
            height: 3em;
            line-height: 3em;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;

            &:hover {
                overflow-x: auto;
                text-overflow: inherit;

                &::-webkit-scrollbar-track {
                    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
                    background-color: $light;
                    border-radius: 5px;
                }

                &::-webkit-scrollbar {
                    height:5px;
                    background-color: $light;
                }

                &::-webkit-scrollbar-thumb {
                    background-color: $grey;
                    border-radius: 5px;
                    background-image: -webkit-linear-gradient(45deg, rgba(0, 0, 0, .3) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, .3) 50%, rgba(0, 0, 0, .3) 75%, transparent 75%, transparent)
                }
            }

        }
    }
}

#ArticleDetail {
    .Title {
        display: block;
        text-align: center;
        font-size: 30px;
        font-weight: 700;
        line-height: 1.5em;
        padding: 20px 0;
    }

    .Detail {
        color: inherit;
        font-size: inherit;
        line-height: 1.8em;

        * {
            color: inherit;
            font-size: inherit;
        }

        p {
            margin: 10px auto;
            line-height: 1.8em;
            text-indent: 2em
        }
    }

    img {
        max-width: 100%;
    }
}

#ProductDetail {
    h1 {
        text-align: center;
    }

    img {
        max-width: 100%;
    }

    .Subject {
        font-size: 1.28em;
        margin-top: 20px;
        margin-bottom: 10px;
    }
}

.Log {
    display: block;
    text-align: center;
    background: $light;
    color: $txt-gray;
    margin-bottom: 20px;
    padding: 10px 0;

    * {
        color: $txt-gray;
    }
}

.Picture {
    text-align: center;

    img {
        max-width: 100%;
    }
}

.Pagination {
    display: block;
    clear: both;
    text-align: center;
    padding: 10px 0;
    background: #f8f8f8;
    margin-top: 30px;

    a {
        padding: 0 2px
    }

    #page {
        text-align: center;
        line-height: 1em
    }
}

.RowsTitle {
    margin-bottom: 30px;

    h3 {
        position: relative;

        .cn {
            display: block;
            margin: 0
        }

        .en {
            display: block;
            font-weight: 400
        }

    }
}

.search {
    padding-left: 15px;
    padding-right: 15px;

    .RowsTitle {
        display: none;
        margin-right: 1rem;
        margin-bottom: 5px;

        h3 {
            display: flex;
            margin-bottom: 0;
            font-size: 1.125rem;
            line-height: 1.5;

            &:before {
                display: inline-flex;
                content: '\f1b0';
                font-size: 1.125rem;
                margin-right: 10px
            }
        }
    }

    .Content {
        flex-grow: 1
    }

    form {
        display: flex;
        flex-flow: row nowrap;
        border: 1px solid $gray;
        margin-left: auto;
        margin-right: 0;
    }

    input {
        height: 30px;
        line-height: 28px;
        padding: 0 10px;
        font-size: 14px;
        border-style: none;

        &[name=kw] {
            flex: 1;
            border-right: 0 solid transparent;
        }

        &[type=submit] {
            background-color: $gray;
        }
    }

    select {
        height: 30px;
        line-height: 28px;
        padding: 0 0 0 5px;
        font-size: 14px;
        border-style: none;
    }

    .Subject {
        display: none;
        margin-bottom: 5px;
        flex-grow: 1;

        .Descript {
            text-align: left;
        }
    }
}

.circle {
    form {
        border-radius: 10px;

        input {
            &[name=kw] {
                border-top-left-radius: 10px;
                border-bottom-left-radius: 10px;
            }

            &[type=submit] {
                border-top-right-radius: 10px;
                border-bottom-right-radius: 10px;
            }
        }
    }
}

.ShortDate {
    white-space: nowrap;
    margin-right: 5px
}

.sider {
    .RowsTitle {
        margin-bottom: 0;
        border-bottom: 1px solid #ccc;

        .Title {
            flex-direction: row;
            justify-content: flex-start;
            padding-top: 20px;
            padding-bottom: 20px
        }
    }

    ul li {
        border-bottom: 1px solid #eee;

        a {
            display: block;
            line-height: 4rem;
            text-align: center;
            font-size: 125%
        }

        ul li {
            border-bottom: 0;
            padding-top: 0;
            padding-bottom: 0;

            a {
                display: block;
                text-indent: 30px;

                &::before {
                    content: ""
                }
            }
        }
    }
}

.guide {
    &.line-through {
        display: flex;
        flex-flow: row nowrap;
        justify-content: space-between;
        align-items: flex-end;

        .title {
            font-size: 150%
        }
    }

    .path {
        display: none
    }
}

#Telephonist {
    background: url(../images/telephonist.jpg) no-repeat;
    padding-top: 250px;
    margin-bottom: 50px;
    overflow: hidden;

    .CompanyName {
        font-size: 1.5em;
        font-weight: bold;
    }
}

#map {
    height: 500px;
    border: 1px solid #ccc;
}

#map .tiplabel {
    height: 20px;
    padding: 0 10px;
}

.MessageTable {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 10px;

    &::before {
        content: '\f0e5';
        font-size: 1.5rem;
        margin-right: 10px;
    }

    red {
        color: $red;
    }
}

.message {
    [type=text] {
        width: 100%;
        padding: 5px;
    }

    [type=submit] {
        margin-top: 10px;
        padding: 5px 30px;
    }

    textarea {
        width: 100%;
        height: 10em;
        padding: 5px;
    }

    &.common {
        .title {
            margin-top: 5px;
            line-height: 2em;
        }
    }
}

@media (min-width: 576px) {
    .search {
        .RowsTitle {
            display: flex;
        }
    }
}

@media (min-width: 768px) {}

@media (min-width: 992px) {
    .about {
        .Margin {
            display: flex;
            flex-flow: row nowrap;

            .card {
                flex: 1;
                padding: 10px;
                border: 1px solid $gray;
                margin-right: 30px;
                overflow: hidden;

                img {
                    height: 100%
                }
            }

            .intro {
                flex: 1;
            }

            .clear {
                flex: 0;
            }
        }
    }

    .search {
        .RowsTitle {
            display: flex;
            margin-bottom: 0;
        }

        .Subject {
            display: flex;
            margin-bottom: 0;
        }
    }

    .navbar-toggler {
        display: none
    }

    #Telephonist {
        padding-top: 0px;
        padding-left: 350px;
    }

    .li-lg-2 {
        #ArticleIntro {
            ul {
                display: flex;
                flex-flow: row wrap;

                li {
                    width: calc(50% - 15px);

                    &:nth-child(2n+1) {
                        margin-right: 30px;
                    }
                }

            }
        }

    }

    .menu {
        display: flex;
        position: inherit;
        top: 0;
        left: 0;
        z-index: auto;
        background: none;

        ul {
            flex-flow: row nowrap;
            justify-content: space-between;
            padding: 0;

            li {
                margin: 0;
                background: none;

                a {
                    line-height: 3rem;
                    color: $white;
                    text-align: center;

                    b {
                        margin-top: 5px;
                        border-top: 5px solid $white;
                        border-left: 5px solid transparent;
                        border-right: 5px solid transparent;
                    }
                }

                ul {
                    display: none;
                    flex-flow: column wrap;
                    left: 0;
                    padding-top: 5px;
                    padding-bottom: 5px;

                    li a {
                        white-space: pre-wrap;
                        line-height: 1.5em;
                        padding: 10px;
                    }
                }

                &:hover {
                    ul {
                        display: flex;
                    }
                }
            }
        }
    }

    .nav menu {
        display: block;
        width: 100%;

        ul {
            display: flex;
            justify-content: center;
            align-items: center;

            li {
                text-align: center
            }
        }
    }

    .guide .path {
        display: flex
    }

    .search .Content {
        max-width: 400px;
    }
}

@media (min-width: 1200px) {}
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|弘帝企业智能建站系统 ( 皖ICP备07503252号 )

GMT+8, 2024-4-21 00:02 , Processed in 0.096001 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表