Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
style: New font, supports accents, locally stored (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanViknar authored Apr 13, 2024
1 parent fa25afa commit c5de76d
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 12 deletions.
9 changes: 9 additions & 0 deletions public/css/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ body {
font-family: 'Minecraft', sans-serif
}

/* Custom font */

@font-face {
font-family: 'Minecraft';
src: url("../fonts/MinecraftRegular-Bmg3.otf");
font-weight: normal;
font-style: normal;
}

.hidden {
display: none !important;
}
Expand Down
Binary file added public/fonts/MinecraftRegular-Bmg3.otf
Binary file not shown.
6 changes: 4 additions & 2 deletions public/js/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ async function getProducts(category) {
const container = document.getElementById("container")
for (let i = 0; i < jsonResponse.length; i++) {
const product = jsonResponse[i]
const product_name = product.name.charAt(0).toUpperCase() + product.name.slice(1)
const productCard =
`
<div class="product" onclick="showProduct(${product.id})">
<div class="imgbox">
<img src="/product/${product.icon}" alt="icon"/>
</div>
<label class="infproduct">${product.name}</label>
<label class="infproduct">${product_name}</label>
<label class="infproduct">${product.unit_price}€</label>
<label class="infproduct" id="amount_${product.id}">En stock: ${product.amount - (product.in_cart === "???" ? 0 : product.in_cart)}</label>
</div>
Expand Down Expand Up @@ -59,7 +60,8 @@ async function showProduct(id) {

details.hidden = false
icon.src = `/product/${product.icon}`
name.innerHTML = product.name
const product_name = product.name.charAt(0).toUpperCase() + product.name.slice(1)
name.innerHTML = product_name
price.innerHTML = `${product.unit_price}€`
available.innerHTML = product.amount
inCart.innerHTML = product.in_cart
Expand Down
4 changes: 2 additions & 2 deletions resources/views/about.blade.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<h1>A propos de HurrShop...</h1>
<p>Je n'ai pas ete assez imaginatif pour placer un placeholder drole ici, donc prenez ce message.</p>
<h1>À propos de HurrShop...</h1>
<p>Je n'ai pas été assez imaginatif pour placer un placeholder drôle ici, donc prenez ce message.</p>
3 changes: 2 additions & 1 deletion resources/views/admin_products.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ function loadCategoryProducts(category) {
product_table_list_container.innerHTML = "";
products.forEach(product => {
const product_name = product.name.charAt(0).toUpperCase() + product.name.slice(1)
product_table_list_container.innerHTML += `
<tr onclick="showProduct(${product.id})" class="product_row">
<td>${product.id}</td>
<td><img src="/product/${product.icon}" alt="icon" class="product_icon"/></td>
<td>${product.name}</td>
<td>${product_name}</td>
<td>${product.amount}</td>
<td>${product.unit_price}€</td>
</tr>
Expand Down
11 changes: 5 additions & 6 deletions resources/views/application.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<link rel="stylesheet" href="{{ asset('css/application.css') }}">
<script type="text/javascript" src="{{asset("js/app.js")}}"></script>
<script type="text/javascript" src="{{asset("js/util.js")}}"></script>
<link href="https://fonts.cdnfonts.com/css/minecraft-4" rel="stylesheet">

<!-- Style de la zone main -->
@if(file_exists(public_path("css/" . ($page_to_load ?? "error") . ".css")))
Expand All @@ -30,12 +29,12 @@
<ul id="product_list">
<h3>Produits</h3>
@foreach(\App\Models\Category::all()->sortBy('name') as $category)
<li><a href="/catalog?category={{$category->id}}"><img src="{{ asset("category/" . $category['icon']) }}" alt="{{$category->name}} category image"/>{{ Illuminate\Support\Str::ascii($category['name']) }}</a></li>
<li><a href="/catalog?category={{$category->id}}"><img src="{{ asset("category/" . $category['icon']) }}" alt="{{$category->name}} category image"/>{{ ucfirst($category['name']) }}</a></li>
@endforeach
</ul>
<hr>
<ul>
<li><a href="/about">A propos</a></li>
<li><a href="/about">À propos</a></li>
<li><a>FAQ</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
Expand All @@ -55,7 +54,7 @@
@auth
<a href="/profile">{{ Auth::user()->name }}</a>
-
<a href="/auth/logout">Se deconnecter</a>
<a href="/auth/logout">Se déconnecter</a>
@else
<a href="/login">Se connecter</a>
@endauth
Expand All @@ -82,12 +81,12 @@
<a>Plan du site</a>
</div>
<div class="footer_column">
<a href="/about">A propos</a>
<a href="/about">À propos</a>
<a href="/contact">Contact</a>
<a>FAQ</a>
</div>
<div class="footer_column">
<a href="https://minecraft.wiki/w/Villager">Reseaux sociaux</a>
<a href="https://minecraft.wiki/w/Villager">Réseaux sociaux</a>
</div>
<div class="footer_column">
<a class="emerald">Emerald.net</a>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/catalog.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</script>
<div class="box">
<div id="container">
<div id="title">Catalogue: {{$category_name}}</div>
<div id="title">Catalogue : {{ ucfirst($category_name) }}</div>
<hr/>
</div>
<div id="details" hidden>
Expand Down

0 comments on commit c5de76d

Please sign in to comment.