sept23
This commit is contained in:
parent
2e66c3f236
commit
0b8966a889
10 changed files with 146 additions and 3114 deletions
|
@ -13,7 +13,6 @@ default-features = false
|
|||
serde = "1.0.130"
|
||||
serde_json = "1.0.67"
|
||||
lazy_static = "1.4.0"
|
||||
askama_rocket = "0.10.0"
|
||||
|
||||
[dependencies.rocket_dyn_templates]
|
||||
version = "0.1.0-rc.1"
|
||||
|
|
|
@ -12,11 +12,11 @@ use rocket_dyn_templates::Template;
|
|||
// generate routes, set attributes
|
||||
// set http method
|
||||
// set uri
|
||||
#[get("/")]
|
||||
#[get("/de")]
|
||||
// if success call handler
|
||||
pub fn index() -> Template {
|
||||
let context = templates::TplIndex::new();
|
||||
Template::render("home", &context)
|
||||
pub fn index_de() -> Template {
|
||||
let context = templates::TplIndexDe::new();
|
||||
Template::render("index_de", &context)
|
||||
}
|
||||
|
||||
// serve other pages (html GET)
|
||||
|
|
|
@ -1,17 +1,27 @@
|
|||
use rocket::serde::Serialize;
|
||||
|
||||
use serde_json::Value;
|
||||
use serde_json::json;
|
||||
|
||||
|
||||
// context Template index
|
||||
#[derive(Serialize)]
|
||||
pub struct TplIndex {
|
||||
pub struct TplIndexDe {
|
||||
pub title: String,
|
||||
pub hemp: Value,
|
||||
}
|
||||
|
||||
impl TplIndex {
|
||||
pub fn new() -> TplIndex {
|
||||
TplIndex {
|
||||
// (prototype languages)
|
||||
impl TplIndexDe {
|
||||
pub fn new() -> TplIndexDe {
|
||||
// transform to JSON value array/object
|
||||
TplIndexDe {
|
||||
title: String::from("Cannabinieri CBD"),
|
||||
// how to include several objects ?
|
||||
hemp : json!({"de" : "Uns interessieren Informationen. "}),
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// context privacy-policy
|
||||
|
|
|
@ -26,7 +26,7 @@ async fn main() -> Result<(), rocket::Error> {
|
|||
// catch errors
|
||||
.mount("/",
|
||||
routes![
|
||||
get::index, get_static_files::fileserver,
|
||||
get::index_de, get_static_files::fileserver,
|
||||
get::hemp, get::spider, get::permapp, get::cyber, get::offgrid, get::about, get::meet, get::privacy ])
|
||||
.mount("/hemp",
|
||||
routes! [ get::oil, get::flower])
|
||||
|
|
|
@ -1,107 +0,0 @@
|
|||
@font-face {
|
||||
font-family: 'Lato', sans-serif;
|
||||
src: url('fonts/Lato-Thin.ttf') format('truetype');
|
||||
font-style: normal;
|
||||
font-weight: 100;
|
||||
}
|
||||
|
||||
.content {
|
||||
height: 120vh !important;
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
.content .container {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-rows: repeat(8, 1fr);
|
||||
margin-top: .2rem;
|
||||
font-family: 'Lato', sans-serif;;
|
||||
}
|
||||
|
||||
.container img {
|
||||
height: 100%;
|
||||
z-index: 0;
|
||||
max-width: 100vw;
|
||||
grid-column: 1/3;
|
||||
grid-row: 1/9;
|
||||
justify-self: center;
|
||||
}
|
||||
|
||||
.link button {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
border-radius: 50%;
|
||||
border: .1rem solid hsl(300, 100%, 50%);
|
||||
background-color: hsl(300, 100%, 50%);
|
||||
transition: all .5s ease-in-out;
|
||||
}
|
||||
|
||||
#hemp button:active {
|
||||
box-shadow: 0px 0px 10px hsl(300, 100%, 30%);
|
||||
}
|
||||
|
||||
.link button a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
font-size: 1.25rem;
|
||||
transition: all .4s ease-in-out;
|
||||
}
|
||||
|
||||
.link button a:active {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.link h6 {
|
||||
text-transform: uppercase;
|
||||
font-size: .85rem;
|
||||
letter-spacing: .25rem;
|
||||
}
|
||||
|
||||
.link p {
|
||||
font-size: .65rem;
|
||||
text-align: center;
|
||||
background-color: #333;
|
||||
color: #eee;
|
||||
line-height: 2.25vh;
|
||||
}
|
||||
|
||||
#hemp {
|
||||
grid-column: 1/3;
|
||||
grid-row: 1;
|
||||
z-index: 2;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-template-rows: repeat(3, 1fr)
|
||||
}
|
||||
|
||||
#hemp button {
|
||||
grid-column: 2;
|
||||
grid-row: 2;
|
||||
justify-self: start;
|
||||
align-self: end;
|
||||
margin-left: 2.4rem;
|
||||
margin-bottom: .2rem;
|
||||
}
|
||||
|
||||
|
||||
#hemp h6 {
|
||||
grid-column: 1;
|
||||
grid-row: 1;
|
||||
justify-self: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#hemp p {
|
||||
grid-column: 1;
|
||||
grid-row: 2;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.content {
|
||||
height: 250vh !important;
|
||||
margin-top: 5rem;
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -115,16 +115,15 @@
|
|||
transition: all .7 ease;
|
||||
}
|
||||
|
||||
#down_5 {
|
||||
bottom: 24%;
|
||||
max-height: 40vh !important;
|
||||
#down_3 {
|
||||
margin-top: 4rem;
|
||||
}
|
||||
|
||||
.desktop_navigation {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (min-width:768px) {
|
||||
@media (min-width: 992px) {
|
||||
.main_bar {
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
|
@ -203,6 +202,7 @@
|
|||
|
||||
#broader {
|
||||
min-width: 15vw;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.desktop_navigation ul li li {
|
||||
|
|
|
@ -10,7 +10,7 @@ document.getElementById("icon").addEventListener("click", function menu() {
|
|||
}
|
||||
)
|
||||
|
||||
// show experiments submenu
|
||||
// show hemp submenu
|
||||
|
||||
document.getElementById("chevron_1").addEventListener("click", function menu() {
|
||||
var x= document.getElementById("down_1");
|
||||
|
@ -22,7 +22,7 @@ document.getElementById("chevron_1").addEventListener("click", function menu() {
|
|||
}
|
||||
)
|
||||
|
||||
// permaculture submenu
|
||||
// spider submenu
|
||||
|
||||
document.getElementById("chevron_2").addEventListener("click", function menu() {
|
||||
var x= document.getElementById("down_2");
|
||||
|
@ -34,7 +34,7 @@ document.getElementById("chevron_2").addEventListener("click", function menu() {
|
|||
}
|
||||
)
|
||||
|
||||
// greentech submenu
|
||||
// offgrid submenu
|
||||
|
||||
document.getElementById("chevron_3").addEventListener("click", function menu() {
|
||||
var x= document.getElementById("down_3");
|
||||
|
@ -46,22 +46,10 @@ document.getElementById("chevron_3").addEventListener("click", function menu() {
|
|||
}
|
||||
)
|
||||
|
||||
// spiderpi submenu
|
||||
// index
|
||||
|
||||
document.getElementById("chevron_4").addEventListener("click", function menu() {
|
||||
var x= document.getElementById("down_4");
|
||||
if (x.style.display === "none") {
|
||||
x.style.display = "flex";}
|
||||
else {
|
||||
x.style.display ="none";
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
// about submenu
|
||||
|
||||
document.getElementById("chevron_5").addEventListener("click", function menu() {
|
||||
var x= document.getElementById("down_5");
|
||||
document.getElementById("click").addEventListener("click", () => {
|
||||
var x = document.getElementById("show");
|
||||
if (x.style.display === "none") {
|
||||
x.style.display = "flex";}
|
||||
else {
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
{%extends "base"%}
|
||||
{%block title %}Cannabinieri CBD{%endblock title %}
|
||||
{%block head%}
|
||||
{{super()}}
|
||||
<link rel="stylesheet" type="text/css" href="css/home.css" />
|
||||
{%endblock head%}
|
||||
{{super()}}
|
||||
{%block content%}
|
||||
<div class="container">
|
||||
<img type="image/png" src="img/hero.png">
|
||||
<div class="link" id="hemp">
|
||||
<button>
|
||||
<a href="/hemp">i</a>
|
||||
</button>
|
||||
<h6>Hanf</h6>
|
||||
<p>We experiment with hemp <br>to understand our ecosystem <br>and produce 100% organic<br> CBD oils and flower</p>
|
||||
</div>
|
||||
</div>
|
||||
{%endblock content%}
|
||||
|
21
templates/index_de.html.tera
Normal file
21
templates/index_de.html.tera
Normal file
|
@ -0,0 +1,21 @@
|
|||
{%extends "base"%}
|
||||
{%block title %}Cannabinieri CBD{%endblock title %}
|
||||
{%block head%}
|
||||
{{super()}}
|
||||
<link rel="stylesheet" type="text/css" href="css/index.css" />
|
||||
{%endblock head%}
|
||||
{{super()}}
|
||||
{%block content%}
|
||||
<div class="container">
|
||||
<img type="image/png" src="img/hero.png">
|
||||
<div class="link" id="hemp">
|
||||
<button id="click">
|
||||
<a href="#">i</a>
|
||||
</button>
|
||||
<div class ="sub_container" id ="show">
|
||||
<p>{{ hemp["de"] }}<br><b>Hanf </b>ist unglaublich vielseitig.<br> Deshalb bauen wir ihn an. <br>Konsequent biologisch.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{%endblock content%}
|
||||
|
Loading…
Reference in a new issue