Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Sep 15, 2023
0 parents commit 3ad6ca3
Show file tree
Hide file tree
Showing 53 changed files with 7,122 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ko_fi: razonyang
custom:
- https://paypal.me/razonyang
15 changes: 15 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: lint

on:
push:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm run lint
18 changes: 18 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
command: manifest
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
public/
resources/
.hugo_build.lock
node_modules/
14 changes: 14 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pull_request_rules:
- name: Automatic merge for Renovate pull requests
conditions:
- author=renovate[bot]
actions:
merge:
method: rebase

- name: Automatic merge on approval
conditions:
- "#approved-reviews-by>=1"
actions:
merge:
method: rebase
16 changes: 16 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"plugins": ["prettier-plugin-go-template"],
"bracketSameLine": true,
"goTemplateBracketSpacing": true,
"overrides": [
{
"files": [
"*.html"
],
"options": {
"parser": "go-template",
"bracketSameLine": true
}
}
]
}
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.0.1"
}
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/*.tmpl.scss
9 changes: 9 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "stylelint-config-standard-scss",
"rules": {
"at-rule-no-unknown": null,
"color-function-notation": null,
"scss/at-rule-no-unknown": true,
"scss/at-extend-no-missing-placeholder": null
}
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 HB Framework Authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# HB Start Theme

[![Used By](https://img.shields.io/badge/dynamic/json?color=success&label=used+by&query=repositories_humanize&logo=hugo&style=flat-square&url=https://api.razonyang.com/v1/github/dependents/hbstack/theme-start)](https://github.com/hbstack/theme-start/network/dependents)
![Hugo Requirements](https://img.shields.io/badge/dynamic/json?color=important&label=requirements&query=requirements&logo=hugo&style=flat-square&url=https://api.razonyang.com/v1/hugo/modules/github.com/hbstack/theme-start)
[![License](https://img.shields.io/github/license/hbstack/theme-start?style=flat-square)](https://github.com/hbstack/theme-start/blob/main/LICENSE)
[![Version](https://img.shields.io/github/v/tag/hbstack/theme-start?label=version&style=flat-square)](https://github.com/hbstack/theme-start/tags)

Building your own fast, responsive, modern and minimalist start page.

Inspired by Google Chrome new tab, and port it for all platforms and browers.
28 changes: 28 additions & 0 deletions assets/hb/modules/theme-start/js/form.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
(() => {
const form = document.querySelector<HTMLFormElement>('.hb-start-search-form')
const input = document.querySelector<HTMLInputElement>('.hb-start-search-input')
const engines = document.querySelectorAll<HTMLElement>('.hb-start-search-engine')
const toggle = document.querySelector<HTMLElement>('.hb-start-search-engine-toggle')

if (!form || !engines) {
return
}

input?.focus()

const activeEngine = (engine: HTMLElement) => {
engines.forEach((el) => {
el.classList.remove('active')
})
engine.classList.add('active')
form.setAttribute('action', engine.getAttribute('data-url')??'')
input?.setAttribute('name', engine.getAttribute('data-input-name')??'q')
toggle.innerHTML = engine.querySelector('svg')?.outerHTML
}

engines.forEach((el) => {
el.addEventListener('click', () => {
activeEngine(el)
})
})
})()
4 changes: 4 additions & 0 deletions assets/hb/modules/theme-start/js/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import 'js/bootstrap/src/dropdown';
import 'js/bootstrap/src/tab';
import "./form";
import "./taxonomies";
36 changes: 36 additions & 0 deletions assets/hb/modules/theme-start/js/taxonomies.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
(() => {
const apps = document.querySelectorAll(".hb-start-app");
const taxonomies = document.querySelectorAll<HTMLElement>(
".hb-start-app-taxonomy",
);
if (!taxonomies) {
return;
}
const active = (item: HTMLElement) => {
taxonomies.forEach((el) => {
// change the state of tabs
if (el !== item) {
el.classList.remove("active");
el.setAttribute("aria-selected", "false");
}
item.classList.add("active");
item.setAttribute("aria-selected", "true");
// show and hide apps
const parent = item.getAttribute("data-id");
console.log(parent);
apps.forEach((app) => {
if (parent && app.getAttribute("data-parent") !== parent) {
app.classList.add("inactive");
} else {
app.classList.remove("inactive");
}
});
});
};

taxonomies.forEach((el) => {
el.addEventListener("click", (e) => {
active(el);
});
});
})();
63 changes: 63 additions & 0 deletions assets/hb/modules/theme-start/scss/_apps.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.hb-start-apps {
height: 240px;
overflow: auto;

&::-webkit-scrollbar {
width: 2px;
}

&::-webkit-scrollbar-track {
background: var(--#{$prefix}body-bg);
}

&::-webkit-scrollbar-thumb {
background: rgba(var(--#{$prefix}body-color-rgb), 0.5);
}
}

.hb-start-app-img {
height: 48px;
width: 48px;
transition: transform 1s linear;

&:not(.loaded) {
&::before {
content: attr(data-title);
font-size: 1.5rem;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
}
}

.hb-start-app {
height: 120px;

&:hover {
background: var(--#{$prefix}primary);

.hb-start-app-title {
color: #fff;
}

.hb-start-app-img {
animation: 1s linear app-flip;
}
}

&.inactive {
display: none !important;
}
}

@keyframes app-flip {
0% {
transform: rotateY(0deg);
}
100% {
transform: rotateY(360deg);
}
}
9 changes: 9 additions & 0 deletions assets/hb/modules/theme-start/scss/_engine.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.hb-start-search-engines {
--#{$prefix}dropdown-item-padding-x: 0.75rem;

min-width: 0;
}

.hb-start-search-engine-icon {
vertical-align: -0.175em;
}
4 changes: 4 additions & 0 deletions assets/hb/modules/theme-start/scss/_input.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.hb-start-search-input {
padding-left: 2.75rem;
padding-right: 2.75rem;
}
14 changes: 14 additions & 0 deletions assets/hb/modules/theme-start/scss/_main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.hb-main {
align-items: center;
justify-content: center;
}

@if ($hb-start-bg) {
.hb-header-nav {
background-color: transparent !important;
}

.hb-footer {
background-color: transparent !important;
}
}
3 changes: 3 additions & 0 deletions assets/hb/modules/theme-start/scss/_search-btn.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.btn-hb-start-search {
margin-top: 0.35rem;
}
9 changes: 9 additions & 0 deletions assets/hb/modules/theme-start/scss/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*! purgecss start ignore */

