// Get canvas and context
const canvas = document.getElementById('myCanvas');
const ctx = canvas.getContext('2d');
// 1. Basic shapes
// Rectangle (filled)
// 1. Create SVG elements
const svgNS = 'http://www.w3.org/2000/svg';
function createSVGElement(type, attributes = {}) {
const element = document.createElementNS(svgNS, type);
Object.entries(attributes).forEach(([key, value]) => {
/* Basic transitions */
.button {
background-color: blue;
color: white;
padding: 1rem 2rem;
transition: background-color 0.3s ease;
import SwiftUI
struct AnimationExamplesView: View {
@State private var isExpanded = false
@State private var rotation: Double = 0
@State private var scale: CGFloat = 1.0