css: CSS style is now decent (mobile menu still to fix)

git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@28 a672b425-5310-4d7a-af5c-997e18724b81
This commit is contained in:
Claudio Maggioni 2018-11-02 15:00:59 +00:00
parent 2fa51cd0ca
commit e6179c1569
9 changed files with 201 additions and 124 deletions

View file

@ -1,21 +1,19 @@
<footer> <footer>
<div> <div class="footer container">
<div class="head">INFO</div> <section class="author">
<div class="child"> <h3>INFO</h3>
Author: {{page.author}}<br> <strong>Author:</strong> {{ page.author }}<br>
<a href="/credits.html">Credits</a> <!-- TODO: talk about link formatting in footer --> <!-- TODO: talk about link formatting in footer -->
</div> <a href="/credits.html">Credits</a>
</div> </section>
<section>
<div> <h3>Other section</h3>
<div class="head">What was it again?</div> <a href="www.malusa.it">Other link</a>
<div class="child"> </section>
something<br>
something else
</div>
</div> </div>
<div class="copyright">
<div> <div class="container">
<img src="test"> <!-- TODO: replace with actual image and add metadata attr --> <i class="far fa-copyright"></i> Group 1, all rights reserved.
</div>
</div> </div>
</footer> </footer>

View file

@ -2,11 +2,15 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="{{ page.author }}">
<title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title> <title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}"> <meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
<!-- fonts -->
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet">
<link rel="stylesheet" href="{{ "/main.css" | prepend: site.baseurl | prepend: site.url }}"> <link rel="stylesheet" href="{{ "/main.css" | prepend: site.baseurl | prepend: site.url }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}"> <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.2/css/all.css" integrity="sha384-/rXc/GQVaYpyDdyxK+ecHPVYJSN9bmVFBvjA/9eOB+pb3F2w2N6fc5qB9Ew5yIns" crossorigin="anonymous">
</head> </head>

View file

@ -1,18 +1,22 @@
<header> <header>
<span><a href="" class="title">THE SHELL</a></span> <section class="desktop grow">
<span id="menuDesktop"> <h1 class="title">{{ site.title }}</h1>
<a href="">FILE SYSTEM</a> </section>
<a href="">BASIC</a>
<a href="">INTERMEDIATE</a> <section class="menu desktop">
<a href="">ADVANCED</a> <a href="">FILE SYSTEM</a>
<a href="">SCRIPTING</a> <a href="">BASIC</a>
</span> <a href="">INTERMEDIATE</a>
<a href="">ADVANCED</a>
<a href="">SCRIPTING</a>
</section>
<span id="menuTriggerMobile" onclick="triggerMenu(this)"> <span id="menuTriggerMobile" onclick="triggerMenu(this)">
<div class="strip1"></div> <div class="strip1"></div>
<div class="strip2"></div> <div class="strip2"></div>
<div class="strip3"></div> <div class="strip3"></div>
</span> </span>
<div id="menuMobile" style="margin-left:-100%;"> <div id="menuMobile" style="margin-left:-100%;">
<a class="menuItem selected" href="">FILE SYSTEM</a> <a class="menuItem selected" href="">FILE SYSTEM</a>
<a class="menuItem" href="">BASIC</a> <a class="menuItem" href="">BASIC</a>

View file

@ -1,16 +1,13 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
{% include head.html %} {% include head.html %}
<body> <body>
<header class="header"> <header class="header">
<section class="head container"> {% include header.html %}
<h1 class="title">{{ site.title }}</h1> </header>
</section> <main class="container">
{% include header.html %} {{ content }}
</header> </main>
<main class="container"> {% include footer.html %}
{{ content }} </body>
</main>
{% include footer.html %}
</body>
</html> </html>

View file

