This commit is contained in:
root 2025-04-06 05:14:08 -04:00
parent f8d24aee90
commit cb7ac9cca1
36 changed files with 1506 additions and 1522 deletions

View File

@ -5,7 +5,7 @@
This themes has Focus (wgite background) and GreenGrey (dark background) schemes. Also this themes has Nolikes scheme (hide "Likes" feature) and Nominus scheme (hide "Minus" icon under one-side connections).
Adapted for Hubzilla version 8.
Adapted for Hubzilla version 10.
- ussrbasic - default theme with custom GreenGrey schemes

View File

@ -1,15 +0,0 @@
.wall-item-content.conv-list-mode {
max-width: 280px;
height:200px;
min-height: 200px;
overflow: hidden;
}
.thread-wrapper.toplevel_item.conv-list-mode {
width: 300px;
height: 300px;
float: left;
margin-left: 5px;
margin-bottom: 35px;
}

View File

@ -1,24 +0,0 @@
/*
section {
left: 0px;
width: 800px;
margin-left: auto;
margin-right: auto;
}
body {background-color: #d00 !important;}
.page-content-wrapper {background: #fff;
color: #000;
border-radius: 20px;
box-shadow: 5px 5px 5px #111;
}
h3.page-title {
padding-top: 30px;
color: #033}
.page-body {padding: 40px;}
.page-body strong {color: #033;}
.nav-links {margin-top: 5px;}
*/

View File

@ -4,9 +4,4 @@
--bs-navbar-padding-y: 1px;
}
#jGrowl.top-right {
top: 3.5rem;
right: 15px;
}
}

14
ussrbasic/css/sample.scss Normal file
View File

@ -0,0 +1,14 @@
// To compiled custom site bootstrap from sass,
// run this script from the document root for an example:
// php vendor/bin/pscss view/theme/ussrbasic/css/sample.scss view/theme/ussrbasic/css/bootstrap-custom.css
// See https://getbootstrap.com/docs/5.3/customize/sass/ for more infos
// required import
@import "vendor/twbs/bootstrap/scss/_functions";
$primary: #ff0000; // set the $primary variable
// set changes
@import "vendor/twbs/bootstrap/scss/bootstrap";

View File

@ -1,58 +0,0 @@
.rotleft1 {
-webkit-transform: rotate(-1deg);
-moz-transform: rotate(-1deg);
-ms-transform: rotate(-1deg);
-o-transform: rotate(-1deg);
}
.rotleft2 {
-webkit-transform: rotate(-2deg);
-moz-transform: rotate(-2deg);
-ms-transform: rotate(-2deg);
-o-transform: rotate(-2deg);
}
.rotleft3 {
-webkit-transform: rotate(-3deg);
-moz-transform: rotate(-3deg);
-ms-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
}
.rotleft4 {
-webkit-transform: rotate(-4deg);
-moz-transform: rotate(-4deg);
-ms-transform: rotate(-4deg);
-o-transform: rotate(-4deg);
}
.rotright1 {
-webkit-transform: rotate(1deg);
-moz-transform: rotate(1deg);
-ms-transform: rotate(1deg);
-o-transform: rotate(1deg);
}
.rotright2 {
-webkit-transform: rotate(2deg);
-moz-transform: rotate(2deg);
-ms-transform: rotate(2deg);
-o-transform: rotate(2deg);
}
.rotright3 {
-webkit-transform: rotate(3deg);
-moz-transform: rotate(3deg);
-ms-transform: rotate(3deg);
-o-transform: rotate(3deg);
}
.rotright4 {
-webkit-transform: rotate(4deg);
-moz-transform: rotate(4deg);
-ms-transform: rotate(4deg);
-o-transform: rotate(4deg);
}

View File

