Browse Source

sept23

master
Xsivax 3 years ago
parent
commit
0b8966a889
10 changed files with 134 additions and 3102 deletions
  1. +0
    -1
      Cargo.toml
  2. +4
    -4
      src/build_rocket/get.rs
  3. +15
    -5
      src/build_rocket/templates.rs
  4. +1
    -1
      src/main.rs
  5. +0
    -107
      templates/assets/css/home.css
  6. +83
    -2942
      templates/assets/css/index.css
  7. +4
    -4
      templates/assets/css/navigation.css
  8. +6
    -18
      templates/assets/js/main.js
  9. +0
    -20
      templates/home.html.tera
  10. +21
    -0
      templates/index_de.html.tera

+ 0
- 1
Cargo.toml View File

@ -13,7 +13,6 @@ default-features = false
serde = "1.0.130" serde = "1.0.130"
serde_json = "1.0.67" serde_json = "1.0.67"
lazy_static = "1.4.0" lazy_static = "1.4.0"
askama_rocket = "0.10.0"
[dependencies.rocket_dyn_templates] [dependencies.rocket_dyn_templates]
version = "0.1.0-rc.1" version = "0.1.0-rc.1"

+ 4
- 4
src/build_rocket/get.rs View File

@ -12,11 +12,11 @@ use rocket_dyn_templates::Template;
// generate routes, set attributes // generate routes, set attributes
// set http method // set http method
// set uri // set uri
#[get("/")]
#[get("/de")]
// if success call handler // 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) // serve other pages (html GET)

+ 15
- 5
src/build_rocket/templates.rs View File

@ -1,17 +1,27 @@
use rocket::serde::Serialize; use rocket::serde::Serialize;
// context Template index
use serde_json::Value;
use serde_json::json;
// context Template index
#[derive(Serialize)] #[derive(Serialize)]
pub struct TplIndex {
pub struct TplIndexDe {
pub title: String, 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"), title: String::from("Cannabinieri CBD"),
// how to include several objects ?
hemp : json!({"de" : "Uns interessieren Informationen. "}),
} }
} }
} }
// context privacy-policy // context privacy-policy

+ 1
- 1
src/main.rs View File

@ -26,7 +26,7 @@ async fn main() -> Result<(), rocket::Error> {
// catch errors // catch errors
.mount("/", .mount("/",
routes![ 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 ]) get::hemp, get::spider, get::permapp, get::cyber, get::offgrid, get::about, get::meet, get::privacy ])
.mount("/hemp", .mount("/hemp",
routes! [ get::oil, get::flower]) routes! [ get::oil, get::flower])

+ 0
- 107
templates/assets/css/home.css View File

@ -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;
}
}

+ 83
- 2942
templates/assets/css/index.css
File diff suppressed because it is too large
View File


+ 4
- 4
templates/assets/css/navigation.css View File

@ -115,16 +115,15 @@
transition: all .7 ease; transition: all .7 ease;
} }
#down_5 {
bottom: 24%;
max-height: 40vh !important;
#down_3 {
margin-top: 4rem;
} }
.desktop_navigation { .desktop_navigation {
display: none; display: none;
} }
@media (min-width:768px) {
@media (min-width: 992px) {
.main_bar { .main_bar {
z-index: 1; z-index: 1;
display: flex; display: flex;
@ -203,6 +202,7 @@
#broader { #broader {
min-width: 15vw; min-width: 15vw;
z-index: 1;
} }
.desktop_navigation ul li li { .desktop_navigation ul li li {

+ 6
- 18
templates/assets/js/main.js View File

@ -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() { document.getElementById("chevron_1").addEventListener("click", function menu() {
var x= document.getElementById("down_1"); 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() { document.getElementById("chevron_2").addEventListener("click", function menu() {
var x= document.getElementById("down_2"); 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() { document.getElementById("chevron_3").addEventListener("click", function menu() {
var x= document.getElementById("down_3"); 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") { if (x.style.display === "none") {
x.style.display = "flex";} x.style.display = "flex";}
else { else {

+ 0
- 20
templates/home.html.tera View File

@ -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
- 0
templates/index_de.html.tera View 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…
Cancel
Save