2sxc: Any way for forcing menu to appear Left-To-Right on inside a Right-To-Left div - 2sxc

Good morning,
Is there any way for achieving result as in the attachment?
The Blue one (on the right) is how it is currently displayed.
The Orange one (on the left) is how I want it to be displayed
Current and required
EDIT:
This is the CSHTML snipet:
#using Extensions;
#using ToSic.SexyContent;
#using System.Collections;
#using System.Web.UI;
#using DotNetNuke.Security.Permissions;
<link rel="stylesheet" data-enableoptimizations="true" href="#App.Path/assets/Announcements.css" />
#if ((Dnn.User.IsSuperUser == false) || (Dnn.User.IsInRole("Administrators") == false))
{
<style>
.sc-content-block-quick-insert {
display: none !important;
}
div.sc-cb-highlight-for-insert {
background: none !important;
}
</style>
}
else
{
<style>
.sc-menu-a {
width: 28px!important;
height: 28px!important;
line-height:28px!important;
background-color: #0088f4;
border-style: solid;
box-sizing: content-box;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
color: #fff;
text-align: center;
font-size: 15px;
background-color: purple;
}
</style>
}
<script src="~/DesktopModules/ToSIC_SexyContent/JS/2sxc.api.min.js" data-enableoptimizations="100"></script>
<script src="~/DesktopModules/ToSIC_SexyContent/Js/AngularJS/angular.min.js" data-enableoptimizations="101"></script>
<script src="~/DesktopModules/ToSIC_SexyContent/Js/AngularJS/2sxc4ng.min.js" data-enableoptimizations="110"></script>
#functions
{
public HtmlString GetFiles(ToSic.SexyContent.DynamicEntity dynEntContent, bool bReverse = false)
{
var lFiles = AsAdam(dynEntContent, "Attachments").Files.ToList();
var iFilesCount = lFiles.Count();
var iTmp = 0;
var sRawHtmlString = "";
if (bReverse)
{
lFiles.Reverse();
}
if (iFilesCount > 0)
{
// sRawHtmlString = "« \r\n"; /* "«" */
sRawHtmlString = "« \r\n"; /* "«" */
foreach(var file in lFiles)
{
sRawHtmlString += "\t\t\t\t\t\t<" + $"a href='{#file.Url}'>{#file.FileName}</" + "a>";
sRawHtmlString += ((++iTmp < iFilesCount) ? " ‖\r\n" : "");
}
// sRawHtmlString += "\r\n\t\t\t\t »"; /* "»" */
sRawHtmlString += "\r\n\t\t\t\t\t »"; /* "»" */
}
return (#Html.Raw(sRawHtmlString));
}
}
<div class="app-announcments app-announcments-list">
<h2>
<div id="ulItem_Menu_(U)" name="ulItem_Menu_(U)" style="width: 100%; direction: ltr;">
<table style="width: 100%; padding: 0 5px 0 5px; border: solid 1pt black;" cellpadding="0" cellspacing="0">
<tr style="height: 55px;">
<td style="width: auto;" valign="top">
#if (Dnn.User.IsSuperUser)
{
#Edit.Toolbar(ListContent)
}
#if ((Dnn.User.IsInRole("Announcements")) && (Dnn.User.IsSuperUser == false))
{
#Edit.Toolbar(actions: "new",
contentType: "Announcements",
prefill: new {
UID = #Dnn.User.UserID,
PublishDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm"),
PublishedBy = Dnn.User.FullName
}
)
}
</td>
<td style="text-align: right;">
לוח מודעות
</td>
</tr>
</table>
</div>
</h2>
#foreach(var li in List)
{
var anContent = li.Content;
var sMnuItem = "ulItem_" + anContent.EntityId + "_Menu_" + ((Dnn.User.IsSuperUser) ? "(SU)" : "(U)");
var sAdminCommands = "[ " +
"{" +
" \"attributeSetName\" : \"Announcements\"," +
" \"action\" : \"new\"," +
" \"sortOrder\" : 0," +
" \"prefill\" : {" +
" \"UID\" : " + Dnn.User.UserID + "," +
" \"PublishDate\" : \"" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "\"," +
" \"PublishedBy\" : \"" + Dnn.User.FullName + "\"" +
" } " +
"}, " +
"{" +
" \"attributeSetName\" : \"Announcements\"," +
" \"entityId\" : \"" + anContent.EntityId + "\"," +
" \"action\" : \"edit\"," +
" \"sortOrder\" : 0 " +
"}, " +
"{" +
" \"attributeSetName\" : \"Announcements\"," +
" \"entityId\" : \"" + anContent.EntityId + "\"," +
" \"action\" : \"remove\"," +
" \"sortOrder\" : 0 " +
"}, " +
// "{" +
// " \"attributeSetName\" : \"Announcements\"," +
// " \"action\" : \"replace\" " +
// "}, " +
"{" +
" \"entityId\" : \"" + anContent.EntityId + "\"," +
" \"attributeSetName\" : \"Announcements\"," +
" \"action\" : \"publish\"," +
" \"sortOrder\" : 0 " +
"}, " +
"{" +
" \"attributeSetName\" : \"Announcements\"," +
" \"action\" : \"more\"," +
" \"sortOrder\" : 0 " +
"}" +
" ]";
var sUserCommandsInAnnouncement = "[ " +
"{" +
" \"attributeSetName\" : \"Announcements\"," +
" \"action\" : \"new\"," +
" \"sortOrder\" : 0," +
" \"prefill\" : {" +
" \"UID\" : " + Dnn.User.UserID + "," +
" \"PublishDate\" : \"" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "\"," +
" \"PublishedBy\" : \"" + Dnn.User.FullName + "\"" +
" } " +
"}, " +
"{" +
" \"attributeSetName\" : \"Announcements\"," +
" \"entityId\" : \"" + anContent.EntityId + "\"," +
" \"action\" : \"edit\"," +
" \"sortOrder\" : 0 " +
"}, " +
"{" +
" \"attributeSetName\" : \"Announcements\"," +
" \"entityId\" : \"" + anContent.EntityId + "\"," +
" \"action\" : \"remove\"," +
" \"sortOrder\" : 0 " +
"}, " +
"{" +
" \"entityId\" : \"" + anContent.EntityId + "\"," +
" \"attributeSetName\" : \"Announcements\"," +
" \"action\" : \"publish\"," +
" \"sortOrder\" : 0 " +
"}, " +
"{" +
" \"attributeSetName\" : \"Announcements\"," +
" \"action\" : \"more\"," +
" \"sortOrder\" : 0 " +
"}" +
" ]";
<hr/>
<div class="app-announcments-item sc-element">
<div name="divInfoInAnnouncement">
#if (Dnn.User.IsSuperUser)
{
<!-- ## [Super User] block : BEGIN (line 152) ## -->
<ul id='#sMnuItem' name='#sMnuItem' class='sc-menu' data-toolbar='#Html.Raw(#sAdminCommands)'></ul>
<!-- ## [Super User] block : END (line 154) ## -->
}
#if ((Dnn.User.IsInRole("Announcements")) && (Dnn.User.IsSuperUser == false))
{
<!-- ## [Announcements User] block: BEGIN (line 158) ## -->
<ul id='#sMnuItem' name='#sMnuItem' class='sc-menu' data-toolbar='#Html.Raw(#sUserCommandsInAnnouncement)'></ul>
<!-- ## [Announcements User] block: END (line 160) ## -->
}
</div>
<div class="app-announcments-link" title="#anContent.AnnouncementTitle">
<table class="app-announcments-text" style="width: 100%; padding: 0 10px 10px 10px;" cellpadding="0" cellspacing="0">
<tr>
<td>
<h4>#anContent.AnnouncementTitle</h4>
פורסם על ידי:
#anContent.PublishedBy
</td>
<td valign="top">
<span class="app-announcments-date">#anContent.PublishDate.ToString("yyyy-MM-dd HH:mm")</span>
</td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td colspan="2">
#Html.Raw(anContent.AnnouncementBody)
</td>
</tr>
<tr>
<td colspan="2">
#if (AsAdam(anContent, "Attachments").Files.Count > 0)
{
<div id="divFiles" name="divFiles" style="height: 1em; font-size: 14pt; text-align: center; background: #f3f3f3; color: black; direction: ltr; padding: 5px 0 5px 0;">
#GetFiles(anContent, false)
</div>
}
</td>
</tr>
</table>
</div>
</div>
} #* foreach(var li in List) *#
</div>
...and the (most of the) CSS - I removed some unrelevant. (Most of the code css is from the original "News - Simple" 2sxc app):
/* Detail Styles */
.app-announcments-detail .app-announcments-image {
/* margin-bottom: 20px; */ border-radius: 4px;
}
.app-announcments-detail-trimmed {
-o-text-overflow: ellipsis; /* Opera */
text-overflow: ellipsis; /* IE, Safari (WebKit) */
overflow: hidden; /* don't show excess chars */
white-space: nowrap; /* force single line */
/* margin-bottom: 25px; */
width: 300px; /* fixed width */
height: 50px; /* Fixed height */
}
/* List Styles */
.app-announcments-item .app-announcments-image {
float: left; width: 38.19% /* Golden Ratio */; /* padding: 0 10px 10px 0; */
}
.app-announcments-item {
padding-bottom: 20px; margin-bottom: 0px;
}
div.app-announcments-link {
display: block; text-decoration: none; color: #666;
/* background-color: #fcfcfc; */ background-color: white;
/* padding: 10px 10px 0 10px; */ overflow: hidden;
border-radius: 4px;
-webkit-box-shadow: 0px 0px 10px 0px rgba(204,204,204,1);
-moz-box-shadow: 0px 0px 10px 0px rgba(204,204,204,1);
box-shadow: 0px 0px 10px 0px rgba(204,204,204,1);
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease; -o-transition: all 1s ease;
transition: all 1s ease;
}
div.app-announcments-link:hover,
div.app-announcments-link:focus {
border-radius: 6px; /* background-color: #eee; */
background-color: #f3f3f3; -webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease; transition: all 1s ease;
}
div.app-announcments-link:hover h3,
div.app-announcments-link:focus h3,
div.app-announcments-link:hover h2,
div.app-announcments-link:focus h2 {
color: #000; -webkit-transition: all 1s ease;
-moz-transition: all 1s ease; -o-transition: all 1s ease;
transition: all 1s ease;
}
/* Buttons */
div.app-announcments-button,
.app-announcments-button {
/* padding: 10px; */ background: #666; color: white;
display: inline-block; border-radius: 2px;
}
div.app-announcments-link:hover .app-announcments-button,
div.app-announcments-link:focus .app-announcments-button,
div.app-announcments-button:hover,
div.app-announcments-button:focus {
background: #000; -webkit-transition: all 1s ease;
-moz-transition: all 1s ease; -o-transition: all 1s ease;
transition: all 1s ease;
}
/************************/
table.app-announcments-link {
display: block; text-decoration: none; color: #666;
/* background-color: #fcfcfc; */ background-color: white;
/* padding: 10px 10px 0 10px; */
overflow: hidden; border-radius: 4px;
-webkit-box-shadow: 0px 0px 10px 0px rgba(204,204,204,1);
-moz-box-shadow: 0px 0px 10px 0px rgba(204,204,204,1);
box-shadow: 0px 0px 10px 0px rgba(204,204,204,1);
-webkit-transition: all 1s ease; -moz-transition: all 1s ease;
-o-transition: all 1s ease; transition: all 1s ease;
}
table.app-announcments-link:hover,
table.app-announcments-link:focus {
border-radius: 6px; /* background-color: #eee; */
background-color: #f3f3f3; -webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease; transition: all 1s ease;
}
table.app-announcments-link:hover h3,
table.app-announcments-link:focus h3,
table.app-announcments-link:hover h2,
table.app-announcments-link:focus h2 {
color: #000; -webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease; transition: all 1s ease;
}
/* Buttons */
table.app-announcments-button,
.app-announcments-button {
/* padding: 10px; */ background: #666; color: white;
display: inline-block; border-radius: 2px;
}
table.app-announcments-link:hover .app-announcments-button,
table.app-announcments-link:focus .app-announcments-button,
table.app-announcments-button:hover,
table.app-announcments-button:focus {
background: #000; -webkit-transition: all 1s ease;
-moz-transition: all 1s ease; -o-transition: all 1s ease;
transition: all 1s ease;
}

