Skip to content

Instantly share code, notes, and snippets.

View 12cassie34's full-sized avatar

Cassie 12cassie34

View GitHub Profile
@12cassie34
12cassie34 / bookshelf.js
Last active July 29, 2021 15:36
Vue Recursive Components Data Structure
const bookshelf = {
name: 'books',
children: [
{
name: '言情',
children: [
{
name: '西方',
children: [
{
@12cassie34
12cassie34 / VueComponentStep1.js
Last active August 2, 2021 15:22
Vue Recursive Components Data Structure
<template>
<div class="tree-menu">
<div>{{ name }}</div>
<tree-menu
v-for="child in children"
:children="child.children"
:name="child.name"
>
</tree-menu>
</div>
@12cassie34
12cassie34 / z-index.html
Created November 24, 2021 07:28
Z-index and Stacking Context
<div class="container">
<div class="img--top"></div>
<div class="text">
艾菲爾鐵塔(法語:La Tour Eiffel,也常稱為巴黎鐵塔)是位於法國巴黎第七區、
塞納河畔戰神廣場的鐵製鏤空塔,世界著名建築,也是法國文化象徵之一,巴黎城市地標之一,
巴黎最高建築物。正式地址為Rue Anatole-France 5號。艾菲爾鐵塔建成於1889年,
初名為「三百米塔」,後得名自其設計師居斯塔夫·艾菲爾。鐵塔是世界建築史上的技術傑作,
也是世界上最多人付費參觀的名勝古跡,2011年約有698萬人參觀,是法國參觀人數第二多的文化景點。
1991年,艾菲爾鐵塔連同巴黎塞納河沿岸整座被列入世界遺產。
</div>
@12cassie34
12cassie34 / step1.css
Created November 24, 2021 07:34
Z-index and Stacking Context - CSS - Step 1
.container {
margin: 0 auto;
width: 70vw;
}
.text {
padding: 15px;
border-radius: 10px;
background-color: #67595E;
color: white;
@12cassie34
12cassie34 / step2.css
Created November 24, 2021 07:44
Z-index and Stacking Context - CSS - Step 2
.text {
padding: 15px;
border-radius: 10px;
position: relative; // add here
background-color: #67595E;
color: white;
}
@12cassie34
12cassie34 / step3.css
Created November 24, 2021 07:48
Z-index and Stacking Context - CSS - Step 3
.img--bottom {
margin-top: -100px;
float: right;
transform: rotate(180deg); // add here
}
@12cassie34
12cassie34 / step4-1.css
Created November 24, 2021 07:53
Z-index and Stacking Context - CSS - Step 4-1
.text {
padding: 15px;
border-radius: 10px;
position: relative;
z-index: 1; // here
background-color: #67595E;
color: white;
}
@12cassie34
12cassie34 / step4-3.css
Created November 24, 2021 07:54
Z-index and Stacking Context - CSS - Step 4-2
.img--bottom {
margin-top: -100px;
// here
position: relative;
z-index: 0;
// end here
float: right;
transform: rotate(180deg);
}
@12cassie34
12cassie34 / side-tab.html
Created November 24, 2021 09:00
Z-index and Stacking Context - side tab example
<section class="main-content">
<div class="text">
艾菲爾鐵塔(法語:La Tour Eiffel,也常稱為巴黎鐵塔)是位於法國巴黎第七區、塞納河畔戰神廣場的鐵製鏤空塔,世界著名建築,也是法國文化象徵之一,巴黎城市地標之一,巴黎最高建築物。正式地址為Rue Anatole-France 5號。<br>
...
</div>
<!-- Button trigger modal -->
<a href="#secretModal" class="btn btn-primary">鐵塔小祕密</a>
<!-- Modal -->
<div id="secretModal" class="modal">
@12cassie34
12cassie34 / step1.css
Created November 24, 2021 09:01
Z-index and Stacking Context - side tab example - step 1
.main-content {
margin-top: 50px;
margin-bottom: 50px;
position: relative; // here
z-index: 0; // here
}
button {
margin-top: 20px;
}