<commit_before>import QtQuick 2.0
import Ubuntu.Components 0.1
import "./"

Flipable {
    property int card:0
    property int suit:0
    property bool showAce: true
    property bool up: outline||shadow?false:true
    property bool outline: false
    property bool shadow: false
    property bool animated: !board._redoing
    property bool animating: xAnimation.running || yAnimation.running || angleAnimation.running
    property bool moveable: false
    property bool highlighted: false
    property int stackIndex: -1
    property variant cardToStack

    property int _duration: UbuntuAnimation.FastDuration

    property alias front: frontLoader.item

    signal afterAnimation()
    signal beforeAnimation()

    id: cardObj

    objectName: "card"

    onAnimatingChanged: {
        if(!animating)
            afterAnimation()
        else
            beforeAnimation()
    }

    onBeforeAnimation: {
        setParentZ(1)
    }
    onAfterAnimation: {
        setParentZ(-1)
    }

    transform: Rotation {
        id: rot
        origin.x: width/2
        origin.y: height/2
        axis.x: 0; axis.y: 1; axis.z: 0

        angle: up||outline||shadow?0:180

        Behavior on angle {
            id: angleBehavior
            animation: angleAnimation
            enabled: animated && !yAnimation.running && !xAnimation.running
        }
    }

    ParallelAnimation {
        id: angleAnimation
        SequentialAnimation {
            PropertyAnimation {
                target: cardObj
                property: "y"
                to: cardObj.y - 20
                duration: _duration
                easing: UbuntuAnimation.StandardEasing
            }
            PropertyAnimation {
                target: cardObj
                property: "y"
                to: cardObj.y
                duration: _duration
                easing: UbuntuAnimation.StandardEasing
            }
        }
        UbuntuNumberAnimation {
            duration: 2*_duration
        }
    }

    front: Item {
        width: cardObj.width
        height: cardObj.height
        UbuntuShape {
            id: highlight
            property int _border: 3
            x: - _border
            y: - _border
            width: cardObj.width + 2*_border
            height: cardObj.height + 2*_border
            visible: highlighted

            color: Theme.palette.selected.overlay
        }
        Loader {
            id: frontLoader
            anchors.fill: parent
            source: getSource()
        }
    }

    back: DownCard {<commit_msg>[Card] Better highlight color<commit_after>import QtQuick 2.0
import Ubuntu.Components 0.1
import "./"

Flipable {
    property int card:0
    property int suit:0
    property bool showAce: true
    property bool up: outline||shadow?false:true
    property bool outline: false
    property bool shadow: false
    property bool animated: !board._redoing
    property bool animating: xAnimation.running || yAnimation.running || angleAnimation.running
    property bool moveable: false
    property bool highlighted: false
    property int stackIndex: -1
    property variant cardToStack

    property int _duration: UbuntuAnimation.FastDuration

    property alias front: frontLoader.item

    signal afterAnimation()
    signal beforeAnimation()

    id: cardObj

    objectName: "card"

    onAnimatingChanged: {
        if(!animating)
            afterAnimation()
        else
            beforeAnimation()
    }

    onBeforeAnimation: {
        setParentZ(1)
    }
    onAfterAnimation: {
        setParentZ(-1)
    }

    transform: Rotation {
        id: rot
        origin.x: width/2
        origin.y: height/2
        axis.x: 0; axis.y: 1; axis.z: 0

        angle: up||outline||shadow?0:180

        Behavior on angle {
            id: angleBehavior
            animation: angleAnimation
            enabled: animated && !yAnimation.running && !xAnimation.running
        }
    }

    ParallelAnimation {
        id: angleAnimation
        SequentialAnimation {
            PropertyAnimation {
                target: cardObj
                property: "y"
                to: cardObj.y - 20
                duration: _duration
                easing: UbuntuAnimation.StandardEasing
            }
            PropertyAnimation {
                target: cardObj
                property: "y"
                to: cardObj.y
                duration: _duration
                easing: UbuntuAnimation.StandardEasing
            }
        }
        UbuntuNumberAnimation {
            duration: 2*_duration
        }
    }

    front: Item {
        width: cardObj.width
        height: cardObj.height
        UbuntuShape {
            id: highlight
            property int _border: 3
            x: - _border
            y: - _border
            width: cardObj.width + 2*_border
            height: cardObj.height + 2*_border
            visible: highlighted

            color: Theme.palette.selected.foreground
        }
        Loader {
            id: frontLoader
            anchors.fill: parent
            source: getSource()
        }
    }

    back: DownCard {
{'fraction_non_alphanumeric': 0.06940924156755703, 'fraction_numerical': 0.00935854942483915, 'mean_word_length': 1.6280737704918034, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '614160', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1281, 'n_words': 349}