Skip to:
Content

bbPress.org

Changeset 6604


Ignore:
Timestamp:
06/26/2017 12:29:31 AM (7 years ago)
Author:
johnjamesjacoby
Message:

Admin: Use some JavaScript to spruce up the badge-animation.

@todo Update the "What's New" page contents.

Location:
trunk/src
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bbpress.php

    r6603 r6604  
    204204        /** Versions **********************************************************/
    205205
    206         $this->version    = '2.6-rc-6602';
     206        $this->version    = '2.6-rc-6604';
    207207        $this->db_version = '262';
    208208
  • trunk/src/includes/admin/assets/css/admin.css

    r6603 r6604  
    1111
    1212.bbp-badge {
     13    transform-origin: top left;
     14    -webkit-animation: swoop 16s infinite linear;
     15    animation: swoop 16s infinite linear;
     16}
     17
     18.bbp-bee {
     19    font: 400 80px/1 dashicons !important;
     20    color: #000;
     21    position: absolute;
     22    height: 60px;
     23    width: 60px;
     24}
     25
     26.bbp-hive {
    1327    font: 400 150px/1 dashicons !important;
    14     color: #000;
    15     display: inline-block;
    16     transform-origin: center center;
    17 }
    18 
    19 .bbp-badge:before {
     28    color: #ccc;
     29    position: absolute;
     30    height: 150px;
     31    width: 150px;
     32    top: 0;
     33    right: 0;
     34    display: block;
     35}
     36
     37.bbp-bee:before {
    2038    content: "\f451";
     39}
     40
     41.bbp-hive:before {
     42    content: "\f449";
    2143}
    2244
     
    3052
    3153@keyframes swoop {
    32   0%   { transform: rotate( -9deg ); }
    33   25%  { transform: rotate( 3deg  ); }
    34   50%  { transform: rotate( -3deg ); }
    35   75%  { transform: rotate( 9deg  ); }
    36   100% { transform: rotate( -9deg ); }
     54  0%   { transform: rotate( 95deg  ); }
     55  100% { transform: rotate( 455deg ); }
    3756}
    3857
    3958.about-wrap .bbp-badge {
    4059    position: absolute;
    41     top: 0;
    42     right: 0;
    43     -webkit-animation: buzz 0.3s infinite ease-in, swoop 5s infinite ease-in-out;
    44     animation: buzz 0.3s infinite ease-in, swoop 5s infinite ease-in-out;
     60    right: 50px;
     61    top: 50px;
     62    height: 25px;
     63    width: 25px;
    4564}
    4665
    4766body.rtl .about-wrap .bbp-badge {
    4867    right: auto;
    49     left: 0;
     68    left: 50px;
    5069}
    5170
  • trunk/src/includes/admin/classes/class-bbp-admin.php

    r6602 r6604  
    533533        $version = bbp_get_version();
    534534
    535         // Register the JS
     535        // Footer JS
     536        wp_register_script( 'bbp-admin-badge-js',   $this->js_url . 'badge' . $suffix . '.js', array(), $version, true );
     537
     538        // Header JS
    536539        wp_register_script( 'bbp-admin-common-js',  $this->js_url . 'common'    . $suffix . '.js', array( 'jquery', 'suggest'              ), $version );
    537540        wp_register_script( 'bbp-admin-topics-js',  $this->js_url . 'topics'    . $suffix . '.js', array( 'jquery'                         ), $version );
     
    541544        // Post type checker (only topics and replies)
    542545        if ( 'post' === get_current_screen()->base ) {
    543 
    544546            switch ( get_current_screen()->post_type ) {
    545547                case bbp_get_reply_post_type() :
     
    560562                    break;
    561563            }
     564
     565        // Enqueue the badge JS
     566        } elseif ( in_array( get_current_screen()->id, array( 'dashboard_page_bbp-about', 'dashboard_page_bbp-credits' ), true ) ) {
     567            wp_enqueue_script( 'bbp-admin-badge-js' );
    562568        }
    563569    }
     
    728734
    729735    /**
     736     * Output the shared screen header for about_screen() & credits_screen()
     737     *
     738     * Contains title, subtitle, and badge area
     739     *
     740     * @since 2.6.0 bbPress (r6604)
     741     */
     742    private function screen_header() {
     743        list( $display_version ) = explode( '-', bbp_get_version() ); ?>
     744
     745        <h1><?php printf( esc_html__( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
     746        <div class="about-text"><?php printf( esc_html__( 'bbPress is fun to use, contains no artificial colors or preservatives, and is absolutely wonderful in every environment. Your community is going to love using it.', 'bbpress' ), $display_version ); ?></div>
     747
     748        <span class="bbp-hive" id="bbp-hive"></span>
     749        <div class="bbp-badge" id="bbp-badge">
     750            <span class="bbp-bee" id="bbp-bee"></span>
     751        </div>
     752
     753        <?php
     754    }
     755
     756    /**
    730757     * Output the about screen
    731758     *
    732759     * @since 2.2.0 bbPress (r4159)
     760     *
     761     * @todo Host this remotely.
    733762     */
    734763    public function about_screen() {
    735 
    736         list( $display_version ) = explode( '-', bbp_get_version() ); ?>
     764        ?>
    737765
    738766        <div class="wrap about-wrap">
    739             <h1><?php printf( esc_html__( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
    740             <div class="about-text"><?php printf( esc_html__( 'Thank you for updating! bbPress %s is sweet and savory, contains no artificial flavors or preservatives, is environmentally friendly, and is a great compliment to your site.', 'bbpress' ), $display_version ); ?></div>
    741             <div class="bbp-badge"></div>
     767
     768            <?php $this->screen_header(); ?>
    742769
    743770            <h2 class="nav-tab-wrapper">
     
    804831     * Output the credits screen
    805832     *
    806      * Hardcoding this in here is pretty janky. It's fine for now, but we'll
    807      * want to leverage api.wordpress.org eventually.
    808      *
    809833     * @since 2.2.0 bbPress (r4159)
     834     *
     835     * @todo Host this remotely.
    810836     */
    811837    public function credits_screen() {
    812 
    813         list( $display_version ) = explode( '-', bbp_get_version() ); ?>
     838        ?>
    814839
    815840        <div class="wrap about-wrap">
    816             <h1><?php printf( esc_html__( 'Welcome to bbPress %s', 'bbpress' ), $display_version ); ?></h1>
    817             <div class="about-text"><?php printf( esc_html__( 'Thank you for updating! bbPress %s is sweet and savory, contains no artificial flavors or preservatives, is environmentally friendly, and is a great compliment to your site.', 'bbpress' ), $display_version ); ?></div>
    818             <div class="bbp-badge"></div>
     841
     842            <?php $this->screen_header(); ?>
    819843
    820844            <h2 class="nav-tab-wrapper">
Note: See TracChangeset for help on using the changeset viewer.