', + 'after' => '
', + ]); + echo 'diff --git a/assets/css/routes/links.css b/assets/css/routes/links.css
index 0df7d394..37baffc7 100644
--- a/assets/css/routes/links.css
+++ b/assets/css/routes/links.css
@@ -1,136 +1,96 @@
/**
- * Jio 网址导航 — legacy links page shell/styles.
+ * 友情链接页 — 页面主体、分类导航与提交表单。
*
* @package Jio
*/
-/* ---- cards ---- */
-.links-cat-header {
+.links-page-container {
+ margin-bottom: 20px;
+}
+
+.links-box {
+ display: flex;
+ flex-wrap: wrap;
+ margin: -5px;
+}
+
+.links-box.links-style-image {
+ flex-wrap: wrap;
+ margin: calc(0px - var(--this-margin, 10px));
+ margin-bottom: calc(20px - var(--this-margin, 10px));
+}
+
+.links-cat-box {
+ margin-bottom: 20px;
+}
+
+.jio-links-submit-status {
+ margin: 10px 0;
+ font-size: 0.92em;
+}
+
+.jio-links-submit-status.text-success {
+ color: var(--c-green, #22a06b);
+}
+
+.jio-links-submit-status.text-danger {
+ color: var(--c-red, #ff5473);
+}
+
+.jio-links-submit-status.text-muted {
+ color: var(--muted-2-color);
+}
+
+.links-card .avatar-dest {
+ display: block;
+ font-style: normal;
+}
+
+.link-page-search-cover .page-mask {
+ background-color: rgba(0, 0, 0, 0.2);
+}
+
+/* Category nav sits inside the fixed-wrap column on desktop. */
+.links-page-container .links-cat-box .title-theme {
+ position: relative;
+ padding-left: 1.2em;
+ font-size: 15px;
+ font-weight: 600;
+ margin-bottom: 6px;
+}
+
+.links-page-container .links-cat-header {
padding: 0 15px 10px;
}
-.links-box:not(.jio-panel):not(.links-style-simple):not(.links-style-image) {
- margin: -5px;
- display: flex;
- flex-wrap: wrap;
-}
-
-.links-box .links-card {
- padding: 10px 4px 10px 8px;
- min-width: 0;
- margin: 5px;
- width: calc(50% - 10px);
- box-sizing: border-box;
-}
-
-.links-style-bigcard {
- display: flex;
- flex-wrap: wrap;
-}
-
-.links-box .links-card.big-card {
- padding: 20px 10px 15px;
- text-align: center;
-}
-
-.links-box:not(.jio-panel) .links-card {
- background: var(--main-bg-color, var(--surface-1, #fff));
-}
-
-.author-minicard.links-card {
- border-radius: 8px;
- overflow: hidden;
- box-shadow: 0 1px 4px var(--main-shadow, rgba(0, 0, 0, 0.06));
- transition: transform 0.15s ease, box-shadow 0.15s ease;
-}
-
-.author-minicard.links-card:hover {
- transform: translateY(-2px);
- box-shadow: 0 4px 14px var(--main-shadow, rgba(0, 0, 0, 0.1));
-}
-
-.links-card a {
- display: block;
- color: inherit;
- text-decoration: none;
-}
-
-.links-card .list-inline {
- display: flex;
- align-items: center;
- gap: 10px;
+.fixed-wrap .link-nav-box .nav {
list-style: none;
margin: 0;
padding: 0;
}
-.links-card .list-inline > li {
- margin: 0;
-}
-
-.link-img {
- --this-size: 42px;
- width: var(--this-size);
- height: var(--this-size);
- flex-shrink: 0;
-}
-
-.link-img img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- border-radius: 4px;
+.fixed-wrap .link-nav-box .nav > li {
display: block;
}
-.links-card.big-card .link-img {
- --this-size: 58px;
- margin: 0 auto;
-}
-
-.links-card.big-card .link-img img {
- border-radius: 100px;
-}
-
-.links-style-image {
- --link-img-size: 60px;
- --this-margin: 10px;
- display: flex;
- flex-wrap: wrap;
-}
-
-.links-style-image .link-img.link-only-img {
- margin: var(--this-margin);
- --this-size: var(--link-img-size);
-}
-
-.links-style-image .link-img.link-only-img img {
- border-radius: 8px;
-}
-
-/* ---- fixed category nav ---- */
-.fixed-wrap .fixed-wrap-nav.jio-panel,
-.link-nav-box .jio-panel {
- padding: 8px 15px;
-}
-
-.fixed-wrap-nav .tab-nav-theme {
- border-bottom: none;
- padding: 0;
- list-style: none;
- margin: 0;
-}
-
-.link-nav-box .nav > li > a {
+.fixed-wrap .link-nav-box .nav > li > a {
display: block;
padding: 6px;
- color: var(--muted-2-color, #888);
+ margin: 1px 0;
+ font-size: 16px;
+ color: var(--muted-2-color);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
text-decoration: none;
}
-.link-nav-box .nav > li > a:hover,
-.link-nav-box .nav > .active > a {
- color: var(--focus-color, var(--color-primary, #f04494));
+.fixed-wrap .link-nav-box .nav > li > a:hover {
+ color: var(--main-color);
+}
+
+.fixed-wrap .link-nav-box .nav > li:before {
+ display: none;
}
.link-nav-submit,
@@ -142,224 +102,7 @@
display: none;
}
-.links-page-container .title-theme {
- font-weight: 600;
- font-size: 1.15em;
- margin-bottom: 6px;
-}
-
-.jio-links-submit-status {
- margin: 10px 0;
- font-size: 0.92em;
-}
-
-.jio-links-logo-preview {
- width: 88px;
- height: 88px;
- object-fit: cover;
-}
-
-/* ---- search cover ---- */
-.link-page-search-cover.page-cover {
- position: relative;
- overflow: hidden;
- padding-bottom: calc(25% + 100px);
- margin-bottom: 20px;
-}
-
-.link-page-search-cover .fit-cover {
- position: absolute;
- inset: 0;
- width: 100%;
- height: 100%;
- object-fit: cover;
-}
-
-.link-page-search-cover .header-slider-search {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- width: min(560px, 92%);
- z-index: 2;
-}
-
-.link-page-search-cover .tab-nav-theme {
- display: flex;
- gap: 4px;
- list-style: none;
- padding: 0;
- margin: 0 0 8px;
- justify-content: center;
-}
-
-.link-page-search-cover .tab-nav-theme li a {
- opacity: 0.7;
- padding: 0 10px;
- color: #fff;
- text-decoration: none;
- cursor: pointer;
-}
-
-.link-page-search-cover .tab-nav-theme li a:hover,
-.link-page-search-cover .tab-nav-theme li.active a {
- color: #fff;
- opacity: 1;
- font-weight: 600;
-}
-
-.link-page-search-cover .tab-pane {
- display: none;
-}
-
-.link-page-search-cover .tab-pane.active,
-.link-page-search-cover .tab-pane.in.active {
- display: block;
-}
-
-.link-page-search-cover .line-form {
- position: relative;
- background: rgba(255, 255, 255, 0.92);
- border-radius: 8px;
- padding: 8px 12px;
-}
-
-.link-page-search-cover .line-form-input {
- width: 100%;
- border: 0;
- background: transparent;
- outline: none;
- font-size: 15px;
- padding: 8px 36px 8px 4px;
-}
-
-.link-page-search-cover .abs-right {
- position: absolute;
- right: 10px;
- top: 50%;
- transform: translateY(-50%);
-}
-
-.link-page-search-cover .abs-right button {
- border: 0;
- background: transparent;
- cursor: pointer;
- color: var(--muted-2-color, #666);
-}
-
-.link-page-search-cover .header-slider-search-more {
- color: #fff;
- text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
- margin-bottom: 8px;
-}
-
-/* ---- submit modal ---- */
-#submit-links-modal.modal {
- position: fixed;
- inset: 0;
- z-index: 1050;
- display: none;
- align-items: center;
- justify-content: center;
- background: rgba(0, 0, 0, 0.45);
- padding: 16px;
-}
-
-#submit-links-modal.modal.is-open,
-#submit-links-modal.modal.show {
- display: flex;
-}
-
-#submit-links-modal .modal-dialog {
- width: min(520px, 100%);
- max-height: 90vh;
- overflow: auto;
-}
-
-#submit-links-modal .modal-content {
- background: var(--main-bg-color, #fff);
- border-radius: 10px;
- box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
-}
-
-#submit-links-modal .modal-body {
- padding: 20px;
-}
-
-#submit-links-modal .close {
- float: right;
- border: 0;
- background: transparent;
- cursor: pointer;
- font-size: 18px;
-}
-
-#submit-links-modal .preview-square {
- width: 72px;
- height: 72px;
- border: 1px dashed var(--main-border-color, #ddd);
- border-radius: 8px;
- overflow: hidden;
- display: inline-block;
-}
-
-#submit-links-modal .preview-square img {
- width: 100%;
- height: 100%;
- object-fit: cover;
-}
-
-#submit-links-modal .hide {
- display: none !important;
-}
-
-#submit-links-modal .form-control {
- width: 100%;
- padding: 8px 10px;
- border: 1px solid var(--main-border-color, #ddd);
- border-radius: 6px;
- box-sizing: border-box;
-}
-
-#submit-links-modal .row.gutters-5 {
- display: flex;
- flex-wrap: wrap;
- margin: 0 -5px;
-}
-
-#submit-links-modal .col-sm-6,
-#submit-links-modal .col-sm-12 {
- padding: 0 5px;
- box-sizing: border-box;
- width: 100%;
-}
-
-@media (min-width: 576px) {
- #submit-links-modal .col-sm-6 {
- width: 50%;
- }
-}
-
-/* ---- responsive grid ---- */
-@media (min-width: 992px) {
- .links-box .links-card {
- width: calc(25% - 10px);
- }
-
- .site-layout-1 .links-box .links-card,
- .fluid-widget-wrap .links-box .links-card {
- width: calc(20% - 10px);
- }
-
- .fluid-widget-wrap .links-box.links-style-bigcard .links-card,
- .site-layout-1 .links-box.links-style-bigcard .links-card {
- width: calc(16.6665% - 10px);
- }
-
- .sidebar .links-box .links-card {
- width: calc(50% - 10px);
- }
-
+@media (min-width: 768px) {
.fixed-wrap {
position: relative;
--fixed-width: 120px;
@@ -374,9 +117,23 @@
margin-left: calc(var(--fixed-width) + 15px);
}
+ .fixed-wrap > .fixed-wrap-nav ~ .affix-clone {
+ display: none;
+ }
+
.fixed-wrap-nav.affix {
- position: sticky;
- top: 80px;
+ position: fixed;
+ left: auto;
+ right: auto;
+ transition: top 0.1s;
+ }
+}
+
+@media (min-width: 992px) {
+ .links-box .links-card {
+ width: calc(25% - 10px);
+ margin: 5px;
+ box-sizing: border-box;
}
.fixed-wrap .tab-nav-theme.mini-scrollbar {
@@ -395,21 +152,25 @@
margin: 1px 0;
display: block;
font-size: 16px;
- color: var(--muted-2-color, #888);
+ color: var(--muted-2-color);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.fixed-wrap .tab-nav-theme.mini-scrollbar > li > a:hover {
- color: var(--main-color, var(--color-primary));
+ color: var(--main-color);
}
.fixed-wrap .tab-nav-theme.mini-scrollbar > li.active > a {
- color: var(--focus-color, var(--color-primary));
+ color: var(--focus-color);
font-weight: 500;
- background: color-mix(in srgb, var(--focus-color, var(--color-primary)) 12%, transparent);
- border-radius: 6px;
+ background: var(--focus-color-opacity05);
+ border-radius: var(--mini-radius);
+ }
+
+ .fixed-wrap .tab-nav-theme.mini-scrollbar > li::before {
+ display: none;
}
.link-nav-submit {
@@ -428,16 +189,21 @@
.link-nav-box > .jio-panel {
background: transparent;
+ border-radius: 0;
box-shadow: none;
padding: 0;
margin: 0;
}
+ .link-nav-box:not(.affix) {
+ margin-bottom: 10px;
+ }
+
.link-nav-box .nav {
+ margin: 0;
display: flex;
gap: 8px;
overflow-x: auto;
- margin: 0 0 10px;
padding: 0;
list-style: none;
}
@@ -448,23 +214,66 @@
}
.link-nav-box .nav > li > a {
- padding: 2px 6px;
- font-size: 1.05em;
+ padding: 2px;
+ font-size: 1.2em;
white-space: nowrap;
}
+
+ .link-nav-box .nav > li > a:hover,
+ .link-nav-box .nav > .active > a {
+ background: 0;
+ }
}
@media (max-width: 640px) {
.links-box .links-card {
width: calc(50% - 10px);
+ margin: 5px;
}
.link-page-search-cover .tab-nav-theme li a {
padding: 0 3px;
font-size: 14px;
}
+}
+
+@media (max-width: 480px) {
+ .link-nav-box.affix-bottom,
+ .link-nav-box.affix {
+ margin-left: -5px;
+ margin-right: -5px;
+ }
.links-page-container .fixed-wrap {
overflow: hidden;
}
}
+
+#submit-links-modal .preview-square {
+ width: 120px;
+ height: 120px;
+ display: block;
+ border-radius: 4px;
+ overflow: hidden;
+}
+
+#submit-links-modal .preview-square img {
+ display: block;
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ border: 1px dashed var(--main-border-color);
+ border-radius: 4px;
+}
+
+#submit-links-modal .edit-footer {
+ margin-top: 5px;
+}
+
+#submit-links-modal .modal-title .toggle-radius {
+ width: 24px;
+ height: 24px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+}
diff --git a/assets/js/links-submit.js b/assets/js/links-submit.js
index caccf4a3..c9fd60b9 100644
--- a/assets/js/links-submit.js
+++ b/assets/js/links-submit.js
@@ -30,6 +30,18 @@
});
}
+ function closeModal() {
+ var modal = document.getElementById('submit-links-modal');
+ if (!modal) return;
+ if (window.jQuery) {
+ window.jQuery(modal).modal('hide');
+ return;
+ }
+ modal.classList.remove('show', 'in', 'is-open');
+ modal.setAttribute('aria-hidden', 'true');
+ document.body.classList.remove('modal-open');
+ }
+
form.addEventListener('submit', function (event) {
event.preventDefault();
if (button && button.disabled) return;
@@ -70,11 +82,7 @@
if (button) button.disabled = false;
if (button) button.innerHTML = original;
if (captcha) captcha.reset('friend_link', form);
- window.setTimeout(function () {
- var modal = document.getElementById('submit-links-modal');
- if (modal) modal.classList.remove('show', 'is-open');
- setStatus('', '');
- }, 1800);
+ window.setTimeout(closeModal, 1800);
}).catch(function (error) {
setStatus(error.message || i18n.error || '提交失败,请重试', 'danger');
if (button) {
@@ -84,4 +92,12 @@
if (captcha) captcha.reset('friend_link', form);
});
});
+
+ document.addEventListener('click', function (event) {
+ var dismiss = event.target.closest('#submit-links-modal [data-dismiss="modal"]');
+ if (dismiss) {
+ event.preventDefault();
+ closeModal();
+ }
+ });
})();
diff --git a/inc/helpers/jio-links.php b/inc/helpers/jio-links.php
index 8c7db6dc..c2b069c7 100644
--- a/inc/helpers/jio-links.php
+++ b/inc/helpers/jio-links.php
@@ -110,7 +110,6 @@ if (!function_exists('jio_links_box')) :
return '';
}
$type = in_array($type, ['card', 'bigcard', 'image', 'simple'], true) ? $type : 'card';
- $placeholder = get_template_directory_uri() . '/assets/img/placeholder.svg';
$html = '';
$i = 0;
@@ -151,8 +150,8 @@ if (!function_exists('jio_links_box')) :
$blank = !empty($link['blank']) ? ' target="_blank"' : '';
$dec = !empty($link['desc']) ? (string) $link['desc'] : '';
$rel = $nofollow ? ' rel="nofollow noopener noreferrer"' : ' rel="noopener noreferrer"';
- $img_src = $src !== '' ? $src : $placeholder;
- $img = '';
+ $img_src = $src !== '' ? $src : (function_exists('jio_get_lazy_thumb') ? jio_get_lazy_thumb() : '');
+ $img = '
';
$data_dec = $dec !== ''
? ' title="' . esc_attr($title) . '" data-content="' . esc_attr($dec) . '"'
: ' data-content="' . esc_attr($title) . '"';
@@ -256,7 +255,7 @@ if (!function_exists('jio_page_links_html')) :
$offset_top = $is_mobile ? '-8' : '';
$offset_bottom = $is_mobile ? '20' : '-30';
$links_con = '
' - . '' . esc_html__('登录', 'jio') . '
'; + . '' . esc_html__('登录', 'jio') . ''; + if ($registration_open && function_exists('jio_get_register_url')) { + $body .= '' + . '' . esc_html__('注册', 'jio') . ''; + } + $body .= ''; if (class_exists('\Jio\Auth\OAuth') && method_exists(\Jio\Auth\OAuth::get_instance(), 'render_social_buttons')) { - $body .= (string) \Jio\Auth\OAuth::get_instance()->render_social_buttons(__('使用以下方式快速登录', 'jio')); + $body .= (string) \Jio\Auth\OAuth::get_instance()->render_social_buttons(); } $body .= '', + 'after' => '
', + ]); + echo '