前端样式相关内容整理


前端样式相关内容整理


引言

前端技术变化很快,样式都开始出现框架了。这里记录一下相关的内容。

Bootstrap

Bootstrap 是一款受欢迎的前端框架,用于构建响应式、移动设备优先的网站。Bootstrap 自带的大部分组件都需要依赖 JavaScript 才能起作用。

Bootstrap官网 https://getbootstrap.com/

Bootstrap 中文网 https://www.bootcss.com/

BootStrap4 中文文档 https://bs4.dashgame.com/

Bootstrap 精选模板 https://www.bootmb.com/

学习示例项目 https://gitee.com/ibaiyang/Bootstrap_learn

LayUI

LayUI是一款采用自身模块规范编写的前端UI框架,它遵循原生HTML/CSS/JS的书写与组织形式。 LayUI是基于jQuery的,因此在使用LayUI时需要先引入jQuery库。

文档地址 https://layui.11dz.cn/https://layui.dev/http://layui.xhcen.com/doc/doc.html

GitHub上的LayUI仓库地址为 https://github.com/layui/layui,Gitee上的LayUI仓库地址为 https://gitee.com/layui/layui

在线体验地址 http://layui.xhcen.com/demo/layuiAdmin.html

LayuiMini

LayuiMini是基于LayUI编写的后台admin前端模板,可以快速拿来进行开发。

LayuiMini官网 http://layuimini.99php.cn

源码地址 https://gitee.com/ibaiyang/layuimini

Laravel结合LayuiMini开发的项目 https://gitee.com/ibaiyang/layuimini-laravel

ThinkPHP结合LayuiMini开发的项目 https://gitee.com/ibaiyang/layuimini-thinkphp

Font Awesome

Font Awesome 提供可缩放的矢量图标,可以使用CSS所提供的所有特性对它们进行更改,包括:大小、颜色、阴影或者其它任何支持的效果。

Font Awesome 官方 https://fontawesome.com/

Font Awesome 中文网 https://fontawesome.com.cn/

其他 https://fontawesome.dashgame.com/

ECharts

ECharts是一个由百度开发和维护的、基于JavaScript的开源数据可视化库。

ECharts官方网址 https://echarts.apache.org/zh/index.html

手册地址 https://echarts.apache.org/handbook/zh/get-started

ECharts属性详解:深入了解并优化你的图表 https://blog.csdn.net/qq_22841387/article/details/120403542

Vue

用Vue练手的一个名为“买卖平台”的项目 https://gitee.com/ibaiyang/vue-maimai

B站上三更编程菌讲的一个用Vue开发Blog的学习项目 https://gitee.com/ibaiyang/vue-blog-sgbc

技术栈:vue3 + vite + typescript + element-plus + pinia + vue-router + axios。 源码地址 https://github.com/vue-admin/vue-adminhttps://gitee.com/ibaiyang/vue-admin, 在线体验地址 http://demo.cncf.vip/vue-admin

Vue 2.0 的一个admin项目,源码地址 https://github.com/iview/iview-adminhttps://gitee.com/ibaiyang/admin-iview, 在线体验地址 https://admin.iviewui.com

Vue2 的一个admin项目,源码地址 https://github.com/vue-bulma/vue-admin.githttps://gitee.com/ibaiyang/admin-bulma

renren-fast-vue基于vue、element-ui构建开发,实现renren-fast后台管理前端功能,提供一套更优的前端解决方案, 源码地址 https://gitee.com/ibaiyang/admin-renren

Element UI

Element,一套为开发者、设计师和产品经理准备的基于 Vue 的桌面端组件库。

Element UI 官网 https://element.eleme.io

tailwindcss

官网 https://tailwindcss.com

文档 https://tailwindcss.com/docs/installation

中文网站 https://www.tailwindcss.cn/

源码类库 https://github.com/tailwindlabs

一些免费的可用框架 https://www.creative-tim.com/templates/tailwind-free

分享2023年必备的 8 个Tailwind CSS 资源 https://cloud.tencent.com/developer/article/2336560

Cruip免费组件:https://codepen.io/cruip

Tailwind Awesome https://www.tailwindawesome.com/

Tail-Kit https://www.tailwind-kit.com/

Sailboat UI https://sailboatui.com/

Tailblocks https://tailblocks.cc/

Flowbite https://flowbite.com/

Tailwind Components https://tailwindcomponents.com/

Components Collection https://github.com/unlight/tailwind-components

购买超市 https://shuffle.dev/components/tailwind

高颜值 tailwindcss 后台模板分享 https://cloud.tencent.com/developer/article/2234726

分享2023年必备的 8 个Tailwind CSS 资源 https://cloud.tencent.com/developer/article/2336560

Sass

Sass(Syntactically Awesome Stylesheets)是一种CSS预处理器,它使用缩排语法(或SCSS,即Sassy CSS,使用大括号和分号)来编写样式代码。

Sass增加了变量、嵌套规则、运算、函数、混入(Mixins)、继承等特性,使得CSS更加灵活和强大。

Sass的安装需要Ruby环境,因为它最初是用Ruby编写的。

Sass文件(.scss或.sass)需要通过Sass编译器转换为CSS文件,这可以在命令行中完成,也可以使用构建工具(如Webpack)来自动化。

