123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361 |
- <?php
- header("Content-type: text/css");
- require_once "../../../include/init.php";
- //https://gist.github.com/bedeabza/10463089
- function hexToHsl($hex) {
- $hex = array($hex[0].$hex[1], $hex[2].$hex[3], $hex[4].$hex[5]);
- $rgb = array_map(function($part) {
- return hexdec($part) / 255;
- }, $hex);
- $max = max($rgb);
- $min = min($rgb);
- $l = ($max + $min) / 2;
- if ($max == $min) {
- $h = $s = 0;
- } else {
- $diff = $max - $min;
- $s = $l > 0.5 ? $diff / (2 - $max - $min) : $diff / ($max + $min);
- switch($max) {
- case $rgb[0]:
- $h = ($rgb[1] - $rgb[2]) / $diff + ($rgb[1] < $rgb[2] ? 6 : 0);
- break;
- case $rgb[1]:
- $h = ($rgb[2] - $rgb[0]) / $diff + 2;
- break;
- case $rgb[2]:
- $h = ($rgb[0] - $rgb[1]) / $diff + 4;
- break;
- }
- $h /= 6;
- }
- return array(360*$h, 100*$s, 100*$l);
- }
- //$link = "hsl("..", ".."%, ".."%)";
- $color = hexToHsl($theme['lc']);
- $link = "hsl(".$color[0].", ".$color[1]."%, ".$color[2]."%)";
-
- $color = hexToHsl($theme['tx']);
- $text = "hsl(".$color[0].", ".$color[1]."%, ".$color[2]."%)";
- $color = hexToHsl($theme['bc']);
- $border = "hsl(".$color[0].", ".$color[1]."%, ".$color[2]."%)";
- $color = hexToHsl($theme['bg']);
- $background = "hsl(".$color[0].", ".$color[1]."%, ".$color[2]."%)";
- $backgroundDark = "hsl(".$color[0].", ". $color[1] ."%, ".($color[2] > 10 ? $color[2] - 10 : 0 )."%)";
- $backgroundDarker = "hsl(".$color[0].", ". $color[1] ."%, ".($color[2] > 18 ? $color[2] - 18 : 0 )."%)";
- $backgroundLight = "hsl(".$color[0].", ". $color[1] ."%, ".($color[2] < 90 ? $color[2] + 10 : 100 )."%)";
- $backgroundLighter = "hsl(".$color[0].", ". $color[1] ."%, ".($color[2] < 70 ? $color[2] + 30 : 100 )."%)";
- $backgroundL = $color[2];
- $color = hexToHsl($theme['fg']);
- $foreground = "hsl(".$color[0].", ".$color[1]."%, ".$color[2]."%)";
- $foregroundDark = "hsl(".$color[0].", ". $color[1] ."%, ".($color[2] > 10 ? $color[2] - 10 : 0 )."%)";
- $foregroundDarker = "hsl(".$color[0].", ". $color[1] ."%, ".($color[2] > 18 ? $color[2] - 18 : 0 )."%)";
- $foregroundLight = "hsl(".$color[0].", ". $color[1] ."%, ".($color[2] < 90 ? $color[2] + 10 : 100 )."%)";
- $foregroundLighter = "hsl(".$color[0].", ". $color[1] ."%, ".($color[2] < 82 ? $color[2] + 18 : 100 )."%)";
- $foregroundL = $color[2];
- ?>
- p,div,span {
- color:<?php echo $text; ?>;
- }
- a, .link {
- color: <?php echo $link; ?>;
- }
- textarea,input[type="text"],select,.flex{
- background-color: <?php echo ($foregroundL < 50 ? $foregroundLight : $foregroundDark) ?>;
- color:<?php echo $text; ?>;
- border:0px;
- }
- body {
- background-color: <?php echo $background; ?>;
- }
- label {
- color: gray;
- }
- input[type="radio"]:checked+label {
- color: black;
- }
- input[type="checkbox"]:checked+label {
- color: red;
- }
- .topbar {
- background-color: <?php echo $backgroundDarker ?>;
- }
- .gotop {
- background-color: rgba(255, 255, 255, 0.5);
- }
- .gotop a {
- color: <?php echo $link; ?>;
- }
- .topicon {
- color: <?php echo $backgroundLighter; ?>;
- }
- .toggleblur {
- background-color: <?php echo $link; ?>;
- color: <?php echo $foreground; ?>;
- }
- .polloption{
- display:block;
- margin:5px;
- padding:5px;
- background-color: <?php echo $foregroundLighter; ?>;
- color: <?php echo $link; ?>;
- }
- .polloption:hover:not(.fixed),.voted{
- cursor: pointer;
- background-color: <?php echo $foregroundDarker; ?>;
- color: white;
- }
- .voteBar{
- background-color: <?php echo $link; ?>;
- }
- .tiselected {
- border-bottom: 2px solid <?php echo $foreground; ?>;
- }
- .alert {
- background-color: red;
- }
- #notifications {
- background-color:<?php echo $foreground; ?>;
- box-shadow: 1px 1px 1px black;
- }
- .notif{
- border-bottom:<?php echo $theme['bw']; ?>px solid #<?php echo $theme['bc']; ?>;
- background-color:<?php echo $foreground; ?>;
- color:<?php echo $text; ?> !important;
- }
- .notif .post_buttons{
- background-color:<?php echo $foreground; ?>;
- }
- .notif .text{
- color:<?php echo $text; ?> !important;
- }
- input[type="submit"] {
- background-color: <?php echo $link; ?>;
- color: <?php echo $foreground; ?>;
- border:0px;
- }
- .new {
- background-color:<?php echo $foreground; ?>;
- }
- .side_element {
- background-color: #455f78;
- /*box-shadow: 1px 1px 1px black;*/
- }
- .side_element li:hover,.menu li:hover {
- background-color: <?php echo $backgroundDarker; ?> !important;
- }
- .side_element li:active {
- background-color: rgba(255, 255, 255, 0.25);
- }
- .uploadBox {
- box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1);
- }
- .delpic {
- color:red;
- background-color:white;
- }
- .formbtn {
- color:<?php echo $link; ?>;
- }
- .formbtn label{
- color:<?php echo $link; ?>;
- }
- .profile,.loader {
- background-color:<?php echo $topbar; ?>;
- color:<?php echo $foreground; ?>;
- }
- .listmenu li {
- background-color:black;
- color:white;
- }
- .listmenu li:hover {
- background-color:white;
- color:black;
- }
- .autl:hover li{
- background-color:lightgreen !important;
- }
- .rutl:hover li{
- background-color:crimson !important;
- }
- .unblock,.unmute,.block,.mute,.follow,
- .unfollow,
- .nsfw,
- .unnsfw,
- .profileMenu,
- .listmenu,.profileButton {
- background-color: black;
- color: white;
- cursor: pointer;
- }
- .mute:hover,.block:hover,.follow:hover,
- .nsfw:hover,.profileButton:hover {
- background-color: lime;
- }
- .unmute:hover,.unblock:hover,.unfollow:hover,
- .unnsfw:hover{
- background-color: crimson !important;
- }
- .unbookmark{
- color: crimson !important;
- }
- .unfav, .unreblog{
- color: red !important;
- }
- .element_pad > .post {
- border-left:2px solid <?php echo $link; ?>;
- }
- .post,
- .rb,
- .textonly,
- .loadmore,
- .postform,
- .side_element,
- .searchmobile
- {
- border: <?php echo $theme['bw']; ?>px solid #<?php echo $theme['bc']; ?>;
- border-radius: <?php echo $theme['br']; ?>px !important;
- background-color: <?php echo $foreground; ?>;
- box-shadow: <?php echo $theme['dr']; ?>px <?php echo $theme['dr']; ?>px <?php echo $theme['dr']; ?>px rgba(0,0,0,0.5);
- }
- .mobilemenu{
- background-color: <?php echo $foreground; ?>;
- border-left: 2px solid <?php echo $background; ?>;
- }
-
- .menu,.menu li {
- background-color: <?php echo ($foregroundL < 50 ? $foregroundLight : $foregroundDark) ?> !important;
- }
- .menu li:hover a {
- color: <?php echo $foreground; ?> !important;
- }
- .menu li a {
- color: <?php echo $link; ?> !important;
- }
- .menu {
- box-shadow: 1px 1px 2px black;
- }
- .previewpost,.userinfo {
- background-color: <?php echo ($foregroundL < 50 ? $foregroundLight : $foregroundDark) ?>;
- border: 1px solid <?php echo ($foregroundL < 50 ? $foregroundLight : $foregroundDark) ?>;
- box-shadow: 1px 1px 1px rgba(0,0,0,1);
- }
- .icon {
- background-color: black;
- }
- .post_footer {
- background-color: <?php echo ($foregroundL < 50 ? $foregroundLighter : $foregroundDarker) ?>;
- border-radius: 0px 0px <?php echo $theme['br']; ?>px <?php echo $theme['br']; ?>px;
- }
- .felem a:hover > span {
- color: <?php echo $backgroundLighter; ?>;
- background-color: <?php echo $backgroundDarker ?> !important;
- border: <?php echo $theme['bw']; ?>px solid #<?php echo $theme['bc']; ?>;
- border-radius:3px;
- }
- .public::after {
- content: '';
- }
- .unlisted::after {
- content: '';
- }
- .private::after {
- content: '';
- }
- .direct::after {
- content: '';
- }
- .sensitive::after {
- content: '';
- }
- .post_buttons {
- color: #404040;
- }
- .reply {
- background-color: <?php echo ($foregroundL < 50 ? $foregroundLighter : $foregroundDarker) ?>;
- border-bottom: 2px solid <?php echo $foreground; ?>;
- }
- .note {
- background-color: #ccc;
- }
- .button {
- background-color: white;
- }
- .setting label {
- background-color: lightgray;
- box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1);
- }
- .setting input[type="radio"]:checked+label,.setting input[type="checkbox"]:checked+label {
- background-color: <?php echo $link; ?>; ;
- box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
- color: <?php echo $foreground; ?>; ;
- }
|