diff --git a/themes/tajian/controller/SiteController.php b/themes/tajian/controller/SiteController.php index 173fa3e..19bae36 100644 --- a/themes/tajian/controller/SiteController.php +++ b/themes/tajian/controller/SiteController.php @@ -127,4 +127,49 @@ Class SiteController extends Controller { return $sorted_tags; } + //添加新视频 + public function actionNew() { + //获取数据 + $menus = array(); //菜单,一级目录 + $htmlReadme = ''; //Readme.md 内容,底部网站详细介绍 + $htmlCateReadme = ''; //当前目录下的Readme.md 内容 + $menus_sorted = array(); //Readme_sort.txt 说明文件内容,一级目录菜单从上到下的排序 + + $scanner = new DirScanner(); + $scanner->setWebRoot(FSC::$app['config']['content_directory']); + $dirTree = $scanner->scan(__DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'], 4); + $scanResults = $scanner->getScanResults(); + + $titles = array(); + $htmlReadme = ''; + $readmeFile = $scanner->getDefaultReadme(); + if (!empty($readmeFile)) { + if (!empty($readmeFile['sort'])) { + $menus_sorted = explode("\n", $readmeFile['sort']); + } + + $titles = $scanner->getMDTitles($readmeFile['id']); + + $Parsedown = new Parsedown(); + $content = file_get_contents($readmeFile['realpath']); + $htmlReadme = $Parsedown->text($content); + $htmlReadme = $scanner->fixMDUrls($readmeFile['realpath'], $htmlReadme); + } + + //获取tags分类 + $tags = $this->getTags($dirTree); + + //排序 + if (!empty($menus_sorted) && !empty($tags)) { + $tags = $this->sortTags($menus_sorted, $tags); + } + + + $pageTitle = '添加视频收藏'; + $viewName = 'new'; + $params = compact('cateId', 'dirTree', 'scanResults', 'htmlReadme', 'tags'); + return $this->render($viewName, $params, $pageTitle); + } + + } diff --git a/themes/tajian/views/layout/main.php b/themes/tajian/views/layout/main.php index 9e67a3d..dc1aaaa 100644 --- a/themes/tajian/views/layout/main.php +++ b/themes/tajian/views/layout/main.php @@ -10,27 +10,61 @@ require_once __DIR__ . '/../../../../plugins/Html.php'; - - - - - - + - -
-
+ Ta荐 - - + +
+ 图片 + 联系我们 +
+
+ +
+ +
+
视频分类
+ $item) { + $selected = $item['id'] == $selectedId || (!empty($breadcrumbs) && $item['id'] == $breadcrumbs[0]['id']) ? 'this_set' : ''; + echo << + 菜单图标 + {$item['name']} +eof; + } +} +?> +
- eof; } - -include_once __DIR__ . '/form_addfav.php'; ?> -
+
+
- - 封面图 - {$title} - {$platform} - - - {$pubDate},{$title} - + eof; } } ?>
+
diff --git a/themes/tajian/views/site/new.php b/themes/tajian/views/site/new.php new file mode 100644 index 0000000..5226a4d --- /dev/null +++ b/themes/tajian/views/site/new.php @@ -0,0 +1,38 @@ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
diff --git a/www/css/tajian.css b/www/css/tajian.css new file mode 100644 index 0000000..b941579 --- /dev/null +++ b/www/css/tajian.css @@ -0,0 +1,223 @@ +body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,select,p,blockquote,th,td{margin:0;padding:0;} +/* body{position:relative;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;word-break: break-all;background-color:#FFF;color:#FFF;font-size:14px;line-height:1.428571429} */ +body{position:relative;font-family:"Roboto","Arial",sans-serif;background-color:#FFF;color:#000;font-size:14px;line-height:1.428571429} +html{scroll-behavior:smooth} +ul,li{list-style:none;margin:0;padding:0;} +img,span,em,a{display:inline-block;max-width:100%} +*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box} +a{color:#464c5c;} +.clearfix{zoom:1;} +.clearfix:after{content:'.';display:block;visibility:hidden;clear:both;overflow:hidden;height:0px;} +.img-responsive{max-width:100%;display:block;} +.elementBlock{display:block !important;} +.elementNone{display:none !important;} +.elementhidden{visibility:hidden !important;} +.verMiddle{vertical-align:middle !important;} +.vercenter{text-align:center !important;} +.verbold{font-weight:bold !important;} +.opacityshow{opacity:1 !important;} +a:hover{text-decoration:none;} +a:active{text-decoration:none;} +a:visited{text-decoration:none;} +a:link{text-decoration:none;} +.breadcrumbs{padding-left:1em;padding-top:1em} +.footer{margin:5em auto 6em auto;text-align:center} + +/* 首页 star*/ +.g_app_lay{padding:56px 0 0 200px;} +/* 顶部导航 */ +.top_nav{position:fixed;top:0;left:0;z-index:1100;width:100%;height:56px;overflow:hidden;background:#FFF;padding:8px 22px;display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;justify-content: space-between;} +.log_tn img{width:37px;float:left;} +.log_tn span{ + font-family: Brush Script MT; + color: #181818; + font-size: 24px; + text-shadow: 1px 1px 0 rgb(122 122 122), + 1px 1px 5px rgb(183 183 183 / 80%); + margin-top:3px; +} +.right_class_tn{padding-top:5px;} +.right_class_tn img{margin-left:5px;} +.search_move_tn img{width:24px;} +.connect_me_tn img{width:22px;} + +.search{flex:1;display:flex;align-items: center;margin:0 30px;max-width:555px;} +.search-left-arrow{padding:5px 13px;display:none;} +.search-left-arrow img{width:32px;display:block;} +.search_form{display:flex;flex:1;align-items: center;border-radius:5px;background-color: #dedede;} +.search_form .input_sf{flex:1;} +.search_form .input_sf input{border-radius:5px;width:100%;border-top-right-radius:0;border-bottom-right-radius: 0;border:none;padding:0 0 0 14px;font-size:15px;height:40px;background:transparent;} +.search_form .input_sm{cursor:pointer;width:52px;border:none;background:transparent;border-radius:5px;border-top-left-radius:0;border-bottom-left-radius: 0;} +.search_form .input_sm img{width:22px;} + +/* 移动端搜索 */ +.mobile_search{opacity:0;transform:translateX(101%);position:fixed;left:0;right:0;top:0;bottom:0;opacity:0;transform:translateX(101%);background-color:#FFF;z-index:1200;} +.mob_search_form{background:none;margin-top:18px;} +.mob_search_form .close{width:52px;text-align:center;} +.mob_search_form .input_sf{background-color:#f7f7f7;border-radius:9px;border:solid 1px #e0e0e0;} + +/* 左侧菜单 */ +.app_layout_side{padding:3px 0 0 0;width:200px;height:100vh;position:fixed;top:56px;left:0;z-index: 1000;overflow-y:auto;background:#FFF;} +.g_ls_menus{padding:9px 12px 6px 12px;border-bottom:solid 1px #eeeeee;} +.g_ls_menus .meuns_title{color:#686868;padding:10px 0 4px 8px;font-weight: bold;} +.g_ls_menus>a{display:block;padding:12px 18px;margin-bottom:4px;color:#4c4c4c;} +.g_ls_menus>a img{width:22px;vertical-align:middle;margin-right:8px;} +.g_ls_menus>a span{vertical-align:middle;} +.g_ls_menus>a:hover, .g_ls_menus .this_set{background-color: #f0f0f0;border-radius: 10px;} +.g_ls_menus .this_set{color: #000;font-weight:bold;font-size:15px;} + + +/* 主内容 */ +.g_main_lay{padding:0 2% 0 3.4%;margin-top:18px;min-height:280px;position:relative;max-width:1700px;} +.g_main_border{border-top:solid 1px #eeeeee;} +.vl_list_main{float:left;width:25%;margin:10px 0 22px 0;position:relative} +.video-menu-ow{border-bottom:1px solid rgba(0,0,0,.1)} +/* .vl_list_main:hover .video_img_vl img{transform:scale(1.01)} */ +.vl_list_main:hover .video_title_vl>a{font-weight:bold;} +.video_img_vl{border-radius:6px;width:calc(100% - 16px);position:relative;padding-top:71%;overflow:hidden;background:rgb(0 0 0 / 1)} +.video_img_vl a{text-align:center;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center} +.video_img_vl img{transform:scale(1);transition:all 0.3s ease-in-out;display:inline-block;max-width:100%;max-height:100%;} +.video_title_vl{padding:0 16px 0 0;color:#bbbbbb;background: #FFF;} +.video_title_vl>a{color:#000;min-height:49px;padding:9px 3px 0 3px;word-break:break-all; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; /* 这里是超出几行省略 */ + overflow: hidden; +} + +/* 首页 end*/ + +/* 联系我们 */ +.svgimg{width:2em;height:2em;vertical-align:middle;fill: currentColor;overflow: hidden;} +.blank_cover{transition: all 0.5s ease;position:fixed;left:0;right:0;top:0;bottom:0;background:rgba(0, 0, 0, .7);opacity:0;z-index: 1199} +.right_sidebox{padding:15px 10px 15px 18px;opacity:0;transform:translateX(101%);background-color:#FFF;position:fixed;right:0;top:0;bottom:0;color:#333;width:396px;overflow-y:auto;max-width:100%;z-index:1200;} +.right_sidebox>h5{display:flex;padding:15px 0 10px 0;border-bottom:solid 1px #e9e2e2;margin-bottom:20px;} +.right_sidebox>h5 span{font-size:20px;font-weight:bold;flex: 1;} +.right_sidebox .link{text-decoration: underline;color:#457fc1;} +.right_sidebox .sort1{font-size:16px;font-weight:bold;margin-top:10px;} +.right_sidebox p{margin:5px 0;} +.right_sidebox .codeimg{width:48%;} +.sideboxShow{animation:bounceInRight 0.5s ease forwards;} + +/* 添加视频 */ +.g_form_style{width:406px;margin:11% auto 0 auto;} +.g_form_style input,.g_form_style select{width:100%;font-size:15px;padding:12px 10px;border-radius:5px;border:solid 1px #9b9b9b;margin:6px 0 0 0;} +.g_form_style>div{margin-bottom:11px;} +.avform_bt{margin-top:18px;} +.avform_bt button{position: relative;font-size:15px;min-width:100px;border-radius:6px;padding:10px 3px;border:none;background-color:#0d6efd;color:#FFF;cursor: pointer;} +.loading_bt{display:inline-block;} +.bt_loading_cover{z-index:100;position:absolute;left:-1px;right:-1px;top:-1px;bottom:-1px;background:rgba(225,225,225,.5);} +.loading_bt svg{width: 20px;transform-origin: center;animation: change 2.5s linear infinite; +} +.loading_bt circle {fill: none;stroke: #FFF;stroke-width: 7;stroke-dasharray: 1, 200;stroke-dashoffset: 0;stroke-linecap: round;animation: diansh 2s ease-in-out infinite; +} + +/* 个人中心 */ +.ui_name{padding:3% 0 0 0;margin-bottom:20px;display:flex;align-items: center;justify-content:center;} +.ui_name img{width:112px;border:solid 4px #e6e6e6;border-radius:50%;} +.ui_name span{font-size:21px;font-weight:bold;margin-left:18px;} +.ui_menu{border-bottom: solid 1px #eeeeee;padding:0 0 0 3%;} +.ui_menu>a{padding:0 2px 6px 2px;margin:0 9px;} +.ui_menu .this_sel{font-weight:bold;border-bottom:solid 3px #000;font-size:15px;} +.ui_video_state{color:#ada7a7;margin:18% 0 10% 0;} + +@keyframes bounceInRight { + 0%, + 60%, + 75%, + 90%, + to { + -webkit-animation-timing-function: cubic-bezier(.215, .61, .355, 1); + animation-timing-function: cubic-bezier(.215, .61, .355, 1) + } + + 0% { + opacity: 0; + -webkit-transform: translate3d(3000px, 0, 0) scaleX(3); + transform: translate3d(3000px, 0, 0) scaleX(3) + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0) scaleX(1); + transform: translate3d(0, 0, 0) scaleX(1) + } + + 75% { + -webkit-transform: translate3d(0, 0, 0) scaleX(.98); + transform: translate3d(0, 0, 0) scaleX(.98) + } + + 90% { + -webkit-transform: translate3d(0, 0, 0) scaleX(.995); + transform: translate3d(0, 0, 0) scaleX(.995) + } + + to { + opacity: 1; + -webkit-transform: translateZ(0); + transform: translateZ(0) + } +} +@keyframes circle { + 0% { + transform: rotate(0); + } + + 100% { + transform: rotate(360deg); + } +} + + +@keyframes change { + 100% { + transform: rotate(360deg); + } +} +@keyframes diansh { + 0% { + stroke-dasharray: 1, 200; + stroke-dashoffset: 0; + } + + 50% { + stroke-dasharray: 90, 200; + stroke-dashoffset: -35px; + } + + 100% { + stroke-dashoffset: -125px; + } +} + +@media screen and (max-width: 1199px) { + +} + +@media screen and (max-width: 991px) { + +} + +@media screen and (max-width: 767px) { + .vl_list_main{width:50%;} +} + +.visible_movi_xs{display:none;} +.hide_movi_xs{display:block;} +@media screen and (max-width:480px) { + .visible_movi_xs{display:inline-block;} + .hide_movi_xs{display:none;} + .top_nav{box-shadow:0 0 7px 0 rgb(155 155 155);} + .g_app_lay{padding:56px 0 60px 0} + .g_main_lay{margin-top:5px;padding:0 0 0 6px;} + .video_img_vl{width:calc(100% - 6px);padding-top:72.6%;} + .app_layout_side{padding:6px 0 6px 0;box-shadow: 0 0 7px 0 rgb(155 155 155);top:initial;bottom:0;right:0;width:100%;height:auto;} + .menu_ls{display:flex;justify-content:space-around;padding:0;border:none;} + .menu_ls>a{flex:1;text-align:center;padding:10px 0;margin:0;} + .menu_ls>a img{margin:0;} + .g_form_style{padding:0 12% 0 10%;width:100%;} +} + +.hide{display:none} diff --git a/www/img/PersonalCenter.svg b/www/img/PersonalCenter.svg new file mode 100644 index 0000000..1d0dfd8 --- /dev/null +++ b/www/img/PersonalCenter.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/www/img/addvideos.svg b/www/img/addvideos.svg new file mode 100644 index 0000000..9d6c0d7 --- /dev/null +++ b/www/img/addvideos.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/www/img/buld.svg b/www/img/buld.svg new file mode 100644 index 0000000..00656fd --- /dev/null +++ b/www/img/buld.svg @@ -0,0 +1,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/www/img/choice.svg b/www/img/choice.svg new file mode 100644 index 0000000..fb02fcc --- /dev/null +++ b/www/img/choice.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/www/img/clos.svg b/www/img/clos.svg new file mode 100644 index 0000000..fcffdbc --- /dev/null +++ b/www/img/clos.svg @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/www/img/contactUs.svg b/www/img/contactUs.svg new file mode 100644 index 0000000..ca9b623 --- /dev/null +++ b/www/img/contactUs.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/www/img/other.svg b/www/img/other.svg new file mode 100644 index 0000000..cad5fde --- /dev/null +++ b/www/img/other.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/www/img/search.svg b/www/img/search.svg new file mode 100644 index 0000000..db55cee --- /dev/null +++ b/www/img/search.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/www/js/tajian.js b/www/js/tajian.js index e0f6cc5..cd8c5f5 100644 --- a/www/js/tajian.js +++ b/www/js/tajian.js @@ -1,6 +1,220 @@ /* for theme TaJian */ (function() { +// 公用功能 +var taJian = { + debug: false, + domain: 'https://tajian.tv', + apis: { + addVideos: '/frontapi/addfav', //添加视频 + register: '/frontapi/register', //注册 + login: '/frontapi/login' //登入 + } +}; + +//--v2.0-- +// 图片异步加载 +if ($("img.lazy").get(0)) { + + $("img.lazy").lazyload({ + effect: "fadeIn", + event: "scroll" + }); +} + + +// 返回顶部 +// var scrolltop = $('.scroll_topJS'); +// $(window).scroll(function () { +// if ($(this).scrollTop() > 100) { +// scrolltop.fadeIn(); +// } else { +// scrolltop.fadeOut(); +// } +// }); + + +if ($('.connectmeJS').get(0)) { + // 点击打开右侧弹出框 + $('.connectmeJS').click(function () { + $('.blank_coverJS, .right_sideboxJS').removeClass('elementNone'); + window.setTimeout(function () { + $('.blank_coverJS').addClass('opacityshow'); + $('.right_sideboxJS').addClass('sideboxShow'); + + }, 0); + + }); + + // 点击关闭右侧弹出框 + $('.rtcloseJS').click(function () { + $('.blank_coverJS').removeClass('opacityshow'); + $('.right_sideboxJS').removeClass('sideboxShow'); + window.setTimeout(function () { + $('.blank_coverJS, .right_sideboxJS').addClass('elementNone'); + + }, 500); + }); +} + +// 打开移动端搜索框 +if ($('.search_mob_JS').get(0)) { + + $('.search_mob_JS').click(function () { + $('.blank_coverJS, .mobile_search_JS').removeClass('elementNone'); + window.setTimeout(function () { + $('.blank_coverJS').addClass('opacityshow'); + $('.mobile_search_JS').addClass('sideboxShow'); + + }, 0); + $('#mobile_search .ms_input_js').focus(); + + }); + + + $('.ms_close_JS').click(function () { + $('.blank_coverJS').removeClass('opacityshow'); + $('.mobile_search_JS').removeClass('sideboxShow'); + window.setTimeout(function () { + $('.blank_coverJS, .mobile_search_JS').addClass('elementNone'); + + }, 500); + }); +} + + +// 搜索相关 +$('#search_form .jsbtn').click(function (e) { + + e.preventDefault(); + if (!$('#search_form .input_sf_JS').val()) { + + return; + } + $('#search_form').submit(); +}); + +// 添加视频 +if ($('#add_video_form').get(0)) { + + // 添加视频表单处理 + $('#add_video_form .jsbtn').click(function (e) { + console.log('btn clicked'); + + e.preventDefault(); + let inputList = $('#add_video_form input'); + // console.log(inputList[0].value); + if (!inputList[0].value) { + alert('请填写分享内容或网址!'); + return false; + } else if (/https:\/\/[\w\.]+\/[\w]+/ig.test(inputList[0].value) == false) { + alert('目前只支持抖音、快手、西瓜视频和Bilibili的分享网址哦!'); + return false; + } + + let bt = $(this), btLoading = bt.children('.bt_class_JS'), btText = bt.children('.bt_text_JS'); + btLoading.removeClass('elementNone'); + bt.prop('disabled', true); + btText.text('提交中...'); + + let datas = { + 'content': inputList[0].value, + 'title': inputList[1].value + } + + let apiUrl = taJian.debug ? taJian.domain + taJian.apis.addVideos : taJian.apis.addVideos; + // console.log(apiUrl); + publicAjax(apiUrl, 'POST', datas, function (data) { + bt.prop('disabled', false); + btLoading.addClass('elementNone'); + if (data.code == 1) { + $(inputList[0]).val(''); + alert(data.msg || data.err); + } else { + alert(data.err); + } + }, function (jqXHR, textStatus, errorThrown) { + bt.prop('disabled', false); + btLoading.removeClass('elementNone'); + console.log(jqXHR); + + }); + // $.ajax({ + // url: '/frontapi/addfav', + // method: 'POST', + // dataType: 'JSON', + // data: datas + // }).done(function (data, textStatus, jqXHR) { + // bt.prop('disabled', false); + + // if (data.code == 1) { + // $(inputList[0]).val(''); + // alert(data.msg || data.err); + // } else { + // alert(data.err); + // } + // }).fail(function (jqXHR, textStatus, errorThrown) { + // bt.prop('disabled', false); + // alert(errorThrown); + // }); + + }); +} + +// form表单 +if ($('.g_form_js').get(0)) { + + $('.g_form_js .jsbtn').click(function (e) { + + e.preventDefault(); + + let inputList = $('.g_form_js input'); + for (let i = 0; i < inputList.length; i++) { + if (!inputList[i].value) { + alert($(inputList[i]).attr('Warning')); + return false; + + } + } + + + let bt = $(this), btLoading = bt.children('.bt_class_JS'), btText = bt.children('.bt_text_JS'); + btLoading.removeClass('elementNone'); + bt.prop('disabled', true); + btText.text('请求中...'); + + + }); +} + +function publicAjax(apiUrl, method, datas, callback, fail) { + let self = this; + + let Options = { + url: apiUrl, + method: method, + data: datas, + dataType: 'json' + }; + if (self.debug) { + Options.crossDomain = true; + Options.xhrFields = { + withCredentials: true + }; + } + + $.ajax(Options).done(function (data) { + callback(data); + }).fail(function (jqXHR, textStatus, errorThrown) { + + fail(jqXHR, textStatus, errorThrown); + + }); +}; + + +//--v1.0-- +/* //show modal $('.btn-open').click(function(evt) { var target_id = $(evt.target).parents('.btn-open').attr('href'); @@ -58,5 +272,6 @@ alert('服务器异常了:' + errorThrown); }); }); +*/ })();