No more building CSS
This commit is contained in:
@ -1,51 +1,51 @@
|
||||
{{define "cardlinks"}}
|
||||
<div class="card card-compact w-64 bg-secondary shadow-xl">
|
||||
<div class="card-body text-base-100 flex flex-col">
|
||||
<h2 class="card-title text-base-100">{{.Name}}</h2>
|
||||
<div class="project-card">
|
||||
<div class="project-card-content">
|
||||
<h2 class="project-card-title">{{.Name}}</h2>
|
||||
|
||||
{{if .Description}}
|
||||
<p>{{.Description}}</p>
|
||||
<p class="project-card-description">{{.Description}}</p>
|
||||
{{end}}
|
||||
|
||||
{{if .Date}}
|
||||
<p>
|
||||
<p class="project-card-date">
|
||||
<div class="flex flex-row flex-wrap items-center gap-1 text-md">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-clock-4"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-clock-4"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
|
||||
{{.Date}}
|
||||
</div>
|
||||
</p>
|
||||
{{end}}
|
||||
|
||||
{{if .Tags}}
|
||||
<div class="flex flex-row flex-wrap text-center items-center justify-center gap-1">
|
||||
<div class="project-card-tags">
|
||||
{{range .Tags}}
|
||||
<div class="badge badge-accent">#{{.}}</div>
|
||||
<span class="project-tag">#{{.}}</span>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if .Href}}
|
||||
<div class="card-actions justify-end">
|
||||
<div class="project-card-link">
|
||||
{{if eq true .Internal}}
|
||||
<a
|
||||
role="button"
|
||||
href={{.Href}}
|
||||
aria-label={{.Name}}
|
||||
class="btn btn-circle btn-base-100 btn-outline"
|
||||
class="project-link-button"
|
||||
preload="mouseover"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-right"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-right"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>
|
||||
</a>
|
||||
{{else}}
|
||||
<a
|
||||
role="button"
|
||||
href={{.Href}}
|
||||
aria-label={{.Name}}
|
||||
class="btn btn-circle btn-base-100 btn-outline"
|
||||
class="project-link-button"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
|
@ -1,21 +1,49 @@
|
||||
{{define "header"}}
|
||||
<header class="navbar bg-base-100">
|
||||
<header class="navbar">
|
||||
<div class="navbar-start">
|
||||
<a class="btn btn-ghost normal-case text-lg sm:text-xl text-white" href="/">{{template "navcontent".}}</a>
|
||||
<a class="btn btn-ghost normal-case text-xl" href="/">{{template "navcontent".}}</a>
|
||||
</div>
|
||||
<div class="navbar-end z-50">
|
||||
<div class="navbar-end">
|
||||
<div class="dropdown dropdown-end">
|
||||
<label tabindex="0" class="btn btn-sm btn-ghost text-white">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-menu"><line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/></svg>
|
||||
<label tabindex="0" class="btn btn-ghost" id="navbar-toggle">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="menu-icon"><line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/></svg>
|
||||
</label>
|
||||
<ul
|
||||
tabindex="0"
|
||||
class="menu menu-sm dropdown-content gap-2 mt-3 p-2 shadow-md bg-base-100 rounded-box"
|
||||
preload="mouseover"
|
||||
class="menu dropdown-content mt-3 shadow-md rounded-box z-50 nav-menu"
|
||||
id="nav-menu"
|
||||
>
|
||||
{{template "navitems" .}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const navbarToggle = document.getElementById('navbar-toggle');
|
||||
const navMenu = document.getElementById('nav-menu');
|
||||
|
||||
// Toggle menu on hamburger click
|
||||
navbarToggle.addEventListener('click', function(e) {
|
||||
e.stopPropagation();
|
||||
navMenu.classList.toggle('show');
|
||||
});
|
||||
|
||||
// Close menu when clicking outside
|
||||
document.addEventListener('click', function(e) {
|
||||
if (!navMenu.contains(e.target) && !navbarToggle.contains(e.target)) {
|
||||
navMenu.classList.remove('show');
|
||||
}
|
||||
});
|
||||
|
||||
// Close menu when clicking on a menu item
|
||||
const menuItems = navMenu.querySelectorAll('a');
|
||||
menuItems.forEach(item => {
|
||||
item.addEventListener('click', function() {
|
||||
navMenu.classList.remove('show');
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{{define "iconlinks"}}
|
||||
<a class="fill-white hover:fill-pink-500" href={{.Href}} target="_blank" rel="me" aria-label={{.Name}}>
|
||||
<a class="icon-link" href={{.Href}} target="_blank" rel="me" aria-label={{.Name}}>
|
||||
{{.Icon}}
|
||||
</a>
|
||||
{{end}}
|
@ -1,20 +1,8 @@
|
||||
{{define "navitems"}}
|
||||
<li>
|
||||
<a class="no-underline" href="/"> Home </a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="no-underline" href="/projects"> Projects </a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="no-underline" href="/papers"> Papers </a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="no-underline" href="/talks"> Talks </a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="no-underline" href="/posts"> Posts </a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="no-underline" href="/tools"> Tools </a>
|
||||
</li>
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/projects">Projects</a></li>
|
||||
<li><a href="/papers">Papers</a></li>
|
||||
<li><a href="/talks">Talks</a></li>
|
||||
<li><a href="/posts">Posts</a></li>
|
||||
<li><a href="/tools">Tools</a></li>
|
||||
{{end}}
|
||||
|
Reference in New Issue
Block a user