Selaa lähdekoodia

menu activeness and contentelement completnesses

dev01
Dominik Schmidt-Philipp 4 vuotta sitten
vanhempi
commit
ccce692924
10 muutettua tiedostoa jossa 149 lisäystä ja 21 poistoa
  1. +1
    -1
      app/modules/filesinfolders.php
  2. +3
    -0
      app/views/header.htm
  3. +5
    -3
      app/views/navigation.htm
  4. +1
    -3
      app/views/tpl/index.html
  5. +16
    -11
      index.php
  6. +17
    -0
      rsc/sass/_design.scss
  7. +8
    -1
      rsc/sass/_freaCMSfeatures.scss
  8. +46
    -1
      rsc/sass/_structure.scss
  9. +51
    -0
      rsc/style.css
  10. +1
    -1
      rsc/style.css.map

+ 1
- 1
app/modules/filesinfolders.php Näytä tiedosto

@@ -508,7 +508,7 @@ class FilesInFolders {
break;
case 'devide':
$new = "<div>";
$new = '<div class="content_element_devided">';
$contents = explode($request[1],implode("\n",$body));
$counter=0;
foreach($contents as $part) {

+ 3
- 0
app/views/header.htm Näytä tiedosto

@@ -3,4 +3,7 @@
<img class="logo" src="{{@RESOURCES}}img/logo.png" />
</check>
<h1><img class="text" src="/{{ @banner }}" alt="{{ @title }}" /></h1>
<nav id="languages">
<include href="navigation.htm" with="menu={{ @navi.languages }}" />
</nav>
</a>

+ 5
- 3
app/views/navigation.htm Näytä tiedosto

@@ -1,15 +1,17 @@
<ul>
<ul class="nav level{{ @level }}">
<repeat group="{{ @menu }}" key="{{ @key }}" value="{{ @item }}">
<li><a href="{{ @item.href }}" >{{ @item.name }}</a>
<li class="{{ @item.class }}"><a href="{{ @item.href }}">{{ @item.name }}</a>
<check if="{{ is_array(@item.submenu) }}">
<include href="navigation.htm" with="menu={{ @item.submenu }}" />
<include href="navigation.htm" with="menu={{ @item.submenu }},level={{ @level + 1 }}" />
</check>
</li>

</repeat>
</ul>



<check if="{{ false }}">
<ul>
<repeat group="{{ @menu }}" key="{{ @key }}" value="{{ @item }}">

+ 1
- 3
app/views/tpl/index.html Näytä tiedosto

@@ -58,9 +58,7 @@
<nav>
<include href="navigation.htm" with="menu={{ @navi.footer }}" />
</nav>
<nav id="languages">
<include href="navigation.htm" with="menu={{ @navi.languages }}" />
</nav>
</footer>

</div> <!-- #page-wrap -->

+ 16
- 11
index.php Näytä tiedosto

@@ -55,17 +55,20 @@ $f3->set('CONTENT', $content_dir);

function menu_recursion($m,$root="") {
$f3 = \Base::instance();
//$url = explode("/", $f3->get('url'));
$out=[];
foreach ($m as $key=>$value) {
$folder = $key == "index" ? "" : "/".$key;
$path = $root.$folder;

if (is_array($value)) {
# submenu
$submenu=menu_recursion($value,$path);
$out[$path]=$submenu[$path];
unset($submenu[$path]);
$out[$path]['submenu']=$submenu;
} else {
$class="";
$ex = explode(":=", $value);
if (count($ex) > 1) {
# external link
@@ -73,11 +76,11 @@ function menu_recursion($m,$root="") {
} else {
# internal link
$href = $f3->get('SITE_URL').$path;
$class .= in_array($path,$f3->get('url')) ? ' active' : ' away';
}
$out[$path]['name']=$ex[0];
$out[$path]['href']=$href;
//print($path." - ".$ex[0]." - ".$href."<br>");
$out[$path]['class']=$class;
}
}
return $out;
@@ -92,26 +95,28 @@ function read_menu($menu_name) {
}

if (is_array($menu)) {
//var_dump($menu);
//print("<br>");
$menu=menu_recursion($menu);
}

$f3->set('navi.'.$menu_name, $menu);
//var_dump($f3->get('navi.'.$menu_name));
//print("<br>");
}

// this is needed so the menu can compare the current page with a link to it
// and use this information to determine the active state
$tmp_url = substr($_SERVER['REQUEST_URI'],1);
$url=substr($tmp_url,0,(strpos($tmp_url,'?') === false) ? 999 : strpos($tmp_url,'?'));
$url_ex=explode('/',$url);
$url=array();
for ($i=1;$i<=count($url_ex);$i++) {
$url[]="/".implode("/",array_slice($url_ex,0,$i));
}
$f3->set('url', $url);
$f3->set('level', 1); // this is for templates, to be abl to count nesting
read_menu("main");
read_menu("footer");
read_menu("network");
read_menu("languages");

// this is needed so the menu can compare the current page with a link to it
// and use this information to determine the active state
$tmp_url = substr($_SERVER['REQUEST_URI'],strlen($f3->get('SITE_URL'))+1);
$url=substr($tmp_url,0,(strpos($tmp_url,'?') === false) ? 999 : strpos($tmp_url,'?'));
$f3->set('url', explode("/", $url));


///////////////////////////////////

+ 17
- 0
rsc/sass/_design.scss Näytä tiedosto

@@ -4,3 +4,20 @@ a {
text-decoration: underline;
}
}

ul.nav {
list-style: none;
li { margin:0; }
.active>a {
font-weight: bold;
}
}

#main-nav {
background: #eec;
border-radius:1.2em 1.2em 0 0;
ul { padding-left: 1.5em; }
.level1>li,.level2>li { margin-top: 1em; }
}

+ 8
- 1
rsc/sass/_freaCMSfeatures.scss Näytä tiedosto

@@ -36,7 +36,14 @@ a.content_element_box {
.content_elment_box_body {
display: none;
}


// devided
.content_element_devided {
display: grid;
grid-template-columns:50% 50%;
}

// lightbox -----------------------

.featherlight .featherlight-content {

+ 46
- 1
rsc/sass/_structure.scss Näytä tiedosto

@@ -3,7 +3,11 @@ body,h1,h2,h3,h4,h5,h6,ul {
// margin:0;
// padding:0;
}

html,body {
height:100%;
margin:0;
padding:0;
}



@@ -21,3 +25,44 @@ body,h1,h2,h3,h4,h5,h6,ul {
height:100px;
}
}

#page-wrap {
display: grid;
grid-template-columns:250px auto;
grid-template-rows:200px 100fr 3em;
height:100vh;
overflow: hidden;
max-width:1300px;
margin:0 auto;
>header {
grid-column:1 / -1;
}
#main-nav {
grid-column:1 / span 1;
grid-row:2 / -1;
}
#content {
grid-column: 2 / -1;
grid-row: 2 / 3;
overflow-y: auto;
}
#main-footer {
grid-column: 2 / -1;
grid-row: -2 / -1;
}
}


