css游戏代码_介绍CSSBattle-第一个CSS代码搜寻游戏
css游戏代码
by kushagra gour
由kushagra gour
介绍CSSBattle-第一个CSS代码搜寻游戏 (Introducing CSSBattle — the first CSS code-golfing game)
If you are learning Web development or are already a professional Web developer, there is a very high chance you have written CSS at least once in your life. It is a very basic building block of any webpage. Amidst all the discussions and love and hate for CSS, we present to you all — CSSBattle ?⚔️
如果您正在学习Web开发或已经是专业的Web开发人员,那么您一生中至少有一次编写CSS的可能性很高。 这是任何网页的基本组成部分。 在所有讨论和对CSS的热爱与憎恨中,我们向大家展示— CSSBattle ?⚔️
CSSBattle is the first ever code-golfing platform for CSS lovers that I and my friend, Kushagra Agarwal, have created. The aim of this game is simple — you have an image target which you need to replicate with the smallest possible CSS (and slight HTML if you please) code. More visual match and fewer bytes get you a higher score. And that is how you climb the leaderboards in CSSBattle. Here is an example target screen:
CSSBattle是我和我的朋友Kushagra Agarwal创建的第一个针对CSS爱好者的代码交流平台。 该游戏的目标很简单-您有一个图像目标,您需要使用尽可能小CSS代码复制该图像目标(如果需要,可以复制一些HTML)。 更多视觉匹配和更少字节可为您带来更高的分数。 这就是您在CSSBattle中攀登排行榜的方式。 这是目标屏幕的示例:
一些有趣的统计 (Some fun stats)
At the time of writing this post, it has been 10 days since we launched. And here are some fun stats we have gathered:
在撰写本文时,距我们启动已经十天了。 以下是我们收集的一些有趣的统计信息:
- 13000+ players worldwide全球13000多名玩家
- Over 100K code submissions提交超过10万条代码
Minimum bytes used on a target: just 54 bytes! ?
目标上使用的最小字节: 仅54个字节 ! ?
A lovely community forum of 140+ players and 40+ conversations
一个由140多个玩家和40多个对话组成的可爱社区论坛
产品开发 (Product development)
We decided to build and launch CSSBattle in one month, to prevent ourselves from getting into an infinite loop of adding and polishing features. We made a list of the absolutely necessary items for launch and focused on it.
我们决定在一个月内构建并启动CSSBattle,以防止自己陷入添加和修饰功能的无限循环中。 我们列出了启动所需的绝对必要物品,并集中精力进行了清单。
During the development, we came up with tons of new ideas to implement in the website, which we kept noting down. I am proud we could resist the urge to work on those exciting ideas and finally launch in one month!
在开发过程中,我们想出了很多新想法要在网站上实施,但我们一直对此表示不满。 我为能够抵制那些激动人心的想法并最终在一个月内发布而感到自豪。
科技栈 (Tech Stack)
Our tech stack is pretty standard for today’s product. We have React (using create-react-app as a starter) on the frontend which is deployed on Zeit Now. For the backend, we use Firebase. Since we both primarily have frontend/design experience, Firebase turned out to be an amazing option to easily implement everything we had on our mind while getting best in class scalability and security without managing any server!
我们的技术栈是当今产品的相当标准。 我们在前端部署了React (使用create-react-app作为启动器),该部署在Zeit Now上 。 对于后端,我们使用Firebase 。 由于我们俩都具有前端/设计经验,因此Firebase成为轻松实现我们所想的一切的绝佳选择,同时无需管理任何服务器即可获得一流的可扩展性和安全性!
计分算法 (The scoring algorithm)
One of the most interesting things about developing CSSBattle was designing the scoring algorithm. We sat literally for days discussing and trying out various formulas. We wanted that a amore visual match should always result in a higher score. And of course, for the same match percentage, the score should increase with decreasing code bytes. Also, we wanted a faster score progression towards lower bytes once you are at 100% match, to make it more rewarding for the players who sweat it out with each removed byte.
开发CSSBattle时最有趣的事情之一是设计评分算法。 从字面上看,我们坐了几天讨论和尝试各种公式。 我们希望视觉效果更好的比赛总能带来更高的分数。 当然,对于相同的匹配百分比,分数应随着代码字节的减少而增加。 此外,我们希望在您达到100%的比赛率时,将得分朝着低字节的方向更快发展,以使每删除一个字节就把汗水消耗掉的球员得到更大的回报。
In the end, we are happy with what we came up with. Maybe we’ll write a separate post about just the scoring algorithm :)
最后,我们对自己的想法感到满意。 也许我们会写一篇关于计分算法的单独文章:)
发射,市场投入 (The Launch)
We originally planned the launch for the 5th of April, but we had to launch it a day before. We had invited many eminent CSS developers to try out CSSBattle before going public. And “fortunately” Jonathan Snook tweeted about us a day before we planned to launch, sending in a huge stream of developers to the game! And so we decide to prepone our launch :)
我们最初计划在4月5日发布产品,但是我们不得不在前一天发布产品。 我们已经邀请了许多著名CSS开发人员在公开上市之前试用CSSBattle。 “很幸运”, 乔纳森·斯努克(Jonathan Snook)在我们计划发布的前一天在推特上发了 帖 ,向游戏派遣了大量开发人员! 因此,我们决定推迟发布时间:)
We started with the announcement on ProductHunt where CSSBattle was the #1 product of the day. Immediately following it was a Reddit rush. And then, the massive and really encouraging tweet by Lea Verou:
我们开始就宣告ProductHunt其中CSSBattle是当天的#1产品。 紧随其后的是Reddit抢购 。 然后,Lea Verou发表的大规模且令人鼓舞的推文:
Since then, it has been a crazy ride for us both seeing the community grow, play, learn and compete! Each day we see players breaking the limits of creativity and imagination with CSS!
从那时起,对于我们俩来说,看到社区的成长,娱乐,学习和竞争对我们来说都是疯狂的旅程! 每天我们都可以看到玩家使用CSS突破了创造力和想象力的极限!
来加入我们吧 (Come join us)
We have a very lovely community of superbly creative and humble developers on Spectrum where you can hang out and learn some CSS Trickery.
我们在Spectrum上有一个非常可爱且极富创造力和谦虚的开发人员社区 ,您可以在这里闲逛并学习一些CSS Trickery。
So, what are you waiting for? If you have ever written CSS, play now — https://cssbattle.dev(We have also seen people wanting to learn CSS just to play this game!)
那你还在等什么? 如果您曾经写过CSS,请立即开始玩-https: //cssbattle.dev (我们也看到人们想要玩CSS只是为了玩这个游戏!)
Fair️公平警告 (⚠️ Fair warning)
CSSBattle is highly fun and addictive. We have seen people losing their sleep, having weird dreams, being late to meet friends, cursing, skipping project deadlines and what not. Please enter at your own risk! ?
CSSBattle非常有趣且令人上瘾 。 我们已经看到人们失去了他们的睡眠 , 有怪异的梦 , 迟到,以满足朋友 , 咒骂 , 跳跃项目的最后期限和什么不可以 。 请自行承担风险! ?
Also, we feel it’s our responsibility to highlight that apart from creative approaches, CSSBattle requires you to exploit how CSS (and HTML) is parsed by browsers. It’s important to understand that the CSS you write here is not the way you would write in a real project. The tips and tricks you learn while playing here would certainly make you better understand CSS, but always be alert and curious about what’s a hack and what is not.
另外,我们感到有责任强调,除了创意方法之外,CSSBattle还要求您利用浏览器如何解析CSS(和HTML)。 重要的是要了解,您在此处编写CSS并不是您在实际项目中编写CSS的方式。 您在此处学习的技巧和窍门当然可以使您更好地理解CSS,但始终警惕什么是hack,什么不是hack。
Have fun CSS-ing!
玩得开心CSS-ing!
翻译自: https://www.freecodecamp.org/news/introducing-cssbattle-the-first-css-code-golfing-game-88b7518df618/
css游戏代码
相关文章:

