1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-28 17:29:36 +02:00

Update AdventureCard component to remove commented out code and add exportData function to log page

This commit is contained in:
Sean Morley 2024-04-14 23:47:05 +00:00
parent 6aca3d72b0
commit 1710c5b54d
3 changed files with 237 additions and 226 deletions

View file

@ -1,221 +1,226 @@
INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
VALUES
('US-AL', 'Alabama', 'us', '{
"name": "Alabama",
"abbreviation": "AL",
"description": "Alabama is a state located in the southeastern region of the United States. Known for its rich history, including its role in the American Civil War and the Civil Rights Movement, Alabama offers a diverse landscape of mountains, plains, and coastal areas. The state boasts a humid subtropical climate and is known for its strong tradition in college sports, particularly football. Alabama''s economy is diverse, with major industries including automotive manufacturing, agriculture, and aerospace. Tourists are drawn to Alabama''s natural beauty, historical sites, and cultural landmarks.",
"capital": "Montgomery",
"largest_city": "Birmingham",
"area": {
"total": 52420,
"units": "square miles"
},
"population": {
"estimate": 4903185,
"year": 2020
},
"state_flower": "Camellia",
"state_bird": "Yellowhammer",
"state_tree": "Southern Longleaf Pine",
"climate": {
"description": "Humid subtropical",
"summer_highs": "80-90°F",
"winter_lows": "30-50°F",
"precipitation": "Abundant throughout the year"
},
"economy": {
"industries": [
"Automotive Manufacturing",
"Agriculture",
"Mining",
"Technology",
"Aerospace"
],
"agricultural_products": [
"Poultry",
"Cotton",
"Peanuts",
"Soybeans",
"Corn"
]
},
"tourism": {
"attractions": [
"U.S. Space & Rocket Center",
"Gulf Shores and Orange Beach",
"Rosa Parks Museum",
"Civil Rights Institute",
"Little River Canyon National Preserve"
]
},
"major_sports_teams": [
"Alabama Crimson Tide (NCAA)",
"Auburn Tigers (NCAA)"
]
}'),
('US-AK', 'Alaska', 'us', '{
"name": "Alaska",
"abbreviation": "AK",
"description": "Alaska is the largest state in the United States by area, known for its rugged and breathtaking natural beauty. It is situated in the northwesternmost region of North America and is bordered by Canada to the east, the Arctic Ocean to the north, and the Pacific Ocean to the west and south. Alaska is renowned for its diverse wildlife, glaciers, and majestic mountains. The state is sparsely populated, with the majority of its residents living in and around Anchorage and Fairbanks. Alaska''s economy is heavily dependent on oil and gas production, as well as fishing, tourism, and mining.",
"capital": "Juneau",
"largest_city": "Anchorage",
"area": {
"total": 663267,
"units": "square miles"
},
"population": {
"estimate": 731158,
"year": 2020
},
"state_flower": "Forget-Me-Not",
"state_bird": "Willow Ptarmigan",
"state_tree": "Sitka Spruce",
"climate": {
"description": "Varies by region, with subarctic and arctic climates in the interior and north and more temperate maritime climates along the coast.",
"summer_highs": "50-70°F (varies by region)",
"winter_lows": "-40 to 20°F (varies by region)",
"precipitation": "Ranges from low in the interior to high along the coast"
},
"economy": {
"industries": [
"Oil and Gas",
"Fishing",
"Mining",
"Tourism",
"Forestry"
],
"agricultural_products": [
"Cattle",
"Hay",
"Vegetables",
"Barley",
"Dairy products"
]
},
"tourism": {
"attractions": [
"Denali National Park",
"Glacier Bay National Park",
"Kenai Fjords National Park",
"Sitka National Historical Park",
"Anchorage Museum"
]
},
"major_sports_teams": [
"Anchorage Wolverines (NAHL)",
"Alaska Aces (ECHL, formerly)"
]
}
'),
('US-AZ', 'Arizona', 'us', '{
"name": "Arizona",
"abbreviation": "AZ",
"description": "Arizona is a state located in the southwestern region of the United States, known for its dramatic desert landscapes and vibrant history. The state is home to iconic landmarks such as the Grand Canyon and Monument Valley. Arizona''s diverse geography includes mountain ranges, forests, and high plateaus. The state has a warm desert climate in the southern and central areas and cooler mountain climates in the northern region. Arizona''s economy is driven by industries such as healthcare, technology, manufacturing, and tourism.",
"capital": "Phoenix",
"largest_city": "Phoenix",
"area": {
"total": 113990,
"units": "square miles"
},
"population": {
"estimate": 7151502,
"year": 2020
},
"state_flower": "Saguaro Cactus Blossom",
"state_bird": "Cactus Wren",
"state_tree": "Palo Verde",
"climate": {
"description": "Mostly arid and semi-arid, with desert climates in the southern and central regions and temperate climates in the north.",
"summer_highs": "85-120°F (varies by region)",
"winter_lows": "30-60°F (varies by region)",
"precipitation": "Low in most areas, with higher amounts in mountain regions"
},
"economy": {
"industries": [
"Healthcare",
"Technology",
"Manufacturing",
"Tourism",
"Agriculture"
],
"agricultural_products": [
"Cattle",
"Dairy",
"Lettuce",
"Cotton",
"Alfalfa"
]
},
"tourism": {
"attractions": [
"Grand Canyon National Park",
"Sedona",
"Monument Valley",
"Saguaro National Park",
"Petrified Forest National Park"
]
},
"major_sports_teams": [
"Arizona Cardinals (NFL)",
"Phoenix Suns (NBA)",
"Arizona Diamondbacks (MLB)",
"Arizona Coyotes (NHL)"
]
}
'),
('US-AR', 'Arkansas', 'us', '{
"name": "Arkansas",
"abbreviation": "AR",
"description": "Arkansas is a state located in the southeastern region of the United States, known for its natural beauty and diverse landscapes that include mountains, forests, and rivers. The state is nicknamed ''The Natural State'' due to its abundant natural resources and outdoor recreational opportunities. Arkansas has a rich history and played a significant role during the American Civil War. The state''s economy is driven by agriculture, manufacturing, and tourism, with key agricultural products including rice, poultry, and soybeans.",
"capital": "Little Rock",
"largest_city": "Little Rock",
"area": {
"total": 53179,
"units": "square miles"
},
"population": {
"estimate": 3013756,
"year": 2020
},
"state_flower": "Apple Blossom",
"state_bird": "Northern Mockingbird",
"state_tree": "Pine",
"climate": {
"description": "Humid subtropical climate, with hot summers and mild winters.",
"summer_highs": "80-90°F",
"winter_lows": "20-40°F",
"precipitation": "High, especially in the spring"
},
"economy": {
"industries": [
"Agriculture",
"Manufacturing",
"Retail",
"Tourism",
"Education"
],
"agricultural_products": [
"Rice",
"Poultry",
"Soybeans",
"Cotton",
"Catfish"
]
},
"tourism": {
"attractions": [
"Hot Springs National Park",
"Buffalo National River",
"Crater of Diamonds State Park",
"Little Rock Central High School National Historic Site",
"Ozark National Forest"
]
},
"major_sports_teams": [
"Arkansas Razorbacks (NCAA)"
]
}
'),
-- INSERT INTO "worldTravelCountryRegions" (id, name, country_code)
-- VALUES
-- ('US-AL', 'Alabama', 'us', '{
-- "name": "Alabama",
-- "abbreviation": "AL",
-- "description": "Alabama is a state located in the southeastern region of the United States. Known for its rich history, including its role in the American Civil War and the Civil Rights Movement, Alabama offers a diverse landscape of mountains, plains, and coastal areas. The state boasts a humid subtropical climate and is known for its strong tradition in college sports, particularly football. Alabama''s economy is diverse, with major industries including automotive manufacturing, agriculture, and aerospace. Tourists are drawn to Alabama''s natural beauty, historical sites, and cultural landmarks.",
-- "capital": "Montgomery",
-- "largest_city": "Birmingham",
-- "area": {
-- "total": 52420,
-- "units": "square miles"
-- },
-- "population": {
-- "estimate": 4903185,
-- "year": 2020
-- },
-- "state_flower": "Camellia",
-- "state_bird": "Yellowhammer",
-- "state_tree": "Southern Longleaf Pine",
-- "climate": {
-- "description": "Humid subtropical",
-- "summer_highs": "80-90°F",
-- "winter_lows": "30-50°F",
-- "precipitation": "Abundant throughout the year"
-- },
-- "economy": {
-- "industries": [
-- "Automotive Manufacturing",
-- "Agriculture",
-- "Mining",
-- "Technology",
-- "Aerospace"
-- ],
-- "agricultural_products": [
-- "Poultry",
-- "Cotton",
-- "Peanuts",
-- "Soybeans",
-- "Corn"
-- ]
-- },
-- "tourism": {
-- "attractions": [
-- "U.S. Space & Rocket Center",
-- "Gulf Shores and Orange Beach",
-- "Rosa Parks Museum",
-- "Civil Rights Institute",
-- "Little River Canyon National Preserve"
-- ]
-- },
-- "major_sports_teams": [
-- "Alabama Crimson Tide (NCAA)",
-- "Auburn Tigers (NCAA)"
-- ]
-- }'),
-- ('US-AK', 'Alaska', 'us', '{
-- "name": "Alaska",
-- "abbreviation": "AK",
-- "description": "Alaska is the largest state in the United States by area, known for its rugged and breathtaking natural beauty. It is situated in the northwesternmost region of North America and is bordered by Canada to the east, the Arctic Ocean to the north, and the Pacific Ocean to the west and south. Alaska is renowned for its diverse wildlife, glaciers, and majestic mountains. The state is sparsely populated, with the majority of its residents living in and around Anchorage and Fairbanks. Alaska''s economy is heavily dependent on oil and gas production, as well as fishing, tourism, and mining.",
-- "capital": "Juneau",
-- "largest_city": "Anchorage",
-- "area": {
-- "total": 663267,
-- "units": "square miles"
-- },
-- "population": {
-- "estimate": 731158,
-- "year": 2020
-- },
-- "state_flower": "Forget-Me-Not",
-- "state_bird": "Willow Ptarmigan",
-- "state_tree": "Sitka Spruce",
-- "climate": {
-- "description": "Varies by region, with subarctic and arctic climates in the interior and north and more temperate maritime climates along the coast.",
-- "summer_highs": "50-70°F (varies by region)",
-- "winter_lows": "-40 to 20°F (varies by region)",
-- "precipitation": "Ranges from low in the interior to high along the coast"
-- },
-- "economy": {
-- "industries": [
-- "Oil and Gas",
-- "Fishing",
-- "Mining",
-- "Tourism",
-- "Forestry"
-- ],
-- "agricultural_products": [
-- "Cattle",
-- "Hay",
-- "Vegetables",
-- "Barley",
-- "Dairy products"
-- ]
-- },
-- "tourism": {
-- "attractions": [
-- "Denali National Park",
-- "Glacier Bay National Park",
-- "Kenai Fjords National Park",
-- "Sitka National Historical Park",
-- "Anchorage Museum"
-- ]
-- },
-- "major_sports_teams": [
-- "Anchorage Wolverines (NAHL)",
-- "Alaska Aces (ECHL, formerly)"
-- ]
-- }
-- '),
-- ('US-AZ', 'Arizona', 'us', '{
-- "name": "Arizona",
-- "abbreviation": "AZ",
-- "description": "Arizona is a state located in the southwestern region of the United States, known for its dramatic desert landscapes and vibrant history. The state is home to iconic landmarks such as the Grand Canyon and Monument Valley. Arizona''s diverse geography includes mountain ranges, forests, and high plateaus. The state has a warm desert climate in the southern and central areas and cooler mountain climates in the northern region. Arizona''s economy is driven by industries such as healthcare, technology, manufacturing, and tourism.",
-- "capital": "Phoenix",
-- "largest_city": "Phoenix",
-- "area": {
-- "total": 113990,
-- "units": "square miles"
-- },
-- "population": {
-- "estimate": 7151502,
-- "year": 2020
-- },
-- "state_flower": "Saguaro Cactus Blossom",
-- "state_bird": "Cactus Wren",
-- "state_tree": "Palo Verde",
-- "climate": {
-- "description": "Mostly arid and semi-arid, with desert climates in the southern and central regions and temperate climates in the north.",
-- "summer_highs": "85-120°F (varies by region)",
-- "winter_lows": "30-60°F (varies by region)",
-- "precipitation": "Low in most areas, with higher amounts in mountain regions"
-- },
-- "economy": {
-- "industries": [
-- "Healthcare",
-- "Technology",
-- "Manufacturing",
-- "Tourism",
-- "Agriculture"
-- ],
-- "agricultural_products": [
-- "Cattle",
-- "Dairy",
-- "Lettuce",
-- "Cotton",
-- "Alfalfa"
-- ]
-- },
-- "tourism": {
-- "attractions": [
-- "Grand Canyon National Park",
-- "Sedona",
-- "Monument Valley",
-- "Saguaro National Park",
-- "Petrified Forest National Park"
-- ]
-- },
-- "major_sports_teams": [
-- "Arizona Cardinals (NFL)",
-- "Phoenix Suns (NBA)",
-- "Arizona Diamondbacks (MLB)",
-- "Arizona Coyotes (NHL)"
-- ]
-- }
-- '),
-- ('US-AR', 'Arkansas', 'us', '{
-- "name": "Arkansas",
-- "abbreviation": "AR",
-- "description": "Arkansas is a state located in the southeastern region of the United States, known for its natural beauty and diverse landscapes that include mountains, forests, and rivers. The state is nicknamed ''The Natural State'' due to its abundant natural resources and outdoor recreational opportunities. Arkansas has a rich history and played a significant role during the American Civil War. The state''s economy is driven by agriculture, manufacturing, and tourism, with key agricultural products including rice, poultry, and soybeans.",
-- "capital": "Little Rock",
-- "largest_city": "Little Rock",
-- "area": {
-- "total": 53179,
-- "units": "square miles"
-- },
-- "population": {
-- "estimate": 3013756,
-- "year": 2020
-- },
-- "state_flower": "Apple Blossom",
-- "state_bird": "Northern Mockingbird",
-- "state_tree": "Pine",
-- "climate": {
-- "description": "Humid subtropical climate, with hot summers and mild winters.",
-- "summer_highs": "80-90°F",
-- "winter_lows": "20-40°F",
-- "precipitation": "High, especially in the spring"
-- },
-- "economy": {
-- "industries": [
-- "Agriculture",
-- "Manufacturing",
-- "Retail",
-- "Tourism",
-- "Education"
-- ],
-- "agricultural_products": [
-- "Rice",
-- "Poultry",
-- "Soybeans",
-- "Cotton",
-- "Catfish"
-- ]
-- },
-- "tourism": {
-- "attractions": [
-- "Hot Springs National Park",
-- "Buffalo National River",
-- "Crater of Diamonds State Park",
-- "Little Rock Central High School National Historic Site",
-- "Ozark National Forest"
-- ]
-- },
-- "major_sports_teams": [
-- "Arkansas Razorbacks (NCAA)"
-- ]
-- }
-- '),
INSERT INTO "worldTravelCountryRegions" (id, name, country_code) VALUES
('US-AL', 'Alabama', 'us'),
('US-AK', 'Alaska', 'us'),
('US-AZ', 'Arizona', 'us'),
('US-AR', 'Arkansas', 'us'),
('US-CA', 'California', 'us'),
('US-CO', 'Colorado', 'us'),
('US-CT', 'Connecticut', 'us'),