#main-nav {
.level2 .away ul {
display: none;
}
}

#content {
img {
max-width: 100%;
}
}

+ 51
- 0
rsc/style.css Näytä tiedosto

@@ -34,6 +34,10 @@ a.content_element_box div.content_element_box {
.content_elment_box_body {
display: none; }

.content_element_devided {
display: grid;
grid-template-columns: 50% 50%; }

.featherlight .featherlight-content {
background: none;
overflow: visible; }
@@ -86,6 +90,11 @@ a.content_element_box div.content_element_box {
#mobile-nav.open a.menu-toggle {
background-position: bottom; }

html, body {
height: 100%;
margin: 0;
padding: 0; }

.content_element_page.wall a.content_element_box {
float: left; }
.content_element_page.wall:after {
@@ -95,9 +104,51 @@ a.content_element_box div.content_element_box {
.content_element_page.wall div.content_element_box {
height: 100px; }

#page-wrap {
display: grid;
grid-template-columns: 250px auto;
grid-template-rows: 200px 100fr 3em;
height: 100vh;
overflow: hidden;
max-width: 1300px;
margin: 0 auto; }
#page-wrap > header {
grid-column: 1 / -1; }
#page-wrap #main-nav {
grid-column: 1 / span 1;
grid-row: 2 / -1; }
#page-wrap #content {
grid-column: 2 / -1;
grid-row: 2 / 3;
overflow-y: auto; }
#page-wrap #main-footer {
grid-column: 2 / -1;
grid-row: -2 / -1; }

