• Remix
  • Share
  • New Entry

on 23 Nov 2023
  • 11
  • 40
  • 0
  • 2
  • 858
drawframe(24);
Write your drawframe function below
function drawframe(f)
% Background plot
figure('Position', [100, 100, 300, 300]);
set(gca, 'color', 'w', 'YTick', [], 'XTick', []);
axis([0 2 0 2]);
axis equal;
axis off
% Toogle background %Day & Night
color = [47, 126, 178]/255*(abs(f-24))/24; % brand color
rectangle('Position', [0 0 2 1], 'Curvature', 1, 'FaceColor', color, 'EdgeColor', 'none');
text(0.26, 0.53, 'Day', 'FontSize', 24, 'Color', 'w');
text(1.1, 0.53, 'Night', 'FontSize', 24, 'Color', 'w');
% Inside toggle ease position
thumbRatio = 0.8;
x = (sin((f-1)/48 * 2*pi + pi/2) + 1) / 2 ; % generate the ease value postition
x = x + (1 - thumbRatio)/2; % reduce the size and shift it, so it doesn't touch the edges
rectangle('Position', [x 0.1 thumbRatio thumbRatio], 'Curvature', [1 1], 'FaceColor', [1 0.5+(24-abs(f-24))/48 1-abs(f-24)/24], 'EdgeColor', 'none');
if(abs(f-24)<4)
text(0.9, 0.53, '*', 'FontSize', 16, 'Color', 'w');
text(1.1, 0.33, '*', 'FontSize', 16, 'Color', 'w');
text(1.6, 0.13, '*', 'FontSize', 16, 'Color', 'w');
text(1.3, 0.86, '*', 'FontSize', 16, 'Color', 'w');
text(1.7, 0.70, '*', 'FontSize', 16, 'Color', 'w');
end
end
Animation
Remix Tree