Skip to content

Commit 88a5912

Browse files
committed
Agregado dropdown nuevo elemento
1 parent a05e5d7 commit 88a5912

File tree

5 files changed

+83
-2
lines changed

5 files changed

+83
-2
lines changed

_data/games-dropdown-items.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- name: "Pi Memorizer"
2+
url: "https://agarnung.github.io/pi-memorizer/"
3+
- name: "Web Riddler"
4+
url: "https://web-riddler.vercel.app/"
5+

_includes/elements/dropdown.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% if site.production %}
2+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" />
3+
{% else %}
4+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" />
5+
{% endif %}
6+
7+
<span class="dropdown">
8+
<button class="btn btn-secondary dropdown-toggle" type="button" id="playGameDropdown" data-bs-toggle="dropdown" aria-expanded="false">
9+
Play a game!
10+
</button>
11+
<ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="playGameDropdown">
12+
{% for game in include.source %}
13+
<li><a class="dropdown-item" href="{{ game.url }}">{{ game.name }}</a></li>
14+
{% endfor %}
15+
</ul>
16+
</span>
17+
18+
{% if site.production %}
19+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
20+
{% else %}
21+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
22+
{% endif %}
23+

_includes/landing.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,17 @@ <h3 class="font-weight-bold">Hi! Welcome to my website</h3>
2424
<p>
2525
I am Alejandro, <span id="age"></span> years old. Here, you can take a look at my (personal) <a href="/projects">projects</a> (I have selected several that are available on my GitHub profile), <a href="/blog">blog</a> (where I document and share insights about computer vision, image processing, math, geometry, engineering, among other topics), <a href="/publications">publications</a> (a mix of informal, formal, and quasi-formal documents I find valuable for anyone interested in my fields), and, if you'd like to know more about me, <a href="/about">additional information</a>.
2626
</p>
27+
28+
{% include elements/dropdown.html
29+
id="playGameDropdown"
30+
label="Play a game!"
31+
menu_class="dropdown-menu-dark"
32+
source=site.data.games-dropdown-items
33+
%}
2734
</div>
2835
</section>
29-
36+
37+
3038
</div>
3139

3240
<div style="white-space: nowrap; overflow: hidden; position: relative; width: 100%; height: 50px; background-color: transparent;">

_sass/_dropdown.scss

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
.dropdown {
2+
display: flex;
3+
justify-content: center;
4+
align-items: center;
5+
margin-top: 1rem;
6+
}
7+
8+
.dropdown-menu {
9+
max-width: 250px;
10+
padding: 0.5rem;
11+
background-color: #343a40;
12+
border-radius: 8px;
13+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
14+
border: none;
15+
margin-top: 0.25rem;
16+
}
17+
18+
.dropdown-item {
19+
color: #f8f9fa;
20+
&:hover {
21+
background-color: #495057;
22+
color: #fff;
23+
}
24+
}
25+
26+
.dropdown-toggle {
27+
background-color: #6c757d;
28+
color: white;
29+
border: none;
30+
padding: 0.375rem 0.75rem;
31+
font-size: 1rem;
32+
border-radius: 5px;
33+
cursor: pointer;
34+
35+
&:focus {
36+
outline: none;
37+
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
38+
}
39+
}
40+
41+
.dropdown-toggle:active {
42+
background-color: #5a6268;
43+
}
44+

_sass/portfolYOU.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@
1717
"autumn",
1818
"theme",
1919
"theme-dark",
20-
"pdf";
20+
"pdf",
21+
"dropdown";

0 commit comments

Comments
 (0)