From aa416d8065de36e7c6859b99e7af2005b1fab858 Mon Sep 17 00:00:00 2001 From: asimon-1 <40246417+asimon-1@users.noreply.github.com> Date: Tue, 10 May 2022 21:45:24 -0400 Subject: [PATCH] Menu fixes (#347) * Menu style nits * Avoid creating junk folders --- src/common/menu.rs | 9 +++------ src/static/css/training_modpack.css | 12 +++--------- src/templates/menu.html | 2 +- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/common/menu.rs b/src/common/menu.rs index 8448316..e71a98e 100644 --- a/src/common/menu.rs +++ b/src/common/menu.rs @@ -1,7 +1,6 @@ use crate::common::consts::get_menu_from_url; use crate::common::*; use crate::events::{Event, EVENT_QUEUE}; -use crate::mkdir; use crate::training::frame_counter; use ramhorns::Template; use skyline::info::get_program_id; @@ -58,13 +57,11 @@ pub unsafe fn write_menu() { // From skyline-web let program_id = get_program_id(); let htdocs_dir = "training_modpack"; - let menu_dir_path = Path::new("sd:/atmosphere/contents") + let menu_html_path = Path::new("sd:/atmosphere/contents") .join(&format!("{:016X}", program_id)) - .join(&format!("manual_html/html-document/{}.htdocs/", htdocs_dir)); + .join(&format!("manual_html/html-document/{}.htdocs/", htdocs_dir)) + .join("training_menu.html"); - let menu_html_path = menu_dir_path.join("training_menu.html"); - - mkdir(menu_dir_path.to_str().unwrap().as_bytes().as_ptr(), 777); let write_resp = fs::write(menu_html_path, data); if write_resp.is_err() { println!("Error!: {}", write_resp.err().unwrap()); diff --git a/src/static/css/training_modpack.css b/src/static/css/training_modpack.css index 46286ae..0fd91c1 100644 --- a/src/static/css/training_modpack.css +++ b/src/static/css/training_modpack.css @@ -68,10 +68,9 @@ } .tab-content { - width: 100%; display: flex; flex-wrap: wrap; - justify-content: space-evenly; + margin-left: 3%; /* Workaround for "centering" menu items since justify-content: center doesn't work */ } body { @@ -80,13 +79,7 @@ body { margin: 0; } -/* Overwrite padding from keyword stuff. */ -.l-main-content { - padding: 0px 0px 0px; -} - -/* Handle alignment of items in the header */ -.l-header { +.header { display: flex; justify-content: space-between; position: relative; @@ -190,6 +183,7 @@ body { /* Container div for menu link and menu list */ width: 30%; margin: 6px; + padding: 0px 8px 0px 8px; } .menu-button, .menu-item > div button { diff --git a/src/templates/menu.html b/src/templates/menu.html index 4041aa8..a4ab42f 100644 --- a/src/templates/menu.html +++ b/src/templates/menu.html @@ -10,7 +10,7 @@ -