css border-radius & yin-yang & taiji

solution

css border-radius & tabs effect

https://codepen.io/xgqfrms/full/ZEbyMyz

See the Pen css border-radius & tabs effect by xgqfrms
(@xgqfrms) on CodePen.

@charset "UTF-8";

*{
box-sizing: border-box;
margin: 0;
padding: 0;
} .box{
width: 100vw;
height: auto;
min-height: 100px;
display: flex;
flex-wrap: nowrap;
flex-flow: row;
align-items: center;
justify-content: space-between;
border: 1px solid #ccc;
padding: 0;
} .item {
width: 50%;
height: 100px;
line-height: 100px;
text-align: center;
} .item-selected{
background: #000;
} .item-unselected{
background: #fff;
} .item-left{
border-radius: 0 25px 0 0;
-webkit-border-radius: 0 25px 0 0;
-moz-border-radius: 0 25px 0 0;
-ms-border-radius: 0 25px 0 0;
-o-border-radius: 0 25px 0 0;
position: relative;
} .item-right{
border-radius: 0 0 0 25px;
-webkit-border-radius: 0 0 0 25px;
-moz-border-radius: 0 0 0 25px;
-ms-border-radius: 0 0 0 25px;
-o-border-radius: 0 0 0 25px;
position: relative;
} .item-unselected .item-left,
.item-unselected .item-right {
color: #fff;
background: #000;
} .item-selected .item-left,
.item-selected .item-right {
color: #000;
background: #fff;
}
  <section>
<div class="box">
<div class="item item-selected">
<div class="item-left">VIP</div>
</div>
<div class="item item-unselected">
<div class="item-right">Others</div>
</div>
</div>
</section>
"use strict";

/**
*
* @author xgqfrms
* @license MIT
* @copyright xgqfrms
* @created 2020-04-28
* @modified
*
* @description css border-radius
* @augments
* @example
* @link
*
*/ const log = console.log; const items = [...document.querySelectorAll(`.item`)]; const updateSelected = (items, selectedItem) => {
items.forEach(item => {
item.classList.remove(`item-selected`);
item.classList.add(`item-unselected`)
});
selectedItem.classList.remove(`item-unselected`);
selectedItem.classList.add(`item-selected`)
} for (const item of items) {
const flag = item.dataset.flag || false;
if(!flag) {
item.dataset.flag = true;
item.addEventListener(`click`, (e) => {
const className = e.target.getAttribute(`class`);
switch (className) {
case `item-left`:
case `item-right`:
updateSelected(items, e.target.parentElement);
break; default:
break;
}
});
}
}

refs

https://www.w3schools.com/css/css3_borders.asp

https://css-tricks.com/almanac/properties/b/border-radius/


css yin-yang

https://codepen.io/xgqfrms/pen/VwvWdzV

https://coursesweb.net/css/yin-yang-css_cs

https://blog.logrocket.com/how-to-create-yin-yang-symbol-pure-css/

https://css-tricks.com/creating-yin-yang-loaders-web/

See the Pen animated illustration: how to ☯ out of 3 components by xgqfrms
(@xgqfrms) on CodePen.

https://gist.github.com/felipecabargas/6574545


最新文章

  1. Linux下几种文件传输命令 sz rz sftp scp
  2. gtest 1.7编译错误:std:tr1:tuple模板参数过多的解决方案
  3. 批量删除SharePoint 2010的List中的item
  4. JS身份证真实性校验(二)
  5. hdu4291之矩阵快速幂
  6. SAP CRM 最新简介文字(2007年、中英文)
  7. 阿里云Ubuntu服务器安装java环境
  8. bitset位图讲解
  9. bash及其特性(笔记)
  10. CAS 单点登录
  11. POJ训练计划3041_Asteroids(二分图/最小点覆盖=最大匹配)
  12. MySQL数据库主从同步配置
  13. 观未见,行不止 &mdash;&mdash; Power BI 两周年技术和方案交流圆桌会议纪实
  14. laravel服务容器
  15. MySQL优化之like关键字
  16. fabric 在阿里云Ubuntu部署 注意
  17. css盒子模型之边框
  18. 【linux】进程状态
  19. jmeter 的java请求代码在main方法里面执行
  20. MarkdownPad2 在 Windows10 下 预览无法显示

热门文章

  1. Certbot CA 证书 https
  2. __new__() to create it, and __init__() to customize it 类方法 实例方法
  3. LOJ10013曲线
  4. python实现文件查找功能,excel写入功能
  5. chrome标签记录——关于各类性能优化
  6. MySQL、SqlServer、Oracle 三种数据库的优缺点
  7. WAMP3.1.3自定义根目录
  8. KVM(虚拟机的迁移)
  9. SparkCore2
  10. hdu1394Minimum Inversion Number