Skip to content

Instantly share code, notes, and snippets.

View tiam-bloom's full-sized avatar

Tiam tiam-bloom

View GitHub Profile
@tiam-bloom
tiam-bloom / index.html
Last active August 6, 2023 04:23
移动端底部内凹导航栏
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="http://at.alicdn.com/t/c/font_4144272_3vtq4renm6e.css" />
<style>
* {
margin: 0;
@tiam-bloom
tiam-bloom / TestSort.java
Created March 28, 2023 09:05
测试排序方法的测试类, 包括一次, 多次, 执行时间, 生成随机数组, 判断数组是否在一定范围内 等方法
package utils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.text.NumberFormat;
import java.util.Arrays;
import java.util.OptionalInt;
import java.util.function.Consumer;
@tiam-bloom
tiam-bloom / SortMethodsImpl.java
Created March 28, 2023 09:03
冒泡, 选择, 插入, 快速排序
package utils;
/**
* @author Tiam
* @date 2023/3/27 20:59
* @description
*/
public class SortMethodsImpl implements SortMethods {
public void swap(int[] arr, int i, int j) {
@tiam-bloom
tiam-bloom / vue3_todolist.html
Created March 28, 2023 09:00
todolist_demo
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<title>Document</title>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD"
@tiam-bloom
tiam-bloom / vue3_table.html
Created March 23, 2023 06:31
vue3 html 表格增删查功能
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<title>Document</title>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
<div id="app">
<fieldset>
@tiam-bloom
tiam-bloom / DragByVue.html
Created February 25, 2023 05:21
Vue2实现拖动, 滚动控制元素高度
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>监听鼠标行为</title>
<!-- Date: 2022-11-24 12:44:52 -->
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.10/dist/vue.js"></script>
@tiam-bloom
tiam-bloom / debounce.js
Created February 25, 2023 04:53
目录锚点
// 优化滚动触发, 添加防抖修饰
window.addEventListener("scroll", debounce((e) => {
const scroll = document.documentElement.scrollTop || document.body.scrollTop;
this.districtName.forEach((item) => {
if (item.offsetTop - scroll < 100) {
this.activeLoadScroll(item.getAttribute("data-tab"));
return;
}
});
}));
@tiam-bloom
tiam-bloom / TreeFold.html
Created February 25, 2023 04:47
可折叠树形菜单
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<style>
li:hover {
cursor: pointer;
}
.tree span:hover {
@tiam-bloom
tiam-bloom / LiSelected.html
Created February 25, 2023 04:43
列表选择Demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
li {
list-style: none;