Add artist website and portfolio files with LFS
This commit is contained in:
55
artist-website/src-tauri/src/main.rs
Normal file
55
artist-website/src-tauri/src/main.rs
Normal file
@@ -0,0 +1,55 @@
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
use serde::Serialize;
|
||||
use tauri::Builder;
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct PortfolioItem {
|
||||
pub id: u32,
|
||||
pub title: String,
|
||||
pub description: String,
|
||||
pub media_type: String,
|
||||
pub media_path: String,
|
||||
pub year: String,
|
||||
pub tags: Vec<String>,
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn get_portfolio_items() -> Vec<PortfolioItem> {
|
||||
vec![
|
||||
PortfolioItem {
|
||||
id: 1,
|
||||
title: "雕塑作品一".to_string(),
|
||||
description: "探索形體與空間的對話".to_string(),
|
||||
media_type: "image".to_string(),
|
||||
media_path: "assets/images/work1.jpg".to_string(),
|
||||
year: "2024".to_string(),
|
||||
tags: vec!["雕塑".to_string()],
|
||||
},
|
||||
PortfolioItem {
|
||||
id: 2,
|
||||
title: "材料實驗系列".to_string(),
|
||||
description: "探索不同媒材的可能性".to_string(),
|
||||
media_type: "image".to_string(),
|
||||
media_path: "assets/images/work2.jpg".to_string(),
|
||||
year: "2024".to_string(),
|
||||
tags: vec!["雕塑".to_string(), "材料".to_string()],
|
||||
},
|
||||
PortfolioItem {
|
||||
id: 3,
|
||||
title: "創作過程記錄".to_string(),
|
||||
description: "雕塑創作過程記錄影片".to_string(),
|
||||
media_type: "video".to_string(),
|
||||
media_path: "assets/videos/work1.mp4".to_string(),
|
||||
year: "2024".to_string(),
|
||||
tags: vec!["過程".to_string(), "影片".to_string()],
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
fn main() {
|
||||
Builder::default()
|
||||
.invoke_handler(tauri::generate_handler![get_portfolio_items])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
Reference in New Issue
Block a user