@ -1,38 +1,39 @@
/* Author: Marco Tereh */ /**
/* this file only concerns elements which are children of the <footer> */ * Author: Marco Tereh and Claudio Maggioni
* this file only concerns elements which are children of the <footer>
*/
footer{ footer {
background-color: grey; /* TODO: replace placeholder color and add text color */ background-color: #333;
overflow: auto; color: white;
text-align: left;
}
footer > div { .footer.container {
float: left; display: flex;
margin: 10px; flex-direction: row;
width: CALC(33% - 20px); padding: 1em;
} }
footer .head { section {
text-decoration: underline; flex-grow: 1;
} padding: .5rem;
footer .child { h3 {
margin-left: 5px; text-transform: uppercase;
} padding-bottom: .5em;
}
}
footer > div:nth-child(2){ .copyright {
text-align: center; background: #111;
width: 100%;
.child{ .container {
text-align: left; padding-top: 1em;
width: fit-content; padding-bottom: 1em;
margin: auto; }
}
section.author {
width: 30%;
} }
} }
footer div img {
height: 50px;
width: 50px;
margin-left: CALC(100% - 50px);
}

73
site/_sass/_global.scss Normal file
View file

@ -0,0 +1,73 @@
* {
margin: 0;
padding: 0;
z-index: 0;
}
body {
font-family: "Lato", sans-serif;
font-size: 16px;
display: flex;
flex-direction: column;
height: 100vh;
}
main {
text-align: justify;
flex-grow: 1;
}
.container {
max-width: 1000px;
width: calc(100% - 6em);
margin: auto;
padding-top: 2em;
padding-bottom: 2em;
}
a {
color: #6a6;
}
a:visited {
background: white;
}
main {
pre, section, p {
margin: 1em 0;
}
td.code pre, pre.lineno {
margin: 0;
}
pre {
overflow-x: auto;
}
pre, code {
font-family: "Source Code Pro", monospace;
}
pre code {
overflow-wrap: normal;
white-space: pre;
}
}
.rouge-table {
.gutter.gl {
border-right: 1px solid #555;
text-align: left;
padding-right: .5em;
}
.code {
padding-left: 1em;
}
}
ul, dl, ol {
margin-left: 2em;
}

View file

@ -1,35 +1,20 @@
/*------- GLOBAL ------*/ /*------- GLOBAL ------*/
*{ header {
margin:0; color: white;
padding:0; background-color: #000;
z-index:0; width: 100%;
display: flex;
flex-direction: row;
section.grow {
flex-grow: 1;
}
} }
body{ header .title {
font-size:16px; padding: 1em;
text-align:center; text-transform: uppercase;
}
a{
display:inline-block;
text-decoration:none;
color:#fff;
}
header{
background-color:#000;
}
span{
display:inline-block;
}
/* ------ HEADER -----*/
.title{
color:green;
padding: 20px 55px 20px 0;
} }
/*------- MENU ------*/ /*------- MENU ------*/
@ -42,34 +27,34 @@ span{
display:none; display:none;
} }
#menuDesktop{ header .menu.desktop {
float:right; background: #333;
text-align:right; display: flex;
padding:20px; justify-content: center;
font-size:2vh; align-items: center;
}
.menuItem{ a {
padding:10px 20px; text-decoration: none;
background-color:#000; text-transform: uppercase;
transition:500ms; font-weight: bold;
} line-height: 100%;
font-size: 1.15em;
padding: 0 1em;
}
.menuItem:hover{ a:hover {
background-color:#d2cfcf; color: #8e8;
color:#000; }
}
#menuDesktop .menuItem:hover{
transform:translateY(10px);
-webkit-transform:translateY(10px);
}
a:visited {
color: #6a6;
}
}
@media screen and (max-width: 800px) { @media screen and (max-width: 800px) {
#menuDesktop{ header .desktop, header .main.desktop {
display:none; display: none;
} }
#menuTriggerMobile{ #menuTriggerMobile{

View file

@ -1,5 +1,6 @@
--- ---
layout: main layout: main
author: Claudio Maggioni
--- ---
<section> <section>
@ -8,7 +9,20 @@ layout: main
<p>The ls command is used to list files</p> <p>The ls command is used to list files</p>
<ul> <ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Hello</li> <li>Hello</li>
</ul> </ul>
{% highlight ruby linenos %}
def show
puts "Outputting a very lo-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-ong lo-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-ong line"
@widget = Widget(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @widget }
end
end
{% endhighlight %}
</section> </section>

View file

@ -1,5 +1,6 @@
--- ---
--- ---
@import "global";
@import "header"; @import "header";
@import "footer"; @import "footer";
@import "syntax-highlighting"; @import "syntax-highlighting";