I assume this is just all css rules. You'll have to override the originals of course - using either a stronger selector (like instead of ".sc-menu {}" use ".sc-menu.sc-ltr {...}" and then you'll have to spend some time fiddling with CSS till it works. Please post your result, so we can include it in 2sxc.

Related

Setting display:none not working for fa icon

<i className="fa fa-close closeButtonSmall" onClick={e => removeColumn(id)} ></i>
I am trying to make this closeButtonSmall class display:none but it doesn't hide the font at all.
.closeButtonSmall{
display:none ;
}
What might be the issues that are happening ?
Here is my whole css file . I am also using Bootstrap 4 btw.
.d-inline{
display:inline ;
}
.closeButton{
color:red ;
float : right ;
transition: all 0.3s ;
margin-top : -20px ;
}
.closeButtonSmall{
display:none ;
transition: all 0.3s ease-in-out;
color:red ;
float : right ;
position: relative;
top:-10px;
right:-15px;
}
.closeButton:hover , .closeButtonSmall:hover{
color: #eee ;
background-color:orangered ;
}
.tabChoosePanel{
background-color: rgba(216, 216, 216 ,0.8 );
}
.tabChooseItem{
transition: all 0.7s ;
flex-grow: 1;
font-size:150%;
}
.tabChooseItem:hover{
transition: all 1s ;
cursor: pointer;
user-select: none;
background-color: rgba(150, 128, 209, 0.5);
flex-grow:1.2 ;
font-size:200%;
}
.tabChooseItem:active{
transition: all 0.1s ease-in-out ;
background-color: rgba(146, 127, 200, 0.6);
}
.columnAddArrow{
transition: all 0.3s ease-in-out;
border: 2px dotted brown ;
padding:35px;
opacity: 0.3 ;
}
.columnAddArrow:hover{
opacity: 1 ;
font-size: 120%;
border:2px dashed black ;
}
.columnAddArrow:active{
font-size: 140%;
color:green;
}
/* THIS THE STYLE FOR VariableNameWithNumbers component */
.columnFormatBlock{
border: 1px solid green ;
margin : 2px 10px 0 10px ;
}
.columnFormatBlock:hover .closeButtonSmall{
display:inline;
}
.numberOptionBox{
border: 2px dotted blueviolet ;
border-radius: 10px ;
}
.columnText{
border : 1px dashed black ;
border-radius:10px ;
color:black ;
font-size:110%;
background-color: rgba(230, 230, 230, 0.774) ;
}
.resultDisplayGrid .outputStringTextArea{
width:70%;
height: 12em;
}
It is may because your font awesome files loaded after your css. Try to add important to display none, or load your css after fa files loaded.

