diff --git a/app/in-the-zone-2/InTheZone2Calender.ts b/app/in-the-zone-2/InTheZone2Calender.ts index 5fb5207..fef796c 100644 --- a/app/in-the-zone-2/InTheZone2Calender.ts +++ b/app/in-the-zone-2/InTheZone2Calender.ts @@ -46,6 +46,15 @@ export class InTheZone2CalenderTemplate { stressPoints: '95', eventID1: "4342491", eventID2: "4342585", + }), + new InTheZone2CalenderTemplate({ + date: "Saturday April 27", + postDate: "04-21-2024", + workout: "In The Zone 2 #2", + duration: '2h', + stressPoints: '98', + eventID1: "4353358", + eventID2: "4353450", }) ]; \ No newline at end of file diff --git a/app/in-the-zone-2/workouts/nextWorkout.tsx b/app/in-the-zone-2/workouts/nextWorkout.tsx index 424d08b..03ac730 100644 --- a/app/in-the-zone-2/workouts/nextWorkout.tsx +++ b/app/in-the-zone-2/workouts/nextWorkout.tsx @@ -5,184 +5,111 @@ export const WorkoutGraphSVG = () => (
- Zone 2 training is one of the most important aspects of any training plan. We do not always get faster by training faster. - - In Zone 2 training we are stimulating your type I muscle fibers - slow twitch. - - Spending time in Zone 2 is absolutely essential to improving performance. This workout is a mashup of shorter zone 2 workouts - Zone 2 1, Cadence Pyramid & Aerobic Threshold Development - to get a long and varied zone 2 workout. + In The Zone 2 #2 is designed to improve your cardiovascular endurance and build a strong foundation for higher intensity training. It features multiple intervals of sustained moderate effort (Zone 2) interspersed with recovery periods and short bursts of high intensity. - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - + + - - - - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + - - + + - - + + - - + + - - + + - - + + + + + - - + + - - + + - - + + + + + - - + + - - + + + + + - - + +
); \ No newline at end of file diff --git a/components/workoutPathApi.ipynb b/components/workoutPathApi.ipynb index f06db22..5923032 100644 --- a/components/workoutPathApi.ipynb +++ b/components/workoutPathApi.ipynb @@ -12,172 +12,7 @@ }, { "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "# Parse the XML file\n", - "tree = ET.parse(r'C:\\Users\\Chris\\OneDrive\\Dokumenter\\React\\dzr\\public\\in-the-zone-2\\InTheZone2_1.zwo')\n", - "# Get the root element\n", - "root = tree.getroot()" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "author {}\n", - "name {}\n", - "description {}\n", - "sportType {}\n", - "tags {}\n", - "\t tag {'name': 'ZONE2'}\n", - "\t None\n", - "workout {}\n", - "\t SteadyState {'Duration': '150', 'Power': '0.5', 'pace': '0'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.60000002', 'pace': '0'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.64999998', 'pace': '0'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.81', 'pace': '0'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.94999999', 'pace': '0'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '120.00001', 'Power': '0.5', 'pace': '0'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '240.00002', 'Power': '0.80000001', 'pace': '0'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '120', 'Power': '0.5', 'pace': '0'}\n", - "\t \n", - " \n", - "\t Ramp {'Duration': '360', 'PowerLow': '0.51930803', 'PowerHigh': '0.69999993', 'pace': '0'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '180.00002', 'Power': '0.69999999', 'pace': '0'}\n", - "\t \n", - " \n", - "\t Ramp {'Duration': '420.00003', 'PowerLow': '0.60000002', 'PowerHigh': '0.69999993', 'pace': '0'}\n", - "\t \n", - " \n", - "\t Ramp {'Duration': '420', 'PowerLow': '0.60000002', 'PowerHigh': '0.75', 'pace': '0'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '300', 'Power': '0.75', 'pace': '0'}\n", - "\t \n", - " \n", - "\t Ramp {'Duration': '390', 'PowerLow': '0.65149999', 'PowerHigh': '0.75150001', 'pace': '0'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '120.00001', 'Power': '0.625', 'pace': '0'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '120.00001', 'Power': '0.69999999', 'pace': '0', 'Cadence': '60'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.69999999', 'pace': '0', 'Cadence': '75'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.69999999', 'pace': '0', 'Cadence': '90'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.69999999', 'pace': '0', 'Cadence': '100'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.69999999', 'pace': '0', 'Cadence': '90'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.69999999', 'pace': '0', 'Cadence': '75'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '120.00001', 'Power': '0.69999999', 'pace': '0', 'Cadence': '60'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '120', 'Power': '0.625', 'pace': '0'}\n", - "\t None\n", - "\t SteadyState {'Duration': '120.00001', 'Power': '0.69999999', 'pace': '0'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.69999999', 'pace': '0', 'Cadence': '75'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.69999999', 'pace': '0', 'Cadence': '90'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.69999999', 'pace': '0', 'Cadence': '100'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.69999999', 'pace': '0', 'Cadence': '90'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.69999999', 'pace': '0', 'Cadence': '75'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '120.00001', 'Power': '0.69999999', 'pace': '0', 'Cadence': '60'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '120', 'Power': '0.625', 'pace': '0'}\n", - "\t None\n", - "\t SteadyState {'Duration': '120.00001', 'Power': '0.69999999', 'pace': '0', 'Cadence': '60'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.69999999', 'pace': '0', 'Cadence': '75'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.69999999', 'pace': '0', 'Cadence': '90'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.69999999', 'pace': '0', 'Cadence': '100'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.69999999', 'pace': '0', 'Cadence': '90'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '60.000004', 'Power': '0.69999999', 'pace': '0', 'Cadence': '75'}\n", - "\t \n", - " \n", - "\t SteadyState {'Duration': '120', 'Power': '0.69999999', 'pace': '0', 'Cadence': '60'}\n", - "\t None\n", - "\t SteadyState {'Duration': '120', 'Power': '0.625', 'pace': '0'}\n", - "\t \n", - " \n", - "\t IntervalsT {'Repeat': '4', 'OnDuration': '120', 'OffDuration': '120', 'OnPower': '0.75', 'OffPower': '0.69999999', 'pace': '0', 'OverUnder': '1'}\n", - "\t None\n", - "\t SteadyState {'Duration': '120', 'Power': '0.625', 'pace': '0'}\n", - "\t \n", - " \n", - "\t IntervalsT {'Repeat': '3', 'OnDuration': '180', 'OffDuration': '120', 'OnPower': '0.75', 'OffPower': '0.69999999', 'pace': '0', 'OverUnder': '1'}\n", - "\t None\n", - "\t Cooldown {'Duration': '180.00002', 'PowerLow': '0.64999998', 'PowerHigh': '0.5', 'pace': '0'}\n", - "\t None\n" - ] - } - ], - "source": [ - "# Iterate over elements\n", - "for child in root:\n", - " print(child.tag, child.attrib)\n", - " for sub_child in child:\n", - " print(\"\\t\", sub_child.tag, sub_child.attrib)\n", - " # Access text content of elements if necessary\n", - " print(\"\\t\", sub_child.text)" - ] - }, - { - "cell_type": "code", - "execution_count": 47, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -242,12 +77,12 @@ " }\n", " workout_data.append(interval_data)\n", "\n", - " return workout_data\n" + " return workout_data,root\n" ] }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -264,16 +99,18 @@ " color = 'orange' \n", " else:\n", " color = 'red'\n", - " return color " + " return color \n", + "\n", + "buckets = [[0, 59], [60, 75], [76, 89], [90, 104], [105, 118],[119,1000]]" ] }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ - "def split_interval_into_buckets(interval, buckets = [[0, 59], [60, 75], [76, 89], [90, 104], [105, 118],[119,1000]]):\n", + "def split_interval_into_buckets(interval, buckets = buckets):\n", " start, end = interval\n", " counts = [0] * len(buckets) # Initialize counts for each bucket\n", "\n", @@ -293,7 +130,7 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -341,7 +178,7 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -386,7 +223,7 @@ " path = box(time, duration, power, cadence, timeScale)\n", " paths.append(path)\n", " time = time + duration*timeScale + gap\n", - " if type in [\"Ramp\",\"Cooldown\"]:\n", + " if type in [\"Ramp\",\"Cooldown\",\"Warmup\"]:\n", " path = trapez(time, duration, powerLow, powerHigh, timeScale)\n", " paths.extend(path)\n", " time = time + duration*timeScale + gap\n", @@ -406,27 +243,7 @@ }, { "cell_type": "code", - "execution_count": 63, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'Zone 2 training is one of the most important aspects of any training plan. We do not always get faster by training faster.\\n\\n In Zone 2 training we are stimulating your type I muscle fibers - slow twitch.\\n\\n Spending time in Zone 2 is absolutely essential to improving performance. This workout is a mashup of shorter zone 2 workouts - Zone 2 1, Cadence Pyramid & Aerobic Threshold Development - to get a long and varied zone 2 workout.'" - ] - }, - "execution_count": 63, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "root.find('description').text" - ] - }, - { - "cell_type": "code", - "execution_count": 67, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ @@ -454,7 +271,7 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -465,21 +282,21 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "7200.000236000003\n" + "6540.0\n" ] } ], "source": [ "# Example usage\n", - "workout_file = r'C:\\Users\\Chris\\OneDrive\\Dokumenter\\React\\dzr\\public\\in-the-zone-2\\InTheZone2_1.zwo'\n", - "workout_data = parse_workout_file(workout_file)\n", + "workout_file = r'C:\\Users\\Chris\\OneDrive\\Dokumenter\\React\\dzr\\public\\in-the-zone-2\\InTheZone2_2.zwo'\n", + "workout_data,root = parse_workout_file(workout_file)\n", "svg_paths = generate_paths(workout_data)\n", "svg_content = generate_svg(svg_paths)\n", "\n", @@ -489,33 +306,6 @@ "# Now you can use svg_paths to embed the SVG paths in your SVG container or save them to an SVG file.\n", "# For example, you can join the svg_paths list into a single string and embed it in an SVG element in an HTML document.\n" ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'\\n import {Box, Tooltip, Heading, Text} from \\'@chakra-ui/react\\'\\n import \\'./css/Workout.css\\'\\n\\n export const WorkoutGraphSVG = () => (\\n
\\n Description\\n Zone 2 training is one of the most important aspects of any training plan. We do not always get faster by training faster.\\n\\n In Zone 2 training we are stimulating your type I muscle fibers - slow twitch.\\n\\n Spending time in Zone 2 is absolutely essential to improving performance. This workout is a mashup of shorter zone 2 workouts - Zone 2 1, Cadence Pyramid & Aerobic Threshold Development - to get a long and varied zone 2 workout.\\n \\n \\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n \\n\\n \\n
);'" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "svg_content" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/next.config.mjs b/next.config.mjs index 2d21063..8c1b65a 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,13 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - async rewrites() { - return [ - { - source: '/api/python/:path*', - destination: 'http://127.0.0.1:5328/:path*', // Proxy to Backend - }, - ]; - } + }; export default nextConfig; diff --git a/package.json b/package.json index 49d62e6..7afef94 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "flask-dev": "set FLASK_DEBUG=1 && pip install -r requirements.txt && python -m flask --app api/python/index run -p 5328", - "next-dev": "next dev", - "dev": "concurrently \"pnpm run next-dev\" \"pnpm run flask-dev\"", + "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" @@ -29,7 +27,6 @@ "gsap": "^3.12.5", "next": "^14.1.4", "papaparse": "^5.4.1", - "python": "^0.0.4", "react": "^18", "react-dom": "^18", "react-icons": "^5.0.1", diff --git a/public/in-the-zone-2/InTheZone2_2.zwo b/public/in-the-zone-2/InTheZone2_2.zwo index e9ec98e..b1ab21d 100644 --- a/public/in-the-zone-2/InTheZone2_2.zwo +++ b/public/in-the-zone-2/InTheZone2_2.zwo @@ -1,42 +1,84 @@ - Copilot AI - AI-Generated Zone 2 Workout - This is a 2-hour Zone 2 focused indoor cycling workout, designed by AI to help you improve your endurance and aerobic capacity. + DZR + In The Zone 2 #2 + In The Zone 2 #2 is designed to improve your cardiovascular endurance and build a strong foundation for higher intensity training. It features multiple intervals of sustained moderate effort (Zone 2) interspersed with recovery periods and short bursts of high intensity. bike + + + + - - - + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - \ No newline at end of file + diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index a993b8d..0000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -Flask==3.0.3 \ No newline at end of file