IOS手机全屏长按识别二维码HTML代码
代码段作用讲解: 1. 二维码的全屏样式, opacity: 0; 透明样式, touch-callout: none; -webkit-touch-callout: none; -ms-touch-callout: none; -moz-touch-callout: none; 禁止IOS默认长按事件 .codePage {position: absolute;touch-callout: none;…

[亲测]在Mac下配置php开发环境:Apache+php+MySql
公司给我们配上了高大上的Apple Mac Pro本本,这两天自己正在习惯中。通过虚拟机PD,确实解决了一些因为工作习惯无法在iOS上很好完成的事情,但是我想,既然用起了iOS就尽量将一些事务在iOS环境下处理,免得好似关羽耍着大…

RabbitMQ 异常与任务分发
RabbitMQ 异常与任务分发 异常情况处理 上篇最后提到了这个问题, consumer异常退出、queue出错、甚至rabbitMQ崩溃。因为它们都是软件 ,软件都会有bug,这是无法避免的。所以RabbitMQ在设计的时候也想到了这一点 在之前,消息分发给…

reddit_如何使用Python创建自定义Reddit通知系统
redditby Kelsey Wang王凯西 如何使用Python创建自定义Reddit通知系统 (How to make a custom Reddit notification system with Python) Don’t you just love automated emails? I know I do. I mean, who doesn’t enjoy waking up to 236 new messages from Nike, Ticket…

1016. Phone Bills (25)
时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, Yue去掉非法数据计算账单A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, depending on the…

样式集(五)微信朋友圈样式模拟
效果图: 小图标: 源码: <!--pages/findList/findList.wxml--> <image class"xxiangji" catchtap"xxiangji" src"/images/xxiangji.png"></image> <image class"top_img" src&…

为什么要选择useState而不是useReducer
by Austin Malerba奥斯汀马勒巴(Austin Malerba) 为什么要选择useState而不是useReducer (Why you should choose useState instead of useReducer) 通过useState进行本地和全局状态管理的指南 (A guide to local and global state management via useState) Since the introd…

php 类中的变量的定义
php 如果在类中定义变量,在类的方法中调用时应该加上$this-> . class ClassName {private $a 333;function __construct(){$this->a 2222;}public function bbb($value){echo $this->a;} } $b new className(); echo $b->bbb();转载于:https://www.c…

微信小程序云数据库触底分页加载,下拉无限加载,第一次请求数据随机,随机获取数据库的数据
效果图 小程序云开发分页加载代码 <!--pages/chatList/chatList.wxml--> <view class"pageTitle">家博慧</view> <view class" search_arr"><icon class"searchcion" size16 typesearch></icon><input …

Linux(Centos)之安装Java JDK及注意事项
1.准备工作 a.因为Java JDK区分32位和64位系统,所以在安装之前必须先要判断以下我们的Centos系统为多少位系统,命令如下: uname -a解释:如果有x86_64就是64位的,没有就是32位的。后面是X686或X86_64则内核是64位的&…

2019web前端趋势_2019年最值得关注的Web开发趋势
2019web前端趋势by Mrudul Shah通过Mrudul Shah 2019年最值得关注的Web开发趋势 (Top Web Development trends to look out for in 2019) Do you know that nearly 200 websites are pushed out every minute? Sounds astonishing right? But it is a fact and that’s why …

WPF入门教程系列九——布局之DockPanel与ViewBox(四)
七. DockPanel DockPanel定义一个区域,在此区域中,您可以使子元素通过描点的形式排列,这些对象位于 Children 属性中。停靠面板其实就是在WinForm类似于Dock属性的元 素。DockPanel会对每个子元素进行排序,并停靠在面板的一侧&…

tabBar 自定义,小程序自定义底部导航栏
创建一个自定义组件 my_tab,组件代码在后面,先看调用自定义组件的代码,比如我需要在index 页面调用,就在index.json中引用组件,index.json 代码(引用的路径为你创建的自定义组件路径) {"n…

2015年最新出炉的JavaScript开发框架
前端框架简化了开发过程中,像 Bootstrap 和 Foundation 就是前端框架的佼佼者。在这篇文章了,我们编制了一组新鲜的,实用的,可以帮助您建立高质量的 Web 应用程序的 JavaScript 框架清单。 1.Aurelia Aurelia是下一代JavaScript客…

小程序前端性能测试_如何提高前端应用程序的性能
小程序前端性能测试If your website takes longer than 3 seconds to load, you could already be losing nearly half of your visitors.如果您的网站加载时间超过3秒,则可能已经失去了将近一半的访问者。 Yes this is a fact, proven by several research studie…

10-TypeScript中的接口
接口是一种规约的约定,从接口继承的类必须实现接口的约定。在高级开发中,通常接口是用于实现各种设计模式的基础,没有接口,设计模式无从谈起。 定义接口: interface ILog{recordlog():boolean; } 类从接口继承…

样式集(六)仿微信通讯录样式
效果图: 这里有引用到 自定义底部导航,自定义底部导航组件链接 <!--pages/chatList/chatList.wxml--><!-- <include src"/components/common/common" /> --> <view class"top"><view class"pageTi…

WCF动态添加ServiceKnownType
WCF中传输自定义类型时,必须在服务接口类(服务协定)上加上ServiceKnownType(typeof(yourClass)), 在实际应用中比较麻烦,可以用动态的办法来实现动态添加。 服务接口类,加上一行 [ServiceKnownType("GetKnownType…

博客 rss 如何使用_如何使用RSS从您的GatsbyJS博客自动交叉发布
博客 rss 如何使用With the recent exodus from Medium many developers are now creating their own GatsbyJS Blogs and then cross-posting to Medium or publications like freecodecamp.org and dev.to.随着Medium最近的离职,许多开发人员现在正在创建自己的Ga…

大型技术网站的技术( 高并发、大数据、高可用、分布式....)(一)
面对高并发、大流量、高可用、海量数据、用户分布广泛、网络情况复杂这类网站系统我们如何应对??? 第一阶段 一台服务器不行就上多台服务器 1.应用程序与数据服务分离 将应用程序、数据库、文件等资源放在一台服务器上,面对海量…

BestCoder Round #65 B C D || HDU 5591 5592 5593
B 题意:ZYB在远足中,和同学们玩了一个“数字炸弹”游戏:由主持人心里想一个在[1,N][1,N]中的数字XX,然后玩家们轮流猜一个数字,如果一个玩家恰好猜中XX则算负,否则主持人将告诉全场的人当前的数和XX比是偏大还是偏小&a…

数组去重,ES6数组去重 new Set()
普通数组去重 var b [...new Set([1,2, 3, 4, 5, 5, 5, 5])]console.log(b); 输出结果: 包含对象的数组去重 var o {a:1}var b [...new Set([o, o, 3, 4, 5, 5, 5, 5])]console.log(b); 输出结果: 包含对象的数组去重有一个坑 var b [...new Set([{…

使用angular的好处_在项目中使用Angular的最大好处
使用angular的好处by Irina Sidorenko伊琳娜西多连科(Irina Sidorenko) 在项目中使用Angular的最大好处 (The top benefits of using Angular for your project) 在项目实施中使用Angular的11个理由及其好处 (11 reasons to use Angular and its benefits for your project im…

python之路——模块和包
一、模块 1、什么是模块? 常见的场景:一个模块就是一个包含了Python定义和声明的文件,文件名就是模块名字加上.py的后缀。 但其实import加载的模块分为四个通用类别: 1、使用Python编写的代码(.py文件) 2、…

夺命雷公狗---linux NO:3 centos_mini版的安装和备份
废话不多说,和前面的其实是差不多的,如下图所示: 安装其实是和桌面版的差不多的,但是经典版的不能自定义分区(如详细区,如home之类的)。。。 因为我们使用的是命令行方式的所以直接选英文&#…

快速学习 async await 的使用, Demo 解析
async 和 await 字面都很好理解,分别是异步和等待。 来两个简单的 demo, demo1 tt2(){return new Promise(rps>{setTimeout(() > {rps(true)}, 1500);})},async tt1(){var a await this.tt2();console.log(a)},/*** 生命周期函数--监听页面加载*…

小型工作室创业项目_为什么新开发人员应该在小型创业公司工作
小型工作室创业项目In my first year of working in the industry (6 months as an intern, 6 months as a full-time employee), I worked at startups that were less than 10 people large. I was one of the only 2 or 3 developers, and usually one of the first. Throug…

head first python菜鸟学习笔记(第六章)
1. Python提供字典,允许有效组织数据,将数据与名关联,从而实现快速查找,而不是以数字关联。 字典是内置数据结构,允许将数据与键而不是数字关联。这样可以使内存中的数据与实际数据的结构保持一致。?&#…

小程序聊天室开发,发送文字,表情,图片,音频,视频,即时通讯,快速部署,可定制开发
效果图: 微信小程序聊天功能模块,现在已经支持发送图片,文字,音频,视频,表情,在线即时聊天啦。 需要做的可以联系我微信。13977284413 上代码: <view class"bo">…

常用浏览器插件
modify headers :firefox的IP伪造插件 httpRequester:firefox的模拟http请求插件JSON-handle:chrome格式化json插件firebug:firefox查看http请求工具firepath:firefox中获取元素路径转载于:https://www.cnblogs.com/xx…