Commit 4e31e671 authored by Jason Fox's avatar Jason Fox
Browse files

Add mobile footer

parent 6e71c2ab
Loading
Loading
Loading
Loading
+24 −8
Original line number Diff line number Diff line
@@ -245,25 +245,37 @@ flex-item:has(#TOC):after {

@media screen and (max-width: 600px) {
  .mobile-nav {
    background-color: #02488d;
     display: block;
     left: -10%;
     width: 120%;
     padding-top: 0.3em;
     padding-bottom: 0.3em;
     z-index: 100;
  }

  .mobile-nav.header {
    background-color: #02488d;
    
    font-size: 2em;
    font-family: "Maven Pro";
    display: block;
    left: -10%;
    position: absolute;
    top: 0px;   
    width: 120%;
    font-weight: 700;
    border-bottom: 1px white solid;
  }

  .mobile-nav a {
  .mobile-nav.footer {
    border-top: 1px white solid;
    background-color: #3e484f;
    position: relative;
    height: 30px;
  }
  
  .mobile-nav.header a {
    color: rgb(255, 255, 255);
    display: block;
    width: 90%;
    padding-left: 10%;
    display: block;
  }

  body {
@@ -272,6 +284,10 @@ flex-item:has(#TOC):after {
    max-width: 100% !important;
  }

  #editor {
    padding: 0 2rem 0 2rem;
  }

  #editor h1 {
    padding-top: 3.4em;
  }
+8 −4
Original line number Diff line number Diff line
@@ -18,15 +18,19 @@ files_with_references = [normative_file, informative_file]


def add_mobile_header(soup: BeautifulSoup,  document_title: str):
    h1 = soup.find("div", id="editor").find("h1")
    editor = soup.find("div", id="editor")
    h1 = editor.find("h1")

    if h1: 
        div = soup.new_tag("div", attrs={"class": "mobile-nav"})
        head_div = soup.new_tag("div", attrs={"class": "mobile-nav header"})

        link = soup.new_tag("a", href=".")
        link.string = document_title
        div.append(link)
        h1.insert_before(div)
        head_div.append(link)
        h1.insert_before(head_div)

        foot_div = soup.new_tag("div", attrs={"class": "mobile-nav footer"})
        editor.insert_after(foot_div)

    return soup