#main-nav .level2 .away ul {
display: none; }

#content img {
max-width: 100%; }

a {
text-decoration: none; }
a:hover {
text-decoration: underline; }

ul.nav {
list-style: none; }
ul.nav li {
margin: 0; }
ul.nav .active > a {
font-weight: bold; }

#main-nav {
background: #eec;
border-radius: 1.2em 1.2em 0 0; }
#main-nav ul {
padding-left: 1.5em; }
#main-nav .level1 > li, #main-nav .level2 > li {
margin-top: 1em; }

/*# sourceMappingURL=style.css.map */

+ 1
- 1
rsc/style.css.map Näytä tiedosto

@@ -1,6 +1,6 @@
{
"version": 3,
"mappings": "AAUA,CAAE;EACE,UAAU,EAAC,UAAU;;ACJzB,IAAK;EACD,KAAK,EALH,IAAI;EAMN,UAAU,EARP,IAAI;;AAWX,CAAE;EACE,KAAK,EAVH,IAAI;;ACCN,4BAAO;EACC,OAAO,EAAE,IAAI;AAGjB,kCAAO;EACH,OAAO,EAAE,MAAM;AAEnB,qCAAU;EACN,OAAO,EAAE,IAAI;AAGrB,6CAAwB;EACpB,OAAO,EAAE,YAAY;EACrB,QAAQ,EAAE,QAAQ;EAClB,MAAM,EAAE,KAAK;EACb,MAAM,EAAC,GAAG;EAEV,oDAAO;IAAE,MAAM,EAAC,IAAI;EACpB,iDAAI;IACA,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,IAAI;EAEf,sD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,UAAU;IACtB,QAAQ,EAAC,MAAM;EAGnB,mBAAS;IACL,WAAW,EAAE,MAAM;IACnB,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,IAAI;EAEpB,uBAAa;IACT,WAAW,EAAE,MAAM;IACnB,QAAQ,EAAE,OAAO;;AAMrB,0BAAiB;EACb,OAAO,EAAE,IAAI;;AAKjB,YAAI;EACA,SAAS,EAAE,IAAI;;ACjEvB,CAAE;EACE,eAAe,EAAE,IAAI;EACrB,OAAQ;IACJ,eAAe,EAAE,SAAS;;AAIlC,MAAO;EACH,UAAU,EAAE,IAAI;EAEhB,SAAG;IAAE,MAAM,EAAC,CAAC;EACb,kBAAU;IACN,WAAW,EAAE,IAAI;;AAIzB,SAAU;EACN,UAAU,EAAE,IAAI;EAChB,aAAa,EAAC,eAAe;EAE7B,YAAG;IAAE,YAAY,EAAE,KAAK;EACxB,8CAAsB;IAAE,UAAU,EAAE,GAAG",
"sources": ["sass/main.scss","sass/_colours.scss","sass/_freaCMSfeatures.scss","sass/_structure.scss","sass/_design.scss"],
"names": [],
"file": "style.css"

Loading…
Peruuta
Tallenna