Apps Home
|
Create an App
mark_ha_test
Author:
mark_ha
Description
Source Code
Launch App
Current Users
Created by:
Mark_Ha
// TIP GOAL var goal_name = "test"; var goal_needed = 0; var goal_at = 0; var recent_tipper = "-"; var recent_tipper_amount = 0; var top_tipper = "-"; var top_tipper_amount = 0; cb.onTip(function (tip) { var amount = parseInt(tip['amount']); var tipper = tip["from_user"]; if (amount > recent_tipper_amount) { top_tipper = tipper; top_tipper_amount = amount; } recent_tipper = tipper; recent_tipper_amount = amount; total_tipped += cb.chatNotice("Total Tipped: " + total_tipped); cb.chatNotice(tip); }); // ANIMATIONS var animation_thanks_name = function(name) { var a = 0; var i = 0; return function() { i++; if (i > 5) { return null; } if (a == 0) { a = 1; return "★ ✩ thanks " + name + "! ✩ ★" } a = 0; return "✩ ★ thanks " + name + "! ★ ✩" } } // ANIMATION LOGIC var currentAnimation = null; var animation_sequence = 0; var currentLine = 1; // start on 0, will be 1 when function getNextLine() { currentLine++; if (currentLine > 3) currentLine = 1; return currentLine; } function getCurrentLine() { return currentLine; } cb.onDrawPanel(function(user) { var animationLine = null; if (currentAnimation != null) { animationLine = currentAnimation(); if (animationLine != null) { return { 'template': '3_rows_11_21_31', 'row1_value': "", 'row2_value': animationLine, 'row3_value': "" }; } currentAnimation = null; } var title = ""; if (animation_sequence == 0) { animation_sequence = 1; title = "=-- next goal: " + goal_name + " --="; } else if(animation_sequence == 1) { animation_sequence = 2; title = "-=- next goal: " + goal_name + " -=-"; } else if(animation_sequence == 2) { animation_sequence = 3; title = "--= next goal: " + goal_name + " =--"; } else if (animation_sequence == 3) { animation_sequence = 0; title = "-=- next goal: " + goal_name + " -=-"; } return { 'template': '3_rows_11_21_31', 'row1_value': title, 'row2_value': "row2", 'row3_value': "row3" }; }); function redraw() { // force redraw every 1s var newRow = getNextLine(); cb.drawPanel(); cb.setTimeout(function() { redraw(); }, 1000); } redraw();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.