Skip to content

Commit

Permalink
Merge pull request #9 from Qwizi/new-components
Browse files Browse the repository at this point in the history
feat: added hero component
  • Loading branch information
Qwizi authored Nov 30, 2024
2 parents daced97 + 21ae1d9 commit dd3761e
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
47 changes: 47 additions & 0 deletions cotton_daisy/templates/hero.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<c-vars bg title center min_h_screen="True" overlay image_src image_alt="Image alternative text" bg_opacity="60"
center="True" reverse="False"/>

{% if overlay and image_src %}
<div
class="hero{% if min_h_screen %} min-h-screen{% endif %}"
style="background-image: url({{ image_src }});"
{{ attrs }}
>
<div class="hero-overlay bg-opacity-{{ bg_opacity }}"></div>
<div class="hero-content text-neutral-content text-center">
<div class="max-w-md">
{% if title %}
<h1 class="mb-5 text-5xl font-bold">{{ title }}</h1>
{% endif %}
{{ slot }}
</div>
</div>
</div>
{% else %}
<div class="hero bg-{{ bg }}{% if min_h_screen %} min-h-screen{% endif %}" {{ attrs }}>
{% if center is True %}
<div class="hero-content text-center">
{% else %}
{% if reverse %}
<div class="hero-content flex-col lg:flex-row-reverse">
{% else %}
<div class="hero-content flex-col lg:flex-row">
{% endif %}

{% if image_src %}
<img
src="{{ image_src }}"
class="max-w-sm rounded-lg shadow-2xl"
alt="{{ image_alt }}"
/>
{% endif %}
{% endif %}
<div class="{% if center is True%}max-w-md{% endif %}">
{% if title %}
<h1 class="text-5xl font-bold">{{ title }}</h1>
{% endif %}
{{ slot }}
</div>
</div>
</div>
{% endif %}
2 changes: 1 addition & 1 deletion cotton_daisy/templates/menu.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<c-vars bg="base-200" w="56" size title responsive horizontal/>

<ul class="menu{% if responsive is True %} menu-vertical lg:menu-horizontal{% endif %}{% if horizontal %} menu-horizontal{% if endif %} %} bg-{{ bg }} rounded-box w-{{ w }}{% if size %} menu-{{ size }}{% endif %}" {{ attrs }}>
<ul class="menu{% if responsive is True %} menu-vertical lg:menu-horizontal{% endif %}{% if horizontal %} menu-horizontal{% endif %} bg-{{ bg }} rounded-box w-{{ w }}{% if size %} menu-{{ size }}{% endif %}" {{ attrs }}>
{% if title %}
<li>
<h2 class="menu-title">{{ title }}</h2>
Expand Down
2 changes: 1 addition & 1 deletion cotton_daisy/templates/skeleton.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<c-vars h="32" w="32" rounded shrink/>

<div class="skeleton h-32 w-32{% if rounded %} rounded-{{ rounded }}{% endif %}{% if shrink %} shrink-{{ shrink }}{% endif %}"></div>
<div class="skeleton h-{{ h }} w-{{ w }}{% if rounded %} rounded-{{ rounded }}{% endif %}{% if shrink %} shrink-{{ shrink }}{% endif %}"></div>
2 changes: 1 addition & 1 deletion cotton_daisy/templates/toast.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<c-vars type title description position align/>

<div class="toas{% if position %} toast-{{ position }}{% endif %}{% if align %} toast-align{% endif %}">
<div class="toas{% if position %} toast-{{ position }}{% endif %}{% if align %} toast-{{ align }}{% endif %}" {{ attrs }}>
<c-alert type="{{ type }}" title="{{ title }}" description="{{ description }}"/>
</div>

0 comments on commit dd3761e

Please sign in to comment.