@import 'main';
@import 'engine';
@import 'input';
@import 'search-btn';
@import 'apps';

/*! purgecss end ignore */
8 changes: 8 additions & 0 deletions assets/hb/modules/theme-start/scss/variables.tmpl.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$hb-start-bg: false;
{{- $bg := resources.GetMatch "images/background.*" }}
{{- with $bg }}
$hb-start-bg: true;
{{- with $bg.Colors }}
$hb-start-color: {{ index . 0 }};
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions exampleSite/assets/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jsconfig.json
Binary file added exampleSite/assets/favicon.ico
Binary file not shown.
Binary file added exampleSite/assets/images/background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added exampleSite/assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions exampleSite/assets/mask-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions exampleSite/config/_default/hugo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
baseURL: https://start.hbstack.dev/
copyright: Copyright © 2023-{year} [HB Framework](https://hbstack.dev/) and [Hugo Modules](https://hugomods.com/). All Rights Reserved.
title: HB Start Theme
11 changes: 11 additions & 0 deletions exampleSite/config/_default/languages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
en:
languageName: English
weight: 1

zh-hans:
languageName: 简体中文
weight: 2

zh-hant:
languageName: 繁體中文
weight: 3
Loading

0 comments on commit 3ad6ca3

Please sign in to comment.