<commit_before>(function(w, d) {
    'use strict';

    var $w = $(w);
    var $d = $(d);

    $(function() {


        $('#reg').on({
            click: function(e) {
                e.preventDefault();
                return window.open($(this).attr('href'), '_blank');
            }
        });
        $('nav a').on({
            click: function(e) {
                e.preventDefault();
                return $('body').stop().scrollTo($($(this).attr('href')), {
                    duration: ($(d).width() > 500) ? 800 : 0,
                    offset: {
                        left: 0,
                        top: -0.03 * $(w).height()
                    }
                });
            }
        });
    });

    $(w).scroll(function(event) {
        var scroll = $(w).scrollTop();
        // Do something
        if (scroll > 500)
            $('#gotop').show();
        else
            $('#gotop').hide();
    });

})(window, document);<commit_msg>修正 JS 捲動問題<commit_after>(function(w, d) {
    'use strict';

    var $w = $(w);
    var $d = $(d);
    var $g = $('#gotop');

    $(function() {

        $('nav a').on({
            click: function(e) {
                e.preventDefault();
                return $('body').stop().scrollTo($($(this).attr('href')), {
                    duration: 800,
                    offset: {
                        left: 0,
                        top: '180px'
                    }
                });
            }
        });
    });

    $w.scroll(function(event) {
        var scroll = $(w).scrollTop();
        // Do something
        if (scroll > 500)
            $g.show();
        else
            $g.hide();
    });

})(window, document);
{'fraction_non_alphanumeric': 0.1912889935256033, 'fraction_numerical': 0.014125956444967627, 'mean_word_length': 1.0935960591133005, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2602399', 'n_tokens_mistral': 523, 'n_tokens_neox': 476, 'n_words': 93}