View file

@ -128,7 +128,7 @@
<h2 class="card-title overflow-ellipsis">{name}</h2>
<p>{regionId}</p>
<div class="card-actions justify-end">
<button class="btn btn-info" on:click={moreInfo}>More Info</button>
<!-- <button class="btn btn-info" on:click={moreInfo}>More Info</button> -->
{#if !visited}
<button class="btn btn-primary" on:click={markVisited}
>Mark Visited</button

View file

@ -6,7 +6,6 @@
import AdventureCard from "$lib/components/AdventureCard.svelte";
import type { Adventure } from "$lib/utils/types";
import { onMount } from "svelte";
import { exportData } from "../../services/export";
import exportFile from "$lib/assets/exportFile.svg";
import deleteIcon from "$lib/assets/deleteIcon.svg";
import SucessToast from "$lib/components/SucessToast.svelte";
@ -48,6 +47,18 @@
}, 3000);
}
function exportData() {
let jsonString = JSON.stringify(adventures);
let blob = new Blob([jsonString], { type: "application/json" });
let url = URL.createObjectURL(blob);
let link = document.createElement("a");
link.download = "data.json";
link.href = url;
link.click();
URL.revokeObjectURL(url);
}
const createNewAdventure = () => {
let currentDate = new Date();
let dateString = currentDate.toISOString().slice(0, 10); // Get date in "yyyy-mm-dd" format
@ -290,12 +301,7 @@
<div
class="flex flex-row items-center justify-center mt-2 gap-4 mb-4 flex-wrap"
>
<button
class="btn btn-neutral"
on:click={async () => {
window.location.href = exportData();
}}
>
<button class="btn btn-neutral" on:click={exportData}>
<img src={exportFile} class="inline-block -mt-1" alt="Logo" /> Save as File
</button>
<button class="btn btn-neutral" on:click={deleteData}>