CSS classes conflicting

I am trying to animate a card flipping face up and then fading out. I do this by adding a class 'flipped' on click and a second 'vanish' after a timeout of 2 seconds. However, as soon as the 'vanish' class is added, the card flips back face down. I don't understand why, as the 'flipped' class is still applied.
Here is my mark up:
<div class="grid-space">
<div class="card">
<div class="front-face">
<img src="https://res.cloudinary.com/lwcqviihu/image/upload/v1512898858/Animals/Sloth_svg.svg"/>
<p>sloth</p>
</div>
<div class="back-face"></div>
</div>
</div>
The CSS (flipped and vanish classes marked)
body {
background: #333;
}
.grid-space {
perspective: 1000;
width: 200px;
margin: auto;
}
.grid-space:hover {
transform: scale(1.02);
transition: 0.3s ease-in-out;
}
.card {
position: relative;
padding-bottom: 100%;
display: flex;
border-radius: 1vw;
transition: transform 0.4s ease-in-out, opacity 2s ease-in-out;
transform-style: preserve-3d;
cursor: pointer;
}
.card p {
color: inherit;
}
/*****These are the classes applied to do the animation***********/
.flipped {
transform: rotateY(180deg);
}
.vanish {
opacity: 0;
}
/*****END**********************************************************/
.front-face, .back-face {
backface-visibility: hidden;
position: absolute;
top: 0;
left: 0;
position: absolute;
width: 100%;
height: 100%;
border-radius: 1vw;
text-align: center;
box-sizing: border-box;
}
.front-face {
transform: rotateY(180deg);
color: #EDCB7A;
background: #487360;
border-style: solid;
border-width: 2px;
}
.back-face {
/* background: #C7C6C4;
border: 1px solid #EBD787; */
background: #3A295C;
border: 1px #EBD787 solid;
z-index: 10;
}
.front-face > p {
font-size: 3vmin;
margin: 0;
position: absolute;
bottom: 5%;
width: 100%;
text-align: center;
}
.front-face > img {
width: 90%;
margin-top: 5%;
}
And finally, the javascript:
window.onload = function() {
var card = document.getElementsByClassName('card')[0];
card.addEventListener('click', function() {
this.className += " flipped";
window.setTimeout(vanish, 2000);
});
function vanish() {
card.className += " vanish";
}
};
You can see the whole thing 'working' here: https://codepen.io/timsig/pen/MVavXv
Many thanks for any help.
There seems to be something odd hiding the revealed face when applying opacity to the parent.
I sinceriously don't know why that happens (if anyone has a clue, I'd really, really like to know), but an alternate approach would be to modify the faces instead of the card itself when you apply the .vanish class
.vanish > .back-face{
visibility:hidden;
}
.vanish > .front-face{
opacity:0
}
.front-face{
transition:opacity 2s ease-in-out;
}
and of course, taking out the rule that applies opacity 0 to the .card
/*.vanish {
opacity: 0;
}*/
I think I know why it's happening. When .card's opacity is being set to 0 because of .vanish, it's setting the opacity of its default state since the opacity style is being set on .card itself.
I fixed it by moving the opacity styles to .front-face since that's the side you want to fade out.
.card {
transition: transform 0.4s ease-in-out;
}
.vanish .front-face {
opacity: 0;
}
.front-face {
transition: opacity 2s ease-in-out;
}