Less

Less也是一种CSS预处理器,它扩展了CSS的功能,增加了变量、嵌套规则、运算、函数等特性。

Less的语法与CSS非常相似,只是增加了一些额外的功能,因此学习曲线相对较低。

Less是基于JavaScript的,因此不需要额外的环境(如Ruby)来安装。

Less文件(.less)可以通过引入Less.js库在客户端上实时编译为CSS,也可以在服务端使用Node.js等工具进行编译。

Chart.js

Chart.js 是一个基于 HTML5 的图表库,用于在网页上绘制各种类型的图表,如折线图、柱状图、饼图等。

Chart.js 官方网站 https://www.chartjs.org/

Chart.js 文档 https://www.chartjs.org/docs/latest/

Chart.js 中文文档 https://www.chartjs.org/docs/latest/zh/

对比图表:https://cloud.tencent.com/developer/article/1075548

peity.js

peity.js 是一个基于 jQuery 的图表插件,用于在网页上绘制简单的图表,如折线图、柱状图、饼图等。

peity.js 官方网站 https://peity.github.io/peity/

peity.js 文档 https://peity.github.io/peity/docs.html

peity.js 中文文档 https://peity.github.io/peity/docs-zh.html

Flot

Flot 是一个基于 jQuery 的图表插件,用于在网页上绘制简单的图表,如折线图、柱状图、饼图等。

Flot 官方网站 https://www.flotcharts.org/

Flot 文档 https://www.flotcharts.org/docs/

Flot 中文文档 https://www.flotcharts.org/docs/zh/

示例一:

$(function () {
    var d1 = [];
    for (var i = 0; i < 14; i += 0.5)
        d1.push([i, Math.sin(i)]);
 
    var d2 = [[0, 3], [4, 8], [8, 5], [9, 13]];
 
    // a null signifies separate line segments
    var d3 = [[0, 12], [7, 12], null, [7, 2.5], [12, 2.5]];
    
    $.plot($("#placeholder"), [ d1, d2, d3 ]);
});

示例二:

<!-- Flot -->
<script src="/static/js/plugins/flot/jquery.flot.js"></script>
<script src="/static/js/plugins/flot/jquery.flot.tooltip.min.js"></script>
<script src="/static/js/plugins/flot/jquery.flot.resize.js"></script>

<!-- ChartJS-->
<script src="/static/js/plugins/chartJs/Chart.min.js"></script>

<!-- Peity -->
<script src="/static/js/plugins/peity/jquery.peity.min.js"></script>

<style type="text/css">
.peity{
    cursor: pointer;
}
</style>

<span class="line" data-id="{$value1}"  style="display: none;width: 200px;">{$data1}</span>

 <div>
    <div class="flot-chart dashboard-chart" style="margin-top:0px;height:100px">
        <div class="flot-chart-content" id="container1"></div>
    </div>
</div>

<script>
// $data1 = 'stat_time_0,stat_time_1,stat_time_2,stat_time_3,stat_time_4,stat_time_5,stat_time_6,stat_time_7,stat_time_8,stat_time_9,stat_time_10,stat_time_11,stat_time_12,stat_time_13,stat_time_14,stat_time_15'
// $value1 = 11
// 


$(function() {
    function advertiser_data(value1){
         layer.open({
            type: 2,
            title: false,
            offset: 'r',
            anim: 'slideLeft', // 从右往左
            area: ['70%', '100%'],
            shade: 0.1,
            shadeClose: true,
            id: 'ID-demo-layer-direction-r',
            content: '{:url("url1")}?advertiser_id='+value1
        });
    }

    $(".line").peity("line",{
        width:108
    });

    $(".peity").on('click', function() {
        var advertiser_id = $(this).prev().attr("data-id");
        advertiser_data(advertiser_id)
    });

    var barData = {
        label: "bar",
        data: [
            {$total_data.timecost}
        ]
    };
    var barOptions = {
        series: {
            lines: {
                show: true,
                lineWidth: 1,
                fill: true,
                fillColor: {
                    colors: [{
                        opacity: 0.2
                    }, {
                        opacity: 0.2
                    }]
                }
            },
            points: { show: false },
            shadowSize: 0,
            splines: {
                tension: 1,
            },
        },
        xaxis: {
            tickDecimals: 0,
            //show:false
        },
        yaxis:{
            //show:false
        },
        colors: ["rgb(77, 137, 249)"],
        grid: {
            color: "#ffffff",
            hoverable: true,
            clickable: true,
            tickColor: "#D4D4D4",
            borderWidth:0,
            backgroundColor: {
                colors: ["#ffffff", "#ffffff"]
            }
        },
        legend: {
            show: false
        },
        tooltip: true,
        tooltipOpts: {
            content: "时段: %x 点, 消耗: %y"
        }
    };
    $.plot($('#container1'), [barData], barOptions);

    $("#container1").bind("plotclick", function (event, pos, item) {
        if (item) {
            // 点击事件发生在数据点上
            console.log('点击的数据点的值:', item.datapoint[0].toFixed(2), item.datapoint[1].toFixed(2));
        }
    });
});
</script>






参考资料


返回