@ -7,21 +7,13 @@
/* bootstrap variables */
:root {
--bs-border-radius: $radius;
--bs-highlight-bg: var(--bs-warning);
}
[data-bs-theme=light] {
--bs-link-color: $link_color;
--bs-link-hover-color: $link_hover_color;
--hz-body-bg: $bgcolor;
--hz-body-bg-image: url('$background_image');
}
[data-bs-theme=dark] {
--bs-link-color: $link_color_dark;
--bs-link-hover-color: $link_hover_color_dark;
--hz-body-bg: $bgcolor_dark;
--hz-body-bg-image: url('$background_image_dark');
}
@ -34,10 +26,6 @@
background-color: $nav_bg_dark !important;
}
.btn {
--bs-btn-border-radius: $radius;
}
/* generals */
@ -46,13 +34,10 @@ html {
}
body {
font-size: 0.9rem;
background-color: var(--hz-body-bg);
background-image: var(--hz-body-bg-image);
background-attachment: fixed;
background-size: cover;
color: var(--bs-body-color);
margin: 0;
}
aside#region_1 {
@ -87,30 +72,31 @@ main {
height: 100vh;
background: rgba(0, 0, 0, .3);
cursor: pointer;
z-index: 1010;
}
h1, .h1 {
font-size: 2rem;
font-size: 2.1rem;
}
h2, .h2 {
font-size: 1.6rem;
font-size: 1.7rem;
}
h3, .h3 {
font-size: 1.2rem;
font-size: 1.3rem;
}
h4, .h4 {
font-size: 1.05rem;
font-size: 1.15rem;
}
h5, .h5 {
font-size: 0.9rem;
font-size: 1rem;
}
h6, .h6 {
font-size: 0.75rem;
font-size: 0.85rem;
}
.navbar-banner {
@ -155,7 +141,7 @@ a:focus,
}
input, optgroup, select, textarea {
font-size: 0.9rem !important;
font-size: 1rem !important;
}
input[type=text], textarea {
@ -164,24 +150,15 @@ input[type=text], textarea {
color: var(--bs-body-color);
}
.selected-doco-nav {
font-weight: bold;
text-shadow: 2px 2px 3px lightgray;
}
#doco-content img {
width: 100%;
}
#help-content pre code {
overflow-x: auto;
white-space: pre;
}
.heart {
color: #FF0000;
}
#toast-container {
z-index: 1060;
width: 300px;
}
#powered-by {
font-size: 0.5rem;
position: absolute;
@ -459,7 +436,7 @@ footer {
.photo,
.contact-block-img {
border-radius: $radius;
border-radius: var(--bs-border-radius);
}
#side-bar-photos-albums {
@ -472,7 +449,7 @@ footer {
.profile-match-photo img,
.directory-photo-img {
border-radius: $radius;
border-radius: var(--bs-border-radius);
}
.profile-match-photo img {
@ -722,29 +699,9 @@ nav .acpopup {
color:#cc0000;
}
/* popup notifications */
div.jGrowl div.notice {
background: #511919 url("../../../../images/icons/48/notice.png") no-repeat 5px center;
color: #ffffff;
padding-left: 58px;
}
div.jGrowl div.info {
background: #364e59 url("../../../../images/icons/48/info.png") no-repeat 5px center;
color: #ffffff;
padding-left: 58px;
}
#jGrowl.top-right {
top: 4.5rem;
right: .25rem;
}
div.jGrowl div.jGrowl-notification {
min-height: 60px;
}
.jslider .jslider-scale ins {
color: #333;
font-size: 0.9rem;
font-size: 1rem;
width: 100px;
text-align: center;
}
@ -810,7 +767,7 @@ div.jGrowl div.jGrowl-notification {
.shared_header img {
border-radius: var(--bs-border-radius);
margin-right: .75rem;
margin-right: .5rem;
}
.tag1 {
@ -873,28 +830,27 @@ margin-right: 50px;
.generic-icons,
a .generic-icons {
font-size: 1rem;
margin-right: 0.5rem;
font-size: 1.2rem;
}
.generic-icons-right {
font-size: 1rem;
font-size: 1.2rem;
margin-left: 0.5rem;
}
.generic-icons-nav {
font-size: 1rem;
margin-right: 7px;
font-size: 1.2rem;
margin-right: 0.5rem;
}
.admin-icons {
font-size: 1.2em;
margin-right: 7px;
font-size: 1.2rem;
margin-right: 0.5rem;
}
.drop-icons,
a .drop-icons {
font-size: 1rem;
font-size: 1.2rem;
text-decoration: none;
cursor: pointer;
}
@ -924,25 +880,6 @@ a .drop-icons:hover {
list-style-type: none;
}
table {
border-spacing: 2px;
max-width: 100%;
}
th,td {
padding: 3px;
}
#channels > tbody > tr > td, #users > tbody > tr > td {
max-width: 19.4em;
overflow: hidden;
}
/* mail */
img.mail-conv-sender-photo {
border-radius: var(--bs-border-radius);
}
/* jot */
@ -958,21 +895,23 @@ img.mail-conv-sender-photo {
font-weight: bold;
}
.jot-icons,
.comment-icon {
font-size: 1.2rem;
}
#profile-jot-wrapper {
background-color: var(--bs-body-bg);
border: 1px solid var(--bs-border-color);
border-radius: var(--bs-border-radius);
}
#profile-jot-text::-webkit-input-placeholder {
font-size: 1.2rem;
font-size: 1.3rem;
}
#profile-jot-text::-moz-placeholder {
font-size: 1.2rem;
font-size: 1.3rem;
}
#profile-jot-text:focus::-webkit-input-placeholder {
@ -1013,6 +952,10 @@ img.mail-conv-sender-photo {
margin-top: 2em;
}
.wall-item-pinned i {
transform: rotate(45deg);
}
.wall-item-content-wrapper {
background-color: var(--bs-tertiary-bg);
}
@ -1035,6 +978,19 @@ img.mail-conv-sender-photo {
border-top: 1px dashed #adadad;
}
.hide-comments-icon,
.divgrow-showmore-icon {
font-size: $font_size;
}
.divgrow-showmore-label,
.hide-comments-label {
text-transform: uppercase;
font-size: 0.7rem;
}
.wall-item-comment-wrapper {
padding: 7px 10px;
background-color: var(--bs-tertiary-bg);
@ -1061,14 +1017,6 @@ img.mail-conv-sender-photo {
height: $reply_photo;
}
.wall-item-content,
.mail-conv-body,
.page-body,
.chat-item-text,
.chat-item-text-self {
font-size: 1rem;
}
.comment-edit-text {
border: 1px solid var(--bs-border-color);
border-radius: var(--bs-border-radius);
@ -1119,7 +1067,7 @@ img.mail-conv-sender-photo {
}
.abook-self {
background-color: #ffdddd;
background-color: var(--bs-light-bg-subtle);
}
.abook-pending-contact, .abook-permschange {
@ -1155,16 +1103,16 @@ img.mail-conv-sender-photo {
}
.menu-img-2 {
height: 2.3rem;
width: 2.3rem;
height: 2.5rem;
width: 2.5rem;
margin-right: .5rem;
border-radius: var(--bs-border-radius);
float: left;
}
.menu-img-1 {
height: 1.1rem;
width: 1.1rem;
height: 1.3rem;
width: 1.3rem;
border-radius: var(--bs-border-radius);
}
@ -1196,9 +1144,18 @@ img.mail-conv-sender-photo {
.generic-content-wrapper {
background-color: var(--bs-body-bg);
border: 1px solid var(--bs-border-color);
border: 1px solid var(--bs-light-border-subtle);
border-radius: var(--bs-border-radius);
margin-bottom: 1.5rem;
font-size: 1.1rem;
}
.generic-content-wrapper.is-contained {
border: 1px solid var(--bs-primary-border-subtle);
}
.generic-content-wrapper.is-new {
border-top: 2px solid var(--bs-primary);
}
.section-title-wrapper {
@ -1236,32 +1193,32 @@ img.mail-conv-sender-photo {
.section-content-success-wrapper {
padding: 21px 10px;
color: #155724;
background-color: #d4edda;
color: var(--bs-success-text-emphasis);
background-color: var(--bs-success-bg-subtle);
border-bottom: 3px solid var(--bs-body-bg);
text-align: center;
}
.section-content-info-wrapper {
padding: 21px 10px;
color: #0c5460;
background-color: #d1ecf1;
color: var(--bs-info-text-emphasis);
background-color: var(--bs-info-bg-subtle);
border-bottom: 3px solid var(--bs-body-bg);
text-align: center;
}
.section-content-warning-wrapper {
padding: 21px 10px;
color: #856404;
background-color: #fff3cd;
color: var(--bs-warning-text-emphasis);
background-color: var(--bs-warning-bg-subtle);
border-bottom: 3px solid var(--bs-body-bg);
text-align: center;
}
.section-content-danger-wrapper {
padding: 21px 10px;
color: #721c24;
background-color: #f8d7da;
color: var(--bs-danger-text-emphasis);
background-color: var(--bs-danger-bg-subtle);
border-bottom: 3px solid var(--bs-body-bg);
text-align: center;
}
@ -1295,17 +1252,23 @@ img.mail-conv-sender-photo {
}
main.fullscreen {
position: fixed;
top: 0px;
left: 0px;
width: 100%;
width: 100vw;
height: 100vh;
max-width: none;
z-index: 1020;
overflow: auto;
}
main.fullscreen .generic-content-wrapper {
position: absolute;
width: 100%;
position: fixed;
top: 0px;
left: 0px;
width: 100vw;
height: 100vh;
z-index: 1020;
overflow: auto;
border-radius: 0px;
border-width: 0px;
}
@ -1354,12 +1317,7 @@ main.fullscreen .section-content-wrapper-np {
/* bootstrap overrides */
.form-control {
border-radius: $radius;
}
blockquote {
font-size: 1rem;
font-style: italic;
border-left: 3px solid var(--bs-border-color);
padding: 1em 0px 1em 1.5em;
@ -1419,12 +1377,16 @@ dl.bb-dl > dd > li {
}
.bootstrap-tagsinput .tag:before {
/* Copied from fa-asterisk, is there a better way to do it? */
font-family: ForkAwesome;
font-weight: normal;
font-style: normal;
text-decoration: inherit;
content:"\f069 ";
font-family: bootstrap-icons;
font-size: 0.5rem;
content: "\F151";
margin-right: .25rem;
}
.bootstrap-tagsinput .tag [data-role="remove"]:after {
font-family: bootstrap-icons;
font-size: 0.5rem;
content: "\F659";
}
/* Modified original CSS to match input in Ussrbasic */
@ -1447,7 +1409,6 @@ dl.bb-dl > dd > li {
.bootstrap-tagsinput input {
height: 2.5rem;
margin: 0;
max-width: 30%;
}
.bootstrap-tagsinput {
@ -1674,3 +1635,5 @@ dl.bb-dl > dd > li {
transform: translateX(80vw);
}
}

View File

@ -6,239 +6,251 @@ let ussrbasic_dark_mode = localStorage.getItem('ussrbasic_dark_mode');
let ussrbasic_theme_color = localStorage.getItem('ussrbasic_theme_color');
if (ussrbasic_dark_mode == 1) {
$('html').attr('data-bs-theme', 'dark');
document.documentElement.setAttribute('data-bs-theme', 'dark');
}
if (ussrbasic_dark_mode == 0) {
$('html').attr('data-bs-theme', 'light');
document.documentElement.setAttribute('data-bs-theme', 'light');
}
if (ussrbasic_theme_color) {
$('meta[name=theme-color]').attr('content', ussrbasic_theme_color);
document.querySelector('meta[name=theme-color]').setAttribute('content', ussrbasic_theme_color);
}
$(document).ready(function() {
// provide a fake progress bar for pwa standalone mode
if (window.matchMedia('(display-mode: standalone)').matches) {
$(window).on('beforeunload', function(){
if ($('.page-loader').length) {
return;
}
$('<div class="bg-primary page-loader"></div>').prependTo('body');
});
}
document.addEventListener('DOMContentLoaded', function () {
// provide a fake progress bar for pwa standalone mode
if (window.matchMedia('(display-mode: standalone)').matches) {
window.addEventListener('beforeunload', function () {
if (!document.querySelector('.page-loader')) {
let loader = document.createElement('div');
loader.classList.add('bg-primary', 'page-loader');
document.body.prepend(loader);
}
});
}
if (ussrbasic_dark_mode == 1) {
$('#theme-switch-icon').removeClass('fa-moon-o').addClass('fa-sun-o');
$('[data-bs-theme="light"]').attr('data-bs-theme', 'dark');
}
if (ussrbasic_dark_mode == 0) {
$('#theme-switch-icon').removeClass('fa-sun-o').addClass('fa-moon-o');
$('[data-bs-theme="dark"]:not(nav)').attr('data-bs-theme', 'light');
}
if (ussrbasic_dark_mode == 1) {
document.getElementById('theme-switch-icon').classList.remove('bi-moon');
document.getElementById('theme-switch-icon').classList.add('bi-sun');
document.querySelector('[data-bs-theme="light"]').setAttribute('data-bs-theme', 'dark');
}
if (ussrbasic_dark_mode == 0) {
document.getElementById('theme-switch-icon').classList.remove('bi-sun');
document.getElementById('theme-switch-icon').classList.add('bi-moon');
let darkElements = document.querySelectorAll('[data-bs-theme="dark"]:not(nav)');
darkElements.forEach(el => el.setAttribute('data-bs-theme', 'light'));
}
if (ussrbasic_theme_color != $('nav').css('background-color')) {
$('meta[name=theme-color]').attr('content', $('nav').css('background-color'));
localStorage.setItem('ussrbasic_theme_color', $('nav').css('background-color'));
}
let navBackgroundColor = document.querySelector('nav').style.backgroundColor;
if (ussrbasic_theme_color !== navBackgroundColor) {
document.querySelector('meta[name=theme-color]').setAttribute('content', navBackgroundColor);
localStorage.setItem('ussrbasic_theme_color', navBackgroundColor);
}
// CSS3 calc() fallback (for unsupported browsers)
$('body').append('<div id="css3-calc" style="width: 10px; width: calc(10px + 10px); display: none;"></div>');
if( $('#css3-calc').width() == 10) {
$(window).resize(function() {
if($(window).width() < 992) {
$('main').css('width', $(window).width() + $('aside').outerWidth() );
} else {
$('main').css('width', '100%');
}
});
}
$('#css3-calc').remove(); // Remove the test element
// CSS3 calc() fallback (for unsupported browsers)
let testElem = document.createElement('div');
testElem.style.width = 'calc(10px + 10px)';
testElem.style.display = 'none';
testElem.id = 'css3-calc';
document.body.appendChild(testElem);
if (testElem.offsetWidth === 10) {
window.addEventListener('resize', function () {
if (window.innerWidth < 992) {
document.querySelector('main').style.width = `${window.innerWidth + document.querySelector('aside').offsetWidth}px`;
} else {
document.querySelector('main').style.width = '100%';
}
});
}
testElem.remove(); // Remove the test element
if($(window).width() < 1200) {
$("#right_aside_wrapper").children().detach().appendTo('#left_aside_wrapper');
$('#notifications_wrapper').addClass('d-none');
}
if (window.innerWidth < 1200) {
let rightAsideWrapper = document.getElementById("right_aside_wrapper");
let leftAsideWrapper = document.getElementById("left_aside_wrapper");
leftAsideWrapper.appendChild(...rightAsideWrapper.children);
document.getElementById('notifications_wrapper').classList.add('d-none');
}
if (document.getElementById('region_1')) {
stickyScroll('.aside_spacer_left', '.aside_spacer_top_left', 'section', parseFloat(document.querySelector('main').getBoundingClientRect().top), 20);
}
if (document.querySelector('#region_1')) {
stickyScroll('.aside_spacer_left', '.aside_spacer_top_left', 'section', parseFloat(document.querySelector('main').getBoundingClientRect().top), 20);
}
if (document.getElementById('region_3')) {
stickyScroll('.aside_spacer_right', '.aside_spacer_top_right', 'section', parseFloat(document.querySelector('main').getBoundingClientRect().top), 20);
}
if (document.querySelector('#region_3')) {
stickyScroll('.aside_spacer_right', '.aside_spacer_top_right', 'section', parseFloat(document.querySelector('main').getBoundingClientRect().top), 20);
}
document.querySelectorAll('.usermenu').forEach(function (element) {
element.addEventListener('click', function () {
let navCollapse = document.querySelectorAll('#navbar-collapse-1, #navbar-collapse-2');
navCollapse.forEach(function (nav) {
if (nav.classList.contains('show')) {
nav.classList.remove('show');
}
});
});
});
$('.usermenu').click(function() {
if($('#navbar-collapse-1, #navbar-collapse-2').hasClass('show')){
$('#navbar-collapse-1, #navbar-collapse-2').removeClass('show');
}
});
document.getElementById('theme-switch').addEventListener('click', function () {
let html = document.documentElement;
if (html.getAttribute('data-bs-theme') === 'dark') {
let nav = document.querySelector('nav');
if (nav.dataset.bsTheme === 'dark') {
document.querySelectorAll('[data-bs-theme="dark"]:not(nav)').forEach(function (el) {
el.setAttribute('data-bs-theme', 'light');
});
} else {
document.querySelector('[data-bs-theme="dark"]').setAttribute('data-bs-theme', 'light');
}
localStorage.setItem('ussrbasic_dark_mode', 0);
document.getElementById('theme-switch-icon').classList.remove('bi-sun');
document.getElementById('theme-switch-icon').classList.add('bi-moon');
} else {
document.querySelectorAll('[data-bs-theme="light"]').forEach(function (el) {
el.setAttribute('data-bs-theme', 'dark');
});
localStorage.setItem('ussrbasic_dark_mode', 1);
document.getElementById('theme-switch-icon').classList.remove('bi-moon');
document.getElementById('theme-switch-icon').classList.add('bi-sun');
}
document.querySelector('meta[name=theme-color]').setAttribute('content', document.querySelector('nav').style.backgroundColor);
localStorage.setItem('ussrbasic_theme_color', document.querySelector('nav').style.backgroundColor);
});
$('#theme-switch').click(function() {
if ($('html').attr('data-bs-theme') === 'dark') {
if ($('nav').data('bs-theme') === 'dark') {
$('[data-bs-theme="dark"]:not(nav)').attr('data-bs-theme', 'light');
}
else {
$('[data-bs-theme="dark"]').attr('data-bs-theme', 'light');
}
localStorage.setItem('ussrbasic_dark_mode', 0);
$('#theme-switch-icon').removeClass('fa-sun-o').addClass('fa-moon-o');
}
else {
$('[data-bs-theme="light"]').attr('data-bs-theme', 'dark');
localStorage.setItem('ussrbasic_dark_mode', 1);
$('#theme-switch-icon').removeClass('fa-moon-o').addClass('fa-sun-o');
}
$('meta[name=theme-color]').attr('content', $('nav').css('background-color'));
localStorage.setItem('ussrbasic_theme_color', $('nav').css('background-color'));
});
document.getElementById('menu-btn').addEventListener('click', function () {
let navCollapse = document.getElementById('navbar-collapse-1');
if (navCollapse.classList.contains('show')) {
navCollapse.classList.remove('show');
}
});
document.querySelectorAll('.notifications-btn').forEach(function (element) {
element.addEventListener('click', function (e) {
e.preventDefault();
e.stopPropagation();
let navCollapse = document.getElementById('navbar-collapse-2');
if (navCollapse.classList.contains('show')) {
navCollapse.classList.remove('show');
}
});
});
$('#menu-btn').click(function() {
if($('#navbar-collapse-1').hasClass('show')){
$('#navbar-collapse-1').removeClass('show');
}
});
$("input[data-role=cat-tagsinput]").tagsinput({
tagClass: 'badge rounded-pill bg-warning text-dark'
});
$('.notifications-btn').click(function(e) {
e.preventDefault();
e.stopPropagation();
if($('#navbar-collapse-2').hasClass('show')){
$('#navbar-collapse-2').removeClass('show');
}
});
document.querySelectorAll('a.disabled').forEach(function (link) {
link.addEventListener('click', function (e) {
e.preventDefault();
e.stopPropagation();
});
});
$("input[data-role=cat-tagsinput]").tagsinput({
tagClass: 'badge rounded-pill bg-warning text-dark'
});
let doctitle = document.title;
function checkNotify() {
let notifyUpdateElem = document.getElementById('notify-update');
if (notifyUpdateElem && notifyUpdateElem.innerHTML !== '') {
document.title = '(' + notifyUpdateElem.innerHTML + ') ' + doctitle;
} else {
document.title = doctitle;
}
}
$('a.disabled').click(function(e) {
e.preventDefault();
e.stopPropagation();
});
setInterval(checkNotify, 10 * 1000);
var doctitle = document.title;
function checkNotify() {
var notifyUpdateElem = document.getElementById('notify-update');
if(notifyUpdateElem !== null) {
if(notifyUpdateElem.innerHTML !== "")
document.title = "(" + notifyUpdateElem.innerHTML + ") " + doctitle;
else
document.title = doctitle;
}
}
setInterval(function () {checkNotify();}, 10 * 1000);
let touch_start = null;
let touch_max = window.innerWidth / 10;
var touch_start = null;
var touch_max = window.innerWidth / 10;
window.addEventListener('touchstart', function(e) {
if (e.touches.length === 1){
//just one finger touched
touch_start = e.touches.item(0).clientX;
if (touch_start < touch_max) {
$('body').css('overflow-y', 'hidden');
}
}
else {
//a second finger hit the screen, abort the touch
touch_start = null;
}
});
window.addEventListener('touchend', function(e) {
$('body').css('overflow-y', '');
let touch_offset = 30; //at least 30px are a swipe
if (touch_start) {
//the only finger that hit the screen left it
let touch_end = e.changedTouches.item(0).clientX;
if (touch_end > (touch_start + touch_offset)) {
//a left -> right swipe
if (touch_start < touch_max) {
toggleAside();
}
}
if (touch_end < (touch_start - touch_offset)) {
//a right -> left swipe
}
}
});
window.addEventListener('touchstart', function (e) {
if (e.touches.length === 1) {
touch_start = e.touches[0].clientX;
if (touch_start < touch_max) {
document.body.style.overflowY = 'hidden';
}
} else {
touch_start = null;
}
});
window.addEventListener('touchend', function (e) {
document.body.style.overflowY = '';
let touch_offset = 30; // at least 30px are a swipe
if (touch_start) {
let touch_end = e.changedTouches[0].clientX;
if (touch_end > (touch_start + touch_offset)) {
if (touch_start < touch_max) {
toggleAside();
}
}
if (touch_end < (touch_start - touch_offset)) {
// a right -> left swipe
}
}
});
});
function setStyle(element, cssProperty) {
for (var property in cssProperty){
element.style[property] = cssProperty[property];
}
for (var property in cssProperty) {
element.style[property] = cssProperty[property];
}
}
function stickyScroll(sticky, stickyTop, container, topOffset, bottomOffset) {
let lastScrollTop = 0;
let stickyElement = document.querySelector(sticky);
var lastScrollTop = 0;
var sticky = document.querySelector(sticky);
if (!stickyElement) {
return;
}
if (!sticky) {
return;
}
let stickyHeight = stickyElement.getBoundingClientRect().height;
let stickyTopElement = document.querySelector(stickyTop);
let content = document.querySelector(container);
let diff = window.innerHeight - stickyHeight;
var stickyHeight = sticky.getBoundingClientRect().height;
var stickyTop = document.querySelector(stickyTop);
var content = document.querySelector(container);
var diff = window.innerHeight - stickyHeight;
var h = 0;
var lasth = 0;
var st = window.pageYOffset || document.documentElement.scrollTop;
let h = 0;
let lasth = 0;
let st = window.pageYOffset || document.documentElement.scrollTop;
var resizeObserver = new ResizeObserver(function(entries) {
stickyHeight = sticky.getBoundingClientRect().height;
st = window.pageYOffset || document.documentElement.scrollTop;
diff = window.innerHeight - stickyHeight;
});
let resizeObserver = new ResizeObserver(function () {
stickyHeight = stickyElement.getBoundingClientRect().height;
st = window.pageYOffset || document.documentElement.scrollTop;
diff = window.innerHeight - stickyHeight;
});
resizeObserver.observe(sticky);
resizeObserver.observe(content);
window.addEventListener('scroll', function() {
if(window.innerHeight > stickyHeight + topOffset) {
setStyle(stickyTop, { height: 0 + 'px' });
setStyle(sticky, { position: 'sticky', top: topOffset + 'px'});
}
else {
st = window.pageYOffset || document.documentElement.scrollTop; // Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
if (st > lastScrollTop){
// downscroll code
setStyle(stickyTop, { height: lasth + 'px' });
setStyle(sticky, { position: 'sticky', top: Math.round(diff) - bottomOffset + 'px', bottom: '' });
} else {
// upscroll code
h = sticky.getBoundingClientRect().top - content.getBoundingClientRect().top;
if(Math.round(stickyTop.getBoundingClientRect().height) === lasth) {
setStyle(stickyTop, { height: Math.round(h) + 'px' });
}
lasth = Math.round(h);
setStyle(sticky, { position: 'sticky', top: '', bottom: Math.round(diff) - topOffset + 'px' });
}
lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling
}
}, false);
resizeObserver.observe(stickyElement);
resizeObserver.observe(content);
window.addEventListener('scroll', function () {
if (window.innerHeight > stickyHeight + topOffset) {
setStyle(stickyTopElement, { height: '0px' });
setStyle(stickyElement, { position: 'sticky', top: `${topOffset}px` });
} else {
st = window.pageYOffset || document.documentElement.scrollTop;
if (st > lastScrollTop) {
setStyle(stickyTopElement, { height: `${lasth}px` });
setStyle(stickyElement, { position: 'sticky', top: `${Math.round(diff) - bottomOffset}px`, bottom: '' });
} else {
h = stickyElement.getBoundingClientRect().top - content.getBoundingClientRect().top;
if (Math.round(stickyTopElement.getBoundingClientRect().height) === lasth) {
setStyle(stickyTopElement, { height: `${Math.round(h)}px` });
}
lasth = Math.round(h);
setStyle(stickyElement, { position: 'sticky', top: '', bottom: `${Math.round(diff) - topOffset}px` });
}
lastScrollTop = st <= 0 ? 0 : st;
}
}, false);
}
function makeFullScreen(full) {
if(typeof full=='undefined' || full == true) {
$('main').addClass('fullscreen');
$('header, nav, aside, #fullscreen-btn').attr('style','display:none !important');
$('#inline-btn').show();
}
else {
$('main').removeClass('fullscreen');
$('header, nav, aside, #fullscreen-btn').show();
$('#inline-btn').hide();
}
if (typeof full === 'undefined' || full === true) {
document.querySelector('main').classList.add('fullscreen');
document.getElementById('fullscreen-btn').style.display = 'none';
document.getElementById('inline-btn').style.display = 'inline-block';
} else {
document.querySelector('main').classList.remove('fullscreen');
document.getElementById('fullscreen-btn').style.display = '';
document.getElementById('inline-btn').style.display = 'none';
}
}

View File

@ -2,6 +2,9 @@
namespace Zotlabs\Theme;
use ScssPhp\ScssPhp\Compiler;
use ScssPhp\ScssPhp\OutputStyle;
class UssrbasicConfig {
function get_schemas() {
@ -36,16 +39,16 @@ class UssrbasicConfig {
return;
}
$arr = array();
$arr['primary_color'] = get_pconfig(local_channel(),'ussrbasic', 'primary_color');
$arr['success_color'] = get_pconfig(local_channel(),'ussrbasic', 'success_color');
$arr['info_color'] = get_pconfig(local_channel(),'ussrbasic', 'info_color');
$arr['warning_color'] = get_pconfig(local_channel(),'ussrbasic', 'warning_color');
$arr['danger_color'] = get_pconfig(local_channel(),'ussrbasic', 'danger_color');
$arr['dark_mode'] = get_pconfig(local_channel(),'ussrbasic', 'dark_mode');
$arr['navbar_dark_mode'] = get_pconfig(local_channel(),'ussrbasic', 'navbar_dark_mode');
$arr['narrow_navbar'] = get_pconfig(local_channel(),'ussrbasic', 'narrow_navbar' );
$arr['nav_bg'] = get_pconfig(local_channel(),'ussrbasic', 'nav_bg' );
$arr['nav_bg_dark'] = get_pconfig(local_channel(),'ussrbasic', 'nav_bg_dark' );
$arr['link_color'] = get_pconfig(local_channel(),'ussrbasic', 'link_color' );
$arr['link_color_dark'] = get_pconfig(local_channel(),'ussrbasic', 'link_color_dark' );
$arr['link_hover_color'] = get_pconfig(local_channel(),'ussrbasic', 'link_hover_color' );
$arr['link_hover_color_dark'] = get_pconfig(local_channel(),'ussrbasic', 'link_hover_color_dark' );
$arr['bgcolor'] = get_pconfig(local_channel(),'ussrbasic', 'background_color' );
$arr['bgcolor_dark'] = get_pconfig(local_channel(),'ussrbasic', 'background_color_dark' );
$arr['background_image'] = get_pconfig(local_channel(),'ussrbasic', 'background_image' );
@ -65,15 +68,99 @@ class UssrbasicConfig {
}
if (isset($_POST['ussrbasic-settings-submit'])) {
if (isset($_POST['ussrbasic_primary_color']) || isset($_POST['ussrbasic_radius'])) {
$primary_color = '';
$success_color = '';
$info_color = '';
$warning_color = '';
$danger_color = '';
$radius = floatval($_POST['ussrbasic_radius']);
if (preg_match('/^#([A-Fa-f0-9]{3}){1,2}$/', $_POST['ussrbasic_primary_color'])) {
$primary_color = $_POST['ussrbasic_primary_color'];
}
if (preg_match('/^#([A-Fa-f0-9]{3}){1,2}$/', $_POST['ussrbasic_success_color'])) {
$success_color = $_POST['ussrbasic_success_color'];
}
if (preg_match('/^#([A-Fa-f0-9]{3}){1,2}$/', $_POST['ussrbasic_info_color'])) {
$info_color = $_POST['ussrbasic_info_color'];
}
if (preg_match('/^#([A-Fa-f0-9]{3}){1,2}$/', $_POST['ussrbasic_warning_color'])) {
$warning_color = $_POST['ussrbasic_warning_color'];
}
if (preg_match('/^#([A-Fa-f0-9]{3}){1,2}$/', $_POST['ussrbasic_danger_color'])) {
$danger_color = $_POST['ussrbasic_danger_color'];
}
if ($primary_color || $success_color || $info_color || $warning_color || $danger_color || $radius) {
try {
$cache_dir = 'store/[data]/[scss]/';
if(!is_dir($cache_dir)) {
os_mkdir($cache_dir, STORAGE_DEFAULT_PERMISSIONS, true);
}
$options = [
'cacheDir' => $cache_dir,
'prefix' => 'ussrbasic_',
'forceRefresh' => false
];
$compiler = new Compiler($options);
$compiler->setImportPaths('vendor/twbs/bootstrap/scss');
$compiler->setOutputStyle(OutputStyle::COMPRESSED);
// Set Variables
if ($primary_color) {
$variables['$primary'] = $primary_color;
}
if ($success_color) {
$variables['$success'] = $success_color;
}
if ($info_color) {
$variables['$info'] = $info_color;
}
if ($warning_color) {
$variables['$warning'] = $warning_color;
}
if ($danger_color) {
$variables['$danger'] = $danger_color;
}
if ($radius) {
$variables['$border-radius'] = $radius . 'rem';
$variables['$border-radius-sm'] = $radius/1.5 . 'rem';
$variables['$border-radius-lg'] = $radius*1.333 . 'rem';
$variables['$border-radius-xl'] = $radius*2.666 . 'rem';
$variables['$border-radius-xxl'] = $radius*5.333 . 'rem';
}
// Replace Bootstrap Variables with Customizer Variables
$compiler->replaceVariables($variables);
$bs = $compiler->compileString('@import "bootstrap.scss";');
set_pconfig(local_channel(), 'ussrbasic', 'bootstrap', $bs->getCss());
} catch (\Exception $e) {
logger('scssphp: Unable to compile content');
}
}
else {
set_pconfig(local_channel(), 'ussrbasic', 'bootstrap', '');
}
}
set_pconfig(local_channel(), 'ussrbasic', 'primary_color', $_POST['ussrbasic_primary_color']);
set_pconfig(local_channel(), 'ussrbasic', 'success_color', $_POST['ussrbasic_success_color']);
set_pconfig(local_channel(), 'ussrbasic', 'info_color', $_POST['ussrbasic_info_color']);
set_pconfig(local_channel(), 'ussrbasic', 'warning_color', $_POST['ussrbasic_warning_color']);
set_pconfig(local_channel(), 'ussrbasic', 'danger_color', $_POST['ussrbasic_danger_color']);
set_pconfig(local_channel(), 'ussrbasic', 'narrow_navbar', $_POST['ussrbasic_narrow_navbar']);
set_pconfig(local_channel(), 'ussrbasic', 'navbar_dark_mode', $_POST['ussrbasic_navbar_dark_mode']);
set_pconfig(local_channel(), 'ussrbasic', 'dark_mode', $_POST['ussrbasic_dark_mode']);
set_pconfig(local_channel(), 'ussrbasic', 'nav_bg', $_POST['ussrbasic_nav_bg']);
set_pconfig(local_channel(), 'ussrbasic', 'nav_bg_dark', $_POST['ussrbasic_nav_bg_dark']);
set_pconfig(local_channel(), 'ussrbasic', 'link_color', $_POST['ussrbasic_link_color']);
set_pconfig(local_channel(), 'ussrbasic', 'link_color_dark', $_POST['ussrbasic_link_color_dark']);
set_pconfig(local_channel(), 'ussrbasic', 'link_hover_color', $_POST['ussrbasic_link_hover_color']);
set_pconfig(local_channel(), 'ussrbasic', 'link_hover_color_dark', $_POST['ussrbasic_link_hover_color_dark']);
set_pconfig(local_channel(), 'ussrbasic', 'background_color', $_POST['ussrbasic_background_color']);
set_pconfig(local_channel(), 'ussrbasic', 'background_color_dark', $_POST['ussrbasic_background_color_dark']);
set_pconfig(local_channel(), 'ussrbasic', 'background_image', $_POST['ussrbasic_background_image']);
@ -84,6 +171,9 @@ class UssrbasicConfig {
set_pconfig(local_channel(), 'ussrbasic', 'top_photo', $_POST['ussrbasic_top_photo']);
set_pconfig(local_channel(), 'ussrbasic', 'reply_photo', $_POST['ussrbasic_reply_photo']);
set_pconfig(local_channel(), 'ussrbasic', 'advanced_theming', $_POST['ussrbasic_advanced_theming']);
// This is used to refresh the cache
set_pconfig(local_channel(), 'system', 'style_update', time());
}
}
@ -103,24 +193,25 @@ class UssrbasicConfig {
'$dark' => t('Dark style'),
'$light' => t('Light style'),
'$common' => t('Common settings'),
'$primary_color' => array('ussrbasic_primary_color', t('Primary theme color'), $arr['primary_color'], '<i class="bi bi-circle-fill text-primary"></i> ' . t('Current color, leave empty for default')),
'$success_color' => array('ussrbasic_success_color', t('Success theme color'), $arr['success_color'], '<i class="bi bi-circle-fill text-success"></i> ' . t('Current color, leave empty for default')),
'$info_color' => array('ussrbasic_info_color', t('Info theme color'), $arr['info_color'], '<i class="bi bi-circle-fill text-info"></i> ' . t('Current color, leave empty for default')),
'$warning_color' => array('ussrbasic_warning_color', t('Warning theme color'), $arr['warning_color'], '<i class="bi bi-circle-fill text-warning"></i> ' . t('Current color, leave empty for default')),
'$danger_color' => array('ussrbasic_danger_color', t('Danger theme color'), $arr['danger_color'], '<i class="bi bi-circle-fill text-danger"></i> ' . t('Current color, leave empty for default')),
'$dark_mode' => array('ussrbasic_dark_mode',t('Default to dark mode'),$arr['dark_mode'], '', array(t('No'),t('Yes'))),
'$navbar_dark_mode' => array('ussrbasic_navbar_dark_mode',t('Always use light icons for navbar'),$arr['navbar_dark_mode'], t('Enable this option if you use a dark navbar color in light mode'), array(t('No'),t('Yes'))),
'$narrow_navbar' => array('ussrbasic_narrow_navbar',t('Narrow navbar'),$arr['narrow_navbar'], '', array(t('No'),t('Yes'))),
'$nav_bg' => array('ussrbasic_nav_bg', t('Navigation bar background color'), $arr['nav_bg']),
'$nav_bg_dark' => array('ussrbasic_nav_bg_dark', t('Dark navigation bar background color'), $arr['nav_bg_dark']),
'$link_color' => array('ussrbasic_link_color', t('Link color'), $arr['link_color']),
'$link_color_dark' => array('ussrbasic_link_color_dark', t('Dark link color'), $arr['link_color_dark']),
'$link_hover_color' => array('ussrbasic_link_hover_color', t('Link hover color'), $arr['link_hover_color']),
'$link_hover_color_dark' => array('ussrbasic_link_hover_color_dark', t('Dark link hover color'), $arr['link_hover_color_dark']),
'$bgcolor' => array('ussrbasic_background_color', t('Set the background color'), $arr['bgcolor']),
'$bgcolor_dark' => array('ussrbasic_background_color_dark', t('Set the dark background color'), $arr['bgcolor_dark']),
'$background_image' => array('ussrbasic_background_image', t('Set the background image'), $arr['background_image']),
'$background_image_dark' => array('ussrbasic_background_image_dark', t('Set the dark background image'), $arr['background_image_dark']),
'$font_size' => array('ussrbasic_font_size', t('Set font-size for the entire application'), $arr['font_size'], t('Examples: 1rem, 100%, 16px')),
'$radius' => array('ussrbasic_radius', t('Set radius of corners'), $arr['radius'], t('Example: 4px')),
'$radius' => array('ussrbasic_radius', t('Set radius of corners in rem'), $arr['radius'], t('Leave empty for default radius')),
'$converse_width' => array('ussrbasic_converse_width',t('Set maximum width of content region in rem'),$arr['converse_width'], t('Leave empty for default width')),
'$top_photo' => array('ussrbasic_top_photo', t('Set size of conversation author photo'), $arr['top_photo']),
'$reply_photo' => array('ussrbasic_reply_photo', t('Set size of followup author photos'), $arr['reply_photo']),
'$top_photo' => array('ussrbasic_top_photo', t('Set size of conversation author photo'), $arr['top_photo'], t('Leave empty for default size')),
'$reply_photo' => array('ussrbasic_reply_photo', t('Set size of followup author photos'), $arr['reply_photo'], t('Leave empty for default size')),
'$advanced_theming' => ['ussrbasic_advanced_theming', t('Show advanced settings'), $arr['advanced_theming'], '', [t('No'), t('Yes')]]
));

View File

@ -1,32 +1,48 @@
<?php
if(! App::$install) {
if(!App::$install) {
// Get the UID of the channel owner
$uid = get_theme_uid();
if($uid) {
load_pconfig($uid,'ussrbasic');
}
// Load the owners pconfig
load_pconfig($uid, 'ussrbasic');
// Load the owners pconfig
$nav_bg = get_pconfig($uid, 'ussrbasic', 'nav_bg');
$nav_bg_dark = get_pconfig($uid, 'ussrbasic', 'nav_bg_dark');
$narrow_navbar = get_pconfig($uid,'ussrbasic','narrow_navbar');
$link_color = get_pconfig($uid, 'ussrbasic', 'link_color');
$link_color_dark = get_pconfig($uid, 'ussrbasic', 'link_color_dark');
$link_hover_color = get_pconfig($uid, 'ussrbasic', 'link_hover_color');
$link_hover_color_dark = get_pconfig($uid, 'ussrbasic', 'link_hover_color_dark');
$bgcolor = get_pconfig($uid, 'ussrbasic', 'background_color');
$bgcolor_dark = get_pconfig($uid, 'ussrbasic', 'background_color_dark');
$schema = get_pconfig($uid,'ussrbasic','schema');
$background_image = get_pconfig($uid, 'ussrbasic', 'background_image');
$background_image_dark = get_pconfig($uid, 'ussrbasic', 'background_image_dark');
$font_size = get_pconfig($uid, 'ussrbasic', 'font_size');
$radius = get_pconfig($uid, 'ussrbasic', 'radius');
$converse_width=get_pconfig($uid,'ussrbasic','converse_width');
$top_photo=get_pconfig($uid,'ussrbasic','top_photo');
$reply_photo=get_pconfig($uid,'ussrbasic','reply_photo');
$custom_bs = get_pconfig($uid, 'ussrbasic', 'bootstrap');
$nav_bg = get_pconfig($uid, 'ussrbasic', 'nav_bg');
$nav_bg_dark = get_pconfig($uid, 'ussrbasic', 'nav_bg_dark');
$narrow_navbar = get_pconfig($uid,'ussrbasic','narrow_navbar');
$bgcolor = get_pconfig($uid, 'ussrbasic', 'background_color');
$bgcolor_dark = get_pconfig($uid, 'ussrbasic', 'background_color_dark');
$schema = get_pconfig($uid,'ussrbasic','schema');
$background_image = get_pconfig($uid, 'ussrbasic', 'background_image');
$background_image_dark = get_pconfig($uid, 'ussrbasic', 'background_image_dark');
$font_size = get_pconfig($uid, 'ussrbasic', 'font_size');
$converse_width = get_pconfig($uid,'ussrbasic','converse_width');
$top_photo = get_pconfig($uid,'ussrbasic','top_photo');
$reply_photo = get_pconfig($uid,'ussrbasic','reply_photo');
}
}
$site_bs_path = 'vendor/twbs/bootstrap/dist/css/bootstrap.min.css';
if (file_exists('view/theme/ussrbasic/css/bootstrap-custom.css')) {
// Compiled custom site bootstrap from sass
// Run this script from the document root for an example:
// php vendor/bin/pscss view/theme/ussrbasic/css/sample.scss view/theme/ussrbasic/css/bootstrap-custom.css
$site_bs_path = 'view/theme/ussrbasic/css/bootstrap-custom.css';
}
$bs = $custom_bs ?: file_get_contents($site_bs_path);
if (file_exists('view/css/bootstrap-red.css')) {
$bs = $bs . file_get_contents('view/css/bootstrap-red.css');
}
if(file_exists('view/theme/ussrbasic/schema/' . $schema . '.css')) {
$schemecss = file_get_contents('view/theme/ussrbasic/schema/' . $schema . '.css');
}
// Now load the scheme. If a value is changed above, we'll keep the settings
@ -71,50 +87,16 @@ if ((!$schema) || ($schema == '---')) {
//Set some defaults - we have to do this after pulling owner settings, and we have to check for each setting
//individually. If we don't, we'll have problems if a user has set one, but not all options.
if (! $nav_bg)
$nav_bg = 'rgba(248, 249, 250, 1)';
if (! $nav_bg_dark)
$nav_bg_dark = 'rgba(43, 48, 53, 1)';
if (! $link_color)
$link_color = '#0d6efd';
if (! $link_color_dark)
$link_color_dark = '#6ea8fe';
if (! $link_hover_color)
$link_hover_color = '#0a58ca';
if (! $link_hover_color_dark)
$link_hover_color_dark = '#9ec5fe';
if (! $bgcolor)
$bgcolor = '#fff';
if (! $bgcolor_dark)
$bgcolor_dark = '#212529';
if (! $background_image)
$background_image = '';
if (! $background_image_dark)
$background_image_dark = '';
if (! $font_size)
$font_size = '0.875rem';
if (! $radius)
$radius = '0.375rem';
if (! $converse_width)
$converse_width = '52'; //unit: rem
if(! $top_photo)
$top_photo = '2.3rem';
if(! $reply_photo)
$reply_photo = '2.3rem';
$nav_bg = $nav_bg ?: 'rgba(248, 249, 250, 1)';
$nav_bg_dark = $nav_bg_dark ?: 'rgba(43, 48, 53, 1)';
$bgcolor = $bgcolor ?: '#fff';
$bgcolor_dark = $bgcolor_dark ?: '#212529';
$background_image = $background_image ?: '';
$background_image_dark = $background_image_dark ?: '';
$font_size = $font_size ?: '0.875rem';
$converse_width = $converse_width ?: '52'; //unit: rem
$top_photo = $top_photo ?: '2.9rem';
$reply_photo = $reply_photo ?: '2.9rem';
// Apply the settings
if(file_exists('view/theme/ussrbasic/css/style.css')) {
@ -140,16 +122,11 @@ if(file_exists('view/theme/ussrbasic/css/style.css')) {
$options = array (
'$nav_bg' => $nav_bg,
'$nav_bg_dark' => $nav_bg_dark,
'$link_color' => $link_color,
'$link_color_dark' => $link_color_dark,
'$link_hover_color' => $link_hover_color,
'$link_hover_color_dark' => $link_hover_color_dark,
'$bgcolor' => $bgcolor,
'$bgcolor_dark' => $bgcolor_dark,
'$background_image' => $background_image,
'$background_image_dark' => $background_image_dark,
'$font_size' => $font_size,
'$radius' => $radius,
'$converse_width' => $converse_width,
'$top_photo' => $top_photo,
'$reply_photo' => $reply_photo,
@ -158,8 +135,12 @@ if(file_exists('view/theme/ussrbasic/css/style.css')) {
'$right_aside_width' => $right_aside_width
);
echo strtr($x, $options);
$o = strtr($x, $options);
header('Cache-Control: max-age=2592000');
echo $bs . $o;
}
// Set the schema to the default schema in derived themes. See the documentation for creating derived themes how to override this.

View File

@ -5,7 +5,7 @@
* * Description: ussr.win theme based on Hubzilla standard theme
* * Version: 2.2
* * MinVersion: 8.9
* * MaxVersion: 10.0
* * MaxVersion: 11.0
* * Author: Fabrixxm
* * Maintainer: ivan zlax
* * Theme_Color: rgb(248, 249, 250)

View File

@ -1,10 +1,11 @@
<?php
use Zotlabs\Lib\Config;
require_once('view/php/theme_init.php');
head_add_css('/library/fork-awesome/css/fork-awesome.min.css');
head_add_css('/vendor/twbs/bootstrap/dist/css/bootstrap.min.css');
head_add_css('/vendor/twbs/bootstrap-icons/font/bootstrap-icons.min.css');
head_add_css('/library/bootstrap-tagsinput/bootstrap-tagsinput.css');
head_add_css('/view/css/bootstrap-red.css');
head_add_css('/library/bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css');
head_add_js('/vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js');
@ -26,8 +27,8 @@ if (App::$profile_uid) {
}
if (!$ussrbasic_mode) {
$ussrbasic_mode = ((get_config('ussrbasic', 'dark_mode')) ? 'dark' : 'light');
$ussrbasic_navbar_mode = ((get_config('ussrbasic', 'navbar_dark_mode')) ? 'dark' : 'light');
$ussrbasic_mode = ((Config::Get('ussrbasic', 'dark_mode')) ? 'dark' : 'light');
$ussrbasic_navbar_mode = ((Config::Get('ussrbasic', 'navbar_dark_mode')) ? 'dark' : 'light');
}
App::$page['color_mode'] = 'data-bs-theme="' . $ussrbasic_mode . '"';

View File

@ -1,5 +1,5 @@
.comment .wall-item-body {
padding-left: 2.8rem;
padding-left: 3.4rem;
}
.wall-item-content-wrapper.comment {

View File

@ -1,6 +1 @@
<?php
if (! $radiuspx)
$radiuspx = "4";
if (! $comment_border_colour)
$comment_border_colour = "rgb(238,238,238)";

View File

@ -401,3 +401,10 @@ blockquote {
--bs-bg-opacity: 0;
}
.generic-content-wrapper.is-contained {
border: 1px solid #5f6271;
}
.generic-content-wrapper.is-new {
border-top: 2px solid #63bd65;
}

View File

@ -409,3 +409,11 @@ blockquote {
.bg-body-secondary {
--bs-bg-opacity: 0;
}
.generic-content-wrapper.is-contained {
border: 1px solid #5f6271;
}
.generic-content-wrapper.is-new {
border-top: 2px solid #63bd65;
}

View File

@ -401,3 +401,11 @@ blockquote {
.bg-body-secondary {
--bs-bg-opacity: 0;
}
.generic-content-wrapper.is-contained {
border: 1px solid #5f6271;
}
.generic-content-wrapper.is-new {
border-top: 2px solid #63bd65;
}

View File

@ -395,3 +395,11 @@ blockquote {
.bg-body-secondary {
--bs-bg-opacity: 0;
}
.generic-content-wrapper.is-contained {
border: 1px solid #5f6271;
}
.generic-content-wrapper.is-new {
border-top: 2px solid #63bd65;
}

View File

@ -421,3 +421,11 @@ blockquote {
.bg-body-secondary {
--bs-bg-opacity: 0;
}
.generic-content-wrapper.is-contained {
border: 1px solid #5f6271;
}
.generic-content-wrapper.is-new {
border-top: 2px solid #63bd65;
}

View File

@ -5,32 +5,38 @@
{{include file="field_checkbox.tpl" field=$advanced_theming}}
{{if $expert}}
<hr>
<h3>{{$common}}</h3>
{{include file="field_colorinput.tpl" field=$primary_color}}
{{include file="field_colorinput.tpl" field=$success_color}}
{{include file="field_colorinput.tpl" field=$info_color}}
{{include file="field_colorinput.tpl" field=$warning_color}}
{{include file="field_colorinput.tpl" field=$danger_color}}
{{include file="field_input.tpl" field=$radius}}
{{include file="field_input.tpl" field=$top_photo}}
{{include file="field_input.tpl" field=$reply_photo}}
<h3>{{$light}}</h3>
{{include file="field_checkbox.tpl" field=$navbar_dark_mode}}
{{include file="field_colorinput.tpl" field=$nav_bg}}
{{include file="field_colorinput.tpl" field=$bgcolor}}
{{include file="field_colorinput.tpl" field=$background_image}}
{{include file="field_colorinput.tpl" field=$link_color}}
{{include file="field_colorinput.tpl" field=$link_hover_color}}
<h3>{{$dark}}</h3>
{{include file="field_colorinput.tpl" field=$nav_bg_dark}}
{{include file="field_colorinput.tpl" field=$bgcolor_dark}}
{{include file="field_colorinput.tpl" field=$background_image_dark}}
{{include file="field_colorinput.tpl" field=$link_color_dark}}
{{include file="field_colorinput.tpl" field=$link_hover_color_dark}}
<h3>{{$common}}</h3>
{{include file="field_input.tpl" field=$radius}}
{{include file="field_input.tpl" field=$top_photo}}
{{include file="field_input.tpl" field=$reply_photo}}
<script>
$(function(){
$('#id_ussrbasic_link_color, #id_ussrbasic_link_color_dark, #id_ussrbasic_link_hover_color, #id_ussrbasic_link_hover_color_dark, #id_ussrbasic_background_color, #id_ussrbasic_background_color_dark, #id_ussrbasic_nav_bg, #id_ussrbasic_nav_bg_dark').colorpicker({format: 'rgba'});
$('#id_redbasic_link_color, #id_redbasic_link_color_dark, #id_redbasic_link_hover_color, #id_redbasic_link_hover_color_dark, #id_redbasic_background_color, #id_redbasic_background_color_dark, #id_redbasic_nav_bg, #id_redbasic_nav_bg_dark').colorpicker({format: 'rgba'});
});
$(function(){
$('#id_redbasic_primary_color, #id_redbasic_success_color, #id_redbasic_info_color, #id_redbasic_warning_color, #id_redbasic_danger_color').colorpicker({format: 'hex'});
});
</script>
{{/if}}
<div class="settings-submit-wrapper" >
<button type="submit" name="ussrbasic-settings-submit" class="btn btn-primary">{{$submit}}</button>
<button type="submit" name="redbasic-settings-submit" class="btn btn-primary">{{$submit}}</button>
</div>

View File

@ -1,15 +0,0 @@
.wall-item-content.conv-list-mode {
max-width: 280px;
height:200px;
min-height: 200px;
overflow: hidden;
}
.thread-wrapper.toplevel_item.conv-list-mode {
width: 300px;
height: 300px;
float: left;
margin-left: 5px;
margin-bottom: 35px;
}

View File

@ -1,24 +0,0 @@
/*
section {
left: 0px;
width: 800px;
margin-left: auto;
margin-right: auto;
}
body {background-color: #d00 !important;}
.page-content-wrapper {background: #fff;
color: #000;
border-radius: 20px;
box-shadow: 5px 5px 5px #111;
}
h3.page-title {
padding-top: 30px;
color: #033}
.page-body {padding: 40px;}
.page-body strong {color: #033;}
.nav-links {margin-top: 5px;}
*/

View File

@ -4,9 +4,4 @@
--bs-navbar-padding-y: 1px;
}
#jGrowl.top-right {
top: 3.5rem;
right: 15px;
}
}

View File

@ -0,0 +1,14 @@
// To compiled custom site bootstrap from sass,
// run this script from the document root for an example:
// php vendor/bin/pscss view/theme/ussrbasicpub/css/sample.scss view/theme/ussrbasicpub/css/bootstrap-custom.css
// See https://getbootstrap.com/docs/5.3/customize/sass/ for more infos
// required import
@import "vendor/twbs/bootstrap/scss/_functions";
$primary: #ff0000; // set the $primary variable
// set changes
@import "vendor/twbs/bootstrap/scss/bootstrap";

View File

@ -1,58 +0,0 @@
.rotleft1 {
-webkit-transform: rotate(-1deg);
-moz-transform: rotate(-1deg);
-ms-transform: rotate(-1deg);
-o-transform: rotate(-1deg);
}
.rotleft2 {
-webkit-transform: rotate(-2deg);
-moz-transform: rotate(-2deg);
-ms-transform: rotate(-2deg);
-o-transform: rotate(-2deg);
}
.rotleft3 {
-webkit-transform: rotate(-3deg);
-moz-transform: rotate(-3deg);
-ms-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
}
.rotleft4 {
-webkit-transform: rotate(-4deg);
-moz-transform: rotate(-4deg);
-ms-transform: rotate(-4deg);
-o-transform: rotate(-4deg);
}
.rotright1 {
-webkit-transform: rotate(1deg);
-moz-transform: rotate(1deg);
-ms-transform: rotate(1deg);
-o-transform: rotate(1deg);
}
.rotright2 {
-webkit-transform: rotate(2deg);
-moz-transform: rotate(2deg);
-ms-transform: rotate(2deg);
-o-transform: rotate(2deg);
}
.rotright3 {
-webkit-transform: rotate(3deg);
-moz-transform: rotate(3deg);
-ms-transform: rotate(3deg);
-o-transform: rotate(3deg);
}
.rotright4 {
-webkit-transform: rotate(4deg);
-moz-transform: rotate(4deg);
-ms-transform: rotate(4deg);
-o-transform: rotate(4deg);
}

View File

@ -7,21 +7,13 @@
/* bootstrap variables */
:root {
--bs-border-radius: $radius;
--bs-highlight-bg: var(--bs-warning);
}
[data-bs-theme=light] {
--bs-link-color: $link_color;
--bs-link-hover-color: $link_hover_color;
--hz-body-bg: $bgcolor;
--hz-body-bg-image: url('$background_image');
}
[data-bs-theme=dark] {
--bs-link-color: $link_color_dark;
--bs-link-hover-color: $link_hover_color_dark;
--hz-body-bg: $bgcolor_dark;
--hz-body-bg-image: url('$background_image_dark');
}
@ -34,10 +26,6 @@
background-color: $nav_bg_dark !important;
}
.btn {
--bs-btn-border-radius: $radius;
}
/* generals */
@ -46,13 +34,10 @@ html {
}
body {
font-size: 0.9rem;
background-color: var(--hz-body-bg);
background-image: var(--hz-body-bg-image);
background-attachment: fixed;
background-size: cover;
color: var(--bs-body-color);
margin: 0;
}
aside#region_1 {
@ -87,30 +72,31 @@ main {
height: 100vh;
background: rgba(0, 0, 0, .3);
cursor: pointer;
z-index: 1010;
}
h1, .h1 {
font-size: 2rem;
font-size: 2.1rem;
}
h2, .h2 {
font-size: 1.6rem;
font-size: 1.7rem;
}
h3, .h3 {
font-size: 1.2rem;
font-size: 1.3rem;
}
h4, .h4 {
font-size: 1.05rem;
font-size: 1.15rem;
}
h5, .h5 {
font-size: 0.9rem;
font-size: 1rem;
}
h6, .h6 {
font-size: 0.75rem;
font-size: 0.85rem;
}
.navbar-banner {
@ -155,7 +141,7 @@ a:focus,
}
input, optgroup, select, textarea {
font-size: 0.9rem !important;
font-size: 1rem !important;
}
input[type=text], textarea {
@ -164,24 +150,15 @@ input[type=text], textarea {
color: var(--bs-body-color);
}
.selected-doco-nav {
font-weight: bold;
text-shadow: 2px 2px 3px lightgray;
}
#doco-content img {
width: 100%;
}
#help-content pre code {
overflow-x: auto;
white-space: pre;
}
.heart {
color: #FF0000;
}
#toast-container {
z-index: 1060;
width: 300px;
}
#powered-by {
font-size: 0.5rem;
position: absolute;
@ -459,7 +436,7 @@ footer {
.photo,
.contact-block-img {
border-radius: $radius;
border-radius: var(--bs-border-radius);
}
#side-bar-photos-albums {
@ -472,7 +449,7 @@ footer {
.profile-match-photo img,
.directory-photo-img {
border-radius: $radius;
border-radius: var(--bs-border-radius);
}
.profile-match-photo img {
@ -722,29 +699,9 @@ nav .acpopup {
color:#cc0000;
}
/* popup notifications */
div.jGrowl div.notice {
background: #511919 url("../../../../images/icons/48/notice.png") no-repeat 5px center;
color: #ffffff;
padding-left: 58px;
}
div.jGrowl div.info {
background: #364e59 url("../../../../images/icons/48/info.png") no-repeat 5px center;
color: #ffffff;
padding-left: 58px;
}
#jGrowl.top-right {
top: 4.5rem;
right: .25rem;
}
div.jGrowl div.jGrowl-notification {
min-height: 60px;
}
.jslider .jslider-scale ins {
color: #333;
font-size: 0.9rem;
font-size: 1rem;
width: 100px;
text-align: center;
}
@ -810,7 +767,7 @@ div.jGrowl div.jGrowl-notification {
.shared_header img {
border-radius: var(--bs-border-radius);
margin-right: .75rem;
margin-right: .5rem;
}
.tag1 {
@ -873,28 +830,27 @@ margin-right: 50px;
.generic-icons,
a .generic-icons {
font-size: 1rem;
margin-right: 0.5rem;
font-size: 1.2rem;
}
.generic-icons-right {
font-size: 1rem;
font-size: 1.2rem;
margin-left: 0.5rem;
}
.generic-icons-nav {
font-size: 1rem;
margin-right: 7px;
font-size: 1.2rem;
margin-right: 0.5rem;
}
.admin-icons {
font-size: 1.2em;
margin-right: 7px;
font-size: 1.2rem;
margin-right: 0.5rem;
}
.drop-icons,
a .drop-icons {
font-size: 1rem;
font-size: 1.2rem;
text-decoration: none;
cursor: pointer;
}
@ -924,25 +880,6 @@ a .drop-icons:hover {
list-style-type: none;
}
table {
border-spacing: 2px;
max-width: 100%;
}
th,td {
padding: 3px;
}
#channels > tbody > tr > td, #users > tbody > tr > td {
max-width: 19.4em;
overflow: hidden;
}
/* mail */
img.mail-conv-sender-photo {
border-radius: var(--bs-border-radius);
}
/* jot */
@ -958,21 +895,23 @@ img.mail-conv-sender-photo {
font-weight: bold;
}
.jot-icons,
.comment-icon {
font-size: 1.2rem;
}
#profile-jot-wrapper {
background-color: var(--bs-body-bg);
border: 1px solid var(--bs-border-color);
border-radius: var(--bs-border-radius);
}
#profile-jot-text::-webkit-input-placeholder {
font-size: 1.2rem;
font-size: 1.3rem;
}
#profile-jot-text::-moz-placeholder {
font-size: 1.2rem;
font-size: 1.3rem;
}
#profile-jot-text:focus::-webkit-input-placeholder {
@ -1013,6 +952,10 @@ img.mail-conv-sender-photo {
margin-top: 2em;
}
.wall-item-pinned i {
transform: rotate(45deg);
}
.wall-item-content-wrapper {
background-color: var(--bs-tertiary-bg);
}
@ -1035,6 +978,19 @@ img.mail-conv-sender-photo {
border-top: 1px dashed #adadad;
}
.hide-comments-icon,
.divgrow-showmore-icon {
font-size: $font_size;
}
.divgrow-showmore-label,
.hide-comments-label {
text-transform: uppercase;
font-size: 0.7rem;
}
.wall-item-comment-wrapper {
padding: 7px 10px;
background-color: var(--bs-tertiary-bg);
@ -1061,14 +1017,6 @@ img.mail-conv-sender-photo {
height: $reply_photo;
}
.wall-item-content,
.mail-conv-body,
.page-body,
.chat-item-text,
.chat-item-text-self {
font-size: 1rem;
}
.comment-edit-text {
border: 1px solid var(--bs-border-color);
border-radius: var(--bs-border-radius);
@ -1119,7 +1067,7 @@ img.mail-conv-sender-photo {
}
.abook-self {
background-color: #ffdddd;
background-color: var(--bs-light-bg-subtle);
}
.abook-pending-contact, .abook-permschange {
@ -1155,16 +1103,16 @@ img.mail-conv-sender-photo {
}
.menu-img-2 {
height: 2.3rem;
width: 2.3rem;
height: 2.5rem;
width: 2.5rem;
margin-right: .5rem;
border-radius: var(--bs-border-radius);
float: left;
}
.menu-img-1 {
height: 1.1rem;
width: 1.1rem;
height: 1.3rem;
width: 1.3rem;
border-radius: var(--bs-border-radius);
}
@ -1196,9 +1144,18 @@ img.mail-conv-sender-photo {
.generic-content-wrapper {
background-color: var(--bs-body-bg);
border: 1px solid var(--bs-border-color);
border: 1px solid var(--bs-light-border-subtle);
border-radius: var(--bs-border-radius);
margin-bottom: 1.5rem;
font-size: 1.1rem;
}
.generic-content-wrapper.is-contained {
border: 1px solid var(--bs-primary-border-subtle);
}
.generic-content-wrapper.is-new {
border-top: 2px solid var(--bs-primary);
}
.section-title-wrapper {
@ -1236,32 +1193,32 @@ img.mail-conv-sender-photo {
.section-content-success-wrapper {
padding: 21px 10px;
color: #155724;
background-color: #d4edda;
color: var(--bs-success-text-emphasis);
background-color: var(--bs-success-bg-subtle);
border-bottom: 3px solid var(--bs-body-bg);
text-align: center;
}
.section-content-info-wrapper {
padding: 21px 10px;
color: #0c5460;
background-color: #d1ecf1;
color: var(--bs-info-text-emphasis);
background-color: var(--bs-info-bg-subtle);
border-bottom: 3px solid var(--bs-body-bg);
text-align: center;
}
.section-content-warning-wrapper {
padding: 21px 10px;
color: #856404;
background-color: #fff3cd;
color: var(--bs-warning-text-emphasis);
background-color: var(--bs-warning-bg-subtle);
border-bottom: 3px solid var(--bs-body-bg);
text-align: center;
}
.section-content-danger-wrapper {
padding: 21px 10px;
color: #721c24;
background-color: #f8d7da;
color: var(--bs-danger-text-emphasis);
background-color: var(--bs-danger-bg-subtle);
border-bottom: 3px solid var(--bs-body-bg);
text-align: center;
}
@ -1295,17 +1252,23 @@ img.mail-conv-sender-photo {
}
main.fullscreen {
position: fixed;
top: 0px;
left: 0px;
width: 100%;
width: 100vw;
height: 100vh;
max-width: none;
z-index: 1020;
overflow: auto;
}
main.fullscreen .generic-content-wrapper {
position: absolute;
width: 100%;
position: fixed;
top: 0px;
left: 0px;
width: 100vw;
height: 100vh;
z-index: 1020;
overflow: auto;
border-radius: 0px;
border-width: 0px;
}
@ -1354,12 +1317,7 @@ main.fullscreen .section-content-wrapper-np {
/* bootstrap overrides */
.form-control {
border-radius: $radius;
}
blockquote {
font-size: 1rem;
font-style: italic;
border-left: 3px solid var(--bs-border-color);
padding: 1em 0px 1em 1.5em;
@ -1419,15 +1377,19 @@ dl.bb-dl > dd > li {
}
.bootstrap-tagsinput .tag:before {
/* Copied from fa-asterisk, is there a better way to do it? */
font-family: ForkAwesome;
font-weight: normal;
font-style: normal;
text-decoration: inherit;
content:"\f069 ";
font-family: bootstrap-icons;
font-size: 0.5rem;
content: "\F151";
margin-right: .25rem;
}
/* Modified original CSS to match input in Ussrbasicpub */
.bootstrap-tagsinput .tag [data-role="remove"]:after {
font-family: bootstrap-icons;
font-size: 0.5rem;
content: "\F659";
}
/* Modified original CSS to match input in Ussrbasic */
.jothidden .bootstrap-tagsinput {
border: 0px solid transparent;
margin-bottom: 0px;
@ -1447,7 +1409,6 @@ dl.bb-dl > dd > li {
.bootstrap-tagsinput input {
height: 2.5rem;
margin: 0;
max-width: 30%;
}
.bootstrap-tagsinput {
@ -1675,414 +1636,9 @@ dl.bb-dl > dd > li {
}
}
/* disable reashred content streching */
.reshared-content img {
width: auto;
}
/* hide theme switch */
#theme-switch {
visibility: hidden;
}
/* disable likes */
.wall-item-like {
visibility: hidden;
}
.wall-item-tools-right > .btn-group > .btn:first-child {
visibility: hidden;
}
/* disable minus icon */
.oneway-overlay, .fa-minus-circle {
visibility: hidden;
}
/* greengrey colors */
body {
background-color: #383c4a;
color: #dddddd;
}
.generic-content-wrapper {
background-color: #383c4a;
}
.section-subtitle-wrapper,
.collapse,
.show,
.section-title-wrapper {
background-color: #404552;
border-bottom-color: #2b2b2b;
}
.vcard, .h-card,
.widget, .settings-widget, .section-subtitle-wrapper {
background-color: #4B5162;
border-bottom: #383c4a;
border-left: #383c4a;
border-right: #383c4a;
border-top: #383c4a;
}
.fn {
color: #ffffff;
}
.contextual-help-content,
.section-content-tools-wrapper, .section-content-wrapper {
background-color: #353945;
border-bottom: #383c4a;
border-left: #383c4a;
border-right: #383c4a;
border-top: #383c4a;
}
a:link {
color: #63bd65;
}
.zinlcxmi {
color: #63bd65;
}
a:visited {
color: #87ab63;
}
a:hover, a:active {
color: #3fec43;
}
div.profile-match-wrapper > div > a {
color: #ffffff;
}
.btn, .btn-primary {
background-color: #5c6b5b;
border-bottom-color: #47741c;
border-left-color: #47741c;
border-right-color: #47741c;
border-top-color: #47741c;
color: #ffffff !important;
}
.btn:hover, .btn-primary:active {
background-color: #4aae40;
border-bottom-color: #29b136;
border-left-color: #29b136;
border-right-color: #29b136;
border-top-color: #29b136;
}
.bg-dark, .navbar-collapse {
background-color: #2e323e !important;
}
.form-group:active, .checkbox:hover {
color: #41d24f;
}
.nav-link.active {
background-color: #315a2b !important;
}
.list-group-item {
background-color: #4B5162;
border-bottom: #383c4a;
border-left: #383c4a;
border-right: #383c4a;
border-top: #383c4a;
color: #9e9e9e;
border: 1px solid #383c4a;
}
.list-group-item:active {
color: #f4f4f4 !important;
}
.text-dark {
color: #bdbdbd !important;
}
a.text-dark:hover, a.text-dark:active {
color: #f4f4f4 !important;
}
.contactname {
color: #bdbdbd;
}
.wall-item-ago, .dropdown-sub-text {
color: #b3b3b3;
}
.list-group-item.active {
background-color: #315a2b;
border-color: #0c4704;
}
.form-control,
.form-control:focus,
input[type="text"]:hover,
input[type="text"]:active,
input[type="text"], textarea {
background-color: #2b2b2b;
border-color: #46583f;
color: #cdcdcd;
box-shadow: 0 0 0 .2rem #415240;
}
.form-group.checkbox:checked,
.form-group.checkbox > div > input:checked + label .onoffswitch-switch {
background-color: #315a2b;
}
.form-group.checkbox:hover label {
color: #315a2b;
}
.dropdown-item.active {
background-color: #315a2b;
}
.dropdown-divider {
border-top: 1px solid #3e3e3e;
}
.dropdown-item:active, .dropdown-item:focus, .dropdown-item:hover, .textcomplete-item:focus .dropdown-item, .textcomplete-item:hover .dropdown-item, .textcomplete-item.active .dropdown-item, .textcomplete-item:active .dropdown-item {
background-color: #4b5162;
color: #b3b3b3;
}
a.dropdown-item {
color: #f3f3f3;
}
.profile-match-wrapper {
border-top: 0px solid #eee;
border-left: 0px solid #eee;
}
.fakelink {
color: #87ab63;
}
a:hover, a:focus, .fakelink:hover, .fakelink:focus {
color: #3fec43;
}
.drop-icons {
color: #ff0000;
}
.drop-icons, a .drop-icons {
color: #bd0000;
}
.section-content-wrapper-np {
background-color: #404552;
}
.atoken-index-row:hover td, .chatroom-index-row:hover td, .group-index-row:hover td, .wikis-index-row:hover td, .locs-index-row:hover td, [id^="cloud-index-"]:hover td, .cloud-index-active {
background-color: #4b5162;
}
.generic-content-wrapper-styled {
background-color: #404552;
}
#profile-jot-wrapper,
.bootstrap-tagsinput {
background-color: #2b2b2b;
}
.wall-item-content-wrapper {
background-color: #404552;
}
.item-highlight {
border-left: 0.2rem solid #00ff00;
}
.wall-item-comment-wrapper-wc,
.hide-comments-outer,
.wall-item-comment-wrapper,
.wall-item-content-wrapper.comment {
background-color: #4b5162;
}
.wall-item-head-new {
border-top: 0.2rem solid #31570b;
}
.wall-item-comment-wrapper {
border-top: 3px solid #454853;
}
blockquote {
border-left: 3px solid #344136;
}
.hide-comments-outer {
border-top-color: #87ab63;
}
.badge-warning {
background-color: #036811;
color: #dddddd;
}
.divgrow-showmore {
border-top: 1px dashed #87ab63;
}
.comment-edit-text {
border: 1px solid #004400;
}
#doco-content h3 {
border-bottom: #87ab63 3px solid;
}
.section-content-info-wrapper {
color: #2aa650;
background-color: #17221b;
border-bottom: 3px solid #060d08;
}
.spinner.s, .spinner.m, .spinner.l {
color: #13c613;
border-top: .2rem solid #02c102;
border-left: .2rem solid #123312;
border-right: .2rem solid #123312;
border-bottom: .2rem solid #123312;
}
.wall-event-item {
background-color: #123312;
}
.fs {
background-color: #404552;
}
.bg-primary {
background-color: #315a2b !important;
}
.modal-content {
background-color: #171d16;
}
.close {
color: #989898;
}
.wall-item-conv {
background-color: #404552;
border-top: 1px solid #2e323e;
}
.dropdown-menu.textcomplete-dropdown {
background-color: #8d9a87;
}
.notification.notification-forum {
color: #63bd65;
}
.wall-photo-item {
background-color: #315a2b;
}
.directory-item .divgrow-showmore {
background-color: #353945;
}
.vcard-header:hover, .vcard-header.active {
background-color: #4B5162;
}
.alert-info {
color: #dddddd;
border-color: #2b2b2b;
}
.conv-participants {
color: #539b55;
}
#photo-view-wrapper {
background-color: #4B5162;
}
.table {
color: #dddccc;
}
#upgrade_info_aside {
border-color: #383c4a !important;
}
.text-muted {
color: #a6a6b9 !important;
}
.card {
background-color: #434753 !important;
}
.border {
border: 1px solid #415240 !important;
}
.item-category, .item-category > .text-dark {
color: #222222 !important;
}
.nav-link:focus, .nav-link:hover {
color: #eeeeee;
}
.nav-link.active > .fa-fw {
color: #eeeeee;
}
.nav-tabs {
border-bottom: 1px solid #415240 !important;
}
.nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active {
border-top-color: #444444;
border-right-color: #444444;
border-bottom-color: #444444;
border-left-color: #444444;
}
.generic-content-wrapper {
border: 1px solid #444444;
}
#notifications {
background-color: #383c4a;
}
[data-bs-theme="light"] .navbar.bg-body-tertiary {
background-color: #2e323e !important;
}
[data-bs-theme="dark"] .navbar.bg-body-tertiary {
background-color: #2e323e !important;
}
.navbar {
--bs-navbar-color: #dddddd;
}
.navbar-banner {
color: #dddddd;
}
.bg-body-secondary {
--bs-bg-opacity: 0;
background-color: #aa2b2b;
padding: 10px;
border-radius: var(--bs-border-radius);
}

View File

@ -6,239 +6,251 @@ let ussrbasicpub_dark_mode = localStorage.getItem('ussrbasicpub_dark_mode');
let ussrbasicpub_theme_color = localStorage.getItem('ussrbasicpub_theme_color');
if (ussrbasicpub_dark_mode == 1) {
$('html').attr('data-bs-theme', 'dark');
document.documentElement.setAttribute('data-bs-theme', 'dark');
}
if (ussrbasicpub_dark_mode == 0) {
$('html').attr('data-bs-theme', 'light');
document.documentElement.setAttribute('data-bs-theme', 'light');
}
if (ussrbasicpub_theme_color) {
$('meta[name=theme-color]').attr('content', ussrbasicpub_theme_color);
document.querySelector('meta[name=theme-color]').setAttribute('content', ussrbasicpub_theme_color);
}
$(document).ready(function() {
// provide a fake progress bar for pwa standalone mode
if (window.matchMedia('(display-mode: standalone)').matches) {
$(window).on('beforeunload', function(){
if ($('.page-loader').length) {
return;
}
$('<div class="bg-primary page-loader"></div>').prependTo('body');
});
}
document.addEventListener('DOMContentLoaded', function () {
// provide a fake progress bar for pwa standalone mode
if (window.matchMedia('(display-mode: standalone)').matches) {
window.addEventListener('beforeunload', function () {
if (!document.querySelector('.page-loader')) {
let loader = document.createElement('div');
loader.classList.add('bg-primary', 'page-loader');
document.body.prepend(loader);
}
});
}
if (ussrbasicpub_dark_mode == 1) {
$('#theme-switch-icon').removeClass('fa-moon-o').addClass('fa-sun-o');
$('[data-bs-theme="light"]').attr('data-bs-theme', 'dark');
}
if (ussrbasicpub_dark_mode == 0) {
$('#theme-switch-icon').removeClass('fa-sun-o').addClass('fa-moon-o');
$('[data-bs-theme="dark"]:not(nav)').attr('data-bs-theme', 'light');
}
if (ussrbasicpub_dark_mode == 1) {
document.getElementById('theme-switch-icon').classList.remove('bi-moon');
document.getElementById('theme-switch-icon').classList.add('bi-sun');
document.querySelector('[data-bs-theme="light"]').setAttribute('data-bs-theme', 'dark');
}
if (ussrbasicpub_dark_mode == 0) {
document.getElementById('theme-switch-icon').classList.remove('bi-sun');
document.getElementById('theme-switch-icon').classList.add('bi-moon');
let darkElements = document.querySelectorAll('[data-bs-theme="dark"]:not(nav)');
darkElements.forEach(el => el.setAttribute('data-bs-theme', 'light'));
}
if (ussrbasicpub_theme_color != $('nav').css('background-color')) {
$('meta[name=theme-color]').attr('content', $('nav').css('background-color'));
localStorage.setItem('ussrbasicpub_theme_color', $('nav').css('background-color'));
}
let navBackgroundColor = document.querySelector('nav').style.backgroundColor;
if (ussrbasicpub_theme_color !== navBackgroundColor) {
document.querySelector('meta[name=theme-color]').setAttribute('content', navBackgroundColor);
localStorage.setItem('ussrbasicpub_theme_color', navBackgroundColor);
}
// CSS3 calc() fallback (for unsupported browsers)
$('body').append('<div id="css3-calc" style="width: 10px; width: calc(10px + 10px); display: none;"></div>');
if( $('#css3-calc').width() == 10) {
$(window).resize(function() {
if($(window).width() < 992) {
$('main').css('width', $(window).width() + $('aside').outerWidth() );
} else {
$('main').css('width', '100%');
}
});
}
$('#css3-calc').remove(); // Remove the test element
// CSS3 calc() fallback (for unsupported browsers)
let testElem = document.createElement('div');
testElem.style.width = 'calc(10px + 10px)';
testElem.style.display = 'none';
testElem.id = 'css3-calc';
document.body.appendChild(testElem);
if (testElem.offsetWidth === 10) {
window.addEventListener('resize', function () {
if (window.innerWidth < 992) {
document.querySelector('main').style.width = `${window.innerWidth + document.querySelector('aside').offsetWidth}px`;
} else {
document.querySelector('main').style.width = '100%';
}
});
}
testElem.remove(); // Remove the test element
if($(window).width() < 1200) {
$("#right_aside_wrapper").children().detach().appendTo('#left_aside_wrapper');
$('#notifications_wrapper').addClass('d-none');
}
if (window.innerWidth < 1200) {
let rightAsideWrapper = document.getElementById("right_aside_wrapper");
let leftAsideWrapper = document.getElementById("left_aside_wrapper");
leftAsideWrapper.appendChild(...rightAsideWrapper.children);
document.getElementById('notifications_wrapper').classList.add('d-none');
}
if (document.getElementById('region_1')) {
stickyScroll('.aside_spacer_left', '.aside_spacer_top_left', 'section', parseFloat(document.querySelector('main').getBoundingClientRect().top), 20);
}
if (document.querySelector('#region_1')) {
stickyScroll('.aside_spacer_left', '.aside_spacer_top_left', 'section', parseFloat(document.querySelector('main').getBoundingClientRect().top), 20);
}
if (document.getElementById('region_3')) {
stickyScroll('.aside_spacer_right', '.aside_spacer_top_right', 'section', parseFloat(document.querySelector('main').getBoundingClientRect().top), 20);
}
if (document.querySelector('#region_3')) {
stickyScroll('.aside_spacer_right', '.aside_spacer_top_right', 'section', parseFloat(document.querySelector('main').getBoundingClientRect().top), 20);
}
document.querySelectorAll('.usermenu').forEach(function (element) {
element.addEventListener('click', function () {
let navCollapse = document.querySelectorAll('#navbar-collapse-1, #navbar-collapse-2');
navCollapse.forEach(function (nav) {
if (nav.classList.contains('show')) {
nav.classList.remove('show');
}
});
});
});
$('.usermenu').click(function() {
if($('#navbar-collapse-1, #navbar-collapse-2').hasClass('show')){
$('#navbar-collapse-1, #navbar-collapse-2').removeClass('show');
}
});
document.getElementById('theme-switch').addEventListener('click', function () {
let html = document.documentElement;
if (html.getAttribute('data-bs-theme') === 'dark') {
let nav = document.querySelector('nav');
if (nav.dataset.bsTheme === 'dark') {
document.querySelectorAll('[data-bs-theme="dark"]:not(nav)').forEach(function (el) {
el.setAttribute('data-bs-theme', 'light');
});
} else {
document.querySelector('[data-bs-theme="dark"]').setAttribute('data-bs-theme', 'light');
}
localStorage.setItem('ussrbasicpub_dark_mode', 0);
document.getElementById('theme-switch-icon').classList.remove('bi-sun');
document.getElementById('theme-switch-icon').classList.add('bi-moon');
} else {
document.querySelectorAll('[data-bs-theme="light"]').forEach(function (el) {
el.setAttribute('data-bs-theme', 'dark');
});
localStorage.setItem('ussrbasicpub_dark_mode', 1);
document.getElementById('theme-switch-icon').classList.remove('bi-moon');
document.getElementById('theme-switch-icon').classList.add('bi-sun');
}
document.querySelector('meta[name=theme-color]').setAttribute('content', document.querySelector('nav').style.backgroundColor);
localStorage.setItem('ussrbasicpub_theme_color', document.querySelector('nav').style.backgroundColor);
});
$('#theme-switch').click(function() {
if ($('html').attr('data-bs-theme') === 'dark') {
if ($('nav').data('bs-theme') === 'dark') {
$('[data-bs-theme="dark"]:not(nav)').attr('data-bs-theme', 'light');
}
else {
$('[data-bs-theme="dark"]').attr('data-bs-theme', 'light');
}
localStorage.setItem('ussrbasicpub_dark_mode', 0);
$('#theme-switch-icon').removeClass('fa-sun-o').addClass('fa-moon-o');
}
else {
$('[data-bs-theme="light"]').attr('data-bs-theme', 'dark');
localStorage.setItem('ussrbasicpub_dark_mode', 1);
$('#theme-switch-icon').removeClass('fa-moon-o').addClass('fa-sun-o');
}
$('meta[name=theme-color]').attr('content', $('nav').css('background-color'));
localStorage.setItem('ussrbasicpub_theme_color', $('nav').css('background-color'));
});
document.getElementById('menu-btn').addEventListener('click', function () {
let navCollapse = document.getElementById('navbar-collapse-1');
if (navCollapse.classList.contains('show')) {
navCollapse.classList.remove('show');
}
});
document.querySelectorAll('.notifications-btn').forEach(function (element) {
element.addEventListener('click', function (e) {
e.preventDefault();
e.stopPropagation();
let navCollapse = document.getElementById('navbar-collapse-2');
if (navCollapse.classList.contains('show')) {
navCollapse.classList.remove('show');
}
});
});
$('#menu-btn').click(function() {
if($('#navbar-collapse-1').hasClass('show')){
$('#navbar-collapse-1').removeClass('show');
}
});
$("input[data-role=cat-tagsinput]").tagsinput({
tagClass: 'badge rounded-pill bg-warning text-dark'
});
$('.notifications-btn').click(function(e) {
e.preventDefault();
e.stopPropagation();
if($('#navbar-collapse-2').hasClass('show')){
$('#navbar-collapse-2').removeClass('show');
}
});
document.querySelectorAll('a.disabled').forEach(function (link) {
link.addEventListener('click', function (e) {
e.preventDefault();
e.stopPropagation();
});
});
$("input[data-role=cat-tagsinput]").tagsinput({
tagClass: 'badge rounded-pill bg-warning text-dark'
});
let doctitle = document.title;
function checkNotify() {
let notifyUpdateElem = document.getElementById('notify-update');
if (notifyUpdateElem && notifyUpdateElem.innerHTML !== '') {
document.title = '(' + notifyUpdateElem.innerHTML + ') ' + doctitle;
} else {
document.title = doctitle;
}
}
$('a.disabled').click(function(e) {
e.preventDefault();
e.stopPropagation();
});
setInterval(checkNotify, 10 * 1000);
var doctitle = document.title;
function checkNotify() {
var notifyUpdateElem = document.getElementById('notify-update');
if(notifyUpdateElem !== null) {
if(notifyUpdateElem.innerHTML !== "")
document.title = "(" + notifyUpdateElem.innerHTML + ") " + doctitle;
else
document.title = doctitle;
}
}
setInterval(function () {checkNotify();}, 10 * 1000);
let touch_start = null;
let touch_max = window.innerWidth / 10;
var touch_start = null;
var touch_max = window.innerWidth / 10;
window.addEventListener('touchstart', function(e) {
if (e.touches.length === 1){
//just one finger touched
touch_start = e.touches.item(0).clientX;
if (touch_start < touch_max) {
$('body').css('overflow-y', 'hidden');
}
}
else {
//a second finger hit the screen, abort the touch
touch_start = null;
}
});
window.addEventListener('touchend', function(e) {
$('body').css('overflow-y', '');
let touch_offset = 30; //at least 30px are a swipe
if (touch_start) {
//the only finger that hit the screen left it
let touch_end = e.changedTouches.item(0).clientX;
if (touch_end > (touch_start + touch_offset)) {
//a left -> right swipe
if (touch_start < touch_max) {
toggleAside();
}
}
if (touch_end < (touch_start - touch_offset)) {
//a right -> left swipe
}
}
});
window.addEventListener('touchstart', function (e) {
if (e.touches.length === 1) {
touch_start = e.touches[0].clientX;
if (touch_start < touch_max) {
document.body.style.overflowY = 'hidden';
}
} else {
touch_start = null;
}
});
window.addEventListener('touchend', function (e) {
document.body.style.overflowY = '';
let touch_offset = 30; // at least 30px are a swipe
if (touch_start) {
let touch_end = e.changedTouches[0].clientX;
if (touch_end > (touch_start + touch_offset)) {
if (touch_start < touch_max) {
toggleAside();
}
}
if (touch_end < (touch_start - touch_offset)) {
// a right -> left swipe
}
}
});
});
function setStyle(element, cssProperty) {
for (var property in cssProperty){
element.style[property] = cssProperty[property];
}
for (var property in cssProperty) {
element.style[property] = cssProperty[property];
}
}
function stickyScroll(sticky, stickyTop, container, topOffset, bottomOffset) {
let lastScrollTop = 0;
let stickyElement = document.querySelector(sticky);
var lastScrollTop = 0;
var sticky = document.querySelector(sticky);
if (!stickyElement) {
return;
}
if (!sticky) {
return;
}
let stickyHeight = stickyElement.getBoundingClientRect().height;
let stickyTopElement = document.querySelector(stickyTop);
let content = document.querySelector(container);
let diff = window.innerHeight - stickyHeight;
var stickyHeight = sticky.getBoundingClientRect().height;
var stickyTop = document.querySelector(stickyTop);
var content = document.querySelector(container);
var diff = window.innerHeight - stickyHeight;
var h = 0;
var lasth = 0;
var st = window.pageYOffset || document.documentElement.scrollTop;
let h = 0;
let lasth = 0;
let st = window.pageYOffset || document.documentElement.scrollTop;
var resizeObserver = new ResizeObserver(function(entries) {
stickyHeight = sticky.getBoundingClientRect().height;
st = window.pageYOffset || document.documentElement.scrollTop;
diff = window.innerHeight - stickyHeight;
});
let resizeObserver = new ResizeObserver(function () {
stickyHeight = stickyElement.getBoundingClientRect().height;
st = window.pageYOffset || document.documentElement.scrollTop;
diff = window.innerHeight - stickyHeight;
});
resizeObserver.observe(sticky);
resizeObserver.observe(content);
window.addEventListener('scroll', function() {
if(window.innerHeight > stickyHeight + topOffset) {
setStyle(stickyTop, { height: 0 + 'px' });
setStyle(sticky, { position: 'sticky', top: topOffset + 'px'});
}
else {
st = window.pageYOffset || document.documentElement.scrollTop; // Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
if (st > lastScrollTop){
// downscroll code
setStyle(stickyTop, { height: lasth + 'px' });
setStyle(sticky, { position: 'sticky', top: Math.round(diff) - bottomOffset + 'px', bottom: '' });
} else {
// upscroll code
h = sticky.getBoundingClientRect().top - content.getBoundingClientRect().top;
if(Math.round(stickyTop.getBoundingClientRect().height) === lasth) {
setStyle(stickyTop, { height: Math.round(h) + 'px' });
}
lasth = Math.round(h);
setStyle(sticky, { position: 'sticky', top: '', bottom: Math.round(diff) - topOffset + 'px' });
}
lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling
}
}, false);
resizeObserver.observe(stickyElement);
resizeObserver.observe(content);
window.addEventListener('scroll', function () {
if (window.innerHeight > stickyHeight + topOffset) {
setStyle(stickyTopElement, { height: '0px' });
setStyle(stickyElement, { position: 'sticky', top: `${topOffset}px` });
} else {
st = window.pageYOffset || document.documentElement.scrollTop;
if (st > lastScrollTop) {
setStyle(stickyTopElement, { height: `${lasth}px` });
setStyle(stickyElement, { position: 'sticky', top: `${Math.round(diff) - bottomOffset}px`, bottom: '' });
} else {
h = stickyElement.getBoundingClientRect().top - content.getBoundingClientRect().top;
if (Math.round(stickyTopElement.getBoundingClientRect().height) === lasth) {
setStyle(stickyTopElement, { height: `${Math.round(h)}px` });
}
lasth = Math.round(h);
setStyle(stickyElement, { position: 'sticky', top: '', bottom: `${Math.round(diff) - topOffset}px` });
}
lastScrollTop = st <= 0 ? 0 : st;
}
}, false);
}
function makeFullScreen(full) {
if(typeof full=='undefined' || full == true) {
$('main').addClass('fullscreen');
$('header, nav, aside, #fullscreen-btn').attr('style','display:none !important');
$('#inline-btn').show();
}
else {
$('main').removeClass('fullscreen');
$('header, nav, aside, #fullscreen-btn').show();
$('#inline-btn').hide();
}
if (typeof full === 'undefined' || full === true) {
document.querySelector('main').classList.add('fullscreen');
document.getElementById('fullscreen-btn').style.display = 'none';
document.getElementById('inline-btn').style.display = 'inline-block';
} else {
document.querySelector('main').classList.remove('fullscreen');
document.getElementById('fullscreen-btn').style.display = '';
document.getElementById('inline-btn').style.display = 'none';
}
}

View File

@ -2,6 +2,9 @@
namespace Zotlabs\Theme;
use ScssPhp\ScssPhp\Compiler;
use ScssPhp\ScssPhp\OutputStyle;
class UssrbasicpubConfig {
function get_schemas() {
@ -36,16 +39,16 @@ class UssrbasicpubConfig {
return;
}
$arr = array();
$arr['primary_color'] = get_pconfig(local_channel(),'ussrbasicpub', 'primary_color');
$arr['success_color'] = get_pconfig(local_channel(),'ussrbasicpub', 'success_color');
$arr['info_color'] = get_pconfig(local_channel(),'ussrbasicpub', 'info_color');
$arr['warning_color'] = get_pconfig(local_channel(),'ussrbasicpub', 'warning_color');
$arr['danger_color'] = get_pconfig(local_channel(),'ussrbasicpub', 'danger_color');
$arr['dark_mode'] = get_pconfig(local_channel(),'ussrbasicpub', 'dark_mode');
$arr['navbar_dark_mode'] = get_pconfig(local_channel(),'ussrbasicpub', 'navbar_dark_mode');
$arr['narrow_navbar'] = get_pconfig(local_channel(),'ussrbasicpub', 'narrow_navbar' );
$arr['nav_bg'] = get_pconfig(local_channel(),'ussrbasicpub', 'nav_bg' );
$arr['nav_bg_dark'] = get_pconfig(local_channel(),'ussrbasicpub', 'nav_bg_dark' );
$arr['link_color'] = get_pconfig(local_channel(),'ussrbasicpub', 'link_color' );
$arr['link_color_dark'] = get_pconfig(local_channel(),'ussrbasicpub', 'link_color_dark' );
$arr['link_hover_color'] = get_pconfig(local_channel(),'ussrbasicpub', 'link_hover_color' );
$arr['link_hover_color_dark'] = get_pconfig(local_channel(),'ussrbasicpub', 'link_hover_color_dark' );
$arr['bgcolor'] = get_pconfig(local_channel(),'ussrbasicpub', 'background_color' );
$arr['bgcolor_dark'] = get_pconfig(local_channel(),'ussrbasicpub', 'background_color_dark' );
$arr['background_image'] = get_pconfig(local_channel(),'ussrbasicpub', 'background_image' );
@ -65,15 +68,99 @@ class UssrbasicpubConfig {
}
if (isset($_POST['ussrbasicpub-settings-submit'])) {
if (isset($_POST['ussrbasicpub_primary_color']) || isset($_POST['ussrbasicpub_radius'])) {
$primary_color = '';
$success_color = '';
$info_color = '';
$warning_color = '';
$danger_color = '';
$radius = floatval($_POST['ussrbasicpub_radius']);
if (preg_match('/^#([A-Fa-f0-9]{3}){1,2}$/', $_POST['ussrbasicpub_primary_color'])) {
$primary_color = $_POST['ussrbasicpub_primary_color'];
}
if (preg_match('/^#([A-Fa-f0-9]{3}){1,2}$/', $_POST['ussrbasicpub_success_color'])) {
$success_color = $_POST['ussrbasicpub_success_color'];
}
if (preg_match('/^#([A-Fa-f0-9]{3}){1,2}$/', $_POST['ussrbasicpub_info_color'])) {
$info_color = $_POST['ussrbasicpub_info_color'];
}
if (preg_match('/^#([A-Fa-f0-9]{3}){1,2}$/', $_POST['ussrbasicpub_warning_color'])) {
$warning_color = $_POST['ussrbasicpub_warning_color'];
}
if (preg_match('/^#([A-Fa-f0-9]{3}){1,2}$/', $_POST['ussrbasicpub_danger_color'])) {
$danger_color = $_POST['ussrbasicpub_danger_color'];
}
if ($primary_color || $success_color || $info_color || $warning_color || $danger_color || $radius) {
try {
$cache_dir = 'store/[data]/[scss]/';
if(!is_dir($cache_dir)) {
os_mkdir($cache_dir, STORAGE_DEFAULT_PERMISSIONS, true);
}
$options = [
'cacheDir' => $cache_dir,
'prefix' => 'ussrbasicpub_',
'forceRefresh' => false
];
$compiler = new Compiler($options);
$compiler->setImportPaths('vendor/twbs/bootstrap/scss');
$compiler->setOutputStyle(OutputStyle::COMPRESSED);
// Set Variables
if ($primary_color) {
$variables['$primary'] = $primary_color;
}
if ($success_color) {
$variables['$success'] = $success_color;
}
if ($info_color) {
$variables['$info'] = $info_color;
}
if ($warning_color) {
$variables['$warning'] = $warning_color;
}
if ($danger_color) {
$variables['$danger'] = $danger_color;
}
if ($radius) {
$variables['$border-radius'] = $radius . 'rem';
$variables['$border-radius-sm'] = $radius/1.5 . 'rem';
$variables['$border-radius-lg'] = $radius*1.333 . 'rem';
$variables['$border-radius-xl'] = $radius*2.666 . 'rem';
$variables['$border-radius-xxl'] = $radius*5.333 . 'rem';
}
// Replace Bootstrap Variables with Customizer Variables
$compiler->replaceVariables($variables);
$bs = $compiler->compileString('@import "bootstrap.scss";');
set_pconfig(local_channel(), 'ussrbasicpub', 'bootstrap', $bs->getCss());
} catch (\Exception $e) {
logger('scssphp: Unable to compile content');
}
}
else {
set_pconfig(local_channel(), 'ussrbasicpub', 'bootstrap', '');
}
}
set_pconfig(local_channel(), 'ussrbasicpub', 'primary_color', $_POST['ussrbasicpub_primary_color']);
set_pconfig(local_channel(), 'ussrbasicpub', 'success_color', $_POST['ussrbasicpub_success_color']);
set_pconfig(local_channel(), 'ussrbasicpub', 'info_color', $_POST['ussrbasicpub_info_color']);
set_pconfig(local_channel(), 'ussrbasicpub', 'warning_color', $_POST['ussrbasicpub_warning_color']);
set_pconfig(local_channel(), 'ussrbasicpub', 'danger_color', $_POST['ussrbasicpub_danger_color']);
set_pconfig(local_channel(), 'ussrbasicpub', 'narrow_navbar', $_POST['ussrbasicpub_narrow_navbar']);
set_pconfig(local_channel(), 'ussrbasicpub', 'navbar_dark_mode', $_POST['ussrbasicpub_navbar_dark_mode']);
set_pconfig(local_channel(), 'ussrbasicpub', 'dark_mode', $_POST['ussrbasicpub_dark_mode']);
set_pconfig(local_channel(), 'ussrbasicpub', 'nav_bg', $_POST['ussrbasicpub_nav_bg']);
set_pconfig(local_channel(), 'ussrbasicpub', 'nav_bg_dark', $_POST['ussrbasicpub_nav_bg_dark']);
set_pconfig(local_channel(), 'ussrbasicpub', 'link_color', $_POST['ussrbasicpub_link_color']);
set_pconfig(local_channel(), 'ussrbasicpub', 'link_color_dark', $_POST['ussrbasicpub_link_color_dark']);
set_pconfig(local_channel(), 'ussrbasicpub', 'link_hover_color', $_POST['ussrbasicpub_link_hover_color']);
set_pconfig(local_channel(), 'ussrbasicpub', 'link_hover_color_dark', $_POST['ussrbasicpub_link_hover_color_dark']);
set_pconfig(local_channel(), 'ussrbasicpub', 'background_color', $_POST['ussrbasicpub_background_color']);
set_pconfig(local_channel(), 'ussrbasicpub', 'background_color_dark', $_POST['ussrbasicpub_background_color_dark']);
set_pconfig(local_channel(), 'ussrbasicpub', 'background_image', $_POST['ussrbasicpub_background_image']);
@ -84,6 +171,9 @@ class UssrbasicpubConfig {
set_pconfig(local_channel(), 'ussrbasicpub', 'top_photo', $_POST['ussrbasicpub_top_photo']);
set_pconfig(local_channel(), 'ussrbasicpub', 'reply_photo', $_POST['ussrbasicpub_reply_photo']);
set_pconfig(local_channel(), 'ussrbasicpub', 'advanced_theming', $_POST['ussrbasicpub_advanced_theming']);
// This is used to refresh the cache
set_pconfig(local_channel(), 'system', 'style_update', time());
}
}
@ -103,24 +193,25 @@ class UssrbasicpubConfig {
'$dark' => t('Dark style'),
'$light' => t('Light style'),
'$common' => t('Common settings'),
'$primary_color' => array('ussrbasicpub_primary_color', t('Primary theme color'), $arr['primary_color'], '<i class="bi bi-circle-fill text-primary"></i> ' . t('Current color, leave empty for default')),
'$success_color' => array('ussrbasicpub_success_color', t('Success theme color'), $arr['success_color'], '<i class="bi bi-circle-fill text-success"></i> ' . t('Current color, leave empty for default')),
'$info_color' => array('ussrbasicpub_info_color', t('Info theme color'), $arr['info_color'], '<i class="bi bi-circle-fill text-info"></i> ' . t('Current color, leave empty for default')),
'$warning_color' => array('ussrbasicpub_warning_color', t('Warning theme color'), $arr['warning_color'], '<i class="bi bi-circle-fill text-warning"></i> ' . t('Current color, leave empty for default')),
'$danger_color' => array('ussrbasicpub_danger_color', t('Danger theme color'), $arr['danger_color'], '<i class="bi bi-circle-fill text-danger"></i> ' . t('Current color, leave empty for default')),
'$dark_mode' => array('ussrbasicpub_dark_mode',t('Default to dark mode'),$arr['dark_mode'], '', array(t('No'),t('Yes'))),
'$navbar_dark_mode' => array('ussrbasicpub_navbar_dark_mode',t('Always use light icons for navbar'),$arr['navbar_dark_mode'], t('Enable this option if you use a dark navbar color in light mode'), array(t('No'),t('Yes'))),
'$narrow_navbar' => array('ussrbasicpub_narrow_navbar',t('Narrow navbar'),$arr['narrow_navbar'], '', array(t('No'),t('Yes'))),
'$nav_bg' => array('ussrbasicpub_nav_bg', t('Navigation bar background color'), $arr['nav_bg']),
'$nav_bg_dark' => array('ussrbasicpub_nav_bg_dark', t('Dark navigation bar background color'), $arr['nav_bg_dark']),
'$link_color' => array('ussrbasicpub_link_color', t('Link color'), $arr['link_color']),
'$link_color_dark' => array('ussrbasicpub_link_color_dark', t('Dark link color'), $arr['link_color_dark']),
'$link_hover_color' => array('ussrbasicpub_link_hover_color', t('Link hover color'), $arr['link_hover_color']),
'$link_hover_color_dark' => array('ussrbasicpub_link_hover_color_dark', t('Dark link hover color'), $arr['link_hover_color_dark']),
'$bgcolor' => array('ussrbasicpub_background_color', t('Set the background color'), $arr['bgcolor']),
'$bgcolor_dark' => array('ussrbasicpub_background_color_dark', t('Set the dark background color'), $arr['bgcolor_dark']),
'$background_image' => array('ussrbasicpub_background_image', t('Set the background image'), $arr['background_image']),
'$background_image_dark' => array('ussrbasicpub_background_image_dark', t('Set the dark background image'), $arr['background_image_dark']),
'$font_size' => array('ussrbasicpub_font_size', t('Set font-size for the entire application'), $arr['font_size'], t('Examples: 1rem, 100%, 16px')),
'$radius' => array('ussrbasicpub_radius', t('Set radius of corners'), $arr['radius'], t('Example: 4px')),
'$radius' => array('ussrbasicpub_radius', t('Set radius of corners in rem'), $arr['radius'], t('Leave empty for default radius')),
'$converse_width' => array('ussrbasicpub_converse_width',t('Set maximum width of content region in rem'),$arr['converse_width'], t('Leave empty for default width')),
'$top_photo' => array('ussrbasicpub_top_photo', t('Set size of conversation author photo'), $arr['top_photo']),
'$reply_photo' => array('ussrbasicpub_reply_photo', t('Set size of followup author photos'), $arr['reply_photo']),
'$top_photo' => array('ussrbasicpub_top_photo', t('Set size of conversation author photo'), $arr['top_photo'], t('Leave empty for default size')),
'$reply_photo' => array('ussrbasicpub_reply_photo', t('Set size of followup author photos'), $arr['reply_photo'], t('Leave empty for default size')),
'$advanced_theming' => ['ussrbasicpub_advanced_theming', t('Show advanced settings'), $arr['advanced_theming'], '', [t('No'), t('Yes')]]
));

View File

@ -1,32 +1,48 @@
<?php
if(! App::$install) {
if(!App::$install) {
// Get the UID of the channel owner
$uid = get_theme_uid();
if($uid) {
load_pconfig($uid,'ussrbasicpub');
}
// Load the owners pconfig
load_pconfig($uid, 'ussrbasicpub');
// Load the owners pconfig
$nav_bg = get_pconfig($uid, 'ussrbasicpub', 'nav_bg');
$nav_bg_dark = get_pconfig($uid, 'ussrbasicpub', 'nav_bg_dark');
$narrow_navbar = get_pconfig($uid,'ussrbasicpub','narrow_navbar');
$link_color = get_pconfig($uid, 'ussrbasicpub', 'link_color');
$link_color_dark = get_pconfig($uid, 'ussrbasicpub', 'link_color_dark');
$link_hover_color = get_pconfig($uid, 'ussrbasicpub', 'link_hover_color');
$link_hover_color_dark = get_pconfig($uid, 'ussrbasicpub', 'link_hover_color_dark');
$bgcolor = get_pconfig($uid, 'ussrbasicpub', 'background_color');
$bgcolor_dark = get_pconfig($uid, 'ussrbasicpub', 'background_color_dark');
$schema = get_pconfig($uid,'ussrbasicpub','schema');
$background_image = get_pconfig($uid, 'ussrbasicpub', 'background_image');
$background_image_dark = get_pconfig($uid, 'ussrbasicpub', 'background_image_dark');
$font_size = get_pconfig($uid, 'ussrbasicpub', 'font_size');
$radius = get_pconfig($uid, 'ussrbasicpub', 'radius');
$converse_width=get_pconfig($uid,'ussrbasicpub','converse_width');
$top_photo=get_pconfig($uid,'ussrbasicpub','top_photo');
$reply_photo=get_pconfig($uid,'ussrbasicpub','reply_photo');
$custom_bs = get_pconfig($uid, 'ussrbasicpub', 'bootstrap');
$nav_bg = get_pconfig($uid, 'ussrbasicpub', 'nav_bg');
$nav_bg_dark = get_pconfig($uid, 'ussrbasicpub', 'nav_bg_dark');
$narrow_navbar = get_pconfig($uid,'ussrbasicpub','narrow_navbar');
$bgcolor = get_pconfig($uid, 'ussrbasicpub', 'background_color');
$bgcolor_dark = get_pconfig($uid, 'ussrbasicpub', 'background_color_dark');
$schema = get_pconfig($uid,'ussrbasicpub','schema');
$background_image = get_pconfig($uid, 'ussrbasicpub', 'background_image');
$background_image_dark = get_pconfig($uid, 'ussrbasicpub', 'background_image_dark');
$font_size = get_pconfig($uid, 'ussrbasicpub', 'font_size');
$converse_width = get_pconfig($uid,'ussrbasicpub','converse_width');
$top_photo = get_pconfig($uid,'ussrbasicpub','top_photo');
$reply_photo = get_pconfig($uid,'ussrbasicpub','reply_photo');
}
}
$site_bs_path = 'vendor/twbs/bootstrap/dist/css/bootstrap.min.css';
if (file_exists('view/theme/ussrbasicpub/css/bootstrap-custom.css')) {
// Compiled custom site bootstrap from sass
// Run this script from the document root for an example:
// php vendor/bin/pscss view/theme/ussrbasicpub/css/sample.scss view/theme/ussrbasicpub/css/bootstrap-custom.css
$site_bs_path = 'view/theme/ussrbasicpub/css/bootstrap-custom.css';
}
$bs = $custom_bs ?: file_get_contents($site_bs_path);
if (file_exists('view/css/bootstrap-red.css')) {
$bs = $bs . file_get_contents('view/css/bootstrap-red.css');
}
if(file_exists('view/theme/ussrbasicpub/schema/' . $schema . '.css')) {
$schemecss = file_get_contents('view/theme/ussrbasicpub/schema/' . $schema . '.css');
}
// Now load the scheme. If a value is changed above, we'll keep the settings
@ -71,50 +87,16 @@ if ((!$schema) || ($schema == '---')) {
//Set some defaults - we have to do this after pulling owner settings, and we have to check for each setting
//individually. If we don't, we'll have problems if a user has set one, but not all options.
if (! $nav_bg)
$nav_bg = 'rgba(248, 249, 250, 1)';
if (! $nav_bg_dark)
$nav_bg_dark = 'rgba(43, 48, 53, 1)';
if (! $link_color)
$link_color = '#0d6efd';
if (! $link_color_dark)
$link_color_dark = '#6ea8fe';
if (! $link_hover_color)
$link_hover_color = '#0a58ca';
if (! $link_hover_color_dark)
$link_hover_color_dark = '#9ec5fe';
if (! $bgcolor)
$bgcolor = '#fff';
if (! $bgcolor_dark)
$bgcolor_dark = '#212529';
if (! $background_image)
$background_image = '';
if (! $background_image_dark)
$background_image_dark = '';
if (! $font_size)
$font_size = '0.875rem';
if (! $radius)
$radius = '0.375rem';
if (! $converse_width)
$converse_width = '52'; //unit: rem
if(! $top_photo)
$top_photo = '2.3rem';
if(! $reply_photo)
$reply_photo = '2.3rem';
$nav_bg = $nav_bg ?: 'rgba(248, 249, 250, 1)';
$nav_bg_dark = $nav_bg_dark ?: 'rgba(43, 48, 53, 1)';
$bgcolor = $bgcolor ?: '#fff';
$bgcolor_dark = $bgcolor_dark ?: '#212529';
$background_image = $background_image ?: '';
$background_image_dark = $background_image_dark ?: '';
$font_size = $font_size ?: '0.875rem';
$converse_width = $converse_width ?: '52'; //unit: rem
$top_photo = $top_photo ?: '2.9rem';
$reply_photo = $reply_photo ?: '2.9rem';
// Apply the settings
if(file_exists('view/theme/ussrbasicpub/css/style.css')) {
@ -140,16 +122,11 @@ if(file_exists('view/theme/ussrbasicpub/css/style.css')) {
$options = array (
'$nav_bg' => $nav_bg,
'$nav_bg_dark' => $nav_bg_dark,
'$link_color' => $link_color,
'$link_color_dark' => $link_color_dark,
'$link_hover_color' => $link_hover_color,
'$link_hover_color_dark' => $link_hover_color_dark,
'$bgcolor' => $bgcolor,
'$bgcolor_dark' => $bgcolor_dark,
'$background_image' => $background_image,
'$background_image_dark' => $background_image_dark,
'$font_size' => $font_size,
'$radius' => $radius,
'$converse_width' => $converse_width,
'$top_photo' => $top_photo,
'$reply_photo' => $reply_photo,
@ -158,8 +135,12 @@ if(file_exists('view/theme/ussrbasicpub/css/style.css')) {
'$right_aside_width' => $right_aside_width
);
echo strtr($x, $options);
$o = strtr($x, $options);
header('Cache-Control: max-age=2592000');
echo $bs . $o;
}
// Set the schema to the default schema in derived themes. See the documentation for creating derived themes how to override this.

View File

@ -5,7 +5,7 @@
* * Description: ussr.win public theme based on Hubzilla standard theme
* * Version: 2.2
* * MinVersion: 8.9
* * MaxVersion: 10.0
* * MaxVersion: 11.0
* * Author: Fabrixxm
* * Maintainer: ivan zlax
* * Theme_Color: rgb(248, 249, 250)

View File

@ -1,10 +1,11 @@
<?php
use Zotlabs\Lib\Config;
require_once('view/php/theme_init.php');
head_add_css('/library/fork-awesome/css/fork-awesome.min.css');
head_add_css('/vendor/twbs/bootstrap/dist/css/bootstrap.min.css');
head_add_css('/vendor/twbs/bootstrap-icons/font/bootstrap-icons.min.css');
head_add_css('/library/bootstrap-tagsinput/bootstrap-tagsinput.css');
head_add_css('/view/css/bootstrap-red.css');
head_add_css('/library/bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css');
head_add_js('/vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js');
@ -26,8 +27,8 @@ if (App::$profile_uid) {
}
if (!$ussrbasicpub_mode) {
$ussrbasicpub_mode = ((get_config('ussrbasicpub', 'dark_mode')) ? 'dark' : 'light');
$ussrbasicpub_navbar_mode = ((get_config('ussrbasicpub', 'navbar_dark_mode')) ? 'dark' : 'light');
$ussrbasicpub_mode = ((Config::Get('ussrbasicpub', 'dark_mode')) ? 'dark' : 'light');
$ussrbasicpub_navbar_mode = ((Config::Get('ussrbasicpub', 'navbar_dark_mode')) ? 'dark' : 'light');
}
App::$page['color_mode'] = 'data-bs-theme="' . $ussrbasicpub_mode . '"';

View File

@ -1,5 +1,5 @@
.comment .wall-item-body {
padding-left: 2.8rem;
padding-left: 3.4rem;
}
.wall-item-content-wrapper.comment {

View File

@ -1,6 +1 @@
<?php
if (! $radiuspx)
$radiuspx = "4";
if (! $comment_border_colour)
$comment_border_colour = "rgb(238,238,238)";

View File

@ -0,0 +1,424 @@
/* disable reashred content streching */
.reshared-content img {
width: auto;
}
/* hide theme switch */
#theme-switch {
visibility: hidden;
}
/* disable allcontact link in profile */
.allcontact-link {
display: none;
}
/* disable likes */
.wall-item-like {
visibility: hidden;
}
.wall-item-tools-right > .btn-group > .btn:first-child {
visibility: hidden;
}
/* disable minus icon */
.oneway-overlay, .fa-minus-circle {
visibility: hidden;
}
/* greengrey colors */
body {
background-color: #383c4a;
color: #dddddd;
}
.generic-content-wrapper {
background-color: #383c4a;
}
.section-subtitle-wrapper,
.collapse,
.show,
.section-title-wrapper {
background-color: #404552;
border-bottom-color: #2b2b2b;
}
.vcard, .h-card,
.widget, .settings-widget, .section-subtitle-wrapper {
background-color: #4B5162;
border-bottom: #383c4a;
border-left: #383c4a;
border-right: #383c4a;
border-top: #383c4a;
}
.fn {
color: #ffffff;
}
.contextual-help-content,
.section-content-tools-wrapper, .section-content-wrapper {
background-color: #353945;
border-bottom: #383c4a;
border-left: #383c4a;
border-right: #383c4a;
border-top: #383c4a;
}
a:link {
color: #63bd65;
}
.zinlcxmi {
color: #63bd65;
}
a:visited {
color: #87ab63;
}
a:hover, a:active {
color: #3fec43;
}
div.profile-match-wrapper > div > a {
color: #ffffff;
}
.btn, .btn-primary {
background-color: #5c6b5b;
border-bottom-color: #47741c;
border-left-color: #47741c;
border-right-color: #47741c;
border-top-color: #47741c;
color: #ffffff !important;
}
.btn:hover, .btn-primary:active {
background-color: #4aae40;
border-bottom-color: #29b136;
border-left-color: #29b136;
border-right-color: #29b136;
border-top-color: #29b136;
}
.bg-dark, .navbar-collapse {
background-color: #2e323e !important;
}
.form-group:active, .checkbox:hover {
color: #41d24f;
}
.nav-link.active {
background-color: #315a2b !important;
}
.list-group-item {
background-color: #4B5162;
border-bottom: #383c4a;
border-left: #383c4a;
border-right: #383c4a;
border-top: #383c4a;
color: #9e9e9e;
border: 1px solid #383c4a;
}
.list-group-item:active {
color: #f4f4f4 !important;
}
.text-dark {
color: #bdbdbd !important;
}
a.text-dark:hover, a.text-dark:active {
color: #f4f4f4 !important;
}
.contactname {
color: #bdbdbd;
}
.wall-item-ago, .dropdown-sub-text {
color: #b3b3b3;
}
.list-group-item.active {
background-color: #315a2b;
border-color: #0c4704;
}
.form-control,
.form-control:focus,
input[type="text"]:hover,
input[type="text"]:active,
input[type="text"], textarea {
background-color: #2b2b2b;
border-color: #46583f;
color: #cdcdcd;
box-shadow: 0 0 0 .2rem #415240;
}
.form-group.checkbox:checked,
.form-group.checkbox > div > input:checked + label .onoffswitch-switch {
background-color: #315a2b;
}
.form-group.checkbox:hover label {
color: #315a2b;
}
.dropdown-item.active {
background-color: #315a2b;
}
.dropdown-divider {
border-top: 1px solid #3e3e3e;
}
.dropdown-item:active, .dropdown-item:focus, .dropdown-item:hover, .textcomplete-item:focus .dropdown-item, .textcomplete-item:hover .dropdown-item, .textcomplete-item.active .dropdown-item, .textcomplete-item:active .dropdown-item {
background-color: #4b5162;
color: #b3b3b3;
}
a.dropdown-item {
color: #f3f3f3;
}
.profile-match-wrapper {
border-top: 0px solid #eee;
border-left: 0px solid #eee;
}
.fakelink {
color: #87ab63;
}
a:hover, a:focus, .fakelink:hover, .fakelink:focus {
color: #3fec43;
}
.drop-icons {
color: #ff0000;
}
.drop-icons, a .drop-icons {
color: #bd0000;
}
.section-content-wrapper-np {
background-color: #404552;
}
.atoken-index-row:hover td, .chatroom-index-row:hover td, .group-index-row:hover td, .wikis-index-row:hover td, .locs-index-row:hover td, [id^="cloud-index-"]:hover td, .cloud-index-active {
background-color: #4b5162;
}
.generic-content-wrapper-styled {
background-color: #404552;
}
#profile-jot-wrapper,
.bootstrap-tagsinput {
background-color: #2b2b2b;
}
.wall-item-content-wrapper {
background-color: #404552;
}
.item-highlight {
border-left: 0.2rem solid #00ff00;
}
.wall-item-comment-wrapper-wc,
.hide-comments-outer,
.wall-item-comment-wrapper,
.wall-item-content-wrapper.comment {
background-color: #4b5162;
}
.wall-item-head-new {
border-top: 0.2rem solid #31570b;
}
.wall-item-comment-wrapper {
border-top: 3px solid #454853;
}
blockquote {
border-left: 3px solid #344136;
}
.hide-comments-outer {
border-top-color: #87ab63;
}
.badge-warning {
background-color: #036811;
color: #dddddd;
}
.divgrow-showmore {
border-top: 1px dashed #87ab63;
}
.comment-edit-text {
border: 1px solid #004400;
}
#doco-content h3 {
border-bottom: #87ab63 3px solid;
}
.section-content-info-wrapper {
color: #2aa650;
background-color: #17221b;
border-bottom: 3px solid #060d08;
}
.spinner.s, .spinner.m, .spinner.l {
color: #13c613;
border-top: .2rem solid #02c102;
border-left: .2rem solid #123312;
border-right: .2rem solid #123312;
border-bottom: .2rem solid #123312;
}
.wall-event-item {
background-color: #123312;
}
.fs {
background-color: #404552;
}
.bg-primary {
background-color: #315a2b !important;
}
.modal-content {
background-color: #171d16;
}
.close {
color: #989898;
}
.wall-item-conv {
background-color: #404552;
border-top: 1px solid #2e323e;
}
.dropdown-menu.textcomplete-dropdown {
background-color: #8d9a87;
}
.notification.notification-forum {
color: #63bd65;
}
.wall-photo-item {
background-color: #315a2b;
}
.directory-item .divgrow-showmore {
background-color: #353945;
}
.vcard-header:hover, .vcard-header.active {
background-color: #4B5162;
}
.alert-info {
color: #dddddd;
border-color: #2b2b2b;
}
.conv-participants {
color: #539b55;
}
#photo-view-wrapper {
background-color: #4B5162;
}
.table {
color: #dddccc;
}
#upgrade_info_aside {
border-color: #383c4a !important;
}
.text-muted {
color: #a6a6b9 !important;
}
.card {
background-color: #434753 !important;
}
.border {
border: 1px solid #415240 !important;
}
.item-category, .item-category > .text-dark {
color: #222222 !important;
}
.nav-link:focus, .nav-link:hover {
color: #eeeeee;
}
.nav-link.active > .fa-fw {
color: #eeeeee;
}
.nav-tabs {
border-bottom: 1px solid #415240 !important;
}
.nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active {
border-top-color: #444444;
border-right-color: #444444;
border-bottom-color: #444444;
border-left-color: #444444;
}
.generic-content-wrapper {
border: 1px solid #444444;
}
#notifications {
background-color: #383c4a;
}
[data-bs-theme="light"] .navbar.bg-body-tertiary {
background-color: #2e323e !important;
}
[data-bs-theme="dark"] .navbar.bg-body-tertiary {
background-color: #2e323e !important;
}
.navbar {
--bs-navbar-color: #dddddd;
}
.navbar-banner {
color: #dddddd;
}
.bg-body-secondary {
--bs-bg-opacity: 0;
}
.generic-content-wrapper.is-contained {
border: 1px solid #5f6271;
}
.generic-content-wrapper.is-new {
border-top: 2px solid #63bd65;
}

View File

@ -5,7 +5,7 @@
<div class="dropdown">
<div class="cursor-pointer usermenu" data-bs-toggle="dropdown">
<img id="avatar" src="{{$userinfo.icon}}" alt="{{$userinfo.name}}" class="rounded">
<i class="navbar-text fa fa-caret-down"></i>
<i class="navbar-text bi bi-caret-down-fill"></i>
</div>
{{if $is_owner}}
<div class="dropdown-menu" {{$color_mode}}>
@ -20,7 +20,7 @@
{{/if}}
{{if $nav.channels}}
{{foreach $nav.channels as $chan}}
<a class="dropdown-item" href="manage/{{$chan.channel_id}}" title="{{$chan.channel_name}}" role="menuitem"><i class="fa fa-circle{{if $localuser == $chan.channel_id}} text-success{{else}} invisible{{/if}}"></i> {{$chan.channel_name}}</a>
<a class="dropdown-item" href="manage/{{$chan.channel_id}}" title="{{$chan.channel_name}}" role="menuitem"><i class="bi bi-circle-fill{{if $localuser == $chan.channel_id}} text-success{{else}} invisible{{/if}}"></i> {{$chan.channel_name}}</a>
{{/foreach}}
{{/if}}
{{if $nav.profiles}}
@ -59,7 +59,7 @@
{{if $settings_url}}
<div id="nav-app-settings-link-wrapper" class="navbar-nav">
<a id="nav-app-settings-link" href="{{$settings_url}}/?f=&rpath={{$url}}" class="nav-link">
<i class="fa fa-fw fa-cog"></i>
<i class="bi bi-gear"></i>
</a>
</div>
{{/if}}
@ -71,30 +71,32 @@
<div class="navbar-toggler-right">
{{if $nav.help.6}}
<button id="context-help-btn" class="navbar-toggler border-0" type="button" onclick="contextualHelp(); return false;">
<i class="fa fa-question-circle"></i>
<i class="bi bi-question-circle-fill generic-icons"></i>
</button>
{{/if}}
<button id="expand-aside" type="button" class="d-lg-none navbar-toggler border-0">
<i class="fa fa-arrow-circle-right" id="expand-aside-icon"></i>
<i class="bi bi-arrow-right-circle generic-icons" id="expand-aside-icon"></i>
</button>
{{if $localuser || $nav.pubs}}
<button id="notifications-btn-1" type="button" class="navbar-toggler border-0 notifications-btn">
<i id="notifications-btn-icon-1" class="fa fa-exclamation-circle notifications-btn-icon"></i>
<i id="notifications-btn-icon-1" class="bi bi-exclamation-circle notifications-btn-icon generic-icons"></i>
</button>
{{/if}}
<button id="menu-btn" class="navbar-toggler border-0" type="button" data-bs-toggle="offcanvas" data-bs-target="#app-bin">
<i class="fa fa-bars"></i>
<i class="bi bi-three-dots-vertical generic-icons"></i>
</button>
</div>
<div class="collapse navbar-collapse justify-content-between" id="navbar-collapse-1">
<ul class="navbar-nav">
{{if $nav.login && !$userinfo}}
<li class="nav-item">
<a href="help" class="nav-link {{if (substr($url,17,4)=="help")}} active{{/if}}" title="{{$nav.help.3}}"><i class="fa fa-fw fa-question-circle"></i></a>
</li>
<li class="nav-item">
<a href="siteinfo" class="nav-link{{if (substr($url,17,8)=="siteinfo")}} active{{/if}}" title="{{t('About this site')}}"><i class="fa fa-fw fa-info"></i></a>
</li>
<li class="nav-item">
<a class="nav-link {{if (substr($url,17,8)=="siteinfo")}} active{{/if}}"" href="siteinfo" title="{{App::$strings['About this site']}}{{if (App::$strings['About this site']=="")}}About this site{{/if}}"><i class="bi bi-info"></i></a>
</li>
<li class="nav-item">
<a class="nav-link {{if (substr($url,17,4)=="help")}} active{{/if}}"" href="help" title="{{App::$strings['Help']}}{{if (App::$strings['Help']=="")}}Help{{/if}}"><i class="bi bi-question-lg"></i></a>
</li>
<li class="nav-item d-lg-flex">
{{if $nav.loginmenu.1.4}}
<a class="nav-link" href="#" title="{{$nav.loginmenu.1.3}}" data-bs-toggle="modal" data-bs-target="#nav-login">
@ -131,28 +133,31 @@
</div>
</li>
<li class="nav-item" id="nav-search-btn">
<a class="nav-link" href="#nav-search" title="{{$nav.search.3}}" onclick="openMenu('nav-search'); closeMenu('nav-search-btn'); $('#nav-search-text').focus(); return false;"><i class="fa fa-fw fa-search"></i></a>
<a class="nav-link" href="#nav-search" title="{{$nav.search.3}}" onclick="openMenu('nav-search'); closeMenu('nav-search-btn'); $('#nav-search-text').focus(); return false;"><i class="bi bi-search generic-icons"></i></a>
</li>
<li class="nav-item">
<a href="directory" class="navbar-app nav-link {{if (substr($url,17,9)=="directory")}} active{{/if}}" title="{{t('Directory')}}"><i class="fa fa-fw fa-sitemap"></i></a>
</li>
<li class="nav-item">
<a href="pubstream" class="navbar-app nav-link {{if (substr($url,17,9)=="pubstream")}} active{{/if}}" title="{{t('Public Stream')}}"><i class="fa fa-fw fa-globe"></i></a>
</li>
<li class="nav-item">
<a href="randprof" class="navbar-app nav-link {{if (substr($url,17,8)=="randprof")}} active{{/if}}" title="{{t('Random Channel')}}"><i class="fa fa-fw fa-random"></i></a>
</li>
<li class="nav-item">
<a href="lang" class="navbar-app nav-link {{if (substr($url,17,4)=="lang")}} active{{/if}}" title="{{t('Language')}}"><i class="fa fa-fw fa-language"></i></a>
</li>
<li class="nav-item">
<a class="nav-link {{if (substr($url,17,9)=="directory")}} active{{/if}}"" href="directory" title="{{App::$strings['Local Directory']}}{{if (App::$strings['Local Directory']=="")}}Local Directory{{/if}}"><i class="bi bi-diagram-3"></i></a>
</li>
<li class="nav-item">
<a class="nav-link {{if (substr($url,17,9)=="pubstream")}} active{{/if}}"" href="pubstream" title="{{App::$strings['Public Stream']}}{{if (App::$strings['Public Stream']=="")}}Public Stream{{/if}}"><i class="bi bi-globe"></i></a>
</li>
<li class="nav-item">
<a class="nav-link {{if (substr($url,17,8)=="randprof")}} active{{/if}}"" href="randprof" title="{{App::$strings['Random Channel']}}{{if (App::$strings['Random Channel']=="")}}Random Channel{{/if}}"><i class="bi bi-shuffle"></i></a>
</li>
<li class="nav-item">
<a class="nav-link {{if (substr($url,17,4)=="lang")}} active{{/if}}"" href="lang" title="{{App::$strings['Language']}}{{if (App::$strings['Language']=="")}}Language{{/if}}"><i class="bi bi-translate"></i></a>
</li>
{{if $nav.help.6}}
<li class="nav-item dropdown {{$sel.help}}">
<a class="nav-link {{$nav.help.2}}" target="hubzilla-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}" id="{{$nav.help.4}}" onclick="contextualHelp(); return false;"><i class="fa fa-fw fa-question-circle"></i></a>
<a class="nav-link {{$nav.help.2}}" target="hubzilla-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}" id="{{$nav.help.4}}" onclick="contextualHelp(); return false;"><i class="bi bi-question-circle-fill"></i></a>
</li>
{{/if}}
{{if $localuser || $nav.pubs}}
<li id="notifications-btn" class="nav-item d-xl-none">
<a class="nav-link notifications-btn" href="#"><i id="notifications-btn-icon" class="fa fa-exclamation-circle notifications-btn-icon"></i></a>
<a class="nav-link notifications-btn" href="#"><i id="notifications-btn-icon" class="bi bi-exclamation-circle notifications-btn-icon generic-icons"></i></a>
</li>
{{/if}}
{{if $navbar_apps}}
@ -163,7 +168,7 @@
{{/foreach}}
{{/if}}
<li class="nav-item dropdown" id="app-menu">
<a class="nav-link" href="#" data-bs-toggle="offcanvas" data-bs-target="#app-bin" aria-controls="app-bin"><i class="fa fa-fw fa-bars"></i></a>
<a class="nav-link" href="#" data-bs-toggle="offcanvas" data-bs-target="#app-bin" aria-controls="app-bin"><i class="bi bi-three-dots-vertical generic-icons"></i></a>
</li>
</ul>
</div>
@ -171,8 +176,8 @@
<div id="contextual-help-content" class="contextual-help-content">
{{$nav.help.5}}
<div class="float-end">
<a class="btn btn-primary btn-sm" target="hubzilla-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}"><i class="fa fa-question"></i>&nbsp;{{$fulldocs}}</a>
<a class="contextual-help-tool" href="#" onclick="contextualHelp(); return false;"><i class="fa fa-times"></i></a>
<a class="btn btn-primary btn-sm" target="hubzilla-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}"><i class="bi bi-question"></i>&nbsp;{{$fulldocs}}</a>
<a class="contextual-help-tool" href="#" onclick="contextualHelp(); return false;"><i class="bi bi-x-lg"></i></a>
</div>
</div>
{{/if}}
@ -210,11 +215,11 @@
</div>
{{/if}}
</div>
<i id="app-bin-trash" class="fa fa-2x fa-fw fa-trash-o d-none"></i>
<i id="app-bin-trash" class="bi bi-trash d-none"></i>
{{/if}}
<div class="hstack gap-1">
{{if $theme_switch_icon}}
<button id="theme-switch" type="button" class="btn btn-outline-secondary border-0"><i id="theme-switch-icon" class="fa fa-{{$theme_switch_icon}}-o"></i></button>
<button id="theme-switch" type="button" class="btn btn-outline-secondary border-0"><i id="theme-switch-icon" class="bi bi-{{$theme_switch_icon}}"></i></button>
{{/if}}
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
@ -237,12 +242,13 @@
</div>
<div id="nav-app-bin-container" class="d-lg-none nav nav-pills flex-column">
{{foreach $navbar_apps as $navbar_app}}
{{$navbar_app|replace:'fa':'generic-icons-nav fa'}}
{{$navbar_app|replace:'generic-icons':'generic-icons-nav'}}
{{/foreach}}
</div>
{{/if}}
{{if $is_owner}}
<div class="text-uppercase text-muted nav-link">
<div class="text-uppercase dropdown-header text-muted">
{{$featured_apps}}
</div>
<div id="app-bin-container" data-token="{{$form_security_token}}" class="nav nav-pills flex-column">
@ -252,7 +258,7 @@
</div>
<hr>
<div class="nav nav-pills flex-column">
<a class="nav-link" href="/apps"><i class="generic-icons-nav fa fa-fw fa-plus"></i>{{$addapps}}</a>
<a class="nav-link" href="/apps"><i class="generic-icons-nav bi bi-plus-lg"></i>{{$addapps}}</a>
</div>
{{else}}
<div class="text-uppercase text-muted nav-link">
@ -390,7 +396,7 @@
}
})
.done( function() {
$('<li><a class="navbar-app nav-link" href="' + app_url + '"><i class="fa fa-fw fa-' + app_icon + '"></i></li>').insertBefore('#app-menu');
$('<li><a class="navbar-app nav-link" href="' + app_url + '"><i class="bi bi-' + app_icon + '"></i></li>').insertBefore('#app-menu');
});
});
@ -424,7 +430,7 @@
}
})
.done( function() {
$('<a class="dropdown-item" href="' + app_url + '"><i class="generic-icons-nav fa fa-fw fa-' + app_icon + '"></i>' + app_name + '</a>').appendTo('#app-bin-container');
$('<a class="dropdown-item" href="' + app_url + '"><i class="generic-icons-nav bi bi-' + app_icon + '"></i>' + app_name + '</a>').appendTo('#app-bin-container');
});
});

View File

@ -5,32 +5,38 @@
{{include file="field_checkbox.tpl" field=$advanced_theming}}
{{if $expert}}
<hr>
<h3>{{$common}}</h3>
{{include file="field_colorinput.tpl" field=$primary_color}}
{{include file="field_colorinput.tpl" field=$success_color}}
{{include file="field_colorinput.tpl" field=$info_color}}
{{include file="field_colorinput.tpl" field=$warning_color}}
{{include file="field_colorinput.tpl" field=$danger_color}}
{{include file="field_input.tpl" field=$radius}}
{{include file="field_input.tpl" field=$top_photo}}
{{include file="field_input.tpl" field=$reply_photo}}
<h3>{{$light}}</h3>
{{include file="field_checkbox.tpl" field=$navbar_dark_mode}}
{{include file="field_colorinput.tpl" field=$nav_bg}}
{{include file="field_colorinput.tpl" field=$bgcolor}}
{{include file="field_colorinput.tpl" field=$background_image}}
{{include file="field_colorinput.tpl" field=$link_color}}
{{include file="field_colorinput.tpl" field=$link_hover_color}}
<h3>{{$dark}}</h3>
{{include file="field_colorinput.tpl" field=$nav_bg_dark}}
{{include file="field_colorinput.tpl" field=$bgcolor_dark}}
{{include file="field_colorinput.tpl" field=$background_image_dark}}
{{include file="field_colorinput.tpl" field=$link_color_dark}}
{{include file="field_colorinput.tpl" field=$link_hover_color_dark}}
<h3>{{$common}}</h3>
{{include file="field_input.tpl" field=$radius}}
{{include file="field_input.tpl" field=$top_photo}}
{{include file="field_input.tpl" field=$reply_photo}}
<script>
$(function(){
$('#id_ussrbasicpub_link_color, #id_ussrbasicpub_link_color_dark, #id_ussrbasicpub_link_hover_color, #id_ussrbasicpub_link_hover_color_dark, #id_ussrbasicpub_background_color, #id_ussrbasicpub_background_color_dark, #id_ussrbasicpub_nav_bg, #id_ussrbasicpub_nav_bg_dark').colorpicker({format: 'rgba'});
$('#id_redbasic_link_color, #id_redbasic_link_color_dark, #id_redbasic_link_hover_color, #id_redbasic_link_hover_color_dark, #id_redbasic_background_color, #id_redbasic_background_color_dark, #id_redbasic_nav_bg, #id_redbasic_nav_bg_dark').colorpicker({format: 'rgba'});
});
$(function(){
$('#id_redbasic_primary_color, #id_redbasic_success_color, #id_redbasic_info_color, #id_redbasic_warning_color, #id_redbasic_danger_color').colorpicker({format: 'hex'});
});
</script>
{{/if}}
<div class="settings-submit-wrapper" >
<button type="submit" name="ussrbasicpub-settings-submit" class="btn btn-primary">{{$submit}}</button>
<button type="submit" name="redbasic-settings-submit" class="btn btn-primary">{{$submit}}</button>
</div>