CSS animation : loading

I am currently learning HTML/CSS3 basics and I came to the transition/animation chapter. To test my understanding of the subject I threw myself a challenge : create a loading page made out of CSS-only animation.
The charging bar is made of 5 white rectangles with red borders, that go red every 0,1 to show that it is charging, and at the end of the loop go blanck again and repeat.
So I first tried to create an animation white first rectangle's background-color changed to red at 20% of the 0,5s animation and so on...
It failed, because I have no clue of how to change multiple element within the same animation.
Then I figured that it would be easier to make each rectangle from state "blanck" to state "red" even though it takes a lot more lines of code.
Only problem, as you can see with my code below, the first rectangle doesn't go red whereas the others do, and I can make it go backward at the end.
Could anyone give me a clue about how to make this transition works, then give me a hint/documentation about how to make it works with an animation ?
<!DOCTYPE html>
<html>
<head>
<title>Loading</title>
<link rel="stylesheet" type="text/css" href="loading.css">
</head>
<body>
<div class="big_div">
<div id="title"> <p class="main_title"> L O A D I N G</p> </div>
<div class="carre" id="premiers_carre"></div>
<div class="carre" id="deuxieme_carre"></div>
<div class="carre" id="troisieme_carre"></div>
<div class="carre" id="quatrieme_carre"></div>
<div class="carre" id="cinquieme_carre"></div>
</div>
</body>
</html>
p
{
font-family: "Press start 2P";
}
#title {
position: absolute;
left : 530px;
top : 280px ;
}
.big_div
{
width: 1250px;
height: 700px;
display :flex;
flex-direction : row;
justify-content: center;
align-items: center;
}
.carre
{
background-color: white;
border: 1px red solid;
width: 80px;
height: 10px;
margin-right: 5px;
}
#premier_carre
{
transition-property: background-color;
transition-delay: 0.1s;
}
#deuxieme_carre
{
transition-property: background-color;
transition-delay: 0.2s;
}
#troisieme_carre
{
transition-property: background-color;
transition-delay: 0.3s;
}
#quatrieme_carre
{
transition-property: background-color;
transition-delay: 0.4s;
}
#cinquieme_carre
{
transition-property: background-color;
transition-delay: 0.5s;
}
.big_div:hover #premier_carre
{
background-color: red;
}
.big_div:hover #deuxieme_carre
{
background-color: red;
}
.big_div:hover #troisieme_carre
{
background-color: red;
}
.big_div:hover #quatrieme_carre
{
background-color: red;
}
.big_div:hover #cinquieme_carre
{
background-color: red;
}
Bonjour ! You wrote id="premiers_carre" in your code and #premier_carre in your CSS. Simple as that.
Here is your code fixed and improved for a more DRY approach (you defined a class, so why not use it?):
p
{
font-family: "Press start 2P";
}
#title {
position: absolute;
left : 530px;
top : 280px ;
}
.big_div
{
width: 1250px;
height: 700px;
display :flex;
flex-direction : row;
justify-content: center;
align-items: center;
}
.carre
{
background-color: white;
border: 1px red solid;
width: 80px;
height: 10px;
margin-right: 5px;
transition-property: background-color;
}
#premier_carre
{
transition-delay: 0.1s;
}
#deuxieme_carre
{
transition-delay: 0.2s;
}
#troisieme_carre
{
transition-delay: 0.3s;
}
#quatrieme_carre
{
transition-delay: 0.4s;
}
#cinquieme_carre
{
transition-delay: 0.5s;
}
.big_div:hover .carre
{
background-color: red;
}
<!DOCTYPE html>
<html>
<head>
<title>Loading</title>
<link rel="stylesheet" type="text/css" href="loading.css">
</head>
<body>
<div class="big_div">
<div id="title"> <p class="main_title"> L O A D I N G</p> </div>
<div class="carre" id="premier_carre"></div>
<div class="carre" id="deuxieme_carre"></div>
<div class="carre" id="troisieme_carre"></div>
<div class="carre" id="quatrieme_carre"></div>
<div class="carre" id="cinquieme_carre"></div>
</div>
</body>
</html>
Well, this is what I have so far for your question:
<!DOCTYPE html>
<html>
<head>
<link rel="fluid-icon" href="https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Light_Blue_Circle.svg/1200px-Light_Blue_Circle.svg.png" title="HTML">
<link rel="mask-icon" href="https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Light_Blue_Circle.svg/1200px-Light_Blue_Circle.svg.png" color="#0096ff">
<link rel="alternate icon" class="js-site-favicon" type="image/png" href="https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Light_Blue_Circle.svg/1200px-Light_Blue_Circle.svg.png">
<link rel="icon" class="js-site-favicon" type="image/svg+xml" href="https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Light_Blue_Circle.svg/1200px-Light_Blue_Circle.svg.png"><style>#splash {
position: absolute; width: 100%; height: 100%; top: 0; left: 0;
display: flex; align-items: center; justify-content: center;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; color: #keyframes loadingColorChange;
}
.tw-loaded #splash, #splash-content { display: none; }
#splash[splash-theme="dark"] { background-color: #303030; color: #303030; }
#splash-spinner:after {
content: " "; display: block; width: 64px; height: 64px;
border-radius: 50%; border: 6px solid; border-color: currentColor transparent currentColor transparent;
animation: splash-spinner 1s linear infinite;
}
#keyframes splash-spinner {
0% { transform: rotate(0deg); }
50% { transform: rotate(180deg); }
100% { transform: rotate(360deg); }
}
body {
animation-name: bgColorChange;
animation-duration: 5s;
animation-iteration-count: infinite;
animation-delay: none;
animation-name: loadingColorChange;
animation-duration: 5s;
animation-iteration-count: infinite;
animation-delay: none;
}
#keyframes bgColorChange {
0% { background-color: #ea4335; }
12.5% { background-color: #fbbc05; }
25% { background-color: #34a853; }
37.5% { background-color: #4285f4; }
50% { background-color: #34a853; }
62.5% { background-color: #fbbc05; }
75% { background-color: #fbbc05; }
100% { background-color: #ea4335; }
}
#keyframes loadingColorChange {
0% { color: #4285f4; }
12.5% { color: #34a853; }
25% { color: #fbbc05; }
37.5% { color: #ea4335; }
50% { color: #fbbc05; }
62.5% { color: #34a853; }
100% { color: #4285f4; }
}
</style><link rel="dns-prefetch" href="https://trampoline.turbowarp.org/"><link rel="dns-prefetch" href="https://projects.scratch.mit.edu/"><link rel="dns-prefetch" href="https://assets.scratch.mit.edu/"></head><body><div id="splash" aria-hidden="true"><div id="splash-content"><div id="splash-spinner"></div></div></div><script>(function() {
document.querySelector('#splash-content').style.display = 'block';
try {var localTheme = localStorage.getItem('tw:theme');} catch (e) {}
if (localTheme ? localTheme === 'dark' : window.matchMedia('(prefers-color-scheme: dark)').matches) document.querySelector('#splash').setAttribute('splash-theme', 'dark');
})();</script><div id="app">Loading...</div><script src="https://turbowarp.org/js/vendors~addon-settings~credits~editor~embed~fullscreen~player.57d02a22479dd55504bc.js"></script><script src="https://turbowarp.org/js/vendors~editor~embed~fullscreen~player.2ebfbf3346f8d17ad60d.js"></script><script src="https://turbowarp.org/js/addon-settings~addons~editor~fullscreen~player.976423b27ac04efde22e.js"></script><script src="https://turbowarp.org/js/editor~embed~fullscreen~player.d227a5ae0c7b2012a7a2.js"></script><script src="https://turbowarp.org/js/player.1fd251802eabb68ba5fe.js"></script></body>
</body>
</html>
Also all credit to Github

Using divs in a looping list

So i'm currently working on this project where I display an list in MVC 4 ListView. One of my fields has a large amount of data so instead of displaying this info in table, I made a CSS modal window to display. Here's a snippet of my HTML with the ListView and clickable modal view:
<table class="srrTable">
<tr>
<th>
Dwelling Id
</th>
<th>
Postal Address Id
</th>
<th>
Insuance Policy Id
<th>
XML Text
</th>
</tr>
#foreach (var item in Model)
{
<tr>
<td>
#Html.DisplayFor(modelItem => item.DwellingIdentifier)
</td>
<td>
#Html.DisplayFor(modelItem => item.PostalAddressIdentifier)
</td>
<td>
#Html.DisplayFor(modelItem => item.InsurancePolicyIdentifier)
</td>
<td>
<a class="xmllabel" href="#xmlmodal">View</a>
<div id="xmlmodal">
<div class="xmlmodal">
<a class="close" href="#">Close</a>
<h2>XMLText</h2>
<p>#Html.DisplayFor(modelItem => item.XMLText)</p>
</div>
</div>
</td>
</tr>
}
</table>
I used this take on this tutorial to make the modal window.
However when I click on my link to display the XMLText, it shows the first XMLText for all of the row when they should be different. If I was displaying this normally without the div all the XMLTexts are the correct element for the column. I guess I don't understand why this doesn't work (Because it's a hidden div? because of the link?) and was just looking for an explanation and maybe some guidance on how to get my XMLText to display properly.
As for the CSS, I followed the tutorial exactly so please refer to my links. I would appreciate any help, thanks!
RE-UPDATE:
After implementing the suggestions below the field in my table looks like this:
.
.
.
<div class="Hidden">#(counter++)</div>
<td>
<a class="xmllabel" href="#xmlmodal#(counter)">View</a>
<div id="xmlmodal#(counter)" class="showhidexmlmodal">
<div class="showhidexmlmodal#(counter)">
<a class="close" href="#">Close</a>
<h2>XMLText</h2>
<p>#Html.DisplayFor(modelItem => item.XMLText)</p>
</div>
</div>
</td>
.
.
.
I added the .showhidexmlmodal as suggested and updated my CSS:
a.xmllabel {
display: block;
margin: 20px auto;
width: 50px;
height: 50px;
background: #232323;
color: #fff;
text-align: center;
font: 14px/50px Helvetica, Verdana, sans-serif;
text-decoration: none;
}
a.xmllabel:hover {
background: #444;
cursor: pointer;
}
input#xmltoggle {
position: absolute;
top: -9999px;
left: -9999px;
}
#xmlmodal {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
background: rgba(0,0,0,0.7);
opacity: 0;
-webkit-transition: opacity 1s ease, z-index 1s ease;
-moz-transition: opacity 1s ease, z-index 1s ease;
-ms-transition: opacity 1s ease, z-index 1s ease;
-o-transition: opacity 1s ease, z-index 1s ease;
transition: opacity 1s ease, z-index 1s ease;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
}
.showhidexmlmodal {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
margin: auto;
padding: 20px;
width: 500px;
height: 200px;
border-radius: 10px;
background: rgba(255,255,255,0.7 );
-webkit-box-shadow: 3px 3px 3px rgba(0,0,0,0.1);
box-shadow: 3px 3px 3px rgba(0,0,0,0.1);
opacity: 0;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
-webkit-transition: opacity 1s ease, z-index 1s ease;
-moz-transition: opacity 1s ease, z-index 1s ease;
-ms-transition: opacity 1s ease, z-index 1s ease;
-o-transition: opacity 1s ease, z-index 1s ease;
transition: opacity 1s ease, z-index 1s ease;
}
.showhidexmlmodal a.close {
position: absolute;
display: block;
top: 7px;
right: 7px;
background: #232323;
color: #fff;
text-align: center;
font: 14px/1.5 Helvetica, Verdana, sans-serif;
text-decoration: none;
padding: 0 5px;
}
.showhidexmlmodal h2 {
color: #232323;
text-transform: uppercase;
font: 35px/1.5 Helvetica, Verdana, sans-serif;
}
.showhidexmlmodal p {
color: #444;
text-align: left;
font: 13px/1.8 Georgia, Times, sans-serif;
}
.showhidexmlmodal:target, .showhidexmlmodal:target > .xmlmodal {
opacity: 1;
z-index: 2;
}
#media all and (max-width: 767px) {
.xmlmodal {
width: 300px;
height: 250px;
}
.xmlmodal h2 {
font: 30px/1.5 Helvetica, Verdana, sans-serif;
text-transform: uppercase;
}
.xmlmodal p {
font: 12px/1.8 Georgia, Times, sans-serif;
}
}
This code is showing the correct XML text now, but my black cover #xmlmodal isn't showing. Any suggestions?
Its ignoring the css that goes with the xmlmodal id.
(Disclamer to new viewers: I'm extremely new to web programming and concept of divs)
You can use a counter to make the ids for the divs unique.
I don't have my Visual Studio handy, but I think it goes something like this:
#{var counter = 0;}
#foreach (var item in Model)
.
.
.
#{counter++;}
<a class="xmllabel" href="#xmlmodal#(counter)">View</a>
<div id="xmlmodal#(counter)" class="showhidexmlmodal">
Hope this helps!
Edit: As per the comments below, I added a class to the div with the id, so you can pinpoint those with the CSS. Simple replace all #xmlmodal with .showhidexmlmodal. (You can use any class name you want of course, as log as it isn't an existing class in the CSS.)
Note: only in the CSS file, not in the hrefs in the example above!

Is it possible to have an (iframed) SoundCloud widget with no background?

I'm trying to make a really minimal player -- just a play button, and another button to zoom up to a full-sized player. (Fiddle.)
As far as I can tell, there's no way to get rid of the white background behind the button. (In the real case, the background is a textured image, so just changing the bg color of the iframe to some other solid color would be less ideal than being able to have a transparent (and borderless) widget.
Fiddle code:
HTML
<div id="player-controls"><span>zoom player</span></div>
<div id="player-container">
<iframe width="450" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F3036975"></iframe>
</div>
CSS
body {
position: relative;
background: black;
margin: 10px
}
#player-container {
position: absolute;
top: 1.5em;
height: 36px;
width: 36px;
overflow: hidden;
transition: width, height;
transition-duration: .5s;
-webkit-transition: width, height;
-webkit-transition-duration: .5s;
-moz-transition: width, height;
-moz-transition-duration: .5s;
-o-transition: width, height;
-o-transition-duration: .5s;
}
#player-container.enlarged {
width: 450px;
height: 450px;
}
#player-container iframe {
position:absolute;
top: -11px;
left: -177px;
transition: top, left;
transition-duration: .5s;
-webkit-transition: top, left;
-webkit-transition-duration: .5s;
-moz-transition: top, left;
-moz-transition-duration: .5s;
-o-transition: top, left;
-o-transition-duration: .5s;
}
#player-controls {
position: absolute;
top: 0;
}
#player-controls a {
color: white;
}
#player-container.enlarged iframe {
top: 0;
left: 0;
}
That guy found a "hacky" solution using SoundCloud API, some JavaScript and CSS
http://codepen.io/nickcolley/pen/uoCIy
$(document).ready(function(){
var player = SC.Widget($('iframe.sc-widget')[0]);
var pOffset = $('.player').offset();
var pWidth = $('.player').width();
var scrub;
player.bind(SC.Widget.Events.READY, function() {
setInfo();
player.play();
}); //Set info on load
player.bind(SC.Widget.Events.PLAY_PROGRESS, function(e) {
if( e.relativePosition < 0.003 ) { setInfo(); }
//Event listener when track is playing
$('.position').css('width', ( e.relativePosition*100)+"%");
});
$('.player').mousemove(function(e){ //Get position of mouse for scrubbing
scrub = (e.pageX-pOffset.left);
});
$(document).on('keydown', function(e){
switch(e.keyCode){
case 32:
player.toggle();
break;
case 39:
player.next();
break;
case 37:
player.prev();
break;
}
});
$('.player').click(function(){ //Use the position to seek when clicked
$('.position').css('width',scrub+"px");
var seek = player.duration*(scrub/pWidth);
//Seeking to the start would be a previous?
if ( seek < player.duration * .05 ) {
player.prev();
} else if ( seek > player.duration * .99 ) {
player.next();
} else {
player.seekTo(seek);
}
});
function setInfo() {
player.getCurrentSound(function(song) {
console.log(song);
$('.waveform').css('background-image', "url('" + song.waveform_url + "')");
$('.player').css('background-image', "url('" + song.artwork_url.replace('-large', '-t500x500') + "')");
var info = song.title;
$('.info').html(info);
player.current = song;
});
player.getDuration(function(value){
player.duration = value;
});
player.isPaused(function(bool){
player.getPaused = bool;
});
}
});
No, unfortunately it's not currently possible to have custom and transparent background.

Resources