Jump to content

sakura

Members
  • Content Count

    75
  • Joined

  • Last visited

Posts posted by sakura


  1. Here an easy script for a dark theme, which seems to work pretty well (TamperMonkey):

    // ==UserScript==
    // @name         [DPE] Dark Theme
    // @namespace    http://tampermonkey.net/
    // @version      0.1
    // @description  try to take over the world!
    // @author       You
    // @match        https://en.delphipraxis.net/*
    // @grant        none
    // ==/UserScript==
    
    (function() {
        try{
            'use strict';
    
            const $ = jQuery;
            const stylesheet = document.styleSheets[document.styleSheets.length - 1];
    
            stylesheet.insertRule('BODY, HEADER, .ipsButtonBar, .ipsComment_meta, .ipsType_sectionHead, .ipsButton, .ipsQuote_citation, IMG, VIDEO, PRE, NAV.ipsBreadcrumb, PRE IMG, .ipsEmoji, .ipsTag, .ipsTag_prefix, .ipsBadge, UL.ipsPagination_mini { filter: invert(100%); }');
            stylesheet.insertRule('HEADER IMG { filter: invert(0%);');
            stylesheet.insertRule('PRE { background-color: #AAA !important');
            stylesheet.insertRule('article::before { filter: invert(100%); height: 3em; content: " "; display: block; }');
        }
        catch(e) {
        }
    })();

    ย 

    ... ๐Ÿˆย ...

    • Thanks 1

  2. // ==UserScript==
    // @name         [DPE] CSS Overrides
    // @namespace    http://tampermonkey.net/
    // @version      0.1
    // @description  try to take over the world!
    // @author       You
    // @match        https://en.delphipraxis.net/*
    // @exclude      *?do=edit
    // @exclude      */discover/
    // @grant        none
    // ==/UserScript==
    
    (function() {
        try{
            'use strict';
    
            const $ = jQuery;
            const stylesheet = document.styleSheets[document.styleSheets.length - 1];
    
            // fluid list
            $('HEADER .logo').attr('style', 'height: auto;');
            $('HEADER .logo IMG').attr('style', 'margin-bottom: -30px;');
            $('LI.ipsDataItem').attr('style', 'padding: 2px 0');
            $('DIV.ipsDataItem_icon').attr('style', 'padding: 0 10px;');
            $('DIV.ipsDataItem_main').attr('style', 'padding: 0;');
            $('UL.ipsDataItem_stats').attr('style', 'padding: 0 10px 0 0;');
    
            $('LI.ipsDataItem_unread DIV.ipsDataItem_main A[href*=topic]').each(function() {
                const href = $(this).attr('href');
                if (href.indexOf('?') < 0) $(this).attr('href', href + '?do=getNewComment');
            });
    
            // thread view
            const ipsPageHeader = $('DIV.ipsPageHeader');
            ipsPageHeader.attr('style', 'padding: 5px;');
            const topicControls = ipsPageHeader.next();
            const topicControlsLinks = topicControls.find('A');
            for (var idx = 0, link; link = topicControlsLinks[idx]; idx++) {
                const div = $('<div class="ipsPos_right ipsResponsive_noFloat ipsResponsive_hidePhone" style="margin-left: 5px;"></div>');
                link.style = 'padding: 5px; line-height: 1.5em;';
                div.append(link);
                ipsPageHeader.prepend(div);
            }
            topicControls.remove();
    
            $('UL.cAuthorPane_info').attr('style', 'transform: scale(0.6); padding: 0; margin: -40px;');
            $('DIV[data-role="commentContent"]').attr('style', 'padding: 0; font-size: small;');
    
            // Code
            $('PRE.ipsCode').attr('style', 'padding: 5px !important; font-size: small;');
    
            // Survey
            $(':root').attr('style', '--grid-gap: 0px;');
            $('span.ipsFaded').attr('style', 'margin-left: 5px;');
    
            stylesheet.insertRule('.ipsDataList.ipsDataList_zebra > .ipsDataItem { height: 45px; }');
    
            // scroll to start of content
            if (window.location.href.indexOf('?do') < 0) $('html,body').animate({scrollTop: $('#elContent').offset().top},'slow');
    
        }
        catch(e) {
        }
    })();

    ... ๐Ÿˆย ...

    • Thanks 1

  3. For those of you, using TamperMonkey in Chrome, I have created a small script, which, for now, will compact the design just a bit. Feel free to enhance/comment.

    ย 

    // ==UserScript==
    // @name         [DPE] CSS Overrides
    // @namespace    http://tampermonkey.net/
    // @version      0.1
    // @description  try to take over the world!
    // @author       You
    // @match        https://en.delphipraxis.net/*
    // @exclude      *?do=edit
    // @grant        none
    // ==/UserScript==
    
    (function() {
        'use strict';
    
        // fluid list
        const $ = jQuery;
    
        $('HEADER .logo').attr('style', 'height: auto;');
        $('HEADER .logo IMG').attr('style', 'margin-bottom: -30px;');
        $('LI.ipsDataItem').attr('style', 'padding: 2px 0');
        $('DIV.ipsDataItem_icon').attr('style', 'padding: 0 10px;');
        $('DIV.ipsDataItem_main').attr('style', 'padding: 0;');
        $('UL.ipsDataItem_stats').attr('style', 'padding: 0 10px 0 0;');
    
        $('LI.ipsDataItem_unread DIV.ipsDataItem_main A[href*=topic]').each(function() {
            const href = $(this).attr('href');
            if (href.indexOf('?') < 0) $(this).attr('href', href + '?do=getNewComment');
        });
    
        // thread view
        const ipsPageHeader = $('DIV.ipsPageHeader');
        ipsPageHeader.attr('style', 'padding: 5px;');
        const topicControls = ipsPageHeader.next();
        const topicControlsLinks = topicControls.find('A');
        for (var idx = 0, link; link = topicControlsLinks[idx]; idx++) {
            const div = $('<div class="ipsPos_right ipsResponsive_noFloat ipsResponsive_hidePhone" style="margin-left: 5px;"></div>');
            link.style = 'padding: 5px; line-height: 1.5em;';
            div.append(link);
            ipsPageHeader.prepend(div);
        }
        topicControls.remove();
    
        $('UL.cAuthorPane_info').attr('style', 'transform: scale(0.6); padding: 0; margin: -40px;');
        $('DIV[data-role="commentContent"]').attr('style', 'padding: 0; font-size: small;');
    
    })();

    ... ๐Ÿˆย ...

    • Like 2

  4. Hi folks,

    ย 

    awesone! I love the new design, besides a few perks - like most things take tooo much space, it could be more compact.

    ย 

    However, I am missing the PORTAL from the German community, which is simply the best part of getting started. Hope it will be here soon too.

    ย 

    ...๐Ÿˆ...

    